var Cw = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function $H(e) {
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var hM = { exports: {} }, $0 = {}, vM = { exports: {} }, ar = {};
var M3;
function Qq() {
  if (M3) return ar;
  M3 = 1;
  var e = /* @__PURE__ */ Symbol.for("react.element"), t = /* @__PURE__ */ Symbol.for("react.portal"), r = /* @__PURE__ */ Symbol.for("react.fragment"), n = /* @__PURE__ */ Symbol.for("react.strict_mode"), i = /* @__PURE__ */ Symbol.for("react.profiler"), a = /* @__PURE__ */ Symbol.for("react.provider"), o = /* @__PURE__ */ Symbol.for("react.context"), s = /* @__PURE__ */ Symbol.for("react.forward_ref"), l = /* @__PURE__ */ Symbol.for("react.suspense"), u = /* @__PURE__ */ Symbol.for("react.memo"), f = /* @__PURE__ */ Symbol.for("react.lazy"), c = Symbol.iterator;
  function h(X) {
    return X === null || typeof X != "object" ? null : (X = c && X[c] || X["@@iterator"], typeof X == "function" ? X : null);
  }
  var v = { isMounted: function() {
    return !1;
  }, enqueueForceUpdate: function() {
  }, enqueueReplaceState: function() {
  }, enqueueSetState: function() {
  } }, d = Object.assign, g = {};
  function y(X, K, ue) {
    this.props = X, this.context = K, this.refs = g, this.updater = ue || v;
  }
  y.prototype.isReactComponent = {}, y.prototype.setState = function(X, K) {
    if (typeof X != "object" && typeof X != "function" && X != null) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
    this.updater.enqueueSetState(this, X, K, "setState");
  }, y.prototype.forceUpdate = function(X) {
    this.updater.enqueueForceUpdate(this, X, "forceUpdate");
  };
  function x() {
  }
  x.prototype = y.prototype;
  function S(X, K, ue) {
    this.props = X, this.context = K, this.refs = g, this.updater = ue || v;
  }
  var T = S.prototype = new x();
  T.constructor = S, d(T, y.prototype), T.isPureReactComponent = !0;
  var C = Array.isArray, A = Object.prototype.hasOwnProperty, M = { current: null }, E = { key: !0, ref: !0, __self: !0, __source: !0 };
  function P(X, K, ue) {
    var oe, te = {}, pe = null, me = null;
    if (K != null) for (oe in K.ref !== void 0 && (me = K.ref), K.key !== void 0 && (pe = "" + K.key), K) A.call(K, oe) && !E.hasOwnProperty(oe) && (te[oe] = K[oe]);
    var de = arguments.length - 2;
    if (de === 1) te.children = ue;
    else if (1 < de) {
      for (var ve = Array(de), Ae = 0; Ae < de; Ae++) ve[Ae] = arguments[Ae + 2];
      te.children = ve;
    }
    if (X && X.defaultProps) for (oe in de = X.defaultProps, de) te[oe] === void 0 && (te[oe] = de[oe]);
    return { $$typeof: e, type: X, key: pe, ref: me, props: te, _owner: M.current };
  }
  function R(X, K) {
    return { $$typeof: e, type: X.type, key: K, ref: X.ref, props: X.props, _owner: X._owner };
  }
  function O(X) {
    return typeof X == "object" && X !== null && X.$$typeof === e;
  }
  function N(X) {
    var K = { "=": "=0", ":": "=2" };
    return "$" + X.replace(/[=:]/g, function(ue) {
      return K[ue];
    });
  }
  var G = /\/+/g;
  function z(X, K) {
    return typeof X == "object" && X !== null && X.key != null ? N("" + X.key) : K.toString(36);
  }
  function H(X, K, ue, oe, te) {
    var pe = typeof X;
    (pe === "undefined" || pe === "boolean") && (X = null);
    var me = !1;
    if (X === null) me = !0;
    else switch (pe) {
      case "string":
      case "number":
        me = !0;
        break;
      case "object":
        switch (X.$$typeof) {
          case e:
          case t:
            me = !0;
        }
    }
    if (me) return me = X, te = te(me), X = oe === "" ? "." + z(me, 0) : oe, C(te) ? (ue = "", X != null && (ue = X.replace(G, "$&/") + "/"), H(te, K, ue, "", function(Ae) {
      return Ae;
    })) : te != null && (O(te) && (te = R(te, ue + (!te.key || me && me.key === te.key ? "" : ("" + te.key).replace(G, "$&/") + "/") + X)), K.push(te)), 1;
    if (me = 0, oe = oe === "" ? "." : oe + ":", C(X)) for (var de = 0; de < X.length; de++) {
      pe = X[de];
      var ve = oe + z(pe, de);
      me += H(pe, K, ue, ve, te);
    }
    else if (ve = h(X), typeof ve == "function") for (X = ve.call(X), de = 0; !(pe = X.next()).done; ) pe = pe.value, ve = oe + z(pe, de++), me += H(pe, K, ue, ve, te);
    else if (pe === "object") throw K = String(X), Error("Objects are not valid as a React child (found: " + (K === "[object Object]" ? "object with keys {" + Object.keys(X).join(", ") + "}" : K) + "). If you meant to render a collection of children, use an array instead.");
    return me;
  }
  function W(X, K, ue) {
    if (X == null) return X;
    var oe = [], te = 0;
    return H(X, oe, "", "", function(pe) {
      return K.call(ue, pe, te++);
    }), oe;
  }
  function Z(X) {
    if (X._status === -1) {
      var K = X._result;
      K = K(), K.then(function(ue) {
        (X._status === 0 || X._status === -1) && (X._status = 1, X._result = ue);
      }, function(ue) {
        (X._status === 0 || X._status === -1) && (X._status = 2, X._result = ue);
      }), X._status === -1 && (X._status = 0, X._result = K);
    }
    if (X._status === 1) return X._result.default;
    throw X._result;
  }
  var ee = { current: null }, V = { transition: null }, Q = { ReactCurrentDispatcher: ee, ReactCurrentBatchConfig: V, ReactCurrentOwner: M };
  function q() {
    throw Error("act(...) is not supported in production builds of React.");
  }
  return ar.Children = { map: W, forEach: function(X, K, ue) {
    W(X, function() {
      K.apply(this, arguments);
    }, ue);
  }, count: function(X) {
    var K = 0;
    return W(X, function() {
      K++;
    }), K;
  }, toArray: function(X) {
    return W(X, function(K) {
      return K;
    }) || [];
  }, only: function(X) {
    if (!O(X)) throw Error("React.Children.only expected to receive a single React element child.");
    return X;
  } }, ar.Component = y, ar.Fragment = r, ar.Profiler = i, ar.PureComponent = S, ar.StrictMode = n, ar.Suspense = l, ar.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Q, ar.act = q, ar.cloneElement = function(X, K, ue) {
    if (X == null) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + X + ".");
    var oe = d({}, X.props), te = X.key, pe = X.ref, me = X._owner;
    if (K != null) {
      if (K.ref !== void 0 && (pe = K.ref, me = M.current), K.key !== void 0 && (te = "" + K.key), X.type && X.type.defaultProps) var de = X.type.defaultProps;
      for (ve in K) A.call(K, ve) && !E.hasOwnProperty(ve) && (oe[ve] = K[ve] === void 0 && de !== void 0 ? de[ve] : K[ve]);
    }
    var ve = arguments.length - 2;
    if (ve === 1) oe.children = ue;
    else if (1 < ve) {
      de = Array(ve);
      for (var Ae = 0; Ae < ve; Ae++) de[Ae] = arguments[Ae + 2];
      oe.children = de;
    }
    return { $$typeof: e, type: X.type, key: te, ref: pe, props: oe, _owner: me };
  }, ar.createContext = function(X) {
    return X = { $$typeof: o, _currentValue: X, _currentValue2: X, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null }, X.Provider = { $$typeof: a, _context: X }, X.Consumer = X;
  }, ar.createElement = P, ar.createFactory = function(X) {
    var K = P.bind(null, X);
    return K.type = X, K;
  }, ar.createRef = function() {
    return { current: null };
  }, ar.forwardRef = function(X) {
    return { $$typeof: s, render: X };
  }, ar.isValidElement = O, ar.lazy = function(X) {
    return { $$typeof: f, _payload: { _status: -1, _result: X }, _init: Z };
  }, ar.memo = function(X, K) {
    return { $$typeof: u, type: X, compare: K === void 0 ? null : K };
  }, ar.startTransition = function(X) {
    var K = V.transition;
    V.transition = {};
    try {
      X();
    } finally {
      V.transition = K;
    }
  }, ar.unstable_act = q, ar.useCallback = function(X, K) {
    return ee.current.useCallback(X, K);
  }, ar.useContext = function(X) {
    return ee.current.useContext(X);
  }, ar.useDebugValue = function() {
  }, ar.useDeferredValue = function(X) {
    return ee.current.useDeferredValue(X);
  }, ar.useEffect = function(X, K) {
    return ee.current.useEffect(X, K);
  }, ar.useId = function() {
    return ee.current.useId();
  }, ar.useImperativeHandle = function(X, K, ue) {
    return ee.current.useImperativeHandle(X, K, ue);
  }, ar.useInsertionEffect = function(X, K) {
    return ee.current.useInsertionEffect(X, K);
  }, ar.useLayoutEffect = function(X, K) {
    return ee.current.useLayoutEffect(X, K);
  }, ar.useMemo = function(X, K) {
    return ee.current.useMemo(X, K);
  }, ar.useReducer = function(X, K, ue) {
    return ee.current.useReducer(X, K, ue);
  }, ar.useRef = function(X) {
    return ee.current.useRef(X);
  }, ar.useState = function(X) {
    return ee.current.useState(X);
  }, ar.useSyncExternalStore = function(X, K, ue) {
    return ee.current.useSyncExternalStore(X, K, ue);
  }, ar.useTransition = function() {
    return ee.current.useTransition();
  }, ar.version = "18.3.1", ar;
}
var L3;
function rR() {
  return L3 || (L3 = 1, vM.exports = Qq()), vM.exports;
}
var D3;
function Jq() {
  if (D3) return $0;
  D3 = 1;
  var e = rR(), t = /* @__PURE__ */ Symbol.for("react.element"), r = /* @__PURE__ */ Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, i = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, a = { key: !0, ref: !0, __self: !0, __source: !0 };
  function o(s, l, u) {
    var f, c = {}, h = null, v = null;
    u !== void 0 && (h = "" + u), l.key !== void 0 && (h = "" + l.key), l.ref !== void 0 && (v = l.ref);
    for (f in l) n.call(l, f) && !a.hasOwnProperty(f) && (c[f] = l[f]);
    if (s && s.defaultProps) for (f in l = s.defaultProps, l) c[f] === void 0 && (c[f] = l[f]);
    return { $$typeof: t, type: s, key: h, ref: v, props: c, _owner: i.current };
  }
  return $0.Fragment = r, $0.jsx = o, $0.jsxs = o, $0;
}
var E3;
function ej() {
  return E3 || (E3 = 1, hM.exports = Jq()), hM.exports;
}
var ME = ej(), M1 = rR();
const tj = /* @__PURE__ */ $H(M1);
var Aw = {}, dM = { exports: {} }, Va = {}, pM = { exports: {} }, gM = {};
var P3;
function rj() {
  return P3 || (P3 = 1, (function(e) {
    function t(V, Q) {
      var q = V.length;
      V.push(Q);
      e: for (; 0 < q; ) {
        var X = q - 1 >>> 1, K = V[X];
        if (0 < i(K, Q)) V[X] = Q, V[q] = K, q = X;
        else break e;
      }
    }
    function r(V) {
      return V.length === 0 ? null : V[0];
    }
    function n(V) {
      if (V.length === 0) return null;
      var Q = V[0], q = V.pop();
      if (q !== Q) {
        V[0] = q;
        e: for (var X = 0, K = V.length, ue = K >>> 1; X < ue; ) {
          var oe = 2 * (X + 1) - 1, te = V[oe], pe = oe + 1, me = V[pe];
          if (0 > i(te, q)) pe < K && 0 > i(me, te) ? (V[X] = me, V[pe] = q, X = pe) : (V[X] = te, V[oe] = q, X = oe);
          else if (pe < K && 0 > i(me, q)) V[X] = me, V[pe] = q, X = pe;
          else break e;
        }
      }
      return Q;
    }
    function i(V, Q) {
      var q = V.sortIndex - Q.sortIndex;
      return q !== 0 ? q : V.id - Q.id;
    }
    if (typeof performance == "object" && typeof performance.now == "function") {
      var a = performance;
      e.unstable_now = function() {
        return a.now();
      };
    } else {
      var o = Date, s = o.now();
      e.unstable_now = function() {
        return o.now() - s;
      };
    }
    var l = [], u = [], f = 1, c = null, h = 3, v = !1, d = !1, g = !1, y = typeof setTimeout == "function" ? setTimeout : null, x = typeof clearTimeout == "function" ? clearTimeout : null, S = typeof setImmediate < "u" ? setImmediate : null;
    typeof navigator < "u" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 && navigator.scheduling.isInputPending.bind(navigator.scheduling);
    function T(V) {
      for (var Q = r(u); Q !== null; ) {
        if (Q.callback === null) n(u);
        else if (Q.startTime <= V) n(u), Q.sortIndex = Q.expirationTime, t(l, Q);
        else break;
        Q = r(u);
      }
    }
    function C(V) {
      if (g = !1, T(V), !d) if (r(l) !== null) d = !0, Z(A);
      else {
        var Q = r(u);
        Q !== null && ee(C, Q.startTime - V);
      }
    }
    function A(V, Q) {
      d = !1, g && (g = !1, x(P), P = -1), v = !0;
      var q = h;
      try {
        for (T(Q), c = r(l); c !== null && (!(c.expirationTime > Q) || V && !N()); ) {
          var X = c.callback;
          if (typeof X == "function") {
            c.callback = null, h = c.priorityLevel;
            var K = X(c.expirationTime <= Q);
            Q = e.unstable_now(), typeof K == "function" ? c.callback = K : c === r(l) && n(l), T(Q);
          } else n(l);
          c = r(l);
        }
        if (c !== null) var ue = !0;
        else {
          var oe = r(u);
          oe !== null && ee(C, oe.startTime - Q), ue = !1;
        }
        return ue;
      } finally {
        c = null, h = q, v = !1;
      }
    }
    var M = !1, E = null, P = -1, R = 5, O = -1;
    function N() {
      return !(e.unstable_now() - O < R);
    }
    function G() {
      if (E !== null) {
        var V = e.unstable_now();
        O = V;
        var Q = !0;
        try {
          Q = E(!0, V);
        } finally {
          Q ? z() : (M = !1, E = null);
        }
      } else M = !1;
    }
    var z;
    if (typeof S == "function") z = function() {
      S(G);
    };
    else if (typeof MessageChannel < "u") {
      var H = new MessageChannel(), W = H.port2;
      H.port1.onmessage = G, z = function() {
        W.postMessage(null);
      };
    } else z = function() {
      y(G, 0);
    };
    function Z(V) {
      E = V, M || (M = !0, z());
    }
    function ee(V, Q) {
      P = y(function() {
        V(e.unstable_now());
      }, Q);
    }
    e.unstable_IdlePriority = 5, e.unstable_ImmediatePriority = 1, e.unstable_LowPriority = 4, e.unstable_NormalPriority = 3, e.unstable_Profiling = null, e.unstable_UserBlockingPriority = 2, e.unstable_cancelCallback = function(V) {
      V.callback = null;
    }, e.unstable_continueExecution = function() {
      d || v || (d = !0, Z(A));
    }, e.unstable_forceFrameRate = function(V) {
      0 > V || 125 < V ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : R = 0 < V ? Math.floor(1e3 / V) : 5;
    }, e.unstable_getCurrentPriorityLevel = function() {
      return h;
    }, e.unstable_getFirstCallbackNode = function() {
      return r(l);
    }, e.unstable_next = function(V) {
      switch (h) {
        case 1:
        case 2:
        case 3:
          var Q = 3;
          break;
        default:
          Q = h;
      }
      var q = h;
      h = Q;
      try {
        return V();
      } finally {
        h = q;
      }
    }, e.unstable_pauseExecution = function() {
    }, e.unstable_requestPaint = function() {
    }, e.unstable_runWithPriority = function(V, Q) {
      switch (V) {
        case 1:
        case 2:
        case 3:
        case 4:
        case 5:
          break;
        default:
          V = 3;
      }
      var q = h;
      h = V;
      try {
        return Q();
      } finally {
        h = q;
      }
    }, e.unstable_scheduleCallback = function(V, Q, q) {
      var X = e.unstable_now();
      switch (typeof q == "object" && q !== null ? (q = q.delay, q = typeof q == "number" && 0 < q ? X + q : X) : q = X, V) {
        case 1:
          var K = -1;
          break;
        case 2:
          K = 250;
          break;
        case 5:
          K = 1073741823;
          break;
        case 4:
          K = 1e4;
          break;
        default:
          K = 5e3;
      }
      return K = q + K, V = { id: f++, callback: Q, priorityLevel: V, startTime: q, expirationTime: K, sortIndex: -1 }, q > X ? (V.sortIndex = q, t(u, V), r(l) === null && V === r(u) && (g ? (x(P), P = -1) : g = !0, ee(C, q - X))) : (V.sortIndex = K, t(l, V), d || v || (d = !0, Z(A))), V;
    }, e.unstable_shouldYield = N, e.unstable_wrapCallback = function(V) {
      var Q = h;
      return function() {
        var q = h;
        h = Q;
        try {
          return V.apply(this, arguments);
        } finally {
          h = q;
        }
      };
    };
  })(gM)), gM;
}
var I3;
function nj() {
  return I3 || (I3 = 1, pM.exports = rj()), pM.exports;
}
var R3;
function ij() {
  if (R3) return Va;
  R3 = 1;
  var e = rR(), t = nj();
  function r(p) {
    for (var m = "https://reactjs.org/docs/error-decoder.html?invariant=" + p, b = 1; b < arguments.length; b++) m += "&args[]=" + encodeURIComponent(arguments[b]);
    return "Minified React error #" + p + "; visit " + m + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
  }
  var n = /* @__PURE__ */ new Set(), i = {};
  function a(p, m) {
    o(p, m), o(p + "Capture", m);
  }
  function o(p, m) {
    for (i[p] = m, p = 0; p < m.length; p++) n.add(m[p]);
  }
  var s = !(typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u"), l = Object.prototype.hasOwnProperty, u = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, f = {}, c = {};
  function h(p) {
    return l.call(c, p) ? !0 : l.call(f, p) ? !1 : u.test(p) ? c[p] = !0 : (f[p] = !0, !1);
  }
  function v(p, m, b, L) {
    if (b !== null && b.type === 0) return !1;
    switch (typeof m) {
      case "function":
      case "symbol":
        return !0;
      case "boolean":
        return L ? !1 : b !== null ? !b.acceptsBooleans : (p = p.toLowerCase().slice(0, 5), p !== "data-" && p !== "aria-");
      default:
        return !1;
    }
  }
  function d(p, m, b, L) {
    if (m === null || typeof m > "u" || v(p, m, b, L)) return !0;
    if (L) return !1;
    if (b !== null) switch (b.type) {
      case 3:
        return !m;
      case 4:
        return m === !1;
      case 5:
        return isNaN(m);
      case 6:
        return isNaN(m) || 1 > m;
    }
    return !1;
  }
  function g(p, m, b, L, I, B, Y) {
    this.acceptsBooleans = m === 2 || m === 3 || m === 4, this.attributeName = L, this.attributeNamespace = I, this.mustUseProperty = b, this.propertyName = p, this.type = m, this.sanitizeURL = B, this.removeEmptyString = Y;
  }
  var y = {};
  "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(p) {
    y[p] = new g(p, 0, !1, p, null, !1, !1);
  }), [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(p) {
    var m = p[0];
    y[m] = new g(m, 1, !1, p[1], null, !1, !1);
  }), ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(p) {
    y[p] = new g(p, 2, !1, p.toLowerCase(), null, !1, !1);
  }), ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(p) {
    y[p] = new g(p, 2, !1, p, null, !1, !1);
  }), "allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(p) {
    y[p] = new g(p, 3, !1, p.toLowerCase(), null, !1, !1);
  }), ["checked", "multiple", "muted", "selected"].forEach(function(p) {
    y[p] = new g(p, 3, !0, p, null, !1, !1);
  }), ["capture", "download"].forEach(function(p) {
    y[p] = new g(p, 4, !1, p, null, !1, !1);
  }), ["cols", "rows", "size", "span"].forEach(function(p) {
    y[p] = new g(p, 6, !1, p, null, !1, !1);
  }), ["rowSpan", "start"].forEach(function(p) {
    y[p] = new g(p, 5, !1, p.toLowerCase(), null, !1, !1);
  });
  var x = /[\-:]([a-z])/g;
  function S(p) {
    return p[1].toUpperCase();
  }
  "accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(p) {
    var m = p.replace(
      x,
      S
    );
    y[m] = new g(m, 1, !1, p, null, !1, !1);
  }), "xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(p) {
    var m = p.replace(x, S);
    y[m] = new g(m, 1, !1, p, "http://www.w3.org/1999/xlink", !1, !1);
  }), ["xml:base", "xml:lang", "xml:space"].forEach(function(p) {
    var m = p.replace(x, S);
    y[m] = new g(m, 1, !1, p, "http://www.w3.org/XML/1998/namespace", !1, !1);
  }), ["tabIndex", "crossOrigin"].forEach(function(p) {
    y[p] = new g(p, 1, !1, p.toLowerCase(), null, !1, !1);
  }), y.xlinkHref = new g("xlinkHref", 1, !1, "xlink:href", "http://www.w3.org/1999/xlink", !0, !1), ["src", "href", "action", "formAction"].forEach(function(p) {
    y[p] = new g(p, 1, !1, p.toLowerCase(), null, !0, !0);
  });
  function T(p, m, b, L) {
    var I = y.hasOwnProperty(m) ? y[m] : null;
    (I !== null ? I.type !== 0 : L || !(2 < m.length) || m[0] !== "o" && m[0] !== "O" || m[1] !== "n" && m[1] !== "N") && (d(m, b, I, L) && (b = null), L || I === null ? h(m) && (b === null ? p.removeAttribute(m) : p.setAttribute(m, "" + b)) : I.mustUseProperty ? p[I.propertyName] = b === null ? I.type === 3 ? !1 : "" : b : (m = I.attributeName, L = I.attributeNamespace, b === null ? p.removeAttribute(m) : (I = I.type, b = I === 3 || I === 4 && b === !0 ? "" : "" + b, L ? p.setAttributeNS(L, m, b) : p.setAttribute(m, b))));
  }
  var C = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, A = /* @__PURE__ */ Symbol.for("react.element"), M = /* @__PURE__ */ Symbol.for("react.portal"), E = /* @__PURE__ */ Symbol.for("react.fragment"), P = /* @__PURE__ */ Symbol.for("react.strict_mode"), R = /* @__PURE__ */ Symbol.for("react.profiler"), O = /* @__PURE__ */ Symbol.for("react.provider"), N = /* @__PURE__ */ Symbol.for("react.context"), G = /* @__PURE__ */ Symbol.for("react.forward_ref"), z = /* @__PURE__ */ Symbol.for("react.suspense"), H = /* @__PURE__ */ Symbol.for("react.suspense_list"), W = /* @__PURE__ */ Symbol.for("react.memo"), Z = /* @__PURE__ */ Symbol.for("react.lazy"), ee = /* @__PURE__ */ Symbol.for("react.offscreen"), V = Symbol.iterator;
  function Q(p) {
    return p === null || typeof p != "object" ? null : (p = V && p[V] || p["@@iterator"], typeof p == "function" ? p : null);
  }
  var q = Object.assign, X;
  function K(p) {
    if (X === void 0) try {
      throw Error();
    } catch (b) {
      var m = b.stack.trim().match(/\n( *(at )?)/);
      X = m && m[1] || "";
    }
    return `
` + X + p;
  }
  var ue = !1;
  function oe(p, m) {
    if (!p || ue) return "";
    ue = !0;
    var b = Error.prepareStackTrace;
    Error.prepareStackTrace = void 0;
    try {
      if (m) if (m = function() {
        throw Error();
      }, Object.defineProperty(m.prototype, "props", { set: function() {
        throw Error();
      } }), typeof Reflect == "object" && Reflect.construct) {
        try {
          Reflect.construct(m, []);
        } catch (Te) {
          var L = Te;
        }
        Reflect.construct(p, [], m);
      } else {
        try {
          m.call();
        } catch (Te) {
          L = Te;
        }
        p.call(m.prototype);
      }
      else {
        try {
          throw Error();
        } catch (Te) {
          L = Te;
        }
        p();
      }
    } catch (Te) {
      if (Te && L && typeof Te.stack == "string") {
        for (var I = Te.stack.split(`
`), B = L.stack.split(`
`), Y = I.length - 1, re = B.length - 1; 1 <= Y && 0 <= re && I[Y] !== B[re]; ) re--;
        for (; 1 <= Y && 0 <= re; Y--, re--) if (I[Y] !== B[re]) {
          if (Y !== 1 || re !== 1)
            do
              if (Y--, re--, 0 > re || I[Y] !== B[re]) {
                var se = `
` + I[Y].replace(" at new ", " at ");
                return p.displayName && se.includes("<anonymous>") && (se = se.replace("<anonymous>", p.displayName)), se;
              }
            while (1 <= Y && 0 <= re);
          break;
        }
      }
    } finally {
      ue = !1, Error.prepareStackTrace = b;
    }
    return (p = p ? p.displayName || p.name : "") ? K(p) : "";
  }
  function te(p) {
    switch (p.tag) {
      case 5:
        return K(p.type);
      case 16:
        return K("Lazy");
      case 13:
        return K("Suspense");
      case 19:
        return K("SuspenseList");
      case 0:
      case 2:
      case 15:
        return p = oe(p.type, !1), p;
      case 11:
        return p = oe(p.type.render, !1), p;
      case 1:
        return p = oe(p.type, !0), p;
      default:
        return "";
    }
  }
  function pe(p) {
    if (p == null) return null;
    if (typeof p == "function") return p.displayName || p.name || null;
    if (typeof p == "string") return p;
    switch (p) {
      case E:
        return "Fragment";
      case M:
        return "Portal";
      case R:
        return "Profiler";
      case P:
        return "StrictMode";
      case z:
        return "Suspense";
      case H:
        return "SuspenseList";
    }
    if (typeof p == "object") switch (p.$$typeof) {
      case N:
        return (p.displayName || "Context") + ".Consumer";
      case O:
        return (p._context.displayName || "Context") + ".Provider";
      case G:
        var m = p.render;
        return p = p.displayName, p || (p = m.displayName || m.name || "", p = p !== "" ? "ForwardRef(" + p + ")" : "ForwardRef"), p;
      case W:
        return m = p.displayName || null, m !== null ? m : pe(p.type) || "Memo";
      case Z:
        m = p._payload, p = p._init;
        try {
          return pe(p(m));
        } catch {
        }
    }
    return null;
  }
  function me(p) {
    var m = p.type;
    switch (p.tag) {
      case 24:
        return "Cache";
      case 9:
        return (m.displayName || "Context") + ".Consumer";
      case 10:
        return (m._context.displayName || "Context") + ".Provider";
      case 18:
        return "DehydratedFragment";
      case 11:
        return p = m.render, p = p.displayName || p.name || "", m.displayName || (p !== "" ? "ForwardRef(" + p + ")" : "ForwardRef");
      case 7:
        return "Fragment";
      case 5:
        return m;
      case 4:
        return "Portal";
      case 3:
        return "Root";
      case 6:
        return "Text";
      case 16:
        return pe(m);
      case 8:
        return m === P ? "StrictMode" : "Mode";
      case 22:
        return "Offscreen";
      case 12:
        return "Profiler";
      case 21:
        return "Scope";
      case 13:
        return "Suspense";
      case 19:
        return "SuspenseList";
      case 25:
        return "TracingMarker";
      case 1:
      case 0:
      case 17:
      case 2:
      case 14:
      case 15:
        if (typeof m == "function") return m.displayName || m.name || null;
        if (typeof m == "string") return m;
    }
    return null;
  }
  function de(p) {
    switch (typeof p) {
      case "boolean":
      case "number":
      case "string":
      case "undefined":
        return p;
      case "object":
        return p;
      default:
        return "";
    }
  }
  function ve(p) {
    var m = p.type;
    return (p = p.nodeName) && p.toLowerCase() === "input" && (m === "checkbox" || m === "radio");
  }
  function Ae(p) {
    var m = ve(p) ? "checked" : "value", b = Object.getOwnPropertyDescriptor(p.constructor.prototype, m), L = "" + p[m];
    if (!p.hasOwnProperty(m) && typeof b < "u" && typeof b.get == "function" && typeof b.set == "function") {
      var I = b.get, B = b.set;
      return Object.defineProperty(p, m, { configurable: !0, get: function() {
        return I.call(this);
      }, set: function(Y) {
        L = "" + Y, B.call(this, Y);
      } }), Object.defineProperty(p, m, { enumerable: b.enumerable }), { getValue: function() {
        return L;
      }, setValue: function(Y) {
        L = "" + Y;
      }, stopTracking: function() {
        p._valueTracker = null, delete p[m];
      } };
    }
  }
  function be(p) {
    p._valueTracker || (p._valueTracker = Ae(p));
  }
  function De(p) {
    if (!p) return !1;
    var m = p._valueTracker;
    if (!m) return !0;
    var b = m.getValue(), L = "";
    return p && (L = ve(p) ? p.checked ? "true" : "false" : p.value), p = L, p !== b ? (m.setValue(p), !0) : !1;
  }
  function Ue(p) {
    if (p = p || (typeof document < "u" ? document : void 0), typeof p > "u") return null;
    try {
      return p.activeElement || p.body;
    } catch {
      return p.body;
    }
  }
  function Xe(p, m) {
    var b = m.checked;
    return q({}, m, { defaultChecked: void 0, defaultValue: void 0, value: void 0, checked: b ?? p._wrapperState.initialChecked });
  }
  function $e(p, m) {
    var b = m.defaultValue == null ? "" : m.defaultValue, L = m.checked != null ? m.checked : m.defaultChecked;
    b = de(m.value != null ? m.value : b), p._wrapperState = { initialChecked: L, initialValue: b, controlled: m.type === "checkbox" || m.type === "radio" ? m.checked != null : m.value != null };
  }
  function vt(p, m) {
    m = m.checked, m != null && T(p, "checked", m, !1);
  }
  function Lt(p, m) {
    vt(p, m);
    var b = de(m.value), L = m.type;
    if (b != null) L === "number" ? (b === 0 && p.value === "" || p.value != b) && (p.value = "" + b) : p.value !== "" + b && (p.value = "" + b);
    else if (L === "submit" || L === "reset") {
      p.removeAttribute("value");
      return;
    }
    m.hasOwnProperty("value") ? mr(p, m.type, b) : m.hasOwnProperty("defaultValue") && mr(p, m.type, de(m.defaultValue)), m.checked == null && m.defaultChecked != null && (p.defaultChecked = !!m.defaultChecked);
  }
  function cr(p, m, b) {
    if (m.hasOwnProperty("value") || m.hasOwnProperty("defaultValue")) {
      var L = m.type;
      if (!(L !== "submit" && L !== "reset" || m.value !== void 0 && m.value !== null)) return;
      m = "" + p._wrapperState.initialValue, b || m === p.value || (p.value = m), p.defaultValue = m;
    }
    b = p.name, b !== "" && (p.name = ""), p.defaultChecked = !!p._wrapperState.initialChecked, b !== "" && (p.name = b);
  }
  function mr(p, m, b) {
    (m !== "number" || Ue(p.ownerDocument) !== p) && (b == null ? p.defaultValue = "" + p._wrapperState.initialValue : p.defaultValue !== "" + b && (p.defaultValue = "" + b));
  }
  var Kt = Array.isArray;
  function wt(p, m, b, L) {
    if (p = p.options, m) {
      m = {};
      for (var I = 0; I < b.length; I++) m["$" + b[I]] = !0;
      for (b = 0; b < p.length; b++) I = m.hasOwnProperty("$" + p[b].value), p[b].selected !== I && (p[b].selected = I), I && L && (p[b].defaultSelected = !0);
    } else {
      for (b = "" + de(b), m = null, I = 0; I < p.length; I++) {
        if (p[I].value === b) {
          p[I].selected = !0, L && (p[I].defaultSelected = !0);
          return;
        }
        m !== null || p[I].disabled || (m = p[I]);
      }
      m !== null && (m.selected = !0);
    }
  }
  function ir(p, m) {
    if (m.dangerouslySetInnerHTML != null) throw Error(r(91));
    return q({}, m, { value: void 0, defaultValue: void 0, children: "" + p._wrapperState.initialValue });
  }
  function Nr(p, m) {
    var b = m.value;
    if (b == null) {
      if (b = m.children, m = m.defaultValue, b != null) {
        if (m != null) throw Error(r(92));
        if (Kt(b)) {
          if (1 < b.length) throw Error(r(93));
          b = b[0];
        }
        m = b;
      }
      m == null && (m = ""), b = m;
    }
    p._wrapperState = { initialValue: de(b) };
  }
  function Di(p, m) {
    var b = de(m.value), L = de(m.defaultValue);
    b != null && (b = "" + b, b !== p.value && (p.value = b), m.defaultValue == null && p.defaultValue !== b && (p.defaultValue = b)), L != null && (p.defaultValue = "" + L);
  }
  function na(p) {
    var m = p.textContent;
    m === p._wrapperState.initialValue && m !== "" && m !== null && (p.value = m);
  }
  function su(p) {
    switch (p) {
      case "svg":
        return "http://www.w3.org/2000/svg";
      case "math":
        return "http://www.w3.org/1998/Math/MathML";
      default:
        return "http://www.w3.org/1999/xhtml";
    }
  }
  function Mo(p, m) {
    return p == null || p === "http://www.w3.org/1999/xhtml" ? su(m) : p === "http://www.w3.org/2000/svg" && m === "foreignObject" ? "http://www.w3.org/1999/xhtml" : p;
  }
  var Zn, ia = (function(p) {
    return typeof MSApp < "u" && MSApp.execUnsafeLocalFunction ? function(m, b, L, I) {
      MSApp.execUnsafeLocalFunction(function() {
        return p(m, b, L, I);
      });
    } : p;
  })(function(p, m) {
    if (p.namespaceURI !== "http://www.w3.org/2000/svg" || "innerHTML" in p) p.innerHTML = m;
    else {
      for (Zn = Zn || document.createElement("div"), Zn.innerHTML = "<svg>" + m.valueOf().toString() + "</svg>", m = Zn.firstChild; p.firstChild; ) p.removeChild(p.firstChild);
      for (; m.firstChild; ) p.appendChild(m.firstChild);
    }
  });
  function Qa(p, m) {
    if (m) {
      var b = p.firstChild;
      if (b && b === p.lastChild && b.nodeType === 3) {
        b.nodeValue = m;
        return;
      }
    }
    p.textContent = m;
  }
  var Ja = {
    animationIterationCount: !0,
    aspectRatio: !0,
    borderImageOutset: !0,
    borderImageSlice: !0,
    borderImageWidth: !0,
    boxFlex: !0,
    boxFlexGroup: !0,
    boxOrdinalGroup: !0,
    columnCount: !0,
    columns: !0,
    flex: !0,
    flexGrow: !0,
    flexPositive: !0,
    flexShrink: !0,
    flexNegative: !0,
    flexOrder: !0,
    gridArea: !0,
    gridRow: !0,
    gridRowEnd: !0,
    gridRowSpan: !0,
    gridRowStart: !0,
    gridColumn: !0,
    gridColumnEnd: !0,
    gridColumnSpan: !0,
    gridColumnStart: !0,
    fontWeight: !0,
    lineClamp: !0,
    lineHeight: !0,
    opacity: !0,
    order: !0,
    orphans: !0,
    tabSize: !0,
    widows: !0,
    zIndex: !0,
    zoom: !0,
    fillOpacity: !0,
    floodOpacity: !0,
    stopOpacity: !0,
    strokeDasharray: !0,
    strokeDashoffset: !0,
    strokeMiterlimit: !0,
    strokeOpacity: !0,
    strokeWidth: !0
  }, aa = ["Webkit", "ms", "Moz", "O"];
  Object.keys(Ja).forEach(function(p) {
    aa.forEach(function(m) {
      m = m + p.charAt(0).toUpperCase() + p.substring(1), Ja[m] = Ja[p];
    });
  });
  function hh(p, m, b) {
    return m == null || typeof m == "boolean" || m === "" ? "" : b || typeof m != "number" || m === 0 || Ja.hasOwnProperty(p) && Ja[p] ? ("" + m).trim() : m + "px";
  }
  function tl(p, m) {
    p = p.style;
    for (var b in m) if (m.hasOwnProperty(b)) {
      var L = b.indexOf("--") === 0, I = hh(b, m[b], L);
      b === "float" && (b = "cssFloat"), L ? p.setProperty(b, I) : p[b] = I;
    }
  }
  var _y = q({ menuitem: !0 }, { area: !0, base: !0, br: !0, col: !0, embed: !0, hr: !0, img: !0, input: !0, keygen: !0, link: !0, meta: !0, param: !0, source: !0, track: !0, wbr: !0 });
  function vh(p, m) {
    if (m) {
      if (_y[p] && (m.children != null || m.dangerouslySetInnerHTML != null)) throw Error(r(137, p));
      if (m.dangerouslySetInnerHTML != null) {
        if (m.children != null) throw Error(r(60));
        if (typeof m.dangerouslySetInnerHTML != "object" || !("__html" in m.dangerouslySetInnerHTML)) throw Error(r(61));
      }
      if (m.style != null && typeof m.style != "object") throw Error(r(62));
    }
  }
  function dh(p, m) {
    if (p.indexOf("-") === -1) return typeof m.is == "string";
    switch (p) {
      case "annotation-xml":
      case "color-profile":
      case "font-face":
      case "font-face-src":
      case "font-face-uri":
      case "font-face-format":
      case "font-face-name":
      case "missing-glyph":
        return !1;
      default:
        return !0;
    }
  }
  var xy = null;
  function Sy(p) {
    return p = p.target || p.srcElement || window, p.correspondingUseElement && (p = p.correspondingUseElement), p.nodeType === 3 ? p.parentNode : p;
  }
  var wy = null, lu = null, uu = null;
  function Yx(p) {
    if (p = ci(p)) {
      if (typeof wy != "function") throw Error(r(280));
      var m = p.stateNode;
      m && (m = xp(m), wy(p.stateNode, p.type, m));
    }
  }
  function Zx(p) {
    lu ? uu ? uu.push(p) : uu = [p] : lu = p;
  }
  function $x() {
    if (lu) {
      var p = lu, m = uu;
      if (uu = lu = null, Yx(p), m) for (p = 0; p < m.length; p++) Yx(m[p]);
    }
  }
  function qx(p, m) {
    return p(m);
  }
  function Ty() {
  }
  var by = !1;
  function jx(p, m, b) {
    if (by) return p(m, b);
    by = !0;
    try {
      return qx(p, m, b);
    } finally {
      by = !1, (lu !== null || uu !== null) && (Ty(), $x());
    }
  }
  function ph(p, m) {
    var b = p.stateNode;
    if (b === null) return null;
    var L = xp(b);
    if (L === null) return null;
    b = L[m];
    e: switch (m) {
      case "onClick":
      case "onClickCapture":
      case "onDoubleClick":
      case "onDoubleClickCapture":
      case "onMouseDown":
      case "onMouseDownCapture":
      case "onMouseMove":
      case "onMouseMoveCapture":
      case "onMouseUp":
      case "onMouseUpCapture":
      case "onMouseEnter":
        (L = !L.disabled) || (p = p.type, L = !(p === "button" || p === "input" || p === "select" || p === "textarea")), p = !L;
        break e;
      default:
        p = !1;
    }
    if (p) return null;
    if (b && typeof b != "function") throw Error(r(231, m, typeof b));
    return b;
  }
  var gh = !1;
  if (s) try {
    var mh = {};
    Object.defineProperty(mh, "passive", { get: function() {
      gh = !0;
    } }), window.addEventListener("test", mh, mh), window.removeEventListener("test", mh, mh);
  } catch {
    gh = !1;
  }
  function Cy(p, m, b, L, I, B, Y, re, se) {
    var Te = Array.prototype.slice.call(arguments, 3);
    try {
      m.apply(b, Te);
    } catch (ke) {
      this.onError(ke);
    }
  }
  var yh = !1, Wd = null, Xd = !1, Ay = null, lA = { onError: function(p) {
    yh = !0, Wd = p;
  } };
  function uA(p, m, b, L, I, B, Y, re, se) {
    yh = !1, Wd = null, Cy.apply(lA, arguments);
  }
  function fA(p, m, b, L, I, B, Y, re, se) {
    if (uA.apply(this, arguments), yh) {
      if (yh) {
        var Te = Wd;
        yh = !1, Wd = null;
      } else throw Error(r(198));
      Xd || (Xd = !0, Ay = Te);
    }
  }
  function fu(p) {
    var m = p, b = p;
    if (p.alternate) for (; m.return; ) m = m.return;
    else {
      p = m;
      do
        m = p, (m.flags & 4098) !== 0 && (b = m.return), p = m.return;
      while (p);
    }
    return m.tag === 3 ? b : null;
  }
  function My(p) {
    if (p.tag === 13) {
      var m = p.memoizedState;
      if (m === null && (p = p.alternate, p !== null && (m = p.memoizedState)), m !== null) return m.dehydrated;
    }
    return null;
  }
  function Kx(p) {
    if (fu(p) !== p) throw Error(r(188));
  }
  function cA(p) {
    var m = p.alternate;
    if (!m) {
      if (m = fu(p), m === null) throw Error(r(188));
      return m !== p ? null : p;
    }
    for (var b = p, L = m; ; ) {
      var I = b.return;
      if (I === null) break;
      var B = I.alternate;
      if (B === null) {
        if (L = I.return, L !== null) {
          b = L;
          continue;
        }
        break;
      }
      if (I.child === B.child) {
        for (B = I.child; B; ) {
          if (B === b) return Kx(I), p;
          if (B === L) return Kx(I), m;
          B = B.sibling;
        }
        throw Error(r(188));
      }
      if (b.return !== L.return) b = I, L = B;
      else {
        for (var Y = !1, re = I.child; re; ) {
          if (re === b) {
            Y = !0, b = I, L = B;
            break;
          }
          if (re === L) {
            Y = !0, L = I, b = B;
            break;
          }
          re = re.sibling;
        }
        if (!Y) {
          for (re = B.child; re; ) {
            if (re === b) {
              Y = !0, b = B, L = I;
              break;
            }
            if (re === L) {
              Y = !0, L = B, b = I;
              break;
            }
            re = re.sibling;
          }
          if (!Y) throw Error(r(189));
        }
      }
      if (b.alternate !== L) throw Error(r(190));
    }
    if (b.tag !== 3) throw Error(r(188));
    return b.stateNode.current === b ? p : m;
  }
  function Qx(p) {
    return p = cA(p), p !== null ? Jx(p) : null;
  }
  function Jx(p) {
    if (p.tag === 5 || p.tag === 6) return p;
    for (p = p.child; p !== null; ) {
      var m = Jx(p);
      if (m !== null) return m;
      p = p.sibling;
    }
    return null;
  }
  var eS = t.unstable_scheduleCallback, tS = t.unstable_cancelCallback, Yd = t.unstable_shouldYield, hA = t.unstable_requestPaint, Ur = t.unstable_now, vA = t.unstable_getCurrentPriorityLevel, Ly = t.unstable_ImmediatePriority, rS = t.unstable_UserBlockingPriority, _h = t.unstable_NormalPriority, nS = t.unstable_LowPriority, Dy = t.unstable_IdlePriority, Zd = null, Lo = null;
  function dA(p) {
    if (Lo && typeof Lo.onCommitFiberRoot == "function") try {
      Lo.onCommitFiberRoot(Zd, p, void 0, (p.current.flags & 128) === 128);
    } catch {
    }
  }
  var eo = Math.clz32 ? Math.clz32 : oS, iS = Math.log, aS = Math.LN2;
  function oS(p) {
    return p >>>= 0, p === 0 ? 32 : 31 - (iS(p) / aS | 0) | 0;
  }
  var Ef = 64, $d = 4194304;
  function Pf(p) {
    switch (p & -p) {
      case 1:
        return 1;
      case 2:
        return 2;
      case 4:
        return 4;
      case 8:
        return 8;
      case 16:
        return 16;
      case 32:
        return 32;
      case 64:
      case 128:
      case 256:
      case 512:
      case 1024:
      case 2048:
      case 4096:
      case 8192:
      case 16384:
      case 32768:
      case 65536:
      case 131072:
      case 262144:
      case 524288:
      case 1048576:
      case 2097152:
        return p & 4194240;
      case 4194304:
      case 8388608:
      case 16777216:
      case 33554432:
      case 67108864:
        return p & 130023424;
      case 134217728:
        return 134217728;
      case 268435456:
        return 268435456;
      case 536870912:
        return 536870912;
      case 1073741824:
        return 1073741824;
      default:
        return p;
    }
  }
  function cu(p, m) {
    var b = p.pendingLanes;
    if (b === 0) return 0;
    var L = 0, I = p.suspendedLanes, B = p.pingedLanes, Y = b & 268435455;
    if (Y !== 0) {
      var re = Y & ~I;
      re !== 0 ? L = Pf(re) : (B &= Y, B !== 0 && (L = Pf(B)));
    } else Y = b & ~I, Y !== 0 ? L = Pf(Y) : B !== 0 && (L = Pf(B));
    if (L === 0) return 0;
    if (m !== 0 && m !== L && (m & I) === 0 && (I = L & -L, B = m & -m, I >= B || I === 16 && (B & 4194240) !== 0)) return m;
    if ((L & 4) !== 0 && (L |= b & 16), m = p.entangledLanes, m !== 0) for (p = p.entanglements, m &= L; 0 < m; ) b = 31 - eo(m), I = 1 << b, L |= p[b], m &= ~I;
    return L;
  }
  function sS(p, m) {
    switch (p) {
      case 1:
      case 2:
      case 4:
        return m + 250;
      case 8:
      case 16:
      case 32:
      case 64:
      case 128:
      case 256:
      case 512:
      case 1024:
      case 2048:
      case 4096:
      case 8192:
      case 16384:
      case 32768:
      case 65536:
      case 131072:
      case 262144:
      case 524288:
      case 1048576:
      case 2097152:
        return m + 5e3;
      case 4194304:
      case 8388608:
      case 16777216:
      case 33554432:
      case 67108864:
        return -1;
      case 134217728:
      case 268435456:
      case 536870912:
      case 1073741824:
        return -1;
      default:
        return -1;
    }
  }
  function pA(p, m) {
    for (var b = p.suspendedLanes, L = p.pingedLanes, I = p.expirationTimes, B = p.pendingLanes; 0 < B; ) {
      var Y = 31 - eo(B), re = 1 << Y, se = I[Y];
      se === -1 ? ((re & b) === 0 || (re & L) !== 0) && (I[Y] = sS(re, m)) : se <= m && (p.expiredLanes |= re), B &= ~re;
    }
  }
  function qd(p) {
    return p = p.pendingLanes & -1073741825, p !== 0 ? p : p & 1073741824 ? 1073741824 : 0;
  }
  function Ey() {
    var p = Ef;
    return Ef <<= 1, (Ef & 4194240) === 0 && (Ef = 64), p;
  }
  function xh(p) {
    for (var m = [], b = 0; 31 > b; b++) m.push(p);
    return m;
  }
  function Sh(p, m, b) {
    p.pendingLanes |= m, m !== 536870912 && (p.suspendedLanes = 0, p.pingedLanes = 0), p = p.eventTimes, m = 31 - eo(m), p[m] = b;
  }
  function lS(p, m) {
    var b = p.pendingLanes & ~m;
    p.pendingLanes = m, p.suspendedLanes = 0, p.pingedLanes = 0, p.expiredLanes &= m, p.mutableReadLanes &= m, p.entangledLanes &= m, m = p.entanglements;
    var L = p.eventTimes;
    for (p = p.expirationTimes; 0 < b; ) {
      var I = 31 - eo(b), B = 1 << I;
      m[I] = 0, L[I] = -1, p[I] = -1, b &= ~B;
    }
  }
  function wh(p, m) {
    var b = p.entangledLanes |= m;
    for (p = p.entanglements; b; ) {
      var L = 31 - eo(b), I = 1 << L;
      I & m | p[L] & m && (p[L] |= m), b &= ~I;
    }
  }
  var xr = 0;
  function hu(p) {
    return p &= -p, 1 < p ? 4 < p ? (p & 268435455) !== 0 ? 16 : 536870912 : 4 : 1;
  }
  var Py, jd, uS, Iy, Ry, Kd = !1, Th = [], rl = null, nl = null, il = null, If = /* @__PURE__ */ new Map(), bh = /* @__PURE__ */ new Map(), al = [], gA = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");
  function fS(p, m) {
    switch (p) {
      case "focusin":
      case "focusout":
        rl = null;
        break;
      case "dragenter":
      case "dragleave":
        nl = null;
        break;
      case "mouseover":
      case "mouseout":
        il = null;
        break;
      case "pointerover":
      case "pointerout":
        If.delete(m.pointerId);
        break;
      case "gotpointercapture":
      case "lostpointercapture":
        bh.delete(m.pointerId);
    }
  }
  function vu(p, m, b, L, I, B) {
    return p === null || p.nativeEvent !== B ? (p = { blockedOn: m, domEventName: b, eventSystemFlags: L, nativeEvent: B, targetContainers: [I] }, m !== null && (m = ci(m), m !== null && jd(m)), p) : (p.eventSystemFlags |= L, m = p.targetContainers, I !== null && m.indexOf(I) === -1 && m.push(I), p);
  }
  function mA(p, m, b, L, I) {
    switch (m) {
      case "focusin":
        return rl = vu(rl, p, m, b, L, I), !0;
      case "dragenter":
        return nl = vu(nl, p, m, b, L, I), !0;
      case "mouseover":
        return il = vu(il, p, m, b, L, I), !0;
      case "pointerover":
        var B = I.pointerId;
        return If.set(B, vu(If.get(B) || null, p, m, b, L, I)), !0;
      case "gotpointercapture":
        return B = I.pointerId, bh.set(B, vu(bh.get(B) || null, p, m, b, L, I)), !0;
    }
    return !1;
  }
  function cS(p) {
    var m = Io(p.target);
    if (m !== null) {
      var b = fu(m);
      if (b !== null) {
        if (m = b.tag, m === 13) {
          if (m = My(b), m !== null) {
            p.blockedOn = m, Ry(p.priority, function() {
              uS(b);
            });
            return;
          }
        } else if (m === 3 && b.stateNode.current.memoizedState.isDehydrated) {
          p.blockedOn = b.tag === 3 ? b.stateNode.containerInfo : null;
          return;
        }
      }
    }
    p.blockedOn = null;
  }
  function Qd(p) {
    if (p.blockedOn !== null) return !1;
    for (var m = p.targetContainers; 0 < m.length; ) {
      var b = tp(p.domEventName, p.eventSystemFlags, m[0], p.nativeEvent);
      if (b === null) {
        b = p.nativeEvent;
        var L = new b.constructor(b.type, b);
        xy = L, b.target.dispatchEvent(L), xy = null;
      } else return m = ci(b), m !== null && jd(m), p.blockedOn = b, !1;
      m.shift();
    }
    return !0;
  }
  function hS(p, m, b) {
    Qd(p) && b.delete(m);
  }
  function yA() {
    Kd = !1, rl !== null && Qd(rl) && (rl = null), nl !== null && Qd(nl) && (nl = null), il !== null && Qd(il) && (il = null), If.forEach(hS), bh.forEach(hS);
  }
  function Ar(p, m) {
    p.blockedOn === m && (p.blockedOn = null, Kd || (Kd = !0, t.unstable_scheduleCallback(t.unstable_NormalPriority, yA)));
  }
  function br(p) {
    function m(I) {
      return Ar(I, p);
    }
    if (0 < Th.length) {
      Ar(Th[0], p);
      for (var b = 1; b < Th.length; b++) {
        var L = Th[b];
        L.blockedOn === p && (L.blockedOn = null);
      }
    }
    for (rl !== null && Ar(rl, p), nl !== null && Ar(nl, p), il !== null && Ar(il, p), If.forEach(m), bh.forEach(m), b = 0; b < al.length; b++) L = al[b], L.blockedOn === p && (L.blockedOn = null);
    for (; 0 < al.length && (b = al[0], b.blockedOn === null); ) cS(b), b.blockedOn === null && al.shift();
  }
  var Rf = C.ReactCurrentBatchConfig, Jd = !0;
  function _A(p, m, b, L) {
    var I = xr, B = Rf.transition;
    Rf.transition = null;
    try {
      xr = 1, Oy(p, m, b, L);
    } finally {
      xr = I, Rf.transition = B;
    }
  }
  function xA(p, m, b, L) {
    var I = xr, B = Rf.transition;
    Rf.transition = null;
    try {
      xr = 4, Oy(p, m, b, L);
    } finally {
      xr = I, Rf.transition = B;
    }
  }
  function Oy(p, m, b, L) {
    if (Jd) {
      var I = tp(p, m, b, L);
      if (I === null) Ky(p, m, L, ep, b), fS(p, L);
      else if (mA(I, p, m, b, L)) L.stopPropagation();
      else if (fS(p, L), m & 4 && -1 < gA.indexOf(p)) {
        for (; I !== null; ) {
          var B = ci(I);
          if (B !== null && Py(B), B = tp(p, m, b, L), B === null && Ky(p, m, L, ep, b), B === I) break;
          I = B;
        }
        I !== null && L.stopPropagation();
      } else Ky(p, m, L, null, b);
    }
  }
  var ep = null;
  function tp(p, m, b, L) {
    if (ep = null, p = Sy(L), p = Io(p), p !== null) if (m = fu(p), m === null) p = null;
    else if (b = m.tag, b === 13) {
      if (p = My(m), p !== null) return p;
      p = null;
    } else if (b === 3) {
      if (m.stateNode.current.memoizedState.isDehydrated) return m.tag === 3 ? m.stateNode.containerInfo : null;
      p = null;
    } else m !== p && (p = null);
    return ep = p, null;
  }
  function vS(p) {
    switch (p) {
      case "cancel":
      case "click":
      case "close":
      case "contextmenu":
      case "copy":
      case "cut":
      case "auxclick":
      case "dblclick":
      case "dragend":
      case "dragstart":
      case "drop":
      case "focusin":
      case "focusout":
      case "input":
      case "invalid":
      case "keydown":
      case "keypress":
      case "keyup":
      case "mousedown":
      case "mouseup":
      case "paste":
      case "pause":
      case "play":
      case "pointercancel":
      case "pointerdown":
      case "pointerup":
      case "ratechange":
      case "reset":
      case "resize":
      case "seeked":
      case "submit":
      case "touchcancel":
      case "touchend":
      case "touchstart":
      case "volumechange":
      case "change":
      case "selectionchange":
      case "textInput":
      case "compositionstart":
      case "compositionend":
      case "compositionupdate":
      case "beforeblur":
      case "afterblur":
      case "beforeinput":
      case "blur":
      case "fullscreenchange":
      case "focus":
      case "hashchange":
      case "popstate":
      case "select":
      case "selectstart":
        return 1;
      case "drag":
      case "dragenter":
      case "dragexit":
      case "dragleave":
      case "dragover":
      case "mousemove":
      case "mouseout":
      case "mouseover":
      case "pointermove":
      case "pointerout":
      case "pointerover":
      case "scroll":
      case "toggle":
      case "touchmove":
      case "wheel":
      case "mouseenter":
      case "mouseleave":
      case "pointerenter":
      case "pointerleave":
        return 4;
      case "message":
        switch (vA()) {
          case Ly:
            return 1;
          case rS:
            return 4;
          case _h:
          case nS:
            return 16;
          case Dy:
            return 536870912;
          default:
            return 16;
        }
      default:
        return 16;
    }
  }
  var Wr = null, Ch = null, Do = null;
  function Ny() {
    if (Do) return Do;
    var p, m = Ch, b = m.length, L, I = "value" in Wr ? Wr.value : Wr.textContent, B = I.length;
    for (p = 0; p < b && m[p] === I[p]; p++) ;
    var Y = b - p;
    for (L = 1; L <= Y && m[b - L] === I[B - L]; L++) ;
    return Do = I.slice(p, 1 < L ? 1 - L : void 0);
  }
  function Of(p) {
    var m = p.keyCode;
    return "charCode" in p ? (p = p.charCode, p === 0 && m === 13 && (p = 13)) : p = m, p === 10 && (p = 13), 32 <= p || p === 13 ? p : 0;
  }
  function Ei() {
    return !0;
  }
  function ky() {
    return !1;
  }
  function Xi(p) {
    function m(b, L, I, B, Y) {
      this._reactName = b, this._targetInst = I, this.type = L, this.nativeEvent = B, this.target = Y, this.currentTarget = null;
      for (var re in p) p.hasOwnProperty(re) && (b = p[re], this[re] = b ? b(B) : B[re]);
      return this.isDefaultPrevented = (B.defaultPrevented != null ? B.defaultPrevented : B.returnValue === !1) ? Ei : ky, this.isPropagationStopped = ky, this;
    }
    return q(m.prototype, { preventDefault: function() {
      this.defaultPrevented = !0;
      var b = this.nativeEvent;
      b && (b.preventDefault ? b.preventDefault() : typeof b.returnValue != "unknown" && (b.returnValue = !1), this.isDefaultPrevented = Ei);
    }, stopPropagation: function() {
      var b = this.nativeEvent;
      b && (b.stopPropagation ? b.stopPropagation() : typeof b.cancelBubble != "unknown" && (b.cancelBubble = !0), this.isPropagationStopped = Ei);
    }, persist: function() {
    }, isPersistent: Ei }), m;
  }
  var du = { eventPhase: 0, bubbles: 0, cancelable: 0, timeStamp: function(p) {
    return p.timeStamp || Date.now();
  }, defaultPrevented: 0, isTrusted: 0 }, rp = Xi(du), Nf = q({}, du, { view: 0, detail: 0 }), dS = Xi(Nf), Pi, By, ui, np = q({}, Nf, { screenX: 0, screenY: 0, clientX: 0, clientY: 0, pageX: 0, pageY: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, getModifierState: Hy, button: 0, buttons: 0, relatedTarget: function(p) {
    return p.relatedTarget === void 0 ? p.fromElement === p.srcElement ? p.toElement : p.fromElement : p.relatedTarget;
  }, movementX: function(p) {
    return "movementX" in p ? p.movementX : (p !== ui && (ui && p.type === "mousemove" ? (Pi = p.screenX - ui.screenX, By = p.screenY - ui.screenY) : By = Pi = 0, ui = p), Pi);
  }, movementY: function(p) {
    return "movementY" in p ? p.movementY : By;
  } }), zy = Xi(np), ol = q({}, np, { dataTransfer: 0 }), ip = Xi(ol), Fy = q({}, Nf, { relatedTarget: 0 }), kr = Xi(Fy), sl = q({}, du, { animationName: 0, elapsedTime: 0, pseudoElement: 0 }), Gy = Xi(sl), SA = q({}, du, { clipboardData: function(p) {
    return "clipboardData" in p ? p.clipboardData : window.clipboardData;
  } }), Vy = Xi(SA), wA = q({}, du, { data: 0 }), pS = Xi(wA), TA = {
    Esc: "Escape",
    Spacebar: " ",
    Left: "ArrowLeft",
    Up: "ArrowUp",
    Right: "ArrowRight",
    Down: "ArrowDown",
    Del: "Delete",
    Win: "OS",
    Menu: "ContextMenu",
    Apps: "ContextMenu",
    Scroll: "ScrollLock",
    MozPrintableKey: "Unidentified"
  }, gS = {
    8: "Backspace",
    9: "Tab",
    12: "Clear",
    13: "Enter",
    16: "Shift",
    17: "Control",
    18: "Alt",
    19: "Pause",
    20: "CapsLock",
    27: "Escape",
    32: " ",
    33: "PageUp",
    34: "PageDown",
    35: "End",
    36: "Home",
    37: "ArrowLeft",
    38: "ArrowUp",
    39: "ArrowRight",
    40: "ArrowDown",
    45: "Insert",
    46: "Delete",
    112: "F1",
    113: "F2",
    114: "F3",
    115: "F4",
    116: "F5",
    117: "F6",
    118: "F7",
    119: "F8",
    120: "F9",
    121: "F10",
    122: "F11",
    123: "F12",
    144: "NumLock",
    145: "ScrollLock",
    224: "Meta"
  }, ap = { Alt: "altKey", Control: "ctrlKey", Meta: "metaKey", Shift: "shiftKey" };
  function kf(p) {
    var m = this.nativeEvent;
    return m.getModifierState ? m.getModifierState(p) : (p = ap[p]) ? !!m[p] : !1;
  }
  function Hy() {
    return kf;
  }
  var mS = q({}, Nf, { key: function(p) {
    if (p.key) {
      var m = TA[p.key] || p.key;
      if (m !== "Unidentified") return m;
    }
    return p.type === "keypress" ? (p = Of(p), p === 13 ? "Enter" : String.fromCharCode(p)) : p.type === "keydown" || p.type === "keyup" ? gS[p.keyCode] || "Unidentified" : "";
  }, code: 0, location: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, repeat: 0, locale: 0, getModifierState: Hy, charCode: function(p) {
    return p.type === "keypress" ? Of(p) : 0;
  }, keyCode: function(p) {
    return p.type === "keydown" || p.type === "keyup" ? p.keyCode : 0;
  }, which: function(p) {
    return p.type === "keypress" ? Of(p) : p.type === "keydown" || p.type === "keyup" ? p.keyCode : 0;
  } }), yS = Xi(mS), Uy = q({}, np, { pointerId: 0, width: 0, height: 0, pressure: 0, tangentialPressure: 0, tiltX: 0, tiltY: 0, twist: 0, pointerType: 0, isPrimary: 0 }), op = Xi(Uy), _S = q({}, Nf, { touches: 0, targetTouches: 0, changedTouches: 0, altKey: 0, metaKey: 0, ctrlKey: 0, shiftKey: 0, getModifierState: Hy }), bA = Xi(_S), Wy = q({}, du, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 }), Xy = Xi(Wy), CA = q({}, np, {
    deltaX: function(p) {
      return "deltaX" in p ? p.deltaX : "wheelDeltaX" in p ? -p.wheelDeltaX : 0;
    },
    deltaY: function(p) {
      return "deltaY" in p ? p.deltaY : "wheelDeltaY" in p ? -p.wheelDeltaY : "wheelDelta" in p ? -p.wheelDelta : 0;
    },
    deltaZ: 0,
    deltaMode: 0
  }), xS = Xi(CA), oa = [9, 13, 27, 32], Ah = s && "CompositionEvent" in window, gs = null;
  s && "documentMode" in document && (gs = document.documentMode);
  var SS = s && "TextEvent" in window && !gs, Yy = s && (!Ah || gs && 8 < gs && 11 >= gs), wS = " ", TS = !1;
  function bS(p, m) {
    switch (p) {
      case "keyup":
        return oa.indexOf(m.keyCode) !== -1;
      case "keydown":
        return m.keyCode !== 229;
      case "keypress":
      case "mousedown":
      case "focusout":
        return !0;
      default:
        return !1;
    }
  }
  function CS(p) {
    return p = p.detail, typeof p == "object" && "data" in p ? p.data : null;
  }
  var Bf = !1;
  function zf(p, m) {
    switch (p) {
      case "compositionend":
        return CS(m);
      case "keypress":
        return m.which !== 32 ? null : (TS = !0, wS);
      case "textInput":
        return p = m.data, p === wS && TS ? null : p;
      default:
        return null;
    }
  }
  function AA(p, m) {
    if (Bf) return p === "compositionend" || !Ah && bS(p, m) ? (p = Ny(), Do = Ch = Wr = null, Bf = !1, p) : null;
    switch (p) {
      case "paste":
        return null;
      case "keypress":
        if (!(m.ctrlKey || m.altKey || m.metaKey) || m.ctrlKey && m.altKey) {
          if (m.char && 1 < m.char.length) return m.char;
          if (m.which) return String.fromCharCode(m.which);
        }
        return null;
      case "compositionend":
        return Yy && m.locale !== "ko" ? null : m.data;
      default:
        return null;
    }
  }
  var MA = { color: !0, date: !0, datetime: !0, "datetime-local": !0, email: !0, month: !0, number: !0, password: !0, range: !0, search: !0, tel: !0, text: !0, time: !0, url: !0, week: !0 };
  function sp(p) {
    var m = p && p.nodeName && p.nodeName.toLowerCase();
    return m === "input" ? !!MA[p.type] : m === "textarea";
  }
  function Zy(p, m, b, L) {
    Zx(L), m = gp(m, "onChange"), 0 < m.length && (b = new rp("onChange", "change", null, b, L), p.push({ event: b, listeners: m }));
  }
  var Aa = null, ll = null;
  function LA(p) {
    IS(p, 0);
  }
  function lp(p) {
    var m = Zt(p);
    if (De(m)) return p;
  }
  function DA(p, m) {
    if (p === "change") return m;
  }
  var pu = !1;
  if (s) {
    var sa;
    if (s) {
      var up = "oninput" in document;
      if (!up) {
        var AS = document.createElement("div");
        AS.setAttribute("oninput", "return;"), up = typeof AS.oninput == "function";
      }
      sa = up;
    } else sa = !1;
    pu = sa && (!document.documentMode || 9 < document.documentMode);
  }
  function MS() {
    Aa && (Aa.detachEvent("onpropertychange", LS), ll = Aa = null);
  }
  function LS(p) {
    if (p.propertyName === "value" && lp(ll)) {
      var m = [];
      Zy(m, ll, p, Sy(p)), jx(LA, m);
    }
  }
  function EA(p, m, b) {
    p === "focusin" ? (MS(), Aa = m, ll = b, Aa.attachEvent("onpropertychange", LS)) : p === "focusout" && MS();
  }
  function PA(p) {
    if (p === "selectionchange" || p === "keyup" || p === "keydown") return lp(ll);
  }
  function Ff(p, m) {
    if (p === "click") return lp(m);
  }
  function he(p, m) {
    if (p === "input" || p === "change") return lp(m);
  }
  function Le(p, m) {
    return p === m && (p !== 0 || 1 / p === 1 / m) || p !== p && m !== m;
  }
  var we = typeof Object.is == "function" ? Object.is : Le;
  function lt(p, m) {
    if (we(p, m)) return !0;
    if (typeof p != "object" || p === null || typeof m != "object" || m === null) return !1;
    var b = Object.keys(p), L = Object.keys(m);
    if (b.length !== L.length) return !1;
    for (L = 0; L < b.length; L++) {
      var I = b[L];
      if (!l.call(m, I) || !we(p[I], m[I])) return !1;
    }
    return !0;
  }
  function Ft(p) {
    for (; p && p.firstChild; ) p = p.firstChild;
    return p;
  }
  function yr(p, m) {
    var b = Ft(p);
    p = 0;
    for (var L; b; ) {
      if (b.nodeType === 3) {
        if (L = p + b.textContent.length, p <= m && L >= m) return { node: b, offset: m - p };
        p = L;
      }
      e: {
        for (; b; ) {
          if (b.nextSibling) {
            b = b.nextSibling;
            break e;
          }
          b = b.parentNode;
        }
        b = void 0;
      }
      b = Ft(b);
    }
  }
  function hn(p, m) {
    return p && m ? p === m ? !0 : p && p.nodeType === 3 ? !1 : m && m.nodeType === 3 ? hn(p, m.parentNode) : "contains" in p ? p.contains(m) : p.compareDocumentPosition ? !!(p.compareDocumentPosition(m) & 16) : !1 : !1;
  }
  function Lr() {
    for (var p = window, m = Ue(); m instanceof p.HTMLIFrameElement; ) {
      try {
        var b = typeof m.contentWindow.location.href == "string";
      } catch {
        b = !1;
      }
      if (b) p = m.contentWindow;
      else break;
      m = Ue(p.document);
    }
    return m;
  }
  function Mh(p) {
    var m = p && p.nodeName && p.nodeName.toLowerCase();
    return m && (m === "input" && (p.type === "text" || p.type === "search" || p.type === "tel" || p.type === "url" || p.type === "password") || m === "textarea" || p.contentEditable === "true");
  }
  function IA(p) {
    var m = Lr(), b = p.focusedElem, L = p.selectionRange;
    if (m !== b && b && b.ownerDocument && hn(b.ownerDocument.documentElement, b)) {
      if (L !== null && Mh(b)) {
        if (m = L.start, p = L.end, p === void 0 && (p = m), "selectionStart" in b) b.selectionStart = m, b.selectionEnd = Math.min(p, b.value.length);
        else if (p = (m = b.ownerDocument || document) && m.defaultView || window, p.getSelection) {
          p = p.getSelection();
          var I = b.textContent.length, B = Math.min(L.start, I);
          L = L.end === void 0 ? B : Math.min(L.end, I), !p.extend && B > L && (I = L, L = B, B = I), I = yr(b, B);
          var Y = yr(
            b,
            L
          );
          I && Y && (p.rangeCount !== 1 || p.anchorNode !== I.node || p.anchorOffset !== I.offset || p.focusNode !== Y.node || p.focusOffset !== Y.offset) && (m = m.createRange(), m.setStart(I.node, I.offset), p.removeAllRanges(), B > L ? (p.addRange(m), p.extend(Y.node, Y.offset)) : (m.setEnd(Y.node, Y.offset), p.addRange(m)));
        }
      }
      for (m = [], p = b; p = p.parentNode; ) p.nodeType === 1 && m.push({ element: p, left: p.scrollLeft, top: p.scrollTop });
      for (typeof b.focus == "function" && b.focus(), b = 0; b < m.length; b++) p = m[b], p.element.scrollLeft = p.left, p.element.scrollTop = p.top;
    }
  }
  var Ma = s && "documentMode" in document && 11 >= document.documentMode, ms = null, $y = null, Eo = null, Gf = !1;
  function Lh(p, m, b) {
    var L = b.window === b ? b.document : b.nodeType === 9 ? b : b.ownerDocument;
    Gf || ms == null || ms !== Ue(L) || (L = ms, "selectionStart" in L && Mh(L) ? L = { start: L.selectionStart, end: L.selectionEnd } : (L = (L.ownerDocument && L.ownerDocument.defaultView || window).getSelection(), L = { anchorNode: L.anchorNode, anchorOffset: L.anchorOffset, focusNode: L.focusNode, focusOffset: L.focusOffset }), Eo && lt(Eo, L) || (Eo = L, L = gp($y, "onSelect"), 0 < L.length && (m = new rp("onSelect", "select", null, m, b), p.push({ event: m, listeners: L }), m.target = ms)));
  }
  function hr(p, m) {
    var b = {};
    return b[p.toLowerCase()] = m.toLowerCase(), b["Webkit" + p] = "webkit" + m, b["Moz" + p] = "moz" + m, b;
  }
  var Vf = { animationend: hr("Animation", "AnimationEnd"), animationiteration: hr("Animation", "AnimationIteration"), animationstart: hr("Animation", "AnimationStart"), transitionend: hr("Transition", "TransitionEnd") }, fp = {}, Dh = {};
  s && (Dh = document.createElement("div").style, "AnimationEvent" in window || (delete Vf.animationend.animation, delete Vf.animationiteration.animation, delete Vf.animationstart.animation), "TransitionEvent" in window || delete Vf.transitionend.transition);
  function cp(p) {
    if (fp[p]) return fp[p];
    if (!Vf[p]) return p;
    var m = Vf[p], b;
    for (b in m) if (m.hasOwnProperty(b) && b in Dh) return fp[p] = m[b];
    return p;
  }
  var DS = cp("animationend"), ES = cp("animationiteration"), Eh = cp("animationstart"), ys = cp("transitionend"), Ph = /* @__PURE__ */ new Map(), qy = "abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");
  function to(p, m) {
    Ph.set(p, m), a(m, [p]);
  }
  for (var hp = 0; hp < qy.length; hp++) {
    var vp = qy[hp], dp = vp.toLowerCase(), PS = vp[0].toUpperCase() + vp.slice(1);
    to(dp, "on" + PS);
  }
  to(DS, "onAnimationEnd"), to(ES, "onAnimationIteration"), to(Eh, "onAnimationStart"), to("dblclick", "onDoubleClick"), to("focusin", "onFocus"), to("focusout", "onBlur"), to(ys, "onTransitionEnd"), o("onMouseEnter", ["mouseout", "mouseover"]), o("onMouseLeave", ["mouseout", "mouseover"]), o("onPointerEnter", ["pointerout", "pointerover"]), o("onPointerLeave", ["pointerout", "pointerover"]), a("onChange", "change click focusin focusout input keydown keyup selectionchange".split(" ")), a("onSelect", "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")), a("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]), a("onCompositionEnd", "compositionend focusout keydown keypress keyup mousedown".split(" ")), a("onCompositionStart", "compositionstart focusout keydown keypress keyup mousedown".split(" ")), a("onCompositionUpdate", "compositionupdate focusout keydown keypress keyup mousedown".split(" "));
  var _s = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "), gu = new Set("cancel close invalid load scroll toggle".split(" ").concat(_s));
  function Ih(p, m, b) {
    var L = p.type || "unknown-event";
    p.currentTarget = b, fA(L, m, void 0, p), p.currentTarget = null;
  }
  function IS(p, m) {
    m = (m & 4) !== 0;
    for (var b = 0; b < p.length; b++) {
      var L = p[b], I = L.event;
      L = L.listeners;
      e: {
        var B = void 0;
        if (m) for (var Y = L.length - 1; 0 <= Y; Y--) {
          var re = L[Y], se = re.instance, Te = re.currentTarget;
          if (re = re.listener, se !== B && I.isPropagationStopped()) break e;
          Ih(I, re, Te), B = se;
        }
        else for (Y = 0; Y < L.length; Y++) {
          if (re = L[Y], se = re.instance, Te = re.currentTarget, re = re.listener, se !== B && I.isPropagationStopped()) break e;
          Ih(I, re, Te), B = se;
        }
      }
    }
    if (Xd) throw p = Ay, Xd = !1, Ay = null, p;
  }
  function Fr(p, m) {
    var b = m[_p];
    b === void 0 && (b = m[_p] = /* @__PURE__ */ new Set());
    var L = p + "__bubble";
    b.has(L) || (pp(m, p, 2, !1), b.add(L));
  }
  function jy(p, m, b) {
    var L = 0;
    m && (L |= 4), pp(b, p, L, m);
  }
  var mu = "_reactListening" + Math.random().toString(36).slice(2);
  function ul(p) {
    if (!p[mu]) {
      p[mu] = !0, n.forEach(function(b) {
        b !== "selectionchange" && (gu.has(b) || jy(b, !1, p), jy(b, !0, p));
      });
      var m = p.nodeType === 9 ? p : p.ownerDocument;
      m === null || m[mu] || (m[mu] = !0, jy("selectionchange", !1, m));
    }
  }
  function pp(p, m, b, L) {
    switch (vS(m)) {
      case 1:
        var I = _A;
        break;
      case 4:
        I = xA;
        break;
      default:
        I = Oy;
    }
    b = I.bind(null, m, b, p), I = void 0, !gh || m !== "touchstart" && m !== "touchmove" && m !== "wheel" || (I = !0), L ? I !== void 0 ? p.addEventListener(m, b, { capture: !0, passive: I }) : p.addEventListener(m, b, !0) : I !== void 0 ? p.addEventListener(m, b, { passive: I }) : p.addEventListener(m, b, !1);
  }
  function Ky(p, m, b, L, I) {
    var B = L;
    if ((m & 1) === 0 && (m & 2) === 0 && L !== null) e: for (; ; ) {
      if (L === null) return;
      var Y = L.tag;
      if (Y === 3 || Y === 4) {
        var re = L.stateNode.containerInfo;
        if (re === I || re.nodeType === 8 && re.parentNode === I) break;
        if (Y === 4) for (Y = L.return; Y !== null; ) {
          var se = Y.tag;
          if ((se === 3 || se === 4) && (se = Y.stateNode.containerInfo, se === I || se.nodeType === 8 && se.parentNode === I)) return;
          Y = Y.return;
        }
        for (; re !== null; ) {
          if (Y = Io(re), Y === null) return;
          if (se = Y.tag, se === 5 || se === 6) {
            L = B = Y;
            continue e;
          }
          re = re.parentNode;
        }
      }
      L = L.return;
    }
    jx(function() {
      var Te = B, ke = Sy(b), Ve = [];
      e: {
        var Ne = Ph.get(p);
        if (Ne !== void 0) {
          var ut = rp, gt = p;
          switch (p) {
            case "keypress":
              if (Of(b) === 0) break e;
            case "keydown":
            case "keyup":
              ut = yS;
              break;
            case "focusin":
              gt = "focus", ut = kr;
              break;
            case "focusout":
              gt = "blur", ut = kr;
              break;
            case "beforeblur":
            case "afterblur":
              ut = kr;
              break;
            case "click":
              if (b.button === 2) break e;
            case "auxclick":
            case "dblclick":
            case "mousedown":
            case "mousemove":
            case "mouseup":
            case "mouseout":
            case "mouseover":
            case "contextmenu":
              ut = zy;
              break;
            case "drag":
            case "dragend":
            case "dragenter":
            case "dragexit":
            case "dragleave":
            case "dragover":
            case "dragstart":
            case "drop":
              ut = ip;
              break;
            case "touchcancel":
            case "touchend":
            case "touchmove":
            case "touchstart":
              ut = bA;
              break;
            case DS:
            case ES:
            case Eh:
              ut = Gy;
              break;
            case ys:
              ut = Xy;
              break;
            case "scroll":
              ut = dS;
              break;
            case "wheel":
              ut = xS;
              break;
            case "copy":
            case "cut":
            case "paste":
              ut = Vy;
              break;
            case "gotpointercapture":
            case "lostpointercapture":
            case "pointercancel":
            case "pointerdown":
            case "pointermove":
            case "pointerout":
            case "pointerover":
            case "pointerup":
              ut = op;
          }
          var mt = (m & 4) !== 0, sn = !mt && p === "scroll", ye = mt ? Ne !== null ? Ne + "Capture" : null : Ne;
          mt = [];
          for (var ce = Te, _e; ce !== null; ) {
            _e = ce;
            var Ye = _e.stateNode;
            if (_e.tag === 5 && Ye !== null && (_e = Ye, ye !== null && (Ye = ph(ce, ye), Ye != null && mt.push(Hf(ce, Ye, _e)))), sn) break;
            ce = ce.return;
          }
          0 < mt.length && (Ne = new ut(Ne, gt, null, b, ke), Ve.push({ event: Ne, listeners: mt }));
        }
      }
      if ((m & 7) === 0) {
        e: {
          if (Ne = p === "mouseover" || p === "pointerover", ut = p === "mouseout" || p === "pointerout", Ne && b !== xy && (gt = b.relatedTarget || b.fromElement) && (Io(gt) || gt[la])) break e;
          if ((ut || Ne) && (Ne = ke.window === ke ? ke : (Ne = ke.ownerDocument) ? Ne.defaultView || Ne.parentWindow : window, ut ? (gt = b.relatedTarget || b.toElement, ut = Te, gt = gt ? Io(gt) : null, gt !== null && (sn = fu(gt), gt !== sn || gt.tag !== 5 && gt.tag !== 6) && (gt = null)) : (ut = null, gt = Te), ut !== gt)) {
            if (mt = zy, Ye = "onMouseLeave", ye = "onMouseEnter", ce = "mouse", (p === "pointerout" || p === "pointerover") && (mt = op, Ye = "onPointerLeave", ye = "onPointerEnter", ce = "pointer"), sn = ut == null ? Ne : Zt(ut), _e = gt == null ? Ne : Zt(gt), Ne = new mt(Ye, ce + "leave", ut, b, ke), Ne.target = sn, Ne.relatedTarget = _e, Ye = null, Io(ke) === Te && (mt = new mt(ye, ce + "enter", gt, b, ke), mt.target = _e, mt.relatedTarget = sn, Ye = mt), sn = Ye, ut && gt) t: {
              for (mt = ut, ye = gt, ce = 0, _e = mt; _e; _e = Uf(_e)) ce++;
              for (_e = 0, Ye = ye; Ye; Ye = Uf(Ye)) _e++;
              for (; 0 < ce - _e; ) mt = Uf(mt), ce--;
              for (; 0 < _e - ce; ) ye = Uf(ye), _e--;
              for (; ce--; ) {
                if (mt === ye || ye !== null && mt === ye.alternate) break t;
                mt = Uf(mt), ye = Uf(ye);
              }
              mt = null;
            }
            else mt = null;
            ut !== null && vn(Ve, Ne, ut, mt, !1), gt !== null && sn !== null && vn(Ve, sn, gt, mt, !0);
          }
        }
        e: {
          if (Ne = Te ? Zt(Te) : window, ut = Ne.nodeName && Ne.nodeName.toLowerCase(), ut === "select" || ut === "input" && Ne.type === "file") var yt = DA;
          else if (sp(Ne)) if (pu) yt = he;
          else {
            yt = PA;
            var Dt = EA;
          }
          else (ut = Ne.nodeName) && ut.toLowerCase() === "input" && (Ne.type === "checkbox" || Ne.type === "radio") && (yt = Ff);
          if (yt && (yt = yt(p, Te))) {
            Zy(Ve, yt, b, ke);
            break e;
          }
          Dt && Dt(p, Ne, Te), p === "focusout" && (Dt = Ne._wrapperState) && Dt.controlled && Ne.type === "number" && mr(Ne, "number", Ne.value);
        }
        switch (Dt = Te ? Zt(Te) : window, p) {
          case "focusin":
            (sp(Dt) || Dt.contentEditable === "true") && (ms = Dt, $y = Te, Eo = null);
            break;
          case "focusout":
            Eo = $y = ms = null;
            break;
          case "mousedown":
            Gf = !0;
            break;
          case "contextmenu":
          case "mouseup":
          case "dragend":
            Gf = !1, Lh(Ve, b, ke);
            break;
          case "selectionchange":
            if (Ma) break;
          case "keydown":
          case "keyup":
            Lh(Ve, b, ke);
        }
        var Ct;
        if (Ah) e: {
          switch (p) {
            case "compositionstart":
              var Ot = "onCompositionStart";
              break e;
            case "compositionend":
              Ot = "onCompositionEnd";
              break e;
            case "compositionupdate":
              Ot = "onCompositionUpdate";
              break e;
          }
          Ot = void 0;
        }
        else Bf ? bS(p, b) && (Ot = "onCompositionEnd") : p === "keydown" && b.keyCode === 229 && (Ot = "onCompositionStart");
        Ot && (Yy && b.locale !== "ko" && (Bf || Ot !== "onCompositionStart" ? Ot === "onCompositionEnd" && Bf && (Ct = Ny()) : (Wr = ke, Ch = "value" in Wr ? Wr.value : Wr.textContent, Bf = !0)), Dt = gp(Te, Ot), 0 < Dt.length && (Ot = new pS(Ot, p, null, b, ke), Ve.push({ event: Ot, listeners: Dt }), Ct ? Ot.data = Ct : (Ct = CS(b), Ct !== null && (Ot.data = Ct)))), (Ct = SS ? zf(p, b) : AA(p, b)) && (Te = gp(Te, "onBeforeInput"), 0 < Te.length && (ke = new pS("onBeforeInput", "beforeinput", null, b, ke), Ve.push({ event: ke, listeners: Te }), ke.data = Ct));
      }
      IS(Ve, m);
    });
  }
  function Hf(p, m, b) {
    return { instance: p, listener: m, currentTarget: b };
  }
  function gp(p, m) {
    for (var b = m + "Capture", L = []; p !== null; ) {
      var I = p, B = I.stateNode;
      I.tag === 5 && B !== null && (I = B, B = ph(p, b), B != null && L.unshift(Hf(p, B, I)), B = ph(p, m), B != null && L.push(Hf(p, B, I))), p = p.return;
    }
    return L;
  }
  function Uf(p) {
    if (p === null) return null;
    do
      p = p.return;
    while (p && p.tag !== 5);
    return p || null;
  }
  function vn(p, m, b, L, I) {
    for (var B = m._reactName, Y = []; b !== null && b !== L; ) {
      var re = b, se = re.alternate, Te = re.stateNode;
      if (se !== null && se === L) break;
      re.tag === 5 && Te !== null && (re = Te, I ? (se = ph(b, B), se != null && Y.unshift(Hf(b, se, re))) : I || (se = ph(b, B), se != null && Y.push(Hf(b, se, re)))), b = b.return;
    }
    Y.length !== 0 && p.push({ event: m, listeners: Y });
  }
  var fi = /\r\n?/g, RA = /\u0000|\uFFFD/g;
  function RS(p) {
    return (typeof p == "string" ? p : "" + p).replace(fi, `
`).replace(RA, "");
  }
  function Rh(p, m, b) {
    if (m = RS(m), RS(p) !== m && b) throw Error(r(425));
  }
  function mp() {
  }
  var Oh = null, yu = null;
  function Nh(p, m) {
    return p === "textarea" || p === "noscript" || typeof m.children == "string" || typeof m.children == "number" || typeof m.dangerouslySetInnerHTML == "object" && m.dangerouslySetInnerHTML !== null && m.dangerouslySetInnerHTML.__html != null;
  }
  var fl = typeof setTimeout == "function" ? setTimeout : void 0, kh = typeof clearTimeout == "function" ? clearTimeout : void 0, Wf = typeof Promise == "function" ? Promise : void 0, yp = typeof queueMicrotask == "function" ? queueMicrotask : typeof Wf < "u" ? function(p) {
    return Wf.resolve(null).then(p).catch(Xf);
  } : fl;
  function Xf(p) {
    setTimeout(function() {
      throw p;
    });
  }
  function Qy(p, m) {
    var b = m, L = 0;
    do {
      var I = b.nextSibling;
      if (p.removeChild(b), I && I.nodeType === 8) if (b = I.data, b === "/$") {
        if (L === 0) {
          p.removeChild(I), br(m);
          return;
        }
        L--;
      } else b !== "$" && b !== "$?" && b !== "$!" || L++;
      b = I;
    } while (b);
    br(m);
  }
  function cl(p) {
    for (; p != null; p = p.nextSibling) {
      var m = p.nodeType;
      if (m === 1 || m === 3) break;
      if (m === 8) {
        if (m = p.data, m === "$" || m === "$!" || m === "$?") break;
        if (m === "/$") return null;
      }
    }
    return p;
  }
  function OS(p) {
    p = p.previousSibling;
    for (var m = 0; p; ) {
      if (p.nodeType === 8) {
        var b = p.data;
        if (b === "$" || b === "$!" || b === "$?") {
          if (m === 0) return p;
          m--;
        } else b === "/$" && m++;
      }
      p = p.previousSibling;
    }
    return null;
  }
  var Yf = Math.random().toString(36).slice(2), Po = "__reactFiber$" + Yf, hl = "__reactProps$" + Yf, la = "__reactContainer$" + Yf, _p = "__reactEvents$" + Yf, $ = "__reactListeners$" + Yf, Zf = "__reactHandles$" + Yf;
  function Io(p) {
    var m = p[Po];
    if (m) return m;
    for (var b = p.parentNode; b; ) {
      if (m = b[la] || b[Po]) {
        if (b = m.alternate, m.child !== null || b !== null && b.child !== null) for (p = OS(p); p !== null; ) {
          if (b = p[Po]) return b;
          p = OS(p);
        }
        return m;
      }
      p = b, b = p.parentNode;
    }
    return null;
  }
  function ci(p) {
    return p = p[Po] || p[la], !p || p.tag !== 5 && p.tag !== 6 && p.tag !== 13 && p.tag !== 3 ? null : p;
  }
  function Zt(p) {
    if (p.tag === 5 || p.tag === 6) return p.stateNode;
    throw Error(r(33));
  }
  function xp(p) {
    return p[hl] || null;
  }
  var Jy = [], $f = -1;
  function Yi(p) {
    return { current: p };
  }
  function Gr(p) {
    0 > $f || (p.current = Jy[$f], Jy[$f] = null, $f--);
  }
  function Br(p, m) {
    $f++, Jy[$f] = p.current, p.current = m;
  }
  var vl = {}, hi = Yi(vl), Zi = Yi(!1), Ii = vl;
  function qf(p, m) {
    var b = p.type.contextTypes;
    if (!b) return vl;
    var L = p.stateNode;
    if (L && L.__reactInternalMemoizedUnmaskedChildContext === m) return L.__reactInternalMemoizedMaskedChildContext;
    var I = {}, B;
    for (B in b) I[B] = m[B];
    return L && (p = p.stateNode, p.__reactInternalMemoizedUnmaskedChildContext = m, p.__reactInternalMemoizedMaskedChildContext = I), I;
  }
  function $i(p) {
    return p = p.childContextTypes, p != null;
  }
  function Sp() {
    Gr(Zi), Gr(hi);
  }
  function NS(p, m, b) {
    if (hi.current !== vl) throw Error(r(168));
    Br(hi, m), Br(Zi, b);
  }
  function kS(p, m, b) {
    var L = p.stateNode;
    if (m = m.childContextTypes, typeof L.getChildContext != "function") return b;
    L = L.getChildContext();
    for (var I in L) if (!(I in m)) throw Error(r(108, me(p) || "Unknown", I));
    return q({}, b, L);
  }
  function La(p) {
    return p = (p = p.stateNode) && p.__reactInternalMemoizedMergedChildContext || vl, Ii = hi.current, Br(hi, p), Br(Zi, Zi.current), !0;
  }
  function BS(p, m, b) {
    var L = p.stateNode;
    if (!L) throw Error(r(169));
    b ? (p = kS(p, m, Ii), L.__reactInternalMemoizedMergedChildContext = p, Gr(Zi), Gr(hi), Br(hi, p)) : Gr(Zi), Br(Zi, b);
  }
  var xs = null, wp = !1, e0 = !1;
  function zS(p) {
    xs === null ? xs = [p] : xs.push(p);
  }
  function _u(p) {
    wp = !0, zS(p);
  }
  function dl() {
    if (!e0 && xs !== null) {
      e0 = !0;
      var p = 0, m = xr;
      try {
        var b = xs;
        for (xr = 1; p < b.length; p++) {
          var L = b[p];
          do
            L = L(!0);
          while (L !== null);
        }
        xs = null, wp = !1;
      } catch (I) {
        throw xs !== null && (xs = xs.slice(p + 1)), eS(Ly, dl), I;
      } finally {
        xr = m, e0 = !1;
      }
    }
    return null;
  }
  var jf = [], vi = 0, Tp = null, bp = 0, Da = [], Ea = 0, xu = null, Ro = 1, Oo = "";
  function Su(p, m) {
    jf[vi++] = bp, jf[vi++] = Tp, Tp = p, bp = m;
  }
  function FS(p, m, b) {
    Da[Ea++] = Ro, Da[Ea++] = Oo, Da[Ea++] = xu, xu = p;
    var L = Ro;
    p = Oo;
    var I = 32 - eo(L) - 1;
    L &= ~(1 << I), b += 1;
    var B = 32 - eo(m) + I;
    if (30 < B) {
      var Y = I - I % 5;
      B = (L & (1 << Y) - 1).toString(32), L >>= Y, I -= Y, Ro = 1 << 32 - eo(m) + I | b << I | L, Oo = B + p;
    } else Ro = 1 << B | b << I | L, Oo = p;
  }
  function Bh(p) {
    p.return !== null && (Su(p, 1), FS(p, 1, 0));
  }
  function wu(p) {
    for (; p === Tp; ) Tp = jf[--vi], jf[vi] = null, bp = jf[--vi], jf[vi] = null;
    for (; p === xu; ) xu = Da[--Ea], Da[Ea] = null, Oo = Da[--Ea], Da[Ea] = null, Ro = Da[--Ea], Da[Ea] = null;
  }
  var di = null, ua = null, Vr = !1, ro = null;
  function No(p, m) {
    var b = Ba(5, null, null, 0);
    b.elementType = "DELETED", b.stateNode = m, b.return = p, m = p.deletions, m === null ? (p.deletions = [b], p.flags |= 16) : m.push(b);
  }
  function Cp(p, m) {
    switch (p.tag) {
      case 5:
        var b = p.type;
        return m = m.nodeType !== 1 || b.toLowerCase() !== m.nodeName.toLowerCase() ? null : m, m !== null ? (p.stateNode = m, di = p, ua = cl(m.firstChild), !0) : !1;
      case 6:
        return m = p.pendingProps === "" || m.nodeType !== 3 ? null : m, m !== null ? (p.stateNode = m, di = p, ua = null, !0) : !1;
      case 13:
        return m = m.nodeType !== 8 ? null : m, m !== null ? (b = xu !== null ? { id: Ro, overflow: Oo } : null, p.memoizedState = { dehydrated: m, treeContext: b, retryLane: 1073741824 }, b = Ba(18, null, null, 0), b.stateNode = m, b.return = p, p.child = b, di = p, ua = null, !0) : !1;
      default:
        return !1;
    }
  }
  function Ss(p) {
    return (p.mode & 1) !== 0 && (p.flags & 128) === 0;
  }
  function qi(p) {
    if (Vr) {
      var m = ua;
      if (m) {
        var b = m;
        if (!Cp(p, m)) {
          if (Ss(p)) throw Error(r(418));
          m = cl(b.nextSibling);
          var L = di;
          m && Cp(p, m) ? No(L, b) : (p.flags = p.flags & -4097 | 2, Vr = !1, di = p);
        }
      } else {
        if (Ss(p)) throw Error(r(418));
        p.flags = p.flags & -4097 | 2, Vr = !1, di = p;
      }
    }
  }
  function GS(p) {
    for (p = p.return; p !== null && p.tag !== 5 && p.tag !== 3 && p.tag !== 13; ) p = p.return;
    di = p;
  }
  function zh(p) {
    if (p !== di) return !1;
    if (!Vr) return GS(p), Vr = !0, !1;
    var m;
    if ((m = p.tag !== 3) && !(m = p.tag !== 5) && (m = p.type, m = m !== "head" && m !== "body" && !Nh(p.type, p.memoizedProps)), m && (m = ua)) {
      if (Ss(p)) throw t0(), Error(r(418));
      for (; m; ) No(p, m), m = cl(m.nextSibling);
    }
    if (GS(p), p.tag === 13) {
      if (p = p.memoizedState, p = p !== null ? p.dehydrated : null, !p) throw Error(r(317));
      e: {
        for (p = p.nextSibling, m = 0; p; ) {
          if (p.nodeType === 8) {
            var b = p.data;
            if (b === "/$") {
              if (m === 0) {
                ua = cl(p.nextSibling);
                break e;
              }
              m--;
            } else b !== "$" && b !== "$!" && b !== "$?" || m++;
          }
          p = p.nextSibling;
        }
        ua = null;
      }
    } else ua = di ? cl(p.stateNode.nextSibling) : null;
    return !0;
  }
  function t0() {
    for (var p = ua; p; ) p = cl(p.nextSibling);
  }
  function ko() {
    ua = di = null, Vr = !1;
  }
  function Bo(p) {
    ro === null ? ro = [p] : ro.push(p);
  }
  var VS = C.ReactCurrentBatchConfig;
  function Fh(p, m, b) {
    if (p = b.ref, p !== null && typeof p != "function" && typeof p != "object") {
      if (b._owner) {
        if (b = b._owner, b) {
          if (b.tag !== 1) throw Error(r(309));
          var L = b.stateNode;
        }
        if (!L) throw Error(r(147, p));
        var I = L, B = "" + p;
        return m !== null && m.ref !== null && typeof m.ref == "function" && m.ref._stringRef === B ? m.ref : (m = function(Y) {
          var re = I.refs;
          Y === null ? delete re[B] : re[B] = Y;
        }, m._stringRef = B, m);
      }
      if (typeof p != "string") throw Error(r(284));
      if (!b._owner) throw Error(r(290, p));
    }
    return p;
  }
  function Tu(p, m) {
    throw p = Object.prototype.toString.call(m), Error(r(31, p === "[object Object]" ? "object with keys {" + Object.keys(m).join(", ") + "}" : p));
  }
  function HS(p) {
    var m = p._init;
    return m(p._payload);
  }
  function r0(p) {
    function m(ye, ce) {
      if (p) {
        var _e = ye.deletions;
        _e === null ? (ye.deletions = [ce], ye.flags |= 16) : _e.push(ce);
      }
    }
    function b(ye, ce) {
      if (!p) return null;
      for (; ce !== null; ) m(ye, ce), ce = ce.sibling;
      return null;
    }
    function L(ye, ce) {
      for (ye = /* @__PURE__ */ new Map(); ce !== null; ) ce.key !== null ? ye.set(ce.key, ce) : ye.set(ce.index, ce), ce = ce.sibling;
      return ye;
    }
    function I(ye, ce) {
      return ye = uo(ye, ce), ye.index = 0, ye.sibling = null, ye;
    }
    function B(ye, ce, _e) {
      return ye.index = _e, p ? (_e = ye.alternate, _e !== null ? (_e = _e.index, _e < ce ? (ye.flags |= 2, ce) : _e) : (ye.flags |= 2, ce)) : (ye.flags |= 1048576, ce);
    }
    function Y(ye) {
      return p && ye.alternate === null && (ye.flags |= 2), ye;
    }
    function re(ye, ce, _e, Ye) {
      return ce === null || ce.tag !== 6 ? (ce = H0(_e, ye.mode, Ye), ce.return = ye, ce) : (ce = I(ce, _e), ce.return = ye, ce);
    }
    function se(ye, ce, _e, Ye) {
      var yt = _e.type;
      return yt === E ? ke(ye, ce, _e.props.children, Ye, _e.key) : ce !== null && (ce.elementType === yt || typeof yt == "object" && yt !== null && yt.$$typeof === Z && HS(yt) === ce.type) ? (Ye = I(ce, _e.props), Ye.ref = Fh(ye, ce, _e), Ye.return = ye, Ye) : (Ye = og(_e.type, _e.key, _e.props, null, ye.mode, Ye), Ye.ref = Fh(ye, ce, _e), Ye.return = ye, Ye);
    }
    function Te(ye, ce, _e, Ye) {
      return ce === null || ce.tag !== 4 || ce.stateNode.containerInfo !== _e.containerInfo || ce.stateNode.implementation !== _e.implementation ? (ce = U0(_e, ye.mode, Ye), ce.return = ye, ce) : (ce = I(ce, _e.children || []), ce.return = ye, ce);
    }
    function ke(ye, ce, _e, Ye, yt) {
      return ce === null || ce.tag !== 7 ? (ce = Ou(_e, ye.mode, Ye, yt), ce.return = ye, ce) : (ce = I(ce, _e), ce.return = ye, ce);
    }
    function Ve(ye, ce, _e) {
      if (typeof ce == "string" && ce !== "" || typeof ce == "number") return ce = H0("" + ce, ye.mode, _e), ce.return = ye, ce;
      if (typeof ce == "object" && ce !== null) {
        switch (ce.$$typeof) {
          case A:
            return _e = og(ce.type, ce.key, ce.props, null, ye.mode, _e), _e.ref = Fh(ye, null, ce), _e.return = ye, _e;
          case M:
            return ce = U0(ce, ye.mode, _e), ce.return = ye, ce;
          case Z:
            var Ye = ce._init;
            return Ve(ye, Ye(ce._payload), _e);
        }
        if (Kt(ce) || Q(ce)) return ce = Ou(ce, ye.mode, _e, null), ce.return = ye, ce;
        Tu(ye, ce);
      }
      return null;
    }
    function Ne(ye, ce, _e, Ye) {
      var yt = ce !== null ? ce.key : null;
      if (typeof _e == "string" && _e !== "" || typeof _e == "number") return yt !== null ? null : re(ye, ce, "" + _e, Ye);
      if (typeof _e == "object" && _e !== null) {
        switch (_e.$$typeof) {
          case A:
            return _e.key === yt ? se(ye, ce, _e, Ye) : null;
          case M:
            return _e.key === yt ? Te(ye, ce, _e, Ye) : null;
          case Z:
            return yt = _e._init, Ne(
              ye,
              ce,
              yt(_e._payload),
              Ye
            );
        }
        if (Kt(_e) || Q(_e)) return yt !== null ? null : ke(ye, ce, _e, Ye, null);
        Tu(ye, _e);
      }
      return null;
    }
    function ut(ye, ce, _e, Ye, yt) {
      if (typeof Ye == "string" && Ye !== "" || typeof Ye == "number") return ye = ye.get(_e) || null, re(ce, ye, "" + Ye, yt);
      if (typeof Ye == "object" && Ye !== null) {
        switch (Ye.$$typeof) {
          case A:
            return ye = ye.get(Ye.key === null ? _e : Ye.key) || null, se(ce, ye, Ye, yt);
          case M:
            return ye = ye.get(Ye.key === null ? _e : Ye.key) || null, Te(ce, ye, Ye, yt);
          case Z:
            var Dt = Ye._init;
            return ut(ye, ce, _e, Dt(Ye._payload), yt);
        }
        if (Kt(Ye) || Q(Ye)) return ye = ye.get(_e) || null, ke(ce, ye, Ye, yt, null);
        Tu(ce, Ye);
      }
      return null;
    }
    function gt(ye, ce, _e, Ye) {
      for (var yt = null, Dt = null, Ct = ce, Ot = ce = 0, kn = null; Ct !== null && Ot < _e.length; Ot++) {
        Ct.index > Ot ? (kn = Ct, Ct = null) : kn = Ct.sibling;
        var _r = Ne(ye, Ct, _e[Ot], Ye);
        if (_r === null) {
          Ct === null && (Ct = kn);
          break;
        }
        p && Ct && _r.alternate === null && m(ye, Ct), ce = B(_r, ce, Ot), Dt === null ? yt = _r : Dt.sibling = _r, Dt = _r, Ct = kn;
      }
      if (Ot === _e.length) return b(ye, Ct), Vr && Su(ye, Ot), yt;
      if (Ct === null) {
        for (; Ot < _e.length; Ot++) Ct = Ve(ye, _e[Ot], Ye), Ct !== null && (ce = B(Ct, ce, Ot), Dt === null ? yt = Ct : Dt.sibling = Ct, Dt = Ct);
        return Vr && Su(ye, Ot), yt;
      }
      for (Ct = L(ye, Ct); Ot < _e.length; Ot++) kn = ut(Ct, ye, Ot, _e[Ot], Ye), kn !== null && (p && kn.alternate !== null && Ct.delete(kn.key === null ? Ot : kn.key), ce = B(kn, ce, Ot), Dt === null ? yt = kn : Dt.sibling = kn, Dt = kn);
      return p && Ct.forEach(function(Al) {
        return m(ye, Al);
      }), Vr && Su(ye, Ot), yt;
    }
    function mt(ye, ce, _e, Ye) {
      var yt = Q(_e);
      if (typeof yt != "function") throw Error(r(150));
      if (_e = yt.call(_e), _e == null) throw Error(r(151));
      for (var Dt = yt = null, Ct = ce, Ot = ce = 0, kn = null, _r = _e.next(); Ct !== null && !_r.done; Ot++, _r = _e.next()) {
        Ct.index > Ot ? (kn = Ct, Ct = null) : kn = Ct.sibling;
        var Al = Ne(ye, Ct, _r.value, Ye);
        if (Al === null) {
          Ct === null && (Ct = kn);
          break;
        }
        p && Ct && Al.alternate === null && m(ye, Ct), ce = B(Al, ce, Ot), Dt === null ? yt = Al : Dt.sibling = Al, Dt = Al, Ct = kn;
      }
      if (_r.done) return b(
        ye,
        Ct
      ), Vr && Su(ye, Ot), yt;
      if (Ct === null) {
        for (; !_r.done; Ot++, _r = _e.next()) _r = Ve(ye, _r.value, Ye), _r !== null && (ce = B(_r, ce, Ot), Dt === null ? yt = _r : Dt.sibling = _r, Dt = _r);
        return Vr && Su(ye, Ot), yt;
      }
      for (Ct = L(ye, Ct); !_r.done; Ot++, _r = _e.next()) _r = ut(Ct, ye, Ot, _r.value, Ye), _r !== null && (p && _r.alternate !== null && Ct.delete(_r.key === null ? Ot : _r.key), ce = B(_r, ce, Ot), Dt === null ? yt = _r : Dt.sibling = _r, Dt = _r);
      return p && Ct.forEach(function(eM) {
        return m(ye, eM);
      }), Vr && Su(ye, Ot), yt;
    }
    function sn(ye, ce, _e, Ye) {
      if (typeof _e == "object" && _e !== null && _e.type === E && _e.key === null && (_e = _e.props.children), typeof _e == "object" && _e !== null) {
        switch (_e.$$typeof) {
          case A:
            e: {
              for (var yt = _e.key, Dt = ce; Dt !== null; ) {
                if (Dt.key === yt) {
                  if (yt = _e.type, yt === E) {
                    if (Dt.tag === 7) {
                      b(ye, Dt.sibling), ce = I(Dt, _e.props.children), ce.return = ye, ye = ce;
                      break e;
                    }
                  } else if (Dt.elementType === yt || typeof yt == "object" && yt !== null && yt.$$typeof === Z && HS(yt) === Dt.type) {
                    b(ye, Dt.sibling), ce = I(Dt, _e.props), ce.ref = Fh(ye, Dt, _e), ce.return = ye, ye = ce;
                    break e;
                  }
                  b(ye, Dt);
                  break;
                } else m(ye, Dt);
                Dt = Dt.sibling;
              }
              _e.type === E ? (ce = Ou(_e.props.children, ye.mode, Ye, _e.key), ce.return = ye, ye = ce) : (Ye = og(_e.type, _e.key, _e.props, null, ye.mode, Ye), Ye.ref = Fh(ye, ce, _e), Ye.return = ye, ye = Ye);
            }
            return Y(ye);
          case M:
            e: {
              for (Dt = _e.key; ce !== null; ) {
                if (ce.key === Dt) if (ce.tag === 4 && ce.stateNode.containerInfo === _e.containerInfo && ce.stateNode.implementation === _e.implementation) {
                  b(ye, ce.sibling), ce = I(ce, _e.children || []), ce.return = ye, ye = ce;
                  break e;
                } else {
                  b(ye, ce);
                  break;
                }
                else m(ye, ce);
                ce = ce.sibling;
              }
              ce = U0(_e, ye.mode, Ye), ce.return = ye, ye = ce;
            }
            return Y(ye);
          case Z:
            return Dt = _e._init, sn(ye, ce, Dt(_e._payload), Ye);
        }
        if (Kt(_e)) return gt(ye, ce, _e, Ye);
        if (Q(_e)) return mt(ye, ce, _e, Ye);
        Tu(ye, _e);
      }
      return typeof _e == "string" && _e !== "" || typeof _e == "number" ? (_e = "" + _e, ce !== null && ce.tag === 6 ? (b(ye, ce.sibling), ce = I(ce, _e), ce.return = ye, ye = ce) : (b(ye, ce), ce = H0(_e, ye.mode, Ye), ce.return = ye, ye = ce), Y(ye)) : b(ye, ce);
    }
    return sn;
  }
  var tn = r0(!0), Ap = r0(!1), Gh = Yi(null), fa = null, pl = null, Kf = null;
  function ws() {
    Kf = pl = fa = null;
  }
  function Mp(p) {
    var m = Gh.current;
    Gr(Gh), p._currentValue = m;
  }
  function $n(p, m, b) {
    for (; p !== null; ) {
      var L = p.alternate;
      if ((p.childLanes & m) !== m ? (p.childLanes |= m, L !== null && (L.childLanes |= m)) : L !== null && (L.childLanes & m) !== m && (L.childLanes |= m), p === b) break;
      p = p.return;
    }
  }
  function gl(p, m) {
    fa = p, Kf = pl = null, p = p.dependencies, p !== null && p.firstContext !== null && ((p.lanes & m) !== 0 && (Oi = !0), p.firstContext = null);
  }
  function Pa(p) {
    var m = p._currentValue;
    if (Kf !== p) if (p = { context: p, memoizedValue: m, next: null }, pl === null) {
      if (fa === null) throw Error(r(308));
      pl = p, fa.dependencies = { lanes: 0, firstContext: p };
    } else pl = pl.next = p;
    return m;
  }
  var bu = null;
  function n0(p) {
    bu === null ? bu = [p] : bu.push(p);
  }
  function Lp(p, m, b, L) {
    var I = m.interleaved;
    return I === null ? (b.next = b, n0(m)) : (b.next = I.next, I.next = b), m.interleaved = b, Ts(p, L);
  }
  function Ts(p, m) {
    p.lanes |= m;
    var b = p.alternate;
    for (b !== null && (b.lanes |= m), b = p, p = p.return; p !== null; ) p.childLanes |= m, b = p.alternate, b !== null && (b.childLanes |= m), b = p, p = p.return;
    return b.tag === 3 ? b.stateNode : null;
  }
  var Ia = !1;
  function Dp(p) {
    p.updateQueue = { baseState: p.memoizedState, firstBaseUpdate: null, lastBaseUpdate: null, shared: { pending: null, interleaved: null, lanes: 0 }, effects: null };
  }
  function US(p, m) {
    p = p.updateQueue, m.updateQueue === p && (m.updateQueue = { baseState: p.baseState, firstBaseUpdate: p.firstBaseUpdate, lastBaseUpdate: p.lastBaseUpdate, shared: p.shared, effects: p.effects });
  }
  function bs(p, m) {
    return { eventTime: p, lane: m, tag: 0, payload: null, callback: null, next: null };
  }
  function Ra(p, m, b) {
    var L = p.updateQueue;
    if (L === null) return null;
    if (L = L.shared, (vr & 2) !== 0) {
      var I = L.pending;
      return I === null ? m.next = m : (m.next = I.next, I.next = m), L.pending = m, Ts(p, b);
    }
    return I = L.interleaved, I === null ? (m.next = m, n0(L)) : (m.next = I.next, I.next = m), L.interleaved = m, Ts(p, b);
  }
  function Ep(p, m, b) {
    if (m = m.updateQueue, m !== null && (m = m.shared, (b & 4194240) !== 0)) {
      var L = m.lanes;
      L &= p.pendingLanes, b |= L, m.lanes = b, wh(p, b);
    }
  }
  function WS(p, m) {
    var b = p.updateQueue, L = p.alternate;
    if (L !== null && (L = L.updateQueue, b === L)) {
      var I = null, B = null;
      if (b = b.firstBaseUpdate, b !== null) {
        do {
          var Y = { eventTime: b.eventTime, lane: b.lane, tag: b.tag, payload: b.payload, callback: b.callback, next: null };
          B === null ? I = B = Y : B = B.next = Y, b = b.next;
        } while (b !== null);
        B === null ? I = B = m : B = B.next = m;
      } else I = B = m;
      b = { baseState: L.baseState, firstBaseUpdate: I, lastBaseUpdate: B, shared: L.shared, effects: L.effects }, p.updateQueue = b;
      return;
    }
    p = b.lastBaseUpdate, p === null ? b.firstBaseUpdate = m : p.next = m, b.lastBaseUpdate = m;
  }
  function Qf(p, m, b, L) {
    var I = p.updateQueue;
    Ia = !1;
    var B = I.firstBaseUpdate, Y = I.lastBaseUpdate, re = I.shared.pending;
    if (re !== null) {
      I.shared.pending = null;
      var se = re, Te = se.next;
      se.next = null, Y === null ? B = Te : Y.next = Te, Y = se;
      var ke = p.alternate;
      ke !== null && (ke = ke.updateQueue, re = ke.lastBaseUpdate, re !== Y && (re === null ? ke.firstBaseUpdate = Te : re.next = Te, ke.lastBaseUpdate = se));
    }
    if (B !== null) {
      var Ve = I.baseState;
      Y = 0, ke = Te = se = null, re = B;
      do {
        var Ne = re.lane, ut = re.eventTime;
        if ((L & Ne) === Ne) {
          ke !== null && (ke = ke.next = {
            eventTime: ut,
            lane: 0,
            tag: re.tag,
            payload: re.payload,
            callback: re.callback,
            next: null
          });
          e: {
            var gt = p, mt = re;
            switch (Ne = m, ut = b, mt.tag) {
              case 1:
                if (gt = mt.payload, typeof gt == "function") {
                  Ve = gt.call(ut, Ve, Ne);
                  break e;
                }
                Ve = gt;
                break e;
              case 3:
                gt.flags = gt.flags & -65537 | 128;
              case 0:
                if (gt = mt.payload, Ne = typeof gt == "function" ? gt.call(ut, Ve, Ne) : gt, Ne == null) break e;
                Ve = q({}, Ve, Ne);
                break e;
              case 2:
                Ia = !0;
            }
          }
          re.callback !== null && re.lane !== 0 && (p.flags |= 64, Ne = I.effects, Ne === null ? I.effects = [re] : Ne.push(re));
        } else ut = { eventTime: ut, lane: Ne, tag: re.tag, payload: re.payload, callback: re.callback, next: null }, ke === null ? (Te = ke = ut, se = Ve) : ke = ke.next = ut, Y |= Ne;
        if (re = re.next, re === null) {
          if (re = I.shared.pending, re === null) break;
          Ne = re, re = Ne.next, Ne.next = null, I.lastBaseUpdate = Ne, I.shared.pending = null;
        }
      } while (!0);
      if (ke === null && (se = Ve), I.baseState = se, I.firstBaseUpdate = Te, I.lastBaseUpdate = ke, m = I.shared.interleaved, m !== null) {
        I = m;
        do
          Y |= I.lane, I = I.next;
        while (I !== m);
      } else B === null && (I.shared.lanes = 0);
      Sl |= Y, p.lanes = Y, p.memoizedState = Ve;
    }
  }
  function i0(p, m, b) {
    if (p = m.effects, m.effects = null, p !== null) for (m = 0; m < p.length; m++) {
      var L = p[m], I = L.callback;
      if (I !== null) {
        if (L.callback = null, L = b, typeof I != "function") throw Error(r(191, I));
        I.call(L);
      }
    }
  }
  var Vh = {}, zo = Yi(Vh), Hh = Yi(Vh), Jf = Yi(Vh);
  function Cs(p) {
    if (p === Vh) throw Error(r(174));
    return p;
  }
  function a0(p, m) {
    switch (Br(Jf, m), Br(Hh, p), Br(zo, Vh), p = m.nodeType, p) {
      case 9:
      case 11:
        m = (m = m.documentElement) ? m.namespaceURI : Mo(null, "");
        break;
      default:
        p = p === 8 ? m.parentNode : m, m = p.namespaceURI || null, p = p.tagName, m = Mo(m, p);
    }
    Gr(zo), Br(zo, m);
  }
  function ml() {
    Gr(zo), Gr(Hh), Gr(Jf);
  }
  function o0(p) {
    Cs(Jf.current);
    var m = Cs(zo.current), b = Mo(m, p.type);
    m !== b && (Br(Hh, p), Br(zo, b));
  }
  function Pp(p) {
    Hh.current === p && (Gr(zo), Gr(Hh));
  }
  var Xr = Yi(0);
  function Cu(p) {
    for (var m = p; m !== null; ) {
      if (m.tag === 13) {
        var b = m.memoizedState;
        if (b !== null && (b = b.dehydrated, b === null || b.data === "$?" || b.data === "$!")) return m;
      } else if (m.tag === 19 && m.memoizedProps.revealOrder !== void 0) {
        if ((m.flags & 128) !== 0) return m;
      } else if (m.child !== null) {
        m.child.return = m, m = m.child;
        continue;
      }
      if (m === p) break;
      for (; m.sibling === null; ) {
        if (m.return === null || m.return === p) return null;
        m = m.return;
      }
      m.sibling.return = m.return, m = m.sibling;
    }
    return null;
  }
  var s0 = [];
  function Ip() {
    for (var p = 0; p < s0.length; p++) s0[p]._workInProgressVersionPrimary = null;
    s0.length = 0;
  }
  var Uh = C.ReactCurrentDispatcher, l0 = C.ReactCurrentBatchConfig, yl = 0, Kr = null, on = null, Cn = null, ec = !1, Wh = !1, Au = 0, Qt = 0;
  function pi() {
    throw Error(r(321));
  }
  function u0(p, m) {
    if (m === null) return !1;
    for (var b = 0; b < m.length && b < p.length; b++) if (!we(p[b], m[b])) return !1;
    return !0;
  }
  function Mu(p, m, b, L, I, B) {
    if (yl = B, Kr = m, m.memoizedState = null, m.updateQueue = null, m.lanes = 0, Uh.current = p === null || p.memoizedState === null ? NA : Fp, p = b(L, I), Wh) {
      B = 0;
      do {
        if (Wh = !1, Au = 0, 25 <= B) throw Error(r(301));
        B += 1, Cn = on = null, m.updateQueue = null, Uh.current = ic, p = b(L, I);
      } while (Wh);
    }
    if (Uh.current = zp, m = on !== null && on.next !== null, yl = 0, Cn = on = Kr = null, ec = !1, m) throw Error(r(300));
    return p;
  }
  function Rp() {
    var p = Au !== 0;
    return Au = 0, p;
  }
  function Fo() {
    var p = { memoizedState: null, baseState: null, baseQueue: null, queue: null, next: null };
    return Cn === null ? Kr.memoizedState = Cn = p : Cn = Cn.next = p, Cn;
  }
  function Oa() {
    if (on === null) {
      var p = Kr.alternate;
      p = p !== null ? p.memoizedState : null;
    } else p = on.next;
    var m = Cn === null ? Kr.memoizedState : Cn.next;
    if (m !== null) Cn = m, on = p;
    else {
      if (p === null) throw Error(r(310));
      on = p, p = { memoizedState: on.memoizedState, baseState: on.baseState, baseQueue: on.baseQueue, queue: on.queue, next: null }, Cn === null ? Kr.memoizedState = Cn = p : Cn = Cn.next = p;
    }
    return Cn;
  }
  function gi(p, m) {
    return typeof m == "function" ? m(p) : m;
  }
  function f0(p) {
    var m = Oa(), b = m.queue;
    if (b === null) throw Error(r(311));
    b.lastRenderedReducer = p;
    var L = on, I = L.baseQueue, B = b.pending;
    if (B !== null) {
      if (I !== null) {
        var Y = I.next;
        I.next = B.next, B.next = Y;
      }
      L.baseQueue = I = B, b.pending = null;
    }
    if (I !== null) {
      B = I.next, L = L.baseState;
      var re = Y = null, se = null, Te = B;
      do {
        var ke = Te.lane;
        if ((yl & ke) === ke) se !== null && (se = se.next = { lane: 0, action: Te.action, hasEagerState: Te.hasEagerState, eagerState: Te.eagerState, next: null }), L = Te.hasEagerState ? Te.eagerState : p(L, Te.action);
        else {
          var Ve = {
            lane: ke,
            action: Te.action,
            hasEagerState: Te.hasEagerState,
            eagerState: Te.eagerState,
            next: null
          };
          se === null ? (re = se = Ve, Y = L) : se = se.next = Ve, Kr.lanes |= ke, Sl |= ke;
        }
        Te = Te.next;
      } while (Te !== null && Te !== B);
      se === null ? Y = L : se.next = re, we(L, m.memoizedState) || (Oi = !0), m.memoizedState = L, m.baseState = Y, m.baseQueue = se, b.lastRenderedState = L;
    }
    if (p = b.interleaved, p !== null) {
      I = p;
      do
        B = I.lane, Kr.lanes |= B, Sl |= B, I = I.next;
      while (I !== p);
    } else I === null && (b.lanes = 0);
    return [m.memoizedState, b.dispatch];
  }
  function tc(p) {
    var m = Oa(), b = m.queue;
    if (b === null) throw Error(r(311));
    b.lastRenderedReducer = p;
    var L = b.dispatch, I = b.pending, B = m.memoizedState;
    if (I !== null) {
      b.pending = null;
      var Y = I = I.next;
      do
        B = p(B, Y.action), Y = Y.next;
      while (Y !== I);
      we(B, m.memoizedState) || (Oi = !0), m.memoizedState = B, m.baseQueue === null && (m.baseState = B), b.lastRenderedState = B;
    }
    return [B, L];
  }
  function Op() {
  }
  function c0(p, m) {
    var b = Kr, L = Oa(), I = m(), B = !we(L.memoizedState, I);
    if (B && (L.memoizedState = I, Oi = !0), L = L.queue, Go(As.bind(null, b, L, p), [p]), L.getSnapshot !== m || B || Cn !== null && Cn.memoizedState.tag & 1) {
      if (b.flags |= 2048, rc(9, ji.bind(null, b, L, I, m), void 0, null), Nn === null) throw Error(r(349));
      (yl & 30) !== 0 || h0(b, m, I);
    }
    return I;
  }
  function h0(p, m, b) {
    p.flags |= 16384, p = { getSnapshot: m, value: b }, m = Kr.updateQueue, m === null ? (m = { lastEffect: null, stores: null }, Kr.updateQueue = m, m.stores = [p]) : (b = m.stores, b === null ? m.stores = [p] : b.push(p));
  }
  function ji(p, m, b, L) {
    m.value = b, m.getSnapshot = L, Np(m) && v0(p);
  }
  function As(p, m, b) {
    return b(function() {
      Np(m) && v0(p);
    });
  }
  function Np(p) {
    var m = p.getSnapshot;
    p = p.value;
    try {
      var b = m();
      return !we(p, b);
    } catch {
      return !0;
    }
  }
  function v0(p) {
    var m = Ts(p, 1);
    m !== null && lo(m, p, 1, -1);
  }
  function Xh(p) {
    var m = Fo();
    return typeof p == "function" && (p = p()), m.memoizedState = m.baseState = p, p = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: gi, lastRenderedState: p }, m.queue = p, p = p.dispatch = jS.bind(null, Kr, p), [m.memoizedState, p];
  }
  function rc(p, m, b, L) {
    return p = { tag: p, create: m, destroy: b, deps: L, next: null }, m = Kr.updateQueue, m === null ? (m = { lastEffect: null, stores: null }, Kr.updateQueue = m, m.lastEffect = p.next = p) : (b = m.lastEffect, b === null ? m.lastEffect = p.next = p : (L = b.next, b.next = p, p.next = L, m.lastEffect = p)), p;
  }
  function kp() {
    return Oa().memoizedState;
  }
  function Yh(p, m, b, L) {
    var I = Fo();
    Kr.flags |= p, I.memoizedState = rc(1 | m, b, void 0, L === void 0 ? null : L);
  }
  function nc(p, m, b, L) {
    var I = Oa();
    L = L === void 0 ? null : L;
    var B = void 0;
    if (on !== null) {
      var Y = on.memoizedState;
      if (B = Y.destroy, L !== null && u0(L, Y.deps)) {
        I.memoizedState = rc(m, b, B, L);
        return;
      }
    }
    Kr.flags |= p, I.memoizedState = rc(1 | m, b, B, L);
  }
  function Bp(p, m) {
    return Yh(8390656, 8, p, m);
  }
  function Go(p, m) {
    return nc(2048, 8, p, m);
  }
  function XS(p, m) {
    return nc(4, 2, p, m);
  }
  function Ms(p, m) {
    return nc(4, 4, p, m);
  }
  function d0(p, m) {
    if (typeof m == "function") return p = p(), m(p), function() {
      m(null);
    };
    if (m != null) return p = p(), m.current = p, function() {
      m.current = null;
    };
  }
  function p0(p, m, b) {
    return b = b != null ? b.concat([p]) : null, nc(4, 4, d0.bind(null, m, p), b);
  }
  function Zh() {
  }
  function YS(p, m) {
    var b = Oa();
    m = m === void 0 ? null : m;
    var L = b.memoizedState;
    return L !== null && m !== null && u0(m, L[1]) ? L[0] : (b.memoizedState = [p, m], p);
  }
  function ZS(p, m) {
    var b = Oa();
    m = m === void 0 ? null : m;
    var L = b.memoizedState;
    return L !== null && m !== null && u0(m, L[1]) ? L[0] : (p = p(), b.memoizedState = [p, m], p);
  }
  function $S(p, m, b) {
    return (yl & 21) === 0 ? (p.baseState && (p.baseState = !1, Oi = !0), p.memoizedState = b) : (we(b, m) || (b = Ey(), Kr.lanes |= b, Sl |= b, p.baseState = !0), m);
  }
  function qS(p, m) {
    var b = xr;
    xr = b !== 0 && 4 > b ? b : 4, p(!0);
    var L = l0.transition;
    l0.transition = {};
    try {
      p(!1), m();
    } finally {
      xr = b, l0.transition = L;
    }
  }
  function g0() {
    return Oa().memoizedState;
  }
  function OA(p, m, b) {
    var L = bl(p);
    if (b = { lane: L, action: b, hasEagerState: !1, eagerState: null, next: null }, m0(p)) Ri(m, b);
    else if (b = Lp(p, m, b, L), b !== null) {
      var I = Bi();
      lo(b, p, L, I), no(b, m, L);
    }
  }
  function jS(p, m, b) {
    var L = bl(p), I = { lane: L, action: b, hasEagerState: !1, eagerState: null, next: null };
    if (m0(p)) Ri(m, I);
    else {
      var B = p.alternate;
      if (p.lanes === 0 && (B === null || B.lanes === 0) && (B = m.lastRenderedReducer, B !== null)) try {
        var Y = m.lastRenderedState, re = B(Y, b);
        if (I.hasEagerState = !0, I.eagerState = re, we(re, Y)) {
          var se = m.interleaved;
          se === null ? (I.next = I, n0(m)) : (I.next = se.next, se.next = I), m.interleaved = I;
          return;
        }
      } catch {
      }
      b = Lp(p, m, I, L), b !== null && (I = Bi(), lo(b, p, L, I), no(b, m, L));
    }
  }
  function m0(p) {
    var m = p.alternate;
    return p === Kr || m !== null && m === Kr;
  }
  function Ri(p, m) {
    Wh = ec = !0;
    var b = p.pending;
    b === null ? m.next = m : (m.next = b.next, b.next = m), p.pending = m;
  }
  function no(p, m, b) {
    if ((b & 4194240) !== 0) {
      var L = m.lanes;
      L &= p.pendingLanes, b |= L, m.lanes = b, wh(p, b);
    }
  }
  var zp = { readContext: Pa, useCallback: pi, useContext: pi, useEffect: pi, useImperativeHandle: pi, useInsertionEffect: pi, useLayoutEffect: pi, useMemo: pi, useReducer: pi, useRef: pi, useState: pi, useDebugValue: pi, useDeferredValue: pi, useTransition: pi, useMutableSource: pi, useSyncExternalStore: pi, useId: pi, unstable_isNewReconciler: !1 }, NA = { readContext: Pa, useCallback: function(p, m) {
    return Fo().memoizedState = [p, m === void 0 ? null : m], p;
  }, useContext: Pa, useEffect: Bp, useImperativeHandle: function(p, m, b) {
    return b = b != null ? b.concat([p]) : null, Yh(
      4194308,
      4,
      d0.bind(null, m, p),
      b
    );
  }, useLayoutEffect: function(p, m) {
    return Yh(4194308, 4, p, m);
  }, useInsertionEffect: function(p, m) {
    return Yh(4, 2, p, m);
  }, useMemo: function(p, m) {
    var b = Fo();
    return m = m === void 0 ? null : m, p = p(), b.memoizedState = [p, m], p;
  }, useReducer: function(p, m, b) {
    var L = Fo();
    return m = b !== void 0 ? b(m) : m, L.memoizedState = L.baseState = m, p = { pending: null, interleaved: null, lanes: 0, dispatch: null, lastRenderedReducer: p, lastRenderedState: m }, L.queue = p, p = p.dispatch = OA.bind(null, Kr, p), [L.memoizedState, p];
  }, useRef: function(p) {
    var m = Fo();
    return p = { current: p }, m.memoizedState = p;
  }, useState: Xh, useDebugValue: Zh, useDeferredValue: function(p) {
    return Fo().memoizedState = p;
  }, useTransition: function() {
    var p = Xh(!1), m = p[0];
    return p = qS.bind(null, p[1]), Fo().memoizedState = p, [m, p];
  }, useMutableSource: function() {
  }, useSyncExternalStore: function(p, m, b) {
    var L = Kr, I = Fo();
    if (Vr) {
      if (b === void 0) throw Error(r(407));
      b = b();
    } else {
      if (b = m(), Nn === null) throw Error(r(349));
      (yl & 30) !== 0 || h0(L, m, b);
    }
    I.memoizedState = b;
    var B = { value: b, getSnapshot: m };
    return I.queue = B, Bp(As.bind(
      null,
      L,
      B,
      p
    ), [p]), L.flags |= 2048, rc(9, ji.bind(null, L, B, b, m), void 0, null), b;
  }, useId: function() {
    var p = Fo(), m = Nn.identifierPrefix;
    if (Vr) {
      var b = Oo, L = Ro;
      b = (L & ~(1 << 32 - eo(L) - 1)).toString(32) + b, m = ":" + m + "R" + b, b = Au++, 0 < b && (m += "H" + b.toString(32)), m += ":";
    } else b = Qt++, m = ":" + m + "r" + b.toString(32) + ":";
    return p.memoizedState = m;
  }, unstable_isNewReconciler: !1 }, Fp = {
    readContext: Pa,
    useCallback: YS,
    useContext: Pa,
    useEffect: Go,
    useImperativeHandle: p0,
    useInsertionEffect: XS,
    useLayoutEffect: Ms,
    useMemo: ZS,
    useReducer: f0,
    useRef: kp,
    useState: function() {
      return f0(gi);
    },
    useDebugValue: Zh,
    useDeferredValue: function(p) {
      var m = Oa();
      return $S(m, on.memoizedState, p);
    },
    useTransition: function() {
      var p = f0(gi)[0], m = Oa().memoizedState;
      return [p, m];
    },
    useMutableSource: Op,
    useSyncExternalStore: c0,
    useId: g0,
    unstable_isNewReconciler: !1
  }, ic = { readContext: Pa, useCallback: YS, useContext: Pa, useEffect: Go, useImperativeHandle: p0, useInsertionEffect: XS, useLayoutEffect: Ms, useMemo: ZS, useReducer: tc, useRef: kp, useState: function() {
    return tc(gi);
  }, useDebugValue: Zh, useDeferredValue: function(p) {
    var m = Oa();
    return on === null ? m.memoizedState = p : $S(m, on.memoizedState, p);
  }, useTransition: function() {
    var p = tc(gi)[0], m = Oa().memoizedState;
    return [p, m];
  }, useMutableSource: Op, useSyncExternalStore: c0, useId: g0, unstable_isNewReconciler: !1 };
  function Na(p, m) {
    if (p && p.defaultProps) {
      m = q({}, m), p = p.defaultProps;
      for (var b in p) m[b] === void 0 && (m[b] = p[b]);
      return m;
    }
    return m;
  }
  function Gp(p, m, b, L) {
    m = p.memoizedState, b = b(L, m), b = b == null ? m : q({}, m, b), p.memoizedState = b, p.lanes === 0 && (p.updateQueue.baseState = b);
  }
  var Vp = { isMounted: function(p) {
    return (p = p._reactInternals) ? fu(p) === p : !1;
  }, enqueueSetState: function(p, m, b) {
    p = p._reactInternals;
    var L = Bi(), I = bl(p), B = bs(L, I);
    B.payload = m, b != null && (B.callback = b), m = Ra(p, B, I), m !== null && (lo(m, p, I, L), Ep(m, p, I));
  }, enqueueReplaceState: function(p, m, b) {
    p = p._reactInternals;
    var L = Bi(), I = bl(p), B = bs(L, I);
    B.tag = 1, B.payload = m, b != null && (B.callback = b), m = Ra(p, B, I), m !== null && (lo(m, p, I, L), Ep(m, p, I));
  }, enqueueForceUpdate: function(p, m) {
    p = p._reactInternals;
    var b = Bi(), L = bl(p), I = bs(b, L);
    I.tag = 2, m != null && (I.callback = m), m = Ra(p, I, L), m !== null && (lo(m, p, L, b), Ep(m, p, L));
  } };
  function y0(p, m, b, L, I, B, Y) {
    return p = p.stateNode, typeof p.shouldComponentUpdate == "function" ? p.shouldComponentUpdate(L, B, Y) : m.prototype && m.prototype.isPureReactComponent ? !lt(b, L) || !lt(I, B) : !0;
  }
  function Lu(p, m, b) {
    var L = !1, I = vl, B = m.contextType;
    return typeof B == "object" && B !== null ? B = Pa(B) : (I = $i(m) ? Ii : hi.current, L = m.contextTypes, B = (L = L != null) ? qf(p, I) : vl), m = new m(b, B), p.memoizedState = m.state !== null && m.state !== void 0 ? m.state : null, m.updater = Vp, p.stateNode = m, m._reactInternals = p, L && (p = p.stateNode, p.__reactInternalMemoizedUnmaskedChildContext = I, p.__reactInternalMemoizedMaskedChildContext = B), m;
  }
  function ac(p, m, b, L) {
    p = m.state, typeof m.componentWillReceiveProps == "function" && m.componentWillReceiveProps(b, L), typeof m.UNSAFE_componentWillReceiveProps == "function" && m.UNSAFE_componentWillReceiveProps(b, L), m.state !== p && Vp.enqueueReplaceState(m, m.state, null);
  }
  function _0(p, m, b, L) {
    var I = p.stateNode;
    I.props = b, I.state = p.memoizedState, I.refs = {}, Dp(p);
    var B = m.contextType;
    typeof B == "object" && B !== null ? I.context = Pa(B) : (B = $i(m) ? Ii : hi.current, I.context = qf(p, B)), I.state = p.memoizedState, B = m.getDerivedStateFromProps, typeof B == "function" && (Gp(p, m, B, b), I.state = p.memoizedState), typeof m.getDerivedStateFromProps == "function" || typeof I.getSnapshotBeforeUpdate == "function" || typeof I.UNSAFE_componentWillMount != "function" && typeof I.componentWillMount != "function" || (m = I.state, typeof I.componentWillMount == "function" && I.componentWillMount(), typeof I.UNSAFE_componentWillMount == "function" && I.UNSAFE_componentWillMount(), m !== I.state && Vp.enqueueReplaceState(I, I.state, null), Qf(p, b, I, L), I.state = p.memoizedState), typeof I.componentDidMount == "function" && (p.flags |= 4194308);
  }
  function Du(p, m) {
    try {
      var b = "", L = m;
      do
        b += te(L), L = L.return;
      while (L);
      var I = b;
    } catch (B) {
      I = `
Error generating stack: ` + B.message + `
` + B.stack;
    }
    return { value: p, source: m, stack: I, digest: null };
  }
  function Hp(p, m, b) {
    return { value: p, source: null, stack: b ?? null, digest: m ?? null };
  }
  function oc(p, m) {
    try {
      console.error(m.value);
    } catch (b) {
      setTimeout(function() {
        throw b;
      });
    }
  }
  var KS = typeof WeakMap == "function" ? WeakMap : Map;
  function $h(p, m, b) {
    b = bs(-1, b), b.tag = 3, b.payload = { element: null };
    var L = m.value;
    return b.callback = function() {
      Jp || (Jp = !0, N0 = L), oc(p, m);
    }, b;
  }
  function Up(p, m, b) {
    b = bs(-1, b), b.tag = 3;
    var L = p.type.getDerivedStateFromError;
    if (typeof L == "function") {
      var I = m.value;
      b.payload = function() {
        return L(I);
      }, b.callback = function() {
        oc(p, m);
      };
    }
    var B = p.stateNode;
    return B !== null && typeof B.componentDidCatch == "function" && (b.callback = function() {
      oc(p, m), typeof L != "function" && (wl === null ? wl = /* @__PURE__ */ new Set([this]) : wl.add(this));
      var Y = m.stack;
      this.componentDidCatch(m.value, { componentStack: Y !== null ? Y : "" });
    }), b;
  }
  function qh(p, m, b) {
    var L = p.pingCache;
    if (L === null) {
      L = p.pingCache = new KS();
      var I = /* @__PURE__ */ new Set();
      L.set(m, I);
    } else I = L.get(m), I === void 0 && (I = /* @__PURE__ */ new Set(), L.set(m, I));
    I.has(b) || (I.add(b), p = UA.bind(null, p, m, b), m.then(p, p));
  }
  function QS(p) {
    do {
      var m;
      if ((m = p.tag === 13) && (m = p.memoizedState, m = m !== null ? m.dehydrated !== null : !0), m) return p;
      p = p.return;
    } while (p !== null);
    return null;
  }
  function x0(p, m, b, L, I) {
    return (p.mode & 1) === 0 ? (p === m ? p.flags |= 65536 : (p.flags |= 128, b.flags |= 131072, b.flags &= -52805, b.tag === 1 && (b.alternate === null ? b.tag = 17 : (m = bs(-1, 1), m.tag = 2, Ra(b, m, 1))), b.lanes |= 1), p) : (p.flags |= 65536, p.lanes = I, p);
  }
  var Wp = C.ReactCurrentOwner, Oi = !1;
  function qn(p, m, b, L) {
    m.child = p === null ? Ap(m, null, b, L) : tn(m, p.child, b, L);
  }
  function JS(p, m, b, L, I) {
    b = b.render;
    var B = m.ref;
    return gl(m, I), L = Mu(p, m, b, L, B, I), b = Rp(), p !== null && !Oi ? (m.updateQueue = p.updateQueue, m.flags &= -2053, p.lanes &= ~I, io(p, m, I)) : (Vr && b && Bh(m), m.flags |= 1, qn(p, m, L, I), m.child);
  }
  function S0(p, m, b, L, I) {
    if (p === null) {
      var B = b.type;
      return typeof B == "function" && !ag(B) && B.defaultProps === void 0 && b.compare === null && b.defaultProps === void 0 ? (m.tag = 15, m.type = B, Vo(p, m, B, L, I)) : (p = og(b.type, null, L, m, m.mode, I), p.ref = m.ref, p.return = m, m.child = p);
    }
    if (B = p.child, (p.lanes & I) === 0) {
      var Y = B.memoizedProps;
      if (b = b.compare, b = b !== null ? b : lt, b(Y, L) && p.ref === m.ref) return io(p, m, I);
    }
    return m.flags |= 1, p = uo(B, L), p.ref = m.ref, p.return = m, m.child = p;
  }
  function Vo(p, m, b, L, I) {
    if (p !== null) {
      var B = p.memoizedProps;
      if (lt(B, L) && p.ref === m.ref) if (Oi = !1, m.pendingProps = L = B, (p.lanes & I) !== 0) (p.flags & 131072) !== 0 && (Oi = !0);
      else return m.lanes = p.lanes, io(p, m, I);
    }
    return b0(p, m, b, L, I);
  }
  function w0(p, m, b) {
    var L = m.pendingProps, I = L.children, B = p !== null ? p.memoizedState : null;
    if (L.mode === "hidden") if ((m.mode & 1) === 0) m.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, Br(fc, ha), ha |= b;
    else {
      if ((b & 1073741824) === 0) return p = B !== null ? B.baseLanes | b : b, m.lanes = m.childLanes = 1073741824, m.memoizedState = { baseLanes: p, cachePool: null, transitions: null }, m.updateQueue = null, Br(fc, ha), ha |= p, null;
      m.memoizedState = { baseLanes: 0, cachePool: null, transitions: null }, L = B !== null ? B.baseLanes : b, Br(fc, ha), ha |= L;
    }
    else B !== null ? (L = B.baseLanes | b, m.memoizedState = null) : L = b, Br(fc, ha), ha |= L;
    return qn(p, m, I, b), m.child;
  }
  function T0(p, m) {
    var b = m.ref;
    (p === null && b !== null || p !== null && p.ref !== b) && (m.flags |= 512, m.flags |= 2097152);
  }
  function b0(p, m, b, L, I) {
    var B = $i(b) ? Ii : hi.current;
    return B = qf(m, B), gl(m, I), b = Mu(p, m, b, L, B, I), L = Rp(), p !== null && !Oi ? (m.updateQueue = p.updateQueue, m.flags &= -2053, p.lanes &= ~I, io(p, m, I)) : (Vr && L && Bh(m), m.flags |= 1, qn(p, m, b, I), m.child);
  }
  function C0(p, m, b, L, I) {
    if ($i(b)) {
      var B = !0;
      La(m);
    } else B = !1;
    if (gl(m, I), m.stateNode === null) Yp(p, m), Lu(m, b, L), _0(m, b, L, I), L = !0;
    else if (p === null) {
      var Y = m.stateNode, re = m.memoizedProps;
      Y.props = re;
      var se = Y.context, Te = b.contextType;
      typeof Te == "object" && Te !== null ? Te = Pa(Te) : (Te = $i(b) ? Ii : hi.current, Te = qf(m, Te));
      var ke = b.getDerivedStateFromProps, Ve = typeof ke == "function" || typeof Y.getSnapshotBeforeUpdate == "function";
      Ve || typeof Y.UNSAFE_componentWillReceiveProps != "function" && typeof Y.componentWillReceiveProps != "function" || (re !== L || se !== Te) && ac(m, Y, L, Te), Ia = !1;
      var Ne = m.memoizedState;
      Y.state = Ne, Qf(m, L, Y, I), se = m.memoizedState, re !== L || Ne !== se || Zi.current || Ia ? (typeof ke == "function" && (Gp(m, b, ke, L), se = m.memoizedState), (re = Ia || y0(m, b, re, L, Ne, se, Te)) ? (Ve || typeof Y.UNSAFE_componentWillMount != "function" && typeof Y.componentWillMount != "function" || (typeof Y.componentWillMount == "function" && Y.componentWillMount(), typeof Y.UNSAFE_componentWillMount == "function" && Y.UNSAFE_componentWillMount()), typeof Y.componentDidMount == "function" && (m.flags |= 4194308)) : (typeof Y.componentDidMount == "function" && (m.flags |= 4194308), m.memoizedProps = L, m.memoizedState = se), Y.props = L, Y.state = se, Y.context = Te, L = re) : (typeof Y.componentDidMount == "function" && (m.flags |= 4194308), L = !1);
    } else {
      Y = m.stateNode, US(p, m), re = m.memoizedProps, Te = m.type === m.elementType ? re : Na(m.type, re), Y.props = Te, Ve = m.pendingProps, Ne = Y.context, se = b.contextType, typeof se == "object" && se !== null ? se = Pa(se) : (se = $i(b) ? Ii : hi.current, se = qf(m, se));
      var ut = b.getDerivedStateFromProps;
      (ke = typeof ut == "function" || typeof Y.getSnapshotBeforeUpdate == "function") || typeof Y.UNSAFE_componentWillReceiveProps != "function" && typeof Y.componentWillReceiveProps != "function" || (re !== Ve || Ne !== se) && ac(m, Y, L, se), Ia = !1, Ne = m.memoizedState, Y.state = Ne, Qf(m, L, Y, I);
      var gt = m.memoizedState;
      re !== Ve || Ne !== gt || Zi.current || Ia ? (typeof ut == "function" && (Gp(m, b, ut, L), gt = m.memoizedState), (Te = Ia || y0(m, b, Te, L, Ne, gt, se) || !1) ? (ke || typeof Y.UNSAFE_componentWillUpdate != "function" && typeof Y.componentWillUpdate != "function" || (typeof Y.componentWillUpdate == "function" && Y.componentWillUpdate(L, gt, se), typeof Y.UNSAFE_componentWillUpdate == "function" && Y.UNSAFE_componentWillUpdate(L, gt, se)), typeof Y.componentDidUpdate == "function" && (m.flags |= 4), typeof Y.getSnapshotBeforeUpdate == "function" && (m.flags |= 1024)) : (typeof Y.componentDidUpdate != "function" || re === p.memoizedProps && Ne === p.memoizedState || (m.flags |= 4), typeof Y.getSnapshotBeforeUpdate != "function" || re === p.memoizedProps && Ne === p.memoizedState || (m.flags |= 1024), m.memoizedProps = L, m.memoizedState = gt), Y.props = L, Y.state = gt, Y.context = se, L = Te) : (typeof Y.componentDidUpdate != "function" || re === p.memoizedProps && Ne === p.memoizedState || (m.flags |= 4), typeof Y.getSnapshotBeforeUpdate != "function" || re === p.memoizedProps && Ne === p.memoizedState || (m.flags |= 1024), L = !1);
    }
    return A0(p, m, b, L, B, I);
  }
  function A0(p, m, b, L, I, B) {
    T0(p, m);
    var Y = (m.flags & 128) !== 0;
    if (!L && !Y) return I && BS(m, b, !1), io(p, m, B);
    L = m.stateNode, Wp.current = m;
    var re = Y && typeof b.getDerivedStateFromError != "function" ? null : L.render();
    return m.flags |= 1, p !== null && Y ? (m.child = tn(m, p.child, null, B), m.child = tn(m, null, re, B)) : qn(p, m, re, B), m.memoizedState = L.state, I && BS(m, b, !0), m.child;
  }
  function ew(p) {
    var m = p.stateNode;
    m.pendingContext ? NS(p, m.pendingContext, m.pendingContext !== m.context) : m.context && NS(p, m.context, !1), a0(p, m.containerInfo);
  }
  function Ho(p, m, b, L, I) {
    return ko(), Bo(I), m.flags |= 256, qn(p, m, b, L), m.child;
  }
  var jh = { dehydrated: null, treeContext: null, retryLane: 0 };
  function Kh(p) {
    return { baseLanes: p, cachePool: null, transitions: null };
  }
  function Xp(p, m, b) {
    var L = m.pendingProps, I = Xr.current, B = !1, Y = (m.flags & 128) !== 0, re;
    if ((re = Y) || (re = p !== null && p.memoizedState === null ? !1 : (I & 2) !== 0), re ? (B = !0, m.flags &= -129) : (p === null || p.memoizedState !== null) && (I |= 1), Br(Xr, I & 1), p === null)
      return qi(m), p = m.memoizedState, p !== null && (p = p.dehydrated, p !== null) ? ((m.mode & 1) === 0 ? m.lanes = 1 : p.data === "$!" ? m.lanes = 8 : m.lanes = 1073741824, null) : (Y = L.children, p = L.fallback, B ? (L = m.mode, B = m.child, Y = { mode: "hidden", children: Y }, (L & 1) === 0 && B !== null ? (B.childLanes = 0, B.pendingProps = Y) : B = sg(Y, L, 0, null), p = Ou(p, L, b, null), B.return = m, p.return = m, B.sibling = p, m.child = B, m.child.memoizedState = Kh(b), m.memoizedState = jh, p) : sc(m, Y));
    if (I = p.memoizedState, I !== null && (re = I.dehydrated, re !== null)) return Et(p, m, Y, L, re, I, b);
    if (B) {
      B = L.fallback, Y = m.mode, I = p.child, re = I.sibling;
      var se = { mode: "hidden", children: L.children };
      return (Y & 1) === 0 && m.child !== I ? (L = m.child, L.childLanes = 0, L.pendingProps = se, m.deletions = null) : (L = uo(I, se), L.subtreeFlags = I.subtreeFlags & 14680064), re !== null ? B = uo(re, B) : (B = Ou(B, Y, b, null), B.flags |= 2), B.return = m, L.return = m, L.sibling = B, m.child = L, L = B, B = m.child, Y = p.child.memoizedState, Y = Y === null ? Kh(b) : { baseLanes: Y.baseLanes | b, cachePool: null, transitions: Y.transitions }, B.memoizedState = Y, B.childLanes = p.childLanes & ~b, m.memoizedState = jh, L;
    }
    return B = p.child, p = B.sibling, L = uo(B, { mode: "visible", children: L.children }), (m.mode & 1) === 0 && (L.lanes = b), L.return = m, L.sibling = null, p !== null && (b = m.deletions, b === null ? (m.deletions = [p], m.flags |= 16) : b.push(p)), m.child = L, m.memoizedState = null, L;
  }
  function sc(p, m) {
    return m = sg({ mode: "visible", children: m }, p.mode, 0, null), m.return = p, p.child = m;
  }
  function Ls(p, m, b, L) {
    return L !== null && Bo(L), tn(m, p.child, null, b), p = sc(m, m.pendingProps.children), p.flags |= 2, m.memoizedState = null, p;
  }
  function Et(p, m, b, L, I, B, Y) {
    if (b)
      return m.flags & 256 ? (m.flags &= -257, L = Hp(Error(r(422))), Ls(p, m, Y, L)) : m.memoizedState !== null ? (m.child = p.child, m.flags |= 128, null) : (B = L.fallback, I = m.mode, L = sg({ mode: "visible", children: L.children }, I, 0, null), B = Ou(B, I, Y, null), B.flags |= 2, L.return = m, B.return = m, L.sibling = B, m.child = L, (m.mode & 1) !== 0 && tn(m, p.child, null, Y), m.child.memoizedState = Kh(Y), m.memoizedState = jh, B);
    if ((m.mode & 1) === 0) return Ls(p, m, Y, null);
    if (I.data === "$!") {
      if (L = I.nextSibling && I.nextSibling.dataset, L) var re = L.dgst;
      return L = re, B = Error(r(419)), L = Hp(B, L, void 0), Ls(p, m, Y, L);
    }
    if (re = (Y & p.childLanes) !== 0, Oi || re) {
      if (L = Nn, L !== null) {
        switch (Y & -Y) {
          case 4:
            I = 2;
            break;
          case 16:
            I = 8;
            break;
          case 64:
          case 128:
          case 256:
          case 512:
          case 1024:
          case 2048:
          case 4096:
          case 8192:
          case 16384:
          case 32768:
          case 65536:
          case 131072:
          case 262144:
          case 524288:
          case 1048576:
          case 2097152:
          case 4194304:
          case 8388608:
          case 16777216:
          case 33554432:
          case 67108864:
            I = 32;
            break;
          case 536870912:
            I = 268435456;
            break;
          default:
            I = 0;
        }
        I = (I & (L.suspendedLanes | Y)) !== 0 ? 0 : I, I !== 0 && I !== B.retryLane && (B.retryLane = I, Ts(p, I), lo(L, p, I, -1));
      }
      return V0(), L = Hp(Error(r(421))), Ls(p, m, Y, L);
    }
    return I.data === "$?" ? (m.flags |= 128, m.child = p.child, m = WA.bind(null, p), I._reactRetry = m, null) : (p = B.treeContext, ua = cl(I.nextSibling), di = m, Vr = !0, ro = null, p !== null && (Da[Ea++] = Ro, Da[Ea++] = Oo, Da[Ea++] = xu, Ro = p.id, Oo = p.overflow, xu = m), m = sc(m, L.children), m.flags |= 4096, m);
  }
  function Qh(p, m, b) {
    p.lanes |= m;
    var L = p.alternate;
    L !== null && (L.lanes |= m), $n(p.return, m, b);
  }
  function Jh(p, m, b, L, I) {
    var B = p.memoizedState;
    B === null ? p.memoizedState = { isBackwards: m, rendering: null, renderingStartTime: 0, last: L, tail: b, tailMode: I } : (B.isBackwards = m, B.rendering = null, B.renderingStartTime = 0, B.last = L, B.tail = b, B.tailMode = I);
  }
  function _l(p, m, b) {
    var L = m.pendingProps, I = L.revealOrder, B = L.tail;
    if (qn(p, m, L.children, b), L = Xr.current, (L & 2) !== 0) L = L & 1 | 2, m.flags |= 128;
    else {
      if (p !== null && (p.flags & 128) !== 0) e: for (p = m.child; p !== null; ) {
        if (p.tag === 13) p.memoizedState !== null && Qh(p, b, m);
        else if (p.tag === 19) Qh(p, b, m);
        else if (p.child !== null) {
          p.child.return = p, p = p.child;
          continue;
        }
        if (p === m) break e;
        for (; p.sibling === null; ) {
          if (p.return === null || p.return === m) break e;
          p = p.return;
        }
        p.sibling.return = p.return, p = p.sibling;
      }
      L &= 1;
    }
    if (Br(Xr, L), (m.mode & 1) === 0) m.memoizedState = null;
    else switch (I) {
      case "forwards":
        for (b = m.child, I = null; b !== null; ) p = b.alternate, p !== null && Cu(p) === null && (I = b), b = b.sibling;
        b = I, b === null ? (I = m.child, m.child = null) : (I = b.sibling, b.sibling = null), Jh(m, !1, I, b, B);
        break;
      case "backwards":
        for (b = null, I = m.child, m.child = null; I !== null; ) {
          if (p = I.alternate, p !== null && Cu(p) === null) {
            m.child = I;
            break;
          }
          p = I.sibling, I.sibling = b, b = I, I = p;
        }
        Jh(m, !0, b, null, B);
        break;
      case "together":
        Jh(m, !1, null, null, void 0);
        break;
      default:
        m.memoizedState = null;
    }
    return m.child;
  }
  function Yp(p, m) {
    (m.mode & 1) === 0 && p !== null && (p.alternate = null, m.alternate = null, m.flags |= 2);
  }
  function io(p, m, b) {
    if (p !== null && (m.dependencies = p.dependencies), Sl |= m.lanes, (b & m.childLanes) === 0) return null;
    if (p !== null && m.child !== p.child) throw Error(r(153));
    if (m.child !== null) {
      for (p = m.child, b = uo(p, p.pendingProps), m.child = b, b.return = m; p.sibling !== null; ) p = p.sibling, b = b.sibling = uo(p, p.pendingProps), b.return = m;
      b.sibling = null;
    }
    return m.child;
  }
  function tw(p, m, b) {
    switch (m.tag) {
      case 3:
        ew(m), ko();
        break;
      case 5:
        o0(m);
        break;
      case 1:
        $i(m.type) && La(m);
        break;
      case 4:
        a0(m, m.stateNode.containerInfo);
        break;
      case 10:
        var L = m.type._context, I = m.memoizedProps.value;
        Br(Gh, L._currentValue), L._currentValue = I;
        break;
      case 13:
        if (L = m.memoizedState, L !== null)
          return L.dehydrated !== null ? (Br(Xr, Xr.current & 1), m.flags |= 128, null) : (b & m.child.childLanes) !== 0 ? Xp(p, m, b) : (Br(Xr, Xr.current & 1), p = io(p, m, b), p !== null ? p.sibling : null);
        Br(Xr, Xr.current & 1);
        break;
      case 19:
        if (L = (b & m.childLanes) !== 0, (p.flags & 128) !== 0) {
          if (L) return _l(p, m, b);
          m.flags |= 128;
        }
        if (I = m.memoizedState, I !== null && (I.rendering = null, I.tail = null, I.lastEffect = null), Br(Xr, Xr.current), L) break;
        return null;
      case 22:
      case 23:
        return m.lanes = 0, w0(p, m, b);
    }
    return io(p, m, b);
  }
  var jn, M0, rw, L0;
  jn = function(p, m) {
    for (var b = m.child; b !== null; ) {
      if (b.tag === 5 || b.tag === 6) p.appendChild(b.stateNode);
      else if (b.tag !== 4 && b.child !== null) {
        b.child.return = b, b = b.child;
        continue;
      }
      if (b === m) break;
      for (; b.sibling === null; ) {
        if (b.return === null || b.return === m) return;
        b = b.return;
      }
      b.sibling.return = b.return, b = b.sibling;
    }
  }, M0 = function() {
  }, rw = function(p, m, b, L) {
    var I = p.memoizedProps;
    if (I !== L) {
      p = m.stateNode, Cs(zo.current);
      var B = null;
      switch (b) {
        case "input":
          I = Xe(p, I), L = Xe(p, L), B = [];
          break;
        case "select":
          I = q({}, I, { value: void 0 }), L = q({}, L, { value: void 0 }), B = [];
          break;
        case "textarea":
          I = ir(p, I), L = ir(p, L), B = [];
          break;
        default:
          typeof I.onClick != "function" && typeof L.onClick == "function" && (p.onclick = mp);
      }
      vh(b, L);
      var Y;
      b = null;
      for (Te in I) if (!L.hasOwnProperty(Te) && I.hasOwnProperty(Te) && I[Te] != null) if (Te === "style") {
        var re = I[Te];
        for (Y in re) re.hasOwnProperty(Y) && (b || (b = {}), b[Y] = "");
      } else Te !== "dangerouslySetInnerHTML" && Te !== "children" && Te !== "suppressContentEditableWarning" && Te !== "suppressHydrationWarning" && Te !== "autoFocus" && (i.hasOwnProperty(Te) ? B || (B = []) : (B = B || []).push(Te, null));
      for (Te in L) {
        var se = L[Te];
        if (re = I?.[Te], L.hasOwnProperty(Te) && se !== re && (se != null || re != null)) if (Te === "style") if (re) {
          for (Y in re) !re.hasOwnProperty(Y) || se && se.hasOwnProperty(Y) || (b || (b = {}), b[Y] = "");
          for (Y in se) se.hasOwnProperty(Y) && re[Y] !== se[Y] && (b || (b = {}), b[Y] = se[Y]);
        } else b || (B || (B = []), B.push(
          Te,
          b
        )), b = se;
        else Te === "dangerouslySetInnerHTML" ? (se = se ? se.__html : void 0, re = re ? re.__html : void 0, se != null && re !== se && (B = B || []).push(Te, se)) : Te === "children" ? typeof se != "string" && typeof se != "number" || (B = B || []).push(Te, "" + se) : Te !== "suppressContentEditableWarning" && Te !== "suppressHydrationWarning" && (i.hasOwnProperty(Te) ? (se != null && Te === "onScroll" && Fr("scroll", p), B || re === se || (B = [])) : (B = B || []).push(Te, se));
      }
      b && (B = B || []).push("style", b);
      var Te = B;
      (m.updateQueue = Te) && (m.flags |= 4);
    }
  }, L0 = function(p, m, b, L) {
    b !== L && (m.flags |= 4);
  };
  function ev(p, m) {
    if (!Vr) switch (p.tailMode) {
      case "hidden":
        m = p.tail;
        for (var b = null; m !== null; ) m.alternate !== null && (b = m), m = m.sibling;
        b === null ? p.tail = null : b.sibling = null;
        break;
      case "collapsed":
        b = p.tail;
        for (var L = null; b !== null; ) b.alternate !== null && (L = b), b = b.sibling;
        L === null ? m || p.tail === null ? p.tail = null : p.tail.sibling = null : L.sibling = null;
    }
  }
  function Kn(p) {
    var m = p.alternate !== null && p.alternate.child === p.child, b = 0, L = 0;
    if (m) for (var I = p.child; I !== null; ) b |= I.lanes | I.childLanes, L |= I.subtreeFlags & 14680064, L |= I.flags & 14680064, I.return = p, I = I.sibling;
    else for (I = p.child; I !== null; ) b |= I.lanes | I.childLanes, L |= I.subtreeFlags, L |= I.flags, I.return = p, I = I.sibling;
    return p.subtreeFlags |= L, p.childLanes = b, m;
  }
  function kA(p, m, b) {
    var L = m.pendingProps;
    switch (wu(m), m.tag) {
      case 2:
      case 16:
      case 15:
      case 0:
      case 11:
      case 7:
      case 8:
      case 12:
      case 9:
      case 14:
        return Kn(m), null;
      case 1:
        return $i(m.type) && Sp(), Kn(m), null;
      case 3:
        return L = m.stateNode, ml(), Gr(Zi), Gr(hi), Ip(), L.pendingContext && (L.context = L.pendingContext, L.pendingContext = null), (p === null || p.child === null) && (zh(m) ? m.flags |= 4 : p === null || p.memoizedState.isDehydrated && (m.flags & 256) === 0 || (m.flags |= 1024, ro !== null && (z0(ro), ro = null))), M0(p, m), Kn(m), null;
      case 5:
        Pp(m);
        var I = Cs(Jf.current);
        if (b = m.type, p !== null && m.stateNode != null) rw(p, m, b, L, I), p.ref !== m.ref && (m.flags |= 512, m.flags |= 2097152);
        else {
          if (!L) {
            if (m.stateNode === null) throw Error(r(166));
            return Kn(m), null;
          }
          if (p = Cs(zo.current), zh(m)) {
            L = m.stateNode, b = m.type;
            var B = m.memoizedProps;
            switch (L[Po] = m, L[hl] = B, p = (m.mode & 1) !== 0, b) {
              case "dialog":
                Fr("cancel", L), Fr("close", L);
                break;
              case "iframe":
              case "object":
              case "embed":
                Fr("load", L);
                break;
              case "video":
              case "audio":
                for (I = 0; I < _s.length; I++) Fr(_s[I], L);
                break;
              case "source":
                Fr("error", L);
                break;
              case "img":
              case "image":
              case "link":
                Fr(
                  "error",
                  L
                ), Fr("load", L);
                break;
              case "details":
                Fr("toggle", L);
                break;
              case "input":
                $e(L, B), Fr("invalid", L);
                break;
              case "select":
                L._wrapperState = { wasMultiple: !!B.multiple }, Fr("invalid", L);
                break;
              case "textarea":
                Nr(L, B), Fr("invalid", L);
            }
            vh(b, B), I = null;
            for (var Y in B) if (B.hasOwnProperty(Y)) {
              var re = B[Y];
              Y === "children" ? typeof re == "string" ? L.textContent !== re && (B.suppressHydrationWarning !== !0 && Rh(L.textContent, re, p), I = ["children", re]) : typeof re == "number" && L.textContent !== "" + re && (B.suppressHydrationWarning !== !0 && Rh(
                L.textContent,
                re,
                p
              ), I = ["children", "" + re]) : i.hasOwnProperty(Y) && re != null && Y === "onScroll" && Fr("scroll", L);
            }
            switch (b) {
              case "input":
                be(L), cr(L, B, !0);
                break;
              case "textarea":
                be(L), na(L);
                break;
              case "select":
              case "option":
                break;
              default:
                typeof B.onClick == "function" && (L.onclick = mp);
            }
            L = I, m.updateQueue = L, L !== null && (m.flags |= 4);
          } else {
            Y = I.nodeType === 9 ? I : I.ownerDocument, p === "http://www.w3.org/1999/xhtml" && (p = su(b)), p === "http://www.w3.org/1999/xhtml" ? b === "script" ? (p = Y.createElement("div"), p.innerHTML = "<script><\/script>", p = p.removeChild(p.firstChild)) : typeof L.is == "string" ? p = Y.createElement(b, { is: L.is }) : (p = Y.createElement(b), b === "select" && (Y = p, L.multiple ? Y.multiple = !0 : L.size && (Y.size = L.size))) : p = Y.createElementNS(p, b), p[Po] = m, p[hl] = L, jn(p, m, !1, !1), m.stateNode = p;
            e: {
              switch (Y = dh(b, L), b) {
                case "dialog":
                  Fr("cancel", p), Fr("close", p), I = L;
                  break;
                case "iframe":
                case "object":
                case "embed":
                  Fr("load", p), I = L;
                  break;
                case "video":
                case "audio":
                  for (I = 0; I < _s.length; I++) Fr(_s[I], p);
                  I = L;
                  break;
                case "source":
                  Fr("error", p), I = L;
                  break;
                case "img":
                case "image":
                case "link":
                  Fr(
                    "error",
                    p
                  ), Fr("load", p), I = L;
                  break;
                case "details":
                  Fr("toggle", p), I = L;
                  break;
                case "input":
                  $e(p, L), I = Xe(p, L), Fr("invalid", p);
                  break;
                case "option":
                  I = L;
                  break;
                case "select":
                  p._wrapperState = { wasMultiple: !!L.multiple }, I = q({}, L, { value: void 0 }), Fr("invalid", p);
                  break;
                case "textarea":
                  Nr(p, L), I = ir(p, L), Fr("invalid", p);
                  break;
                default:
                  I = L;
              }
              vh(b, I), re = I;
              for (B in re) if (re.hasOwnProperty(B)) {
                var se = re[B];
                B === "style" ? tl(p, se) : B === "dangerouslySetInnerHTML" ? (se = se ? se.__html : void 0, se != null && ia(p, se)) : B === "children" ? typeof se == "string" ? (b !== "textarea" || se !== "") && Qa(p, se) : typeof se == "number" && Qa(p, "" + se) : B !== "suppressContentEditableWarning" && B !== "suppressHydrationWarning" && B !== "autoFocus" && (i.hasOwnProperty(B) ? se != null && B === "onScroll" && Fr("scroll", p) : se != null && T(p, B, se, Y));
              }
              switch (b) {
                case "input":
                  be(p), cr(p, L, !1);
                  break;
                case "textarea":
                  be(p), na(p);
                  break;
                case "option":
                  L.value != null && p.setAttribute("value", "" + de(L.value));
                  break;
                case "select":
                  p.multiple = !!L.multiple, B = L.value, B != null ? wt(p, !!L.multiple, B, !1) : L.defaultValue != null && wt(
                    p,
                    !!L.multiple,
                    L.defaultValue,
                    !0
                  );
                  break;
                default:
                  typeof I.onClick == "function" && (p.onclick = mp);
              }
              switch (b) {
                case "button":
                case "input":
                case "select":
                case "textarea":
                  L = !!L.autoFocus;
                  break e;
                case "img":
                  L = !0;
                  break e;
                default:
                  L = !1;
              }
            }
            L && (m.flags |= 4);
          }
          m.ref !== null && (m.flags |= 512, m.flags |= 2097152);
        }
        return Kn(m), null;
      case 6:
        if (p && m.stateNode != null) L0(p, m, p.memoizedProps, L);
        else {
          if (typeof L != "string" && m.stateNode === null) throw Error(r(166));
          if (b = Cs(Jf.current), Cs(zo.current), zh(m)) {
            if (L = m.stateNode, b = m.memoizedProps, L[Po] = m, (B = L.nodeValue !== b) && (p = di, p !== null)) switch (p.tag) {
              case 3:
                Rh(L.nodeValue, b, (p.mode & 1) !== 0);
                break;
              case 5:
                p.memoizedProps.suppressHydrationWarning !== !0 && Rh(L.nodeValue, b, (p.mode & 1) !== 0);
            }
            B && (m.flags |= 4);
          } else L = (b.nodeType === 9 ? b : b.ownerDocument).createTextNode(L), L[Po] = m, m.stateNode = L;
        }
        return Kn(m), null;
      case 13:
        if (Gr(Xr), L = m.memoizedState, p === null || p.memoizedState !== null && p.memoizedState.dehydrated !== null) {
          if (Vr && ua !== null && (m.mode & 1) !== 0 && (m.flags & 128) === 0) t0(), ko(), m.flags |= 98560, B = !1;
          else if (B = zh(m), L !== null && L.dehydrated !== null) {
            if (p === null) {
              if (!B) throw Error(r(318));
              if (B = m.memoizedState, B = B !== null ? B.dehydrated : null, !B) throw Error(r(317));
              B[Po] = m;
            } else ko(), (m.flags & 128) === 0 && (m.memoizedState = null), m.flags |= 4;
            Kn(m), B = !1;
          } else ro !== null && (z0(ro), ro = null), B = !0;
          if (!B) return m.flags & 65536 ? m : null;
        }
        return (m.flags & 128) !== 0 ? (m.lanes = b, m) : (L = L !== null, L !== (p !== null && p.memoizedState !== null) && L && (m.child.flags |= 8192, (m.mode & 1) !== 0 && (p === null || (Xr.current & 1) !== 0 ? An === 0 && (An = 3) : V0())), m.updateQueue !== null && (m.flags |= 4), Kn(m), null);
      case 4:
        return ml(), M0(p, m), p === null && ul(m.stateNode.containerInfo), Kn(m), null;
      case 10:
        return Mp(m.type._context), Kn(m), null;
      case 17:
        return $i(m.type) && Sp(), Kn(m), null;
      case 19:
        if (Gr(Xr), B = m.memoizedState, B === null) return Kn(m), null;
        if (L = (m.flags & 128) !== 0, Y = B.rendering, Y === null) if (L) ev(B, !1);
        else {
          if (An !== 0 || p !== null && (p.flags & 128) !== 0) for (p = m.child; p !== null; ) {
            if (Y = Cu(p), Y !== null) {
              for (m.flags |= 128, ev(B, !1), L = Y.updateQueue, L !== null && (m.updateQueue = L, m.flags |= 4), m.subtreeFlags = 0, L = b, b = m.child; b !== null; ) B = b, p = L, B.flags &= 14680066, Y = B.alternate, Y === null ? (B.childLanes = 0, B.lanes = p, B.child = null, B.subtreeFlags = 0, B.memoizedProps = null, B.memoizedState = null, B.updateQueue = null, B.dependencies = null, B.stateNode = null) : (B.childLanes = Y.childLanes, B.lanes = Y.lanes, B.child = Y.child, B.subtreeFlags = 0, B.deletions = null, B.memoizedProps = Y.memoizedProps, B.memoizedState = Y.memoizedState, B.updateQueue = Y.updateQueue, B.type = Y.type, p = Y.dependencies, B.dependencies = p === null ? null : { lanes: p.lanes, firstContext: p.firstContext }), b = b.sibling;
              return Br(Xr, Xr.current & 1 | 2), m.child;
            }
            p = p.sibling;
          }
          B.tail !== null && Ur() > Eu && (m.flags |= 128, L = !0, ev(B, !1), m.lanes = 4194304);
        }
        else {
          if (!L) if (p = Cu(Y), p !== null) {
            if (m.flags |= 128, L = !0, b = p.updateQueue, b !== null && (m.updateQueue = b, m.flags |= 4), ev(B, !0), B.tail === null && B.tailMode === "hidden" && !Y.alternate && !Vr) return Kn(m), null;
          } else 2 * Ur() - B.renderingStartTime > Eu && b !== 1073741824 && (m.flags |= 128, L = !0, ev(B, !1), m.lanes = 4194304);
          B.isBackwards ? (Y.sibling = m.child, m.child = Y) : (b = B.last, b !== null ? b.sibling = Y : m.child = Y, B.last = Y);
        }
        return B.tail !== null ? (m = B.tail, B.rendering = m, B.tail = m.sibling, B.renderingStartTime = Ur(), m.sibling = null, b = Xr.current, Br(Xr, L ? b & 1 | 2 : b & 1), m) : (Kn(m), null);
      case 22:
      case 23:
        return G0(), L = m.memoizedState !== null, p !== null && p.memoizedState !== null !== L && (m.flags |= 8192), L && (m.mode & 1) !== 0 ? (ha & 1073741824) !== 0 && (Kn(m), m.subtreeFlags & 6 && (m.flags |= 8192)) : Kn(m), null;
      case 24:
        return null;
      case 25:
        return null;
    }
    throw Error(r(156, m.tag));
  }
  function BA(p, m) {
    switch (wu(m), m.tag) {
      case 1:
        return $i(m.type) && Sp(), p = m.flags, p & 65536 ? (m.flags = p & -65537 | 128, m) : null;
      case 3:
        return ml(), Gr(Zi), Gr(hi), Ip(), p = m.flags, (p & 65536) !== 0 && (p & 128) === 0 ? (m.flags = p & -65537 | 128, m) : null;
      case 5:
        return Pp(m), null;
      case 13:
        if (Gr(Xr), p = m.memoizedState, p !== null && p.dehydrated !== null) {
          if (m.alternate === null) throw Error(r(340));
          ko();
        }
        return p = m.flags, p & 65536 ? (m.flags = p & -65537 | 128, m) : null;
      case 19:
        return Gr(Xr), null;
      case 4:
        return ml(), null;
      case 10:
        return Mp(m.type._context), null;
      case 22:
      case 23:
        return G0(), null;
      case 24:
        return null;
      default:
        return null;
    }
  }
  var Zp = !1, Yr = !1, Ni = typeof WeakSet == "function" ? WeakSet : Set, dt = null;
  function lc(p, m) {
    var b = p.ref;
    if (b !== null) if (typeof b == "function") try {
      b(null);
    } catch (L) {
      Qr(p, m, L);
    }
    else b.current = null;
  }
  function tv(p, m, b) {
    try {
      b();
    } catch (L) {
      Qr(p, m, L);
    }
  }
  var nw = !1;
  function zA(p, m) {
    if (Oh = Jd, p = Lr(), Mh(p)) {
      if ("selectionStart" in p) var b = { start: p.selectionStart, end: p.selectionEnd };
      else e: {
        b = (b = p.ownerDocument) && b.defaultView || window;
        var L = b.getSelection && b.getSelection();
        if (L && L.rangeCount !== 0) {
          b = L.anchorNode;
          var I = L.anchorOffset, B = L.focusNode;
          L = L.focusOffset;
          try {
            b.nodeType, B.nodeType;
          } catch {
            b = null;
            break e;
          }
          var Y = 0, re = -1, se = -1, Te = 0, ke = 0, Ve = p, Ne = null;
          t: for (; ; ) {
            for (var ut; Ve !== b || I !== 0 && Ve.nodeType !== 3 || (re = Y + I), Ve !== B || L !== 0 && Ve.nodeType !== 3 || (se = Y + L), Ve.nodeType === 3 && (Y += Ve.nodeValue.length), (ut = Ve.firstChild) !== null; )
              Ne = Ve, Ve = ut;
            for (; ; ) {
              if (Ve === p) break t;
              if (Ne === b && ++Te === I && (re = Y), Ne === B && ++ke === L && (se = Y), (ut = Ve.nextSibling) !== null) break;
              Ve = Ne, Ne = Ve.parentNode;
            }
            Ve = ut;
          }
          b = re === -1 || se === -1 ? null : { start: re, end: se };
        } else b = null;
      }
      b = b || { start: 0, end: 0 };
    } else b = null;
    for (yu = { focusedElem: p, selectionRange: b }, Jd = !1, dt = m; dt !== null; ) if (m = dt, p = m.child, (m.subtreeFlags & 1028) !== 0 && p !== null) p.return = m, dt = p;
    else for (; dt !== null; ) {
      m = dt;
      try {
        var gt = m.alternate;
        if ((m.flags & 1024) !== 0) switch (m.tag) {
          case 0:
          case 11:
          case 15:
            break;
          case 1:
            if (gt !== null) {
              var mt = gt.memoizedProps, sn = gt.memoizedState, ye = m.stateNode, ce = ye.getSnapshotBeforeUpdate(m.elementType === m.type ? mt : Na(m.type, mt), sn);
              ye.__reactInternalSnapshotBeforeUpdate = ce;
            }
            break;
          case 3:
            var _e = m.stateNode.containerInfo;
            _e.nodeType === 1 ? _e.textContent = "" : _e.nodeType === 9 && _e.documentElement && _e.removeChild(_e.documentElement);
            break;
          case 5:
          case 6:
          case 4:
          case 17:
            break;
          default:
            throw Error(r(163));
        }
      } catch (Ye) {
        Qr(m, m.return, Ye);
      }
      if (p = m.sibling, p !== null) {
        p.return = m.return, dt = p;
        break;
      }
      dt = m.return;
    }
    return gt = nw, nw = !1, gt;
  }
  function Ds(p, m, b) {
    var L = m.updateQueue;
    if (L = L !== null ? L.lastEffect : null, L !== null) {
      var I = L = L.next;
      do {
        if ((I.tag & p) === p) {
          var B = I.destroy;
          I.destroy = void 0, B !== void 0 && tv(m, b, B);
        }
        I = I.next;
      } while (I !== L);
    }
  }
  function rv(p, m) {
    if (m = m.updateQueue, m = m !== null ? m.lastEffect : null, m !== null) {
      var b = m = m.next;
      do {
        if ((b.tag & p) === p) {
          var L = b.create;
          b.destroy = L();
        }
        b = b.next;
      } while (b !== m);
    }
  }
  function $p(p) {
    var m = p.ref;
    if (m !== null) {
      var b = p.stateNode;
      p.tag, p = b, typeof m == "function" ? m(p) : m.current = p;
    }
  }
  function iw(p) {
    var m = p.alternate;
    m !== null && (p.alternate = null, iw(m)), p.child = null, p.deletions = null, p.sibling = null, p.tag === 5 && (m = p.stateNode, m !== null && (delete m[Po], delete m[hl], delete m[_p], delete m[$], delete m[Zf])), p.stateNode = null, p.return = null, p.dependencies = null, p.memoizedProps = null, p.memoizedState = null, p.pendingProps = null, p.stateNode = null, p.updateQueue = null;
  }
  function aw(p) {
    return p.tag === 5 || p.tag === 3 || p.tag === 4;
  }
  function ow(p) {
    e: for (; ; ) {
      for (; p.sibling === null; ) {
        if (p.return === null || aw(p.return)) return null;
        p = p.return;
      }
      for (p.sibling.return = p.return, p = p.sibling; p.tag !== 5 && p.tag !== 6 && p.tag !== 18; ) {
        if (p.flags & 2 || p.child === null || p.tag === 4) continue e;
        p.child.return = p, p = p.child;
      }
      if (!(p.flags & 2)) return p.stateNode;
    }
  }
  function D0(p, m, b) {
    var L = p.tag;
    if (L === 5 || L === 6) p = p.stateNode, m ? b.nodeType === 8 ? b.parentNode.insertBefore(p, m) : b.insertBefore(p, m) : (b.nodeType === 8 ? (m = b.parentNode, m.insertBefore(p, b)) : (m = b, m.appendChild(p)), b = b._reactRootContainer, b != null || m.onclick !== null || (m.onclick = mp));
    else if (L !== 4 && (p = p.child, p !== null)) for (D0(p, m, b), p = p.sibling; p !== null; ) D0(p, m, b), p = p.sibling;
  }
  function qp(p, m, b) {
    var L = p.tag;
    if (L === 5 || L === 6) p = p.stateNode, m ? b.insertBefore(p, m) : b.appendChild(p);
    else if (L !== 4 && (p = p.child, p !== null)) for (qp(p, m, b), p = p.sibling; p !== null; ) qp(p, m, b), p = p.sibling;
  }
  var On = null, ao = !1;
  function Uo(p, m, b) {
    for (b = b.child; b !== null; ) E0(p, m, b), b = b.sibling;
  }
  function E0(p, m, b) {
    if (Lo && typeof Lo.onCommitFiberUnmount == "function") try {
      Lo.onCommitFiberUnmount(Zd, b);
    } catch {
    }
    switch (b.tag) {
      case 5:
        Yr || lc(b, m);
      case 6:
        var L = On, I = ao;
        On = null, Uo(p, m, b), On = L, ao = I, On !== null && (ao ? (p = On, b = b.stateNode, p.nodeType === 8 ? p.parentNode.removeChild(b) : p.removeChild(b)) : On.removeChild(b.stateNode));
        break;
      case 18:
        On !== null && (ao ? (p = On, b = b.stateNode, p.nodeType === 8 ? Qy(p.parentNode, b) : p.nodeType === 1 && Qy(p, b), br(p)) : Qy(On, b.stateNode));
        break;
      case 4:
        L = On, I = ao, On = b.stateNode.containerInfo, ao = !0, Uo(p, m, b), On = L, ao = I;
        break;
      case 0:
      case 11:
      case 14:
      case 15:
        if (!Yr && (L = b.updateQueue, L !== null && (L = L.lastEffect, L !== null))) {
          I = L = L.next;
          do {
            var B = I, Y = B.destroy;
            B = B.tag, Y !== void 0 && ((B & 2) !== 0 || (B & 4) !== 0) && tv(b, m, Y), I = I.next;
          } while (I !== L);
        }
        Uo(p, m, b);
        break;
      case 1:
        if (!Yr && (lc(b, m), L = b.stateNode, typeof L.componentWillUnmount == "function")) try {
          L.props = b.memoizedProps, L.state = b.memoizedState, L.componentWillUnmount();
        } catch (re) {
          Qr(b, m, re);
        }
        Uo(p, m, b);
        break;
      case 21:
        Uo(p, m, b);
        break;
      case 22:
        b.mode & 1 ? (Yr = (L = Yr) || b.memoizedState !== null, Uo(p, m, b), Yr = L) : Uo(p, m, b);
        break;
      default:
        Uo(p, m, b);
    }
  }
  function uc(p) {
    var m = p.updateQueue;
    if (m !== null) {
      p.updateQueue = null;
      var b = p.stateNode;
      b === null && (b = p.stateNode = new Ni()), m.forEach(function(L) {
        var I = XA.bind(null, p, L);
        b.has(L) || (b.add(L), L.then(I, I));
      });
    }
  }
  function ca(p, m) {
    var b = m.deletions;
    if (b !== null) for (var L = 0; L < b.length; L++) {
      var I = b[L];
      try {
        var B = p, Y = m, re = Y;
        e: for (; re !== null; ) {
          switch (re.tag) {
            case 5:
              On = re.stateNode, ao = !1;
              break e;
            case 3:
              On = re.stateNode.containerInfo, ao = !0;
              break e;
            case 4:
              On = re.stateNode.containerInfo, ao = !0;
              break e;
          }
          re = re.return;
        }
        if (On === null) throw Error(r(160));
        E0(B, Y, I), On = null, ao = !1;
        var se = I.alternate;
        se !== null && (se.return = null), I.return = null;
      } catch (Te) {
        Qr(I, m, Te);
      }
    }
    if (m.subtreeFlags & 12854) for (m = m.child; m !== null; ) P0(m, p), m = m.sibling;
  }
  function P0(p, m) {
    var b = p.alternate, L = p.flags;
    switch (p.tag) {
      case 0:
      case 11:
      case 14:
      case 15:
        if (ca(m, p), oo(p), L & 4) {
          try {
            Ds(3, p, p.return), rv(3, p);
          } catch (mt) {
            Qr(p, p.return, mt);
          }
          try {
            Ds(5, p, p.return);
          } catch (mt) {
            Qr(p, p.return, mt);
          }
        }
        break;
      case 1:
        ca(m, p), oo(p), L & 512 && b !== null && lc(b, b.return);
        break;
      case 5:
        if (ca(m, p), oo(p), L & 512 && b !== null && lc(b, b.return), p.flags & 32) {
          var I = p.stateNode;
          try {
            Qa(I, "");
          } catch (mt) {
            Qr(p, p.return, mt);
          }
        }
        if (L & 4 && (I = p.stateNode, I != null)) {
          var B = p.memoizedProps, Y = b !== null ? b.memoizedProps : B, re = p.type, se = p.updateQueue;
          if (p.updateQueue = null, se !== null) try {
            re === "input" && B.type === "radio" && B.name != null && vt(I, B), dh(re, Y);
            var Te = dh(re, B);
            for (Y = 0; Y < se.length; Y += 2) {
              var ke = se[Y], Ve = se[Y + 1];
              ke === "style" ? tl(I, Ve) : ke === "dangerouslySetInnerHTML" ? ia(I, Ve) : ke === "children" ? Qa(I, Ve) : T(I, ke, Ve, Te);
            }
            switch (re) {
              case "input":
                Lt(I, B);
                break;
              case "textarea":
                Di(I, B);
                break;
              case "select":
                var Ne = I._wrapperState.wasMultiple;
                I._wrapperState.wasMultiple = !!B.multiple;
                var ut = B.value;
                ut != null ? wt(I, !!B.multiple, ut, !1) : Ne !== !!B.multiple && (B.defaultValue != null ? wt(
                  I,
                  !!B.multiple,
                  B.defaultValue,
                  !0
                ) : wt(I, !!B.multiple, B.multiple ? [] : "", !1));
            }
            I[hl] = B;
          } catch (mt) {
            Qr(p, p.return, mt);
          }
        }
        break;
      case 6:
        if (ca(m, p), oo(p), L & 4) {
          if (p.stateNode === null) throw Error(r(162));
          I = p.stateNode, B = p.memoizedProps;
          try {
            I.nodeValue = B;
          } catch (mt) {
            Qr(p, p.return, mt);
          }
        }
        break;
      case 3:
        if (ca(m, p), oo(p), L & 4 && b !== null && b.memoizedState.isDehydrated) try {
          br(m.containerInfo);
        } catch (mt) {
          Qr(p, p.return, mt);
        }
        break;
      case 4:
        ca(m, p), oo(p);
        break;
      case 13:
        ca(m, p), oo(p), I = p.child, I.flags & 8192 && (B = I.memoizedState !== null, I.stateNode.isHidden = B, !B || I.alternate !== null && I.alternate.memoizedState !== null || (O0 = Ur())), L & 4 && uc(p);
        break;
      case 22:
        if (ke = b !== null && b.memoizedState !== null, p.mode & 1 ? (Yr = (Te = Yr) || ke, ca(m, p), Yr = Te) : ca(m, p), oo(p), L & 8192) {
          if (Te = p.memoizedState !== null, (p.stateNode.isHidden = Te) && !ke && (p.mode & 1) !== 0) for (dt = p, ke = p.child; ke !== null; ) {
            for (Ve = dt = ke; dt !== null; ) {
              switch (Ne = dt, ut = Ne.child, Ne.tag) {
                case 0:
                case 11:
                case 14:
                case 15:
                  Ds(4, Ne, Ne.return);
                  break;
                case 1:
                  lc(Ne, Ne.return);
                  var gt = Ne.stateNode;
                  if (typeof gt.componentWillUnmount == "function") {
                    L = Ne, b = Ne.return;
                    try {
                      m = L, gt.props = m.memoizedProps, gt.state = m.memoizedState, gt.componentWillUnmount();
                    } catch (mt) {
                      Qr(L, b, mt);
                    }
                  }
                  break;
                case 5:
                  lc(Ne, Ne.return);
                  break;
                case 22:
                  if (Ne.memoizedState !== null) {
                    xl(Ve);
                    continue;
                  }
              }
              ut !== null ? (ut.return = Ne, dt = ut) : xl(Ve);
            }
            ke = ke.sibling;
          }
          e: for (ke = null, Ve = p; ; ) {
            if (Ve.tag === 5) {
              if (ke === null) {
                ke = Ve;
                try {
                  I = Ve.stateNode, Te ? (B = I.style, typeof B.setProperty == "function" ? B.setProperty("display", "none", "important") : B.display = "none") : (re = Ve.stateNode, se = Ve.memoizedProps.style, Y = se != null && se.hasOwnProperty("display") ? se.display : null, re.style.display = hh("display", Y));
                } catch (mt) {
                  Qr(p, p.return, mt);
                }
              }
            } else if (Ve.tag === 6) {
              if (ke === null) try {
                Ve.stateNode.nodeValue = Te ? "" : Ve.memoizedProps;
              } catch (mt) {
                Qr(p, p.return, mt);
              }
            } else if ((Ve.tag !== 22 && Ve.tag !== 23 || Ve.memoizedState === null || Ve === p) && Ve.child !== null) {
              Ve.child.return = Ve, Ve = Ve.child;
              continue;
            }
            if (Ve === p) break e;
            for (; Ve.sibling === null; ) {
              if (Ve.return === null || Ve.return === p) break e;
              ke === Ve && (ke = null), Ve = Ve.return;
            }
            ke === Ve && (ke = null), Ve.sibling.return = Ve.return, Ve = Ve.sibling;
          }
        }
        break;
      case 19:
        ca(m, p), oo(p), L & 4 && uc(p);
        break;
      case 21:
        break;
      default:
        ca(
          m,
          p
        ), oo(p);
    }
  }
  function oo(p) {
    var m = p.flags;
    if (m & 2) {
      try {
        e: {
          for (var b = p.return; b !== null; ) {
            if (aw(b)) {
              var L = b;
              break e;
            }
            b = b.return;
          }
          throw Error(r(160));
        }
        switch (L.tag) {
          case 5:
            var I = L.stateNode;
            L.flags & 32 && (Qa(I, ""), L.flags &= -33);
            var B = ow(p);
            qp(p, B, I);
            break;
          case 3:
          case 4:
            var Y = L.stateNode.containerInfo, re = ow(p);
            D0(p, re, Y);
            break;
          default:
            throw Error(r(161));
        }
      } catch (se) {
        Qr(p, p.return, se);
      }
      p.flags &= -3;
    }
    m & 4096 && (p.flags &= -4097);
  }
  function jp(p, m, b) {
    dt = p, I0(p);
  }
  function I0(p, m, b) {
    for (var L = (p.mode & 1) !== 0; dt !== null; ) {
      var I = dt, B = I.child;
      if (I.tag === 22 && L) {
        var Y = I.memoizedState !== null || Zp;
        if (!Y) {
          var re = I.alternate, se = re !== null && re.memoizedState !== null || Yr;
          re = Zp;
          var Te = Yr;
          if (Zp = Y, (Yr = se) && !Te) for (dt = I; dt !== null; ) Y = dt, se = Y.child, Y.tag === 22 && Y.memoizedState !== null ? sw(I) : se !== null ? (se.return = Y, dt = se) : sw(I);
          for (; B !== null; ) dt = B, I0(B), B = B.sibling;
          dt = I, Zp = re, Yr = Te;
        }
        so(p);
      } else (I.subtreeFlags & 8772) !== 0 && B !== null ? (B.return = I, dt = B) : so(p);
    }
  }
  function so(p) {
    for (; dt !== null; ) {
      var m = dt;
      if ((m.flags & 8772) !== 0) {
        var b = m.alternate;
        try {
          if ((m.flags & 8772) !== 0) switch (m.tag) {
            case 0:
            case 11:
            case 15:
              Yr || rv(5, m);
              break;
            case 1:
              var L = m.stateNode;
              if (m.flags & 4 && !Yr) if (b === null) L.componentDidMount();
              else {
                var I = m.elementType === m.type ? b.memoizedProps : Na(m.type, b.memoizedProps);
                L.componentDidUpdate(I, b.memoizedState, L.__reactInternalSnapshotBeforeUpdate);
              }
              var B = m.updateQueue;
              B !== null && i0(m, B, L);
              break;
            case 3:
              var Y = m.updateQueue;
              if (Y !== null) {
                if (b = null, m.child !== null) switch (m.child.tag) {
                  case 5:
                    b = m.child.stateNode;
                    break;
                  case 1:
                    b = m.child.stateNode;
                }
                i0(m, Y, b);
              }
              break;
            case 5:
              var re = m.stateNode;
              if (b === null && m.flags & 4) {
                b = re;
                var se = m.memoizedProps;
                switch (m.type) {
                  case "button":
                  case "input":
                  case "select":
                  case "textarea":
                    se.autoFocus && b.focus();
                    break;
                  case "img":
                    se.src && (b.src = se.src);
                }
              }
              break;
            case 6:
              break;
            case 4:
              break;
            case 12:
              break;
            case 13:
              if (m.memoizedState === null) {
                var Te = m.alternate;
                if (Te !== null) {
                  var ke = Te.memoizedState;
                  if (ke !== null) {
                    var Ve = ke.dehydrated;
                    Ve !== null && br(Ve);
                  }
                }
              }
              break;
            case 19:
            case 17:
            case 21:
            case 22:
            case 23:
            case 25:
              break;
            default:
              throw Error(r(163));
          }
          Yr || m.flags & 512 && $p(m);
        } catch (Ne) {
          Qr(m, m.return, Ne);
        }
      }
      if (m === p) {
        dt = null;
        break;
      }
      if (b = m.sibling, b !== null) {
        b.return = m.return, dt = b;
        break;
      }
      dt = m.return;
    }
  }
  function xl(p) {
    for (; dt !== null; ) {
      var m = dt;
      if (m === p) {
        dt = null;
        break;
      }
      var b = m.sibling;
      if (b !== null) {
        b.return = m.return, dt = b;
        break;
      }
      dt = m.return;
    }
  }
  function sw(p) {
    for (; dt !== null; ) {
      var m = dt;
      try {
        switch (m.tag) {
          case 0:
          case 11:
          case 15:
            var b = m.return;
            try {
              rv(4, m);
            } catch (se) {
              Qr(m, b, se);
            }
            break;
          case 1:
            var L = m.stateNode;
            if (typeof L.componentDidMount == "function") {
              var I = m.return;
              try {
                L.componentDidMount();
              } catch (se) {
                Qr(m, I, se);
              }
            }
            var B = m.return;
            try {
              $p(m);
            } catch (se) {
              Qr(m, B, se);
            }
            break;
          case 5:
            var Y = m.return;
            try {
              $p(m);
            } catch (se) {
              Qr(m, Y, se);
            }
        }
      } catch (se) {
        Qr(m, m.return, se);
      }
      if (m === p) {
        dt = null;
        break;
      }
      var re = m.sibling;
      if (re !== null) {
        re.return = m.return, dt = re;
        break;
      }
      dt = m.return;
    }
  }
  var lw = Math.ceil, Kp = C.ReactCurrentDispatcher, R0 = C.ReactCurrentOwner, ka = C.ReactCurrentBatchConfig, vr = 0, Nn = null, dn = null, Qn = 0, ha = 0, fc = Yi(0), An = 0, nv = null, Sl = 0, iv = 0, Qp = 0, av = null, Ki = null, O0 = 0, Eu = 1 / 0, Es = null, Jp = !1, N0 = null, wl = null, eg = !1, Tl = null, ki = 0, ov = 0, k0 = null, tg = -1, sv = 0;
  function Bi() {
    return (vr & 6) !== 0 ? Ur() : tg !== -1 ? tg : tg = Ur();
  }
  function bl(p) {
    return (p.mode & 1) === 0 ? 1 : (vr & 2) !== 0 && Qn !== 0 ? Qn & -Qn : VS.transition !== null ? (sv === 0 && (sv = Ey()), sv) : (p = xr, p !== 0 || (p = window.event, p = p === void 0 ? 16 : vS(p.type)), p);
  }
  function lo(p, m, b, L) {
    if (50 < ov) throw ov = 0, k0 = null, Error(r(185));
    Sh(p, b, L), ((vr & 2) === 0 || p !== Nn) && (p === Nn && ((vr & 2) === 0 && (iv |= b), An === 4 && Cl(p, Qn)), Qi(p, L), b === 1 && vr === 0 && (m.mode & 1) === 0 && (Eu = Ur() + 500, wp && dl()));
  }
  function Qi(p, m) {
    var b = p.callbackNode;
    pA(p, m);
    var L = cu(p, p === Nn ? Qn : 0);
    if (L === 0) b !== null && tS(b), p.callbackNode = null, p.callbackPriority = 0;
    else if (m = L & -L, p.callbackPriority !== m) {
      if (b != null && tS(b), m === 1) p.tag === 0 ? _u(uw.bind(null, p)) : zS(uw.bind(null, p)), yp(function() {
        (vr & 6) === 0 && dl();
      }), b = null;
      else {
        switch (hu(L)) {
          case 1:
            b = Ly;
            break;
          case 4:
            b = rS;
            break;
          case 16:
            b = _h;
            break;
          case 536870912:
            b = Dy;
            break;
          default:
            b = _h;
        }
        b = gw(b, rg.bind(null, p));
      }
      p.callbackPriority = m, p.callbackNode = b;
    }
  }
  function rg(p, m) {
    if (tg = -1, sv = 0, (vr & 6) !== 0) throw Error(r(327));
    var b = p.callbackNode;
    if (cc() && p.callbackNode !== b) return null;
    var L = cu(p, p === Nn ? Qn : 0);
    if (L === 0) return null;
    if ((L & 30) !== 0 || (L & p.expiredLanes) !== 0 || m) m = ng(p, L);
    else {
      m = L;
      var I = vr;
      vr |= 2;
      var B = cw();
      (Nn !== p || Qn !== m) && (Es = null, Eu = Ur() + 500, Iu(p, m));
      do
        try {
          VA();
          break;
        } catch (re) {
          fw(p, re);
        }
      while (!0);
      ws(), Kp.current = B, vr = I, dn !== null ? m = 0 : (Nn = null, Qn = 0, m = An);
    }
    if (m !== 0) {
      if (m === 2 && (I = qd(p), I !== 0 && (L = I, m = B0(p, I))), m === 1) throw b = nv, Iu(p, 0), Cl(p, L), Qi(p, Ur()), b;
      if (m === 6) Cl(p, L);
      else {
        if (I = p.current.alternate, (L & 30) === 0 && !FA(I) && (m = ng(p, L), m === 2 && (B = qd(p), B !== 0 && (L = B, m = B0(p, B))), m === 1)) throw b = nv, Iu(p, 0), Cl(p, L), Qi(p, Ur()), b;
        switch (p.finishedWork = I, p.finishedLanes = L, m) {
          case 0:
          case 1:
            throw Error(r(345));
          case 2:
            Ru(p, Ki, Es);
            break;
          case 3:
            if (Cl(p, L), (L & 130023424) === L && (m = O0 + 500 - Ur(), 10 < m)) {
              if (cu(p, 0) !== 0) break;
              if (I = p.suspendedLanes, (I & L) !== L) {
                Bi(), p.pingedLanes |= p.suspendedLanes & I;
                break;
              }
              p.timeoutHandle = fl(Ru.bind(null, p, Ki, Es), m);
              break;
            }
            Ru(p, Ki, Es);
            break;
          case 4:
            if (Cl(p, L), (L & 4194240) === L) break;
            for (m = p.eventTimes, I = -1; 0 < L; ) {
              var Y = 31 - eo(L);
              B = 1 << Y, Y = m[Y], Y > I && (I = Y), L &= ~B;
            }
            if (L = I, L = Ur() - L, L = (120 > L ? 120 : 480 > L ? 480 : 1080 > L ? 1080 : 1920 > L ? 1920 : 3e3 > L ? 3e3 : 4320 > L ? 4320 : 1960 * lw(L / 1960)) - L, 10 < L) {
              p.timeoutHandle = fl(Ru.bind(null, p, Ki, Es), L);
              break;
            }
            Ru(p, Ki, Es);
            break;
          case 5:
            Ru(p, Ki, Es);
            break;
          default:
            throw Error(r(329));
        }
      }
    }
    return Qi(p, Ur()), p.callbackNode === b ? rg.bind(null, p) : null;
  }
  function B0(p, m) {
    var b = av;
    return p.current.memoizedState.isDehydrated && (Iu(p, m).flags |= 256), p = ng(p, m), p !== 2 && (m = Ki, Ki = b, m !== null && z0(m)), p;
  }
  function z0(p) {
    Ki === null ? Ki = p : Ki.push.apply(Ki, p);
  }
  function FA(p) {
    for (var m = p; ; ) {
      if (m.flags & 16384) {
        var b = m.updateQueue;
        if (b !== null && (b = b.stores, b !== null)) for (var L = 0; L < b.length; L++) {
          var I = b[L], B = I.getSnapshot;
          I = I.value;
          try {
            if (!we(B(), I)) return !1;
          } catch {
            return !1;
          }
        }
      }
      if (b = m.child, m.subtreeFlags & 16384 && b !== null) b.return = m, m = b;
      else {
        if (m === p) break;
        for (; m.sibling === null; ) {
          if (m.return === null || m.return === p) return !0;
          m = m.return;
        }
        m.sibling.return = m.return, m = m.sibling;
      }
    }
    return !0;
  }
  function Cl(p, m) {
    for (m &= ~Qp, m &= ~iv, p.suspendedLanes |= m, p.pingedLanes &= ~m, p = p.expirationTimes; 0 < m; ) {
      var b = 31 - eo(m), L = 1 << b;
      p[b] = -1, m &= ~L;
    }
  }
  function uw(p) {
    if ((vr & 6) !== 0) throw Error(r(327));
    cc();
    var m = cu(p, 0);
    if ((m & 1) === 0) return Qi(p, Ur()), null;
    var b = ng(p, m);
    if (p.tag !== 0 && b === 2) {
      var L = qd(p);
      L !== 0 && (m = L, b = B0(p, L));
    }
    if (b === 1) throw b = nv, Iu(p, 0), Cl(p, m), Qi(p, Ur()), b;
    if (b === 6) throw Error(r(345));
    return p.finishedWork = p.current.alternate, p.finishedLanes = m, Ru(p, Ki, Es), Qi(p, Ur()), null;
  }
  function F0(p, m) {
    var b = vr;
    vr |= 1;
    try {
      return p(m);
    } finally {
      vr = b, vr === 0 && (Eu = Ur() + 500, wp && dl());
    }
  }
  function Pu(p) {
    Tl !== null && Tl.tag === 0 && (vr & 6) === 0 && cc();
    var m = vr;
    vr |= 1;
    var b = ka.transition, L = xr;
    try {
      if (ka.transition = null, xr = 1, p) return p();
    } finally {
      xr = L, ka.transition = b, vr = m, (vr & 6) === 0 && dl();
    }
  }
  function G0() {
    ha = fc.current, Gr(fc);
  }
  function Iu(p, m) {
    p.finishedWork = null, p.finishedLanes = 0;
    var b = p.timeoutHandle;
    if (b !== -1 && (p.timeoutHandle = -1, kh(b)), dn !== null) for (b = dn.return; b !== null; ) {
      var L = b;
      switch (wu(L), L.tag) {
        case 1:
          L = L.type.childContextTypes, L != null && Sp();
          break;
        case 3:
          ml(), Gr(Zi), Gr(hi), Ip();
          break;
        case 5:
          Pp(L);
          break;
        case 4:
          ml();
          break;
        case 13:
          Gr(Xr);
          break;
        case 19:
          Gr(Xr);
          break;
        case 10:
          Mp(L.type._context);
          break;
        case 22:
        case 23:
          G0();
      }
      b = b.return;
    }
    if (Nn = p, dn = p = uo(p.current, null), Qn = ha = m, An = 0, nv = null, Qp = iv = Sl = 0, Ki = av = null, bu !== null) {
      for (m = 0; m < bu.length; m++) if (b = bu[m], L = b.interleaved, L !== null) {
        b.interleaved = null;
        var I = L.next, B = b.pending;
        if (B !== null) {
          var Y = B.next;
          B.next = I, L.next = Y;
        }
        b.pending = L;
      }
      bu = null;
    }
    return p;
  }
  function fw(p, m) {
    do {
      var b = dn;
      try {
        if (ws(), Uh.current = zp, ec) {
          for (var L = Kr.memoizedState; L !== null; ) {
            var I = L.queue;
            I !== null && (I.pending = null), L = L.next;
          }
          ec = !1;
        }
        if (yl = 0, Cn = on = Kr = null, Wh = !1, Au = 0, R0.current = null, b === null || b.return === null) {
          An = 1, nv = m, dn = null;
          break;
        }
        e: {
          var B = p, Y = b.return, re = b, se = m;
          if (m = Qn, re.flags |= 32768, se !== null && typeof se == "object" && typeof se.then == "function") {
            var Te = se, ke = re, Ve = ke.tag;
            if ((ke.mode & 1) === 0 && (Ve === 0 || Ve === 11 || Ve === 15)) {
              var Ne = ke.alternate;
              Ne ? (ke.updateQueue = Ne.updateQueue, ke.memoizedState = Ne.memoizedState, ke.lanes = Ne.lanes) : (ke.updateQueue = null, ke.memoizedState = null);
            }
            var ut = QS(Y);
            if (ut !== null) {
              ut.flags &= -257, x0(ut, Y, re, B, m), ut.mode & 1 && qh(B, Te, m), m = ut, se = Te;
              var gt = m.updateQueue;
              if (gt === null) {
                var mt = /* @__PURE__ */ new Set();
                mt.add(se), m.updateQueue = mt;
              } else gt.add(se);
              break e;
            } else {
              if ((m & 1) === 0) {
                qh(B, Te, m), V0();
                break e;
              }
              se = Error(r(426));
            }
          } else if (Vr && re.mode & 1) {
            var sn = QS(Y);
            if (sn !== null) {
              (sn.flags & 65536) === 0 && (sn.flags |= 256), x0(sn, Y, re, B, m), Bo(Du(se, re));
              break e;
            }
          }
          B = se = Du(se, re), An !== 4 && (An = 2), av === null ? av = [B] : av.push(B), B = Y;
          do {
            switch (B.tag) {
              case 3:
                B.flags |= 65536, m &= -m, B.lanes |= m;
                var ye = $h(B, se, m);
                WS(B, ye);
                break e;
              case 1:
                re = se;
                var ce = B.type, _e = B.stateNode;
                if ((B.flags & 128) === 0 && (typeof ce.getDerivedStateFromError == "function" || _e !== null && typeof _e.componentDidCatch == "function" && (wl === null || !wl.has(_e)))) {
                  B.flags |= 65536, m &= -m, B.lanes |= m;
                  var Ye = Up(B, re, m);
                  WS(B, Ye);
                  break e;
                }
            }
            B = B.return;
          } while (B !== null);
        }
        vw(b);
      } catch (yt) {
        m = yt, dn === b && b !== null && (dn = b = b.return);
        continue;
      }
      break;
    } while (!0);
  }
  function cw() {
    var p = Kp.current;
    return Kp.current = zp, p === null ? zp : p;
  }
  function V0() {
    (An === 0 || An === 3 || An === 2) && (An = 4), Nn === null || (Sl & 268435455) === 0 && (iv & 268435455) === 0 || Cl(Nn, Qn);
  }
  function ng(p, m) {
    var b = vr;
    vr |= 2;
    var L = cw();
    (Nn !== p || Qn !== m) && (Es = null, Iu(p, m));
    do
      try {
        GA();
        break;
      } catch (I) {
        fw(p, I);
      }
    while (!0);
    if (ws(), vr = b, Kp.current = L, dn !== null) throw Error(r(261));
    return Nn = null, Qn = 0, An;
  }
  function GA() {
    for (; dn !== null; ) hw(dn);
  }
  function VA() {
    for (; dn !== null && !Yd(); ) hw(dn);
  }
  function hw(p) {
    var m = pw(p.alternate, p, ha);
    p.memoizedProps = p.pendingProps, m === null ? vw(p) : dn = m, R0.current = null;
  }
  function vw(p) {
    var m = p;
    do {
      var b = m.alternate;
      if (p = m.return, (m.flags & 32768) === 0) {
        if (b = kA(b, m, ha), b !== null) {
          dn = b;
          return;
        }
      } else {
        if (b = BA(b, m), b !== null) {
          b.flags &= 32767, dn = b;
          return;
        }
        if (p !== null) p.flags |= 32768, p.subtreeFlags = 0, p.deletions = null;
        else {
          An = 6, dn = null;
          return;
        }
      }
      if (m = m.sibling, m !== null) {
        dn = m;
        return;
      }
      dn = m = p;
    } while (m !== null);
    An === 0 && (An = 5);
  }
  function Ru(p, m, b) {
    var L = xr, I = ka.transition;
    try {
      ka.transition = null, xr = 1, HA(p, m, b, L);
    } finally {
      ka.transition = I, xr = L;
    }
    return null;
  }
  function HA(p, m, b, L) {
    do
      cc();
    while (Tl !== null);
    if ((vr & 6) !== 0) throw Error(r(327));
    b = p.finishedWork;
    var I = p.finishedLanes;
    if (b === null) return null;
    if (p.finishedWork = null, p.finishedLanes = 0, b === p.current) throw Error(r(177));
    p.callbackNode = null, p.callbackPriority = 0;
    var B = b.lanes | b.childLanes;
    if (lS(p, B), p === Nn && (dn = Nn = null, Qn = 0), (b.subtreeFlags & 2064) === 0 && (b.flags & 2064) === 0 || eg || (eg = !0, gw(_h, function() {
      return cc(), null;
    })), B = (b.flags & 15990) !== 0, (b.subtreeFlags & 15990) !== 0 || B) {
      B = ka.transition, ka.transition = null;
      var Y = xr;
      xr = 1;
      var re = vr;
      vr |= 4, R0.current = null, zA(p, b), P0(b, p), IA(yu), Jd = !!Oh, yu = Oh = null, p.current = b, jp(b), hA(), vr = re, xr = Y, ka.transition = B;
    } else p.current = b;
    if (eg && (eg = !1, Tl = p, ki = I), B = p.pendingLanes, B === 0 && (wl = null), dA(b.stateNode), Qi(p, Ur()), m !== null) for (L = p.onRecoverableError, b = 0; b < m.length; b++) I = m[b], L(I.value, { componentStack: I.stack, digest: I.digest });
    if (Jp) throw Jp = !1, p = N0, N0 = null, p;
    return (ki & 1) !== 0 && p.tag !== 0 && cc(), B = p.pendingLanes, (B & 1) !== 0 ? p === k0 ? ov++ : (ov = 0, k0 = p) : ov = 0, dl(), null;
  }
  function cc() {
    if (Tl !== null) {
      var p = hu(ki), m = ka.transition, b = xr;
      try {
        if (ka.transition = null, xr = 16 > p ? 16 : p, Tl === null) var L = !1;
        else {
          if (p = Tl, Tl = null, ki = 0, (vr & 6) !== 0) throw Error(r(331));
          var I = vr;
          for (vr |= 4, dt = p.current; dt !== null; ) {
            var B = dt, Y = B.child;
            if ((dt.flags & 16) !== 0) {
              var re = B.deletions;
              if (re !== null) {
                for (var se = 0; se < re.length; se++) {
                  var Te = re[se];
                  for (dt = Te; dt !== null; ) {
                    var ke = dt;
                    switch (ke.tag) {
                      case 0:
                      case 11:
                      case 15:
                        Ds(8, ke, B);
                    }
                    var Ve = ke.child;
                    if (Ve !== null) Ve.return = ke, dt = Ve;
                    else for (; dt !== null; ) {
                      ke = dt;
                      var Ne = ke.sibling, ut = ke.return;
                      if (iw(ke), ke === Te) {
                        dt = null;
                        break;
                      }
                      if (Ne !== null) {
                        Ne.return = ut, dt = Ne;
                        break;
                      }
                      dt = ut;
                    }
                  }
                }
                var gt = B.alternate;
                if (gt !== null) {
                  var mt = gt.child;
                  if (mt !== null) {
                    gt.child = null;
                    do {
                      var sn = mt.sibling;
                      mt.sibling = null, mt = sn;
                    } while (mt !== null);
                  }
                }
                dt = B;
              }
            }
            if ((B.subtreeFlags & 2064) !== 0 && Y !== null) Y.return = B, dt = Y;
            else e: for (; dt !== null; ) {
              if (B = dt, (B.flags & 2048) !== 0) switch (B.tag) {
                case 0:
                case 11:
                case 15:
                  Ds(9, B, B.return);
              }
              var ye = B.sibling;
              if (ye !== null) {
                ye.return = B.return, dt = ye;
                break e;
              }
              dt = B.return;
            }
          }
          var ce = p.current;
          for (dt = ce; dt !== null; ) {
            Y = dt;
            var _e = Y.child;
            if ((Y.subtreeFlags & 2064) !== 0 && _e !== null) _e.return = Y, dt = _e;
            else e: for (Y = ce; dt !== null; ) {
              if (re = dt, (re.flags & 2048) !== 0) try {
                switch (re.tag) {
                  case 0:
                  case 11:
                  case 15:
                    rv(9, re);
                }
              } catch (yt) {
                Qr(re, re.return, yt);
              }
              if (re === Y) {
                dt = null;
                break e;
              }
              var Ye = re.sibling;
              if (Ye !== null) {
                Ye.return = re.return, dt = Ye;
                break e;
              }
              dt = re.return;
            }
          }
          if (vr = I, dl(), Lo && typeof Lo.onPostCommitFiberRoot == "function") try {
            Lo.onPostCommitFiberRoot(Zd, p);
          } catch {
          }
          L = !0;
        }
        return L;
      } finally {
        xr = b, ka.transition = m;
      }
    }
    return !1;
  }
  function ig(p, m, b) {
    m = Du(b, m), m = $h(p, m, 1), p = Ra(p, m, 1), m = Bi(), p !== null && (Sh(p, 1, m), Qi(p, m));
  }
  function Qr(p, m, b) {
    if (p.tag === 3) ig(p, p, b);
    else for (; m !== null; ) {
      if (m.tag === 3) {
        ig(m, p, b);
        break;
      } else if (m.tag === 1) {
        var L = m.stateNode;
        if (typeof m.type.getDerivedStateFromError == "function" || typeof L.componentDidCatch == "function" && (wl === null || !wl.has(L))) {
          p = Du(b, p), p = Up(m, p, 1), m = Ra(m, p, 1), p = Bi(), m !== null && (Sh(m, 1, p), Qi(m, p));
          break;
        }
      }
      m = m.return;
    }
  }
  function UA(p, m, b) {
    var L = p.pingCache;
    L !== null && L.delete(m), m = Bi(), p.pingedLanes |= p.suspendedLanes & b, Nn === p && (Qn & b) === b && (An === 4 || An === 3 && (Qn & 130023424) === Qn && 500 > Ur() - O0 ? Iu(p, 0) : Qp |= b), Qi(p, m);
  }
  function dw(p, m) {
    m === 0 && ((p.mode & 1) === 0 ? m = 1 : (m = $d, $d <<= 1, ($d & 130023424) === 0 && ($d = 4194304)));
    var b = Bi();
    p = Ts(p, m), p !== null && (Sh(p, m, b), Qi(p, b));
  }
  function WA(p) {
    var m = p.memoizedState, b = 0;
    m !== null && (b = m.retryLane), dw(p, b);
  }
  function XA(p, m) {
    var b = 0;
    switch (p.tag) {
      case 13:
        var L = p.stateNode, I = p.memoizedState;
        I !== null && (b = I.retryLane);
        break;
      case 19:
        L = p.stateNode;
        break;
      default:
        throw Error(r(314));
    }
    L !== null && L.delete(m), dw(p, b);
  }
  var pw;
  pw = function(p, m, b) {
    if (p !== null) if (p.memoizedProps !== m.pendingProps || Zi.current) Oi = !0;
    else {
      if ((p.lanes & b) === 0 && (m.flags & 128) === 0) return Oi = !1, tw(p, m, b);
      Oi = (p.flags & 131072) !== 0;
    }
    else Oi = !1, Vr && (m.flags & 1048576) !== 0 && FS(m, bp, m.index);
    switch (m.lanes = 0, m.tag) {
      case 2:
        var L = m.type;
        Yp(p, m), p = m.pendingProps;
        var I = qf(m, hi.current);
        gl(m, b), I = Mu(null, m, L, p, I, b);
        var B = Rp();
        return m.flags |= 1, typeof I == "object" && I !== null && typeof I.render == "function" && I.$$typeof === void 0 ? (m.tag = 1, m.memoizedState = null, m.updateQueue = null, $i(L) ? (B = !0, La(m)) : B = !1, m.memoizedState = I.state !== null && I.state !== void 0 ? I.state : null, Dp(m), I.updater = Vp, m.stateNode = I, I._reactInternals = m, _0(m, L, p, b), m = A0(null, m, L, !0, B, b)) : (m.tag = 0, Vr && B && Bh(m), qn(null, m, I, b), m = m.child), m;
      case 16:
        L = m.elementType;
        e: {
          switch (Yp(p, m), p = m.pendingProps, I = L._init, L = I(L._payload), m.type = L, I = m.tag = ZA(L), p = Na(L, p), I) {
            case 0:
              m = b0(null, m, L, p, b);
              break e;
            case 1:
              m = C0(null, m, L, p, b);
              break e;
            case 11:
              m = JS(null, m, L, p, b);
              break e;
            case 14:
              m = S0(null, m, L, Na(L.type, p), b);
              break e;
          }
          throw Error(r(
            306,
            L,
            ""
          ));
        }
        return m;
      case 0:
        return L = m.type, I = m.pendingProps, I = m.elementType === L ? I : Na(L, I), b0(p, m, L, I, b);
      case 1:
        return L = m.type, I = m.pendingProps, I = m.elementType === L ? I : Na(L, I), C0(p, m, L, I, b);
      case 3:
        e: {
          if (ew(m), p === null) throw Error(r(387));
          L = m.pendingProps, B = m.memoizedState, I = B.element, US(p, m), Qf(m, L, null, b);
          var Y = m.memoizedState;
          if (L = Y.element, B.isDehydrated) if (B = { element: L, isDehydrated: !1, cache: Y.cache, pendingSuspenseBoundaries: Y.pendingSuspenseBoundaries, transitions: Y.transitions }, m.updateQueue.baseState = B, m.memoizedState = B, m.flags & 256) {
            I = Du(Error(r(423)), m), m = Ho(p, m, L, b, I);
            break e;
          } else if (L !== I) {
            I = Du(Error(r(424)), m), m = Ho(p, m, L, b, I);
            break e;
          } else for (ua = cl(m.stateNode.containerInfo.firstChild), di = m, Vr = !0, ro = null, b = Ap(m, null, L, b), m.child = b; b; ) b.flags = b.flags & -3 | 4096, b = b.sibling;
          else {
            if (ko(), L === I) {
              m = io(p, m, b);
              break e;
            }
            qn(p, m, L, b);
          }
          m = m.child;
        }
        return m;
      case 5:
        return o0(m), p === null && qi(m), L = m.type, I = m.pendingProps, B = p !== null ? p.memoizedProps : null, Y = I.children, Nh(L, I) ? Y = null : B !== null && Nh(L, B) && (m.flags |= 32), T0(p, m), qn(p, m, Y, b), m.child;
      case 6:
        return p === null && qi(m), null;
      case 13:
        return Xp(p, m, b);
      case 4:
        return a0(m, m.stateNode.containerInfo), L = m.pendingProps, p === null ? m.child = tn(m, null, L, b) : qn(p, m, L, b), m.child;
      case 11:
        return L = m.type, I = m.pendingProps, I = m.elementType === L ? I : Na(L, I), JS(p, m, L, I, b);
      case 7:
        return qn(p, m, m.pendingProps, b), m.child;
      case 8:
        return qn(p, m, m.pendingProps.children, b), m.child;
      case 12:
        return qn(p, m, m.pendingProps.children, b), m.child;
      case 10:
        e: {
          if (L = m.type._context, I = m.pendingProps, B = m.memoizedProps, Y = I.value, Br(Gh, L._currentValue), L._currentValue = Y, B !== null) if (we(B.value, Y)) {
            if (B.children === I.children && !Zi.current) {
              m = io(p, m, b);
              break e;
            }
          } else for (B = m.child, B !== null && (B.return = m); B !== null; ) {
            var re = B.dependencies;
            if (re !== null) {
              Y = B.child;
              for (var se = re.firstContext; se !== null; ) {
                if (se.context === L) {
                  if (B.tag === 1) {
                    se = bs(-1, b & -b), se.tag = 2;
                    var Te = B.updateQueue;
                    if (Te !== null) {
                      Te = Te.shared;
                      var ke = Te.pending;
                      ke === null ? se.next = se : (se.next = ke.next, ke.next = se), Te.pending = se;
                    }
                  }
                  B.lanes |= b, se = B.alternate, se !== null && (se.lanes |= b), $n(
                    B.return,
                    b,
                    m
                  ), re.lanes |= b;
                  break;
                }
                se = se.next;
              }
            } else if (B.tag === 10) Y = B.type === m.type ? null : B.child;
            else if (B.tag === 18) {
              if (Y = B.return, Y === null) throw Error(r(341));
              Y.lanes |= b, re = Y.alternate, re !== null && (re.lanes |= b), $n(Y, b, m), Y = B.sibling;
            } else Y = B.child;
            if (Y !== null) Y.return = B;
            else for (Y = B; Y !== null; ) {
              if (Y === m) {
                Y = null;
                break;
              }
              if (B = Y.sibling, B !== null) {
                B.return = Y.return, Y = B;
                break;
              }
              Y = Y.return;
            }
            B = Y;
          }
          qn(p, m, I.children, b), m = m.child;
        }
        return m;
      case 9:
        return I = m.type, L = m.pendingProps.children, gl(m, b), I = Pa(I), L = L(I), m.flags |= 1, qn(p, m, L, b), m.child;
      case 14:
        return L = m.type, I = Na(L, m.pendingProps), I = Na(L.type, I), S0(p, m, L, I, b);
      case 15:
        return Vo(p, m, m.type, m.pendingProps, b);
      case 17:
        return L = m.type, I = m.pendingProps, I = m.elementType === L ? I : Na(L, I), Yp(p, m), m.tag = 1, $i(L) ? (p = !0, La(m)) : p = !1, gl(m, b), Lu(m, L, I), _0(m, L, I, b), A0(null, m, L, !0, p, b);
      case 19:
        return _l(p, m, b);
      case 22:
        return w0(p, m, b);
    }
    throw Error(r(156, m.tag));
  };
  function gw(p, m) {
    return eS(p, m);
  }
  function YA(p, m, b, L) {
    this.tag = p, this.key = b, this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null, this.index = 0, this.ref = null, this.pendingProps = m, this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null, this.mode = L, this.subtreeFlags = this.flags = 0, this.deletions = null, this.childLanes = this.lanes = 0, this.alternate = null;
  }
  function Ba(p, m, b, L) {
    return new YA(p, m, b, L);
  }
  function ag(p) {
    return p = p.prototype, !(!p || !p.isReactComponent);
  }
  function ZA(p) {
    if (typeof p == "function") return ag(p) ? 1 : 0;
    if (p != null) {
      if (p = p.$$typeof, p === G) return 11;
      if (p === W) return 14;
    }
    return 2;
  }
  function uo(p, m) {
    var b = p.alternate;
    return b === null ? (b = Ba(p.tag, m, p.key, p.mode), b.elementType = p.elementType, b.type = p.type, b.stateNode = p.stateNode, b.alternate = p, p.alternate = b) : (b.pendingProps = m, b.type = p.type, b.flags = 0, b.subtreeFlags = 0, b.deletions = null), b.flags = p.flags & 14680064, b.childLanes = p.childLanes, b.lanes = p.lanes, b.child = p.child, b.memoizedProps = p.memoizedProps, b.memoizedState = p.memoizedState, b.updateQueue = p.updateQueue, m = p.dependencies, b.dependencies = m === null ? null : { lanes: m.lanes, firstContext: m.firstContext }, b.sibling = p.sibling, b.index = p.index, b.ref = p.ref, b;
  }
  function og(p, m, b, L, I, B) {
    var Y = 2;
    if (L = p, typeof p == "function") ag(p) && (Y = 1);
    else if (typeof p == "string") Y = 5;
    else e: switch (p) {
      case E:
        return Ou(b.children, I, B, m);
      case P:
        Y = 8, I |= 8;
        break;
      case R:
        return p = Ba(12, b, m, I | 2), p.elementType = R, p.lanes = B, p;
      case z:
        return p = Ba(13, b, m, I), p.elementType = z, p.lanes = B, p;
      case H:
        return p = Ba(19, b, m, I), p.elementType = H, p.lanes = B, p;
      case ee:
        return sg(b, I, B, m);
      default:
        if (typeof p == "object" && p !== null) switch (p.$$typeof) {
          case O:
            Y = 10;
            break e;
          case N:
            Y = 9;
            break e;
          case G:
            Y = 11;
            break e;
          case W:
            Y = 14;
            break e;
          case Z:
            Y = 16, L = null;
            break e;
        }
        throw Error(r(130, p == null ? p : typeof p, ""));
    }
    return m = Ba(Y, b, m, I), m.elementType = p, m.type = L, m.lanes = B, m;
  }
  function Ou(p, m, b, L) {
    return p = Ba(7, p, L, m), p.lanes = b, p;
  }
  function sg(p, m, b, L) {
    return p = Ba(22, p, L, m), p.elementType = ee, p.lanes = b, p.stateNode = { isHidden: !1 }, p;
  }
  function H0(p, m, b) {
    return p = Ba(6, p, null, m), p.lanes = b, p;
  }
  function U0(p, m, b) {
    return m = Ba(4, p.children !== null ? p.children : [], p.key, m), m.lanes = b, m.stateNode = { containerInfo: p.containerInfo, pendingChildren: null, implementation: p.implementation }, m;
  }
  function $A(p, m, b, L, I) {
    this.tag = m, this.containerInfo = p, this.finishedWork = this.pingCache = this.current = this.pendingChildren = null, this.timeoutHandle = -1, this.callbackNode = this.pendingContext = this.context = null, this.callbackPriority = 0, this.eventTimes = xh(0), this.expirationTimes = xh(-1), this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0, this.entanglements = xh(0), this.identifierPrefix = L, this.onRecoverableError = I, this.mutableSourceEagerHydrationData = null;
  }
  function W0(p, m, b, L, I, B, Y, re, se) {
    return p = new $A(p, m, b, re, se), m === 1 ? (m = 1, B === !0 && (m |= 8)) : m = 0, B = Ba(3, null, null, m), p.current = B, B.stateNode = p, B.memoizedState = { element: L, isDehydrated: b, cache: null, transitions: null, pendingSuspenseBoundaries: null }, Dp(B), p;
  }
  function qA(p, m, b) {
    var L = 3 < arguments.length && arguments[3] !== void 0 ? arguments[3] : null;
    return { $$typeof: M, key: L == null ? null : "" + L, children: p, containerInfo: m, implementation: b };
  }
  function mw(p) {
    if (!p) return vl;
    p = p._reactInternals;
    e: {
      if (fu(p) !== p || p.tag !== 1) throw Error(r(170));
      var m = p;
      do {
        switch (m.tag) {
          case 3:
            m = m.stateNode.context;
            break e;
          case 1:
            if ($i(m.type)) {
              m = m.stateNode.__reactInternalMemoizedMergedChildContext;
              break e;
            }
        }
        m = m.return;
      } while (m !== null);
      throw Error(r(171));
    }
    if (p.tag === 1) {
      var b = p.type;
      if ($i(b)) return kS(p, b, m);
    }
    return m;
  }
  function yw(p, m, b, L, I, B, Y, re, se) {
    return p = W0(b, L, !0, p, I, B, Y, re, se), p.context = mw(null), b = p.current, L = Bi(), I = bl(b), B = bs(L, I), B.callback = m ?? null, Ra(b, B, I), p.current.lanes = I, Sh(p, I, L), Qi(p, L), p;
  }
  function lg(p, m, b, L) {
    var I = m.current, B = Bi(), Y = bl(I);
    return b = mw(b), m.context === null ? m.context = b : m.pendingContext = b, m = bs(B, Y), m.payload = { element: p }, L = L === void 0 ? null : L, L !== null && (m.callback = L), p = Ra(I, m, Y), p !== null && (lo(p, I, Y, B), Ep(p, I, Y)), Y;
  }
  function ug(p) {
    return p = p.current, p.child ? (p.child.tag === 5, p.child.stateNode) : null;
  }
  function _w(p, m) {
    if (p = p.memoizedState, p !== null && p.dehydrated !== null) {
      var b = p.retryLane;
      p.retryLane = b !== 0 && b < m ? b : m;
    }
  }
  function X0(p, m) {
    _w(p, m), (p = p.alternate) && _w(p, m);
  }
  function jA() {
    return null;
  }
  var xw = typeof reportError == "function" ? reportError : function(p) {
    console.error(p);
  };
  function fg(p) {
    this._internalRoot = p;
  }
  lv.prototype.render = fg.prototype.render = function(p) {
    var m = this._internalRoot;
    if (m === null) throw Error(r(409));
    lg(p, m, null, null);
  }, lv.prototype.unmount = fg.prototype.unmount = function() {
    var p = this._internalRoot;
    if (p !== null) {
      this._internalRoot = null;
      var m = p.containerInfo;
      Pu(function() {
        lg(null, p, null, null);
      }), m[la] = null;
    }
  };
  function lv(p) {
    this._internalRoot = p;
  }
  lv.prototype.unstable_scheduleHydration = function(p) {
    if (p) {
      var m = Iy();
      p = { blockedOn: null, target: p, priority: m };
      for (var b = 0; b < al.length && m !== 0 && m < al[b].priority; b++) ;
      al.splice(b, 0, p), b === 0 && cS(p);
    }
  };
  function Y0(p) {
    return !(!p || p.nodeType !== 1 && p.nodeType !== 9 && p.nodeType !== 11);
  }
  function cg(p) {
    return !(!p || p.nodeType !== 1 && p.nodeType !== 9 && p.nodeType !== 11 && (p.nodeType !== 8 || p.nodeValue !== " react-mount-point-unstable "));
  }
  function Sw() {
  }
  function KA(p, m, b, L, I) {
    if (I) {
      if (typeof L == "function") {
        var B = L;
        L = function() {
          var Te = ug(Y);
          B.call(Te);
        };
      }
      var Y = yw(m, L, p, 0, null, !1, !1, "", Sw);
      return p._reactRootContainer = Y, p[la] = Y.current, ul(p.nodeType === 8 ? p.parentNode : p), Pu(), Y;
    }
    for (; I = p.lastChild; ) p.removeChild(I);
    if (typeof L == "function") {
      var re = L;
      L = function() {
        var Te = ug(se);
        re.call(Te);
      };
    }
    var se = W0(p, 0, !1, null, null, !1, !1, "", Sw);
    return p._reactRootContainer = se, p[la] = se.current, ul(p.nodeType === 8 ? p.parentNode : p), Pu(function() {
      lg(m, se, b, L);
    }), se;
  }
  function Nu(p, m, b, L, I) {
    var B = b._reactRootContainer;
    if (B) {
      var Y = B;
      if (typeof I == "function") {
        var re = I;
        I = function() {
          var se = ug(Y);
          re.call(se);
        };
      }
      lg(m, Y, p, I);
    } else Y = KA(b, m, p, I, L);
    return ug(Y);
  }
  Py = function(p) {
    switch (p.tag) {
      case 3:
        var m = p.stateNode;
        if (m.current.memoizedState.isDehydrated) {
          var b = Pf(m.pendingLanes);
          b !== 0 && (wh(m, b | 1), Qi(m, Ur()), (vr & 6) === 0 && (Eu = Ur() + 500, dl()));
        }
        break;
      case 13:
        Pu(function() {
          var L = Ts(p, 1);
          if (L !== null) {
            var I = Bi();
            lo(L, p, 1, I);
          }
        }), X0(p, 1);
    }
  }, jd = function(p) {
    if (p.tag === 13) {
      var m = Ts(p, 134217728);
      if (m !== null) {
        var b = Bi();
        lo(m, p, 134217728, b);
      }
      X0(p, 134217728);
    }
  }, uS = function(p) {
    if (p.tag === 13) {
      var m = bl(p), b = Ts(p, m);
      if (b !== null) {
        var L = Bi();
        lo(b, p, m, L);
      }
      X0(p, m);
    }
  }, Iy = function() {
    return xr;
  }, Ry = function(p, m) {
    var b = xr;
    try {
      return xr = p, m();
    } finally {
      xr = b;
    }
  }, wy = function(p, m, b) {
    switch (m) {
      case "input":
        if (Lt(p, b), m = b.name, b.type === "radio" && m != null) {
          for (b = p; b.parentNode; ) b = b.parentNode;
          for (b = b.querySelectorAll("input[name=" + JSON.stringify("" + m) + '][type="radio"]'), m = 0; m < b.length; m++) {
            var L = b[m];
            if (L !== p && L.form === p.form) {
              var I = xp(L);
              if (!I) throw Error(r(90));
              De(L), Lt(L, I);
            }
          }
        }
        break;
      case "textarea":
        Di(p, b);
        break;
      case "select":
        m = b.value, m != null && wt(p, !!b.multiple, m, !1);
    }
  }, qx = F0, Ty = Pu;
  var QA = { usingClientEntryPoint: !1, Events: [ci, Zt, xp, Zx, $x, F0] }, uv = { findFiberByHostInstance: Io, bundleType: 0, version: "18.3.1", rendererPackageName: "react-dom" }, JA = { bundleType: uv.bundleType, version: uv.version, rendererPackageName: uv.rendererPackageName, rendererConfig: uv.rendererConfig, overrideHookState: null, overrideHookStateDeletePath: null, overrideHookStateRenamePath: null, overrideProps: null, overridePropsDeletePath: null, overridePropsRenamePath: null, setErrorHandler: null, setSuspenseHandler: null, scheduleUpdate: null, currentDispatcherRef: C.ReactCurrentDispatcher, findHostInstanceByFiber: function(p) {
    return p = Qx(p), p === null ? null : p.stateNode;
  }, findFiberByHostInstance: uv.findFiberByHostInstance || jA, findHostInstancesForRefresh: null, scheduleRefresh: null, scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, reconcilerVersion: "18.3.1-next-f1338f8080-20240426" };
  if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u") {
    var hg = __REACT_DEVTOOLS_GLOBAL_HOOK__;
    if (!hg.isDisabled && hg.supportsFiber) try {
      Zd = hg.inject(JA), Lo = hg;
    } catch {
    }
  }
  return Va.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = QA, Va.createPortal = function(p, m) {
    var b = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : null;
    if (!Y0(m)) throw Error(r(200));
    return qA(p, m, null, b);
  }, Va.createRoot = function(p, m) {
    if (!Y0(p)) throw Error(r(299));
    var b = !1, L = "", I = xw;
    return m != null && (m.unstable_strictMode === !0 && (b = !0), m.identifierPrefix !== void 0 && (L = m.identifierPrefix), m.onRecoverableError !== void 0 && (I = m.onRecoverableError)), m = W0(p, 1, !1, null, null, b, !1, L, I), p[la] = m.current, ul(p.nodeType === 8 ? p.parentNode : p), new fg(m);
  }, Va.findDOMNode = function(p) {
    if (p == null) return null;
    if (p.nodeType === 1) return p;
    var m = p._reactInternals;
    if (m === void 0)
      throw typeof p.render == "function" ? Error(r(188)) : (p = Object.keys(p).join(","), Error(r(268, p)));
    return p = Qx(m), p = p === null ? null : p.stateNode, p;
  }, Va.flushSync = function(p) {
    return Pu(p);
  }, Va.hydrate = function(p, m, b) {
    if (!cg(m)) throw Error(r(200));
    return Nu(null, p, m, !0, b);
  }, Va.hydrateRoot = function(p, m, b) {
    if (!Y0(p)) throw Error(r(405));
    var L = b != null && b.hydratedSources || null, I = !1, B = "", Y = xw;
    if (b != null && (b.unstable_strictMode === !0 && (I = !0), b.identifierPrefix !== void 0 && (B = b.identifierPrefix), b.onRecoverableError !== void 0 && (Y = b.onRecoverableError)), m = yw(m, null, p, 1, b ?? null, I, !1, B, Y), p[la] = m.current, ul(p), L) for (p = 0; p < L.length; p++) b = L[p], I = b._getVersion, I = I(b._source), m.mutableSourceEagerHydrationData == null ? m.mutableSourceEagerHydrationData = [b, I] : m.mutableSourceEagerHydrationData.push(
      b,
      I
    );
    return new lv(m);
  }, Va.render = function(p, m, b) {
    if (!cg(m)) throw Error(r(200));
    return Nu(null, p, m, !1, b);
  }, Va.unmountComponentAtNode = function(p) {
    if (!cg(p)) throw Error(r(40));
    return p._reactRootContainer ? (Pu(function() {
      Nu(null, null, p, !1, function() {
        p._reactRootContainer = null, p[la] = null;
      });
    }), !0) : !1;
  }, Va.unstable_batchedUpdates = F0, Va.unstable_renderSubtreeIntoContainer = function(p, m, b, L) {
    if (!cg(b)) throw Error(r(200));
    if (p == null || p._reactInternals === void 0) throw Error(r(38));
    return Nu(p, m, b, !1, L);
  }, Va.version = "18.3.1-next-f1338f8080-20240426", Va;
}
var O3;
function aj() {
  if (O3) return dM.exports;
  O3 = 1;
  function e() {
    if (!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE != "function"))
      try {
        __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e);
      } catch (t) {
        console.error(t);
      }
  }
  return e(), dM.exports = ij(), dM.exports;
}
var N3;
function oj() {
  if (N3) return Aw;
  N3 = 1;
  var e = aj();
  return Aw.createRoot = e.createRoot, Aw.hydrateRoot = e.hydrateRoot, Aw;
}
var sj = oj(), F_ = { exports: {} };
var lj = F_.exports, k3;
function uj() {
  return k3 || (k3 = 1, (function(e, t) {
    (function() {
      var r, n = "4.17.23", i = 200, a = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", o = "Expected a function", s = "Invalid `variable` option passed into `_.template`", l = "__lodash_hash_undefined__", u = 500, f = "__lodash_placeholder__", c = 1, h = 2, v = 4, d = 1, g = 2, y = 1, x = 2, S = 4, T = 8, C = 16, A = 32, M = 64, E = 128, P = 256, R = 512, O = 30, N = "...", G = 800, z = 16, H = 1, W = 2, Z = 3, ee = 1 / 0, V = 9007199254740991, Q = 17976931348623157e292, q = NaN, X = 4294967295, K = X - 1, ue = X >>> 1, oe = [
        ["ary", E],
        ["bind", y],
        ["bindKey", x],
        ["curry", T],
        ["curryRight", C],
        ["flip", R],
        ["partial", A],
        ["partialRight", M],
        ["rearg", P]
      ], te = "[object Arguments]", pe = "[object Array]", me = "[object AsyncFunction]", de = "[object Boolean]", ve = "[object Date]", Ae = "[object DOMException]", be = "[object Error]", De = "[object Function]", Ue = "[object GeneratorFunction]", Xe = "[object Map]", $e = "[object Number]", vt = "[object Null]", Lt = "[object Object]", cr = "[object Promise]", mr = "[object Proxy]", Kt = "[object RegExp]", wt = "[object Set]", ir = "[object String]", Nr = "[object Symbol]", Di = "[object Undefined]", na = "[object WeakMap]", su = "[object WeakSet]", Mo = "[object ArrayBuffer]", Zn = "[object DataView]", ia = "[object Float32Array]", Qa = "[object Float64Array]", Ja = "[object Int8Array]", aa = "[object Int16Array]", hh = "[object Int32Array]", tl = "[object Uint8Array]", _y = "[object Uint8ClampedArray]", vh = "[object Uint16Array]", dh = "[object Uint32Array]", xy = /\b__p \+= '';/g, Sy = /\b(__p \+=) '' \+/g, wy = /(__e\(.*?\)|\b__t\)) \+\n'';/g, lu = /&(?:amp|lt|gt|quot|#39);/g, uu = /[&<>"']/g, Yx = RegExp(lu.source), Zx = RegExp(uu.source), $x = /<%-([\s\S]+?)%>/g, qx = /<%([\s\S]+?)%>/g, Ty = /<%=([\s\S]+?)%>/g, by = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, jx = /^\w*$/, ph = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, gh = /[\\^$.*+?()[\]{}|]/g, mh = RegExp(gh.source), Cy = /^\s+/, yh = /\s/, Wd = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, Xd = /\{\n\/\* \[wrapped with (.+)\] \*/, Ay = /,? & /, lA = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, uA = /[()=,{}\[\]\/\s]/, fA = /\\(\\)?/g, fu = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, My = /\w*$/, Kx = /^[-+]0x[0-9a-f]+$/i, cA = /^0b[01]+$/i, Qx = /^\[object .+?Constructor\]$/, Jx = /^0o[0-7]+$/i, eS = /^(?:0|[1-9]\d*)$/, tS = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, Yd = /($^)/, hA = /['\n\r\u2028\u2029\\]/g, Ur = "\\ud800-\\udfff", vA = "\\u0300-\\u036f", Ly = "\\ufe20-\\ufe2f", rS = "\\u20d0-\\u20ff", _h = vA + Ly + rS, nS = "\\u2700-\\u27bf", Dy = "a-z\\xdf-\\xf6\\xf8-\\xff", Zd = "\\xac\\xb1\\xd7\\xf7", Lo = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", dA = "\\u2000-\\u206f", eo = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", iS = "A-Z\\xc0-\\xd6\\xd8-\\xde", aS = "\\ufe0e\\ufe0f", oS = Zd + Lo + dA + eo, Ef = "['’]", $d = "[" + Ur + "]", Pf = "[" + oS + "]", cu = "[" + _h + "]", sS = "\\d+", pA = "[" + nS + "]", qd = "[" + Dy + "]", Ey = "[^" + Ur + oS + sS + nS + Dy + iS + "]", xh = "\\ud83c[\\udffb-\\udfff]", Sh = "(?:" + cu + "|" + xh + ")", lS = "[^" + Ur + "]", wh = "(?:\\ud83c[\\udde6-\\uddff]){2}", xr = "[\\ud800-\\udbff][\\udc00-\\udfff]", hu = "[" + iS + "]", Py = "\\u200d", jd = "(?:" + qd + "|" + Ey + ")", uS = "(?:" + hu + "|" + Ey + ")", Iy = "(?:" + Ef + "(?:d|ll|m|re|s|t|ve))?", Ry = "(?:" + Ef + "(?:D|LL|M|RE|S|T|VE))?", Kd = Sh + "?", Th = "[" + aS + "]?", rl = "(?:" + Py + "(?:" + [lS, wh, xr].join("|") + ")" + Th + Kd + ")*", nl = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", il = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", If = Th + Kd + rl, bh = "(?:" + [pA, wh, xr].join("|") + ")" + If, al = "(?:" + [lS + cu + "?", cu, wh, xr, $d].join("|") + ")", gA = RegExp(Ef, "g"), fS = RegExp(cu, "g"), vu = RegExp(xh + "(?=" + xh + ")|" + al + If, "g"), mA = RegExp([
        hu + "?" + qd + "+" + Iy + "(?=" + [Pf, hu, "$"].join("|") + ")",
        uS + "+" + Ry + "(?=" + [Pf, hu + jd, "$"].join("|") + ")",
        hu + "?" + jd + "+" + Iy,
        hu + "+" + Ry,
        il,
        nl,
        sS,
        bh
      ].join("|"), "g"), cS = RegExp("[" + Py + Ur + _h + aS + "]"), Qd = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, hS = [
        "Array",
        "Buffer",
        "DataView",
        "Date",
        "Error",
        "Float32Array",
        "Float64Array",
        "Function",
        "Int8Array",
        "Int16Array",
        "Int32Array",
        "Map",
        "Math",
        "Object",
        "Promise",
        "RegExp",
        "Set",
        "String",
        "Symbol",
        "TypeError",
        "Uint8Array",
        "Uint8ClampedArray",
        "Uint16Array",
        "Uint32Array",
        "WeakMap",
        "_",
        "clearTimeout",
        "isFinite",
        "parseInt",
        "setTimeout"
      ], yA = -1, Ar = {};
      Ar[ia] = Ar[Qa] = Ar[Ja] = Ar[aa] = Ar[hh] = Ar[tl] = Ar[_y] = Ar[vh] = Ar[dh] = !0, Ar[te] = Ar[pe] = Ar[Mo] = Ar[de] = Ar[Zn] = Ar[ve] = Ar[be] = Ar[De] = Ar[Xe] = Ar[$e] = Ar[Lt] = Ar[Kt] = Ar[wt] = Ar[ir] = Ar[na] = !1;
      var br = {};
      br[te] = br[pe] = br[Mo] = br[Zn] = br[de] = br[ve] = br[ia] = br[Qa] = br[Ja] = br[aa] = br[hh] = br[Xe] = br[$e] = br[Lt] = br[Kt] = br[wt] = br[ir] = br[Nr] = br[tl] = br[_y] = br[vh] = br[dh] = !0, br[be] = br[De] = br[na] = !1;
      var Rf = {
        // Latin-1 Supplement block.
        À: "A",
        Á: "A",
        Â: "A",
        Ã: "A",
        Ä: "A",
        Å: "A",
        à: "a",
        á: "a",
        â: "a",
        ã: "a",
        ä: "a",
        å: "a",
        Ç: "C",
        ç: "c",
        Ð: "D",
        ð: "d",
        È: "E",
        É: "E",
        Ê: "E",
        Ë: "E",
        è: "e",
        é: "e",
        ê: "e",
        ë: "e",
        Ì: "I",
        Í: "I",
        Î: "I",
        Ï: "I",
        ì: "i",
        í: "i",
        î: "i",
        ï: "i",
        Ñ: "N",
        ñ: "n",
        Ò: "O",
        Ó: "O",
        Ô: "O",
        Õ: "O",
        Ö: "O",
        Ø: "O",
        ò: "o",
        ó: "o",
        ô: "o",
        õ: "o",
        ö: "o",
        ø: "o",
        Ù: "U",
        Ú: "U",
        Û: "U",
        Ü: "U",
        ù: "u",
        ú: "u",
        û: "u",
        ü: "u",
        Ý: "Y",
        ý: "y",
        ÿ: "y",
        Æ: "Ae",
        æ: "ae",
        Þ: "Th",
        þ: "th",
        ß: "ss",
        // Latin Extended-A block.
        Ā: "A",
        Ă: "A",
        Ą: "A",
        ā: "a",
        ă: "a",
        ą: "a",
        Ć: "C",
        Ĉ: "C",
        Ċ: "C",
        Č: "C",
        ć: "c",
        ĉ: "c",
        ċ: "c",
        č: "c",
        Ď: "D",
        Đ: "D",
        ď: "d",
        đ: "d",
        Ē: "E",
        Ĕ: "E",
        Ė: "E",
        Ę: "E",
        Ě: "E",
        ē: "e",
        ĕ: "e",
        ė: "e",
        ę: "e",
        ě: "e",
        Ĝ: "G",
        Ğ: "G",
        Ġ: "G",
        Ģ: "G",
        ĝ: "g",
        ğ: "g",
        ġ: "g",
        ģ: "g",
        Ĥ: "H",
        Ħ: "H",
        ĥ: "h",
        ħ: "h",
        Ĩ: "I",
        Ī: "I",
        Ĭ: "I",
        Į: "I",
        İ: "I",
        ĩ: "i",
        ī: "i",
        ĭ: "i",
        į: "i",
        ı: "i",
        Ĵ: "J",
        ĵ: "j",
        Ķ: "K",
        ķ: "k",
        ĸ: "k",
        Ĺ: "L",
        Ļ: "L",
        Ľ: "L",
        Ŀ: "L",
        Ł: "L",
        ĺ: "l",
        ļ: "l",
        ľ: "l",
        ŀ: "l",
        ł: "l",
        Ń: "N",
        Ņ: "N",
        Ň: "N",
        Ŋ: "N",
        ń: "n",
        ņ: "n",
        ň: "n",
        ŋ: "n",
        Ō: "O",
        Ŏ: "O",
        Ő: "O",
        ō: "o",
        ŏ: "o",
        ő: "o",
        Ŕ: "R",
        Ŗ: "R",
        Ř: "R",
        ŕ: "r",
        ŗ: "r",
        ř: "r",
        Ś: "S",
        Ŝ: "S",
        Ş: "S",
        Š: "S",
        ś: "s",
        ŝ: "s",
        ş: "s",
        š: "s",
        Ţ: "T",
        Ť: "T",
        Ŧ: "T",
        ţ: "t",
        ť: "t",
        ŧ: "t",
        Ũ: "U",
        Ū: "U",
        Ŭ: "U",
        Ů: "U",
        Ű: "U",
        Ų: "U",
        ũ: "u",
        ū: "u",
        ŭ: "u",
        ů: "u",
        ű: "u",
        ų: "u",
        Ŵ: "W",
        ŵ: "w",
        Ŷ: "Y",
        ŷ: "y",
        Ÿ: "Y",
        Ź: "Z",
        Ż: "Z",
        Ž: "Z",
        ź: "z",
        ż: "z",
        ž: "z",
        Ĳ: "IJ",
        ĳ: "ij",
        Œ: "Oe",
        œ: "oe",
        ŉ: "'n",
        ſ: "s"
      }, Jd = {
        "&": "&amp;",
        "<": "&lt;",
        ">": "&gt;",
        '"': "&quot;",
        "'": "&#39;"
      }, _A = {
        "&amp;": "&",
        "&lt;": "<",
        "&gt;": ">",
        "&quot;": '"',
        "&#39;": "'"
      }, xA = {
        "\\": "\\",
        "'": "'",
        "\n": "n",
        "\r": "r",
        "\u2028": "u2028",
        "\u2029": "u2029"
      }, Oy = parseFloat, ep = parseInt, tp = typeof Cw == "object" && Cw && Cw.Object === Object && Cw, vS = typeof self == "object" && self && self.Object === Object && self, Wr = tp || vS || Function("return this")(), Ch = t && !t.nodeType && t, Do = Ch && !0 && e && !e.nodeType && e, Ny = Do && Do.exports === Ch, Of = Ny && tp.process, Ei = (function() {
        try {
          var he = Do && Do.require && Do.require("util").types;
          return he || Of && Of.binding && Of.binding("util");
        } catch {
        }
      })(), ky = Ei && Ei.isArrayBuffer, Xi = Ei && Ei.isDate, du = Ei && Ei.isMap, rp = Ei && Ei.isRegExp, Nf = Ei && Ei.isSet, dS = Ei && Ei.isTypedArray;
      function Pi(he, Le, we) {
        switch (we.length) {
          case 0:
            return he.call(Le);
          case 1:
            return he.call(Le, we[0]);
          case 2:
            return he.call(Le, we[0], we[1]);
          case 3:
            return he.call(Le, we[0], we[1], we[2]);
        }
        return he.apply(Le, we);
      }
      function By(he, Le, we, lt) {
        for (var Ft = -1, yr = he == null ? 0 : he.length; ++Ft < yr; ) {
          var hn = he[Ft];
          Le(lt, hn, we(hn), he);
        }
        return lt;
      }
      function ui(he, Le) {
        for (var we = -1, lt = he == null ? 0 : he.length; ++we < lt && Le(he[we], we, he) !== !1; )
          ;
        return he;
      }
      function np(he, Le) {
        for (var we = he == null ? 0 : he.length; we-- && Le(he[we], we, he) !== !1; )
          ;
        return he;
      }
      function zy(he, Le) {
        for (var we = -1, lt = he == null ? 0 : he.length; ++we < lt; )
          if (!Le(he[we], we, he))
            return !1;
        return !0;
      }
      function ol(he, Le) {
        for (var we = -1, lt = he == null ? 0 : he.length, Ft = 0, yr = []; ++we < lt; ) {
          var hn = he[we];
          Le(hn, we, he) && (yr[Ft++] = hn);
        }
        return yr;
      }
      function ip(he, Le) {
        var we = he == null ? 0 : he.length;
        return !!we && kf(he, Le, 0) > -1;
      }
      function Fy(he, Le, we) {
        for (var lt = -1, Ft = he == null ? 0 : he.length; ++lt < Ft; )
          if (we(Le, he[lt]))
            return !0;
        return !1;
      }
      function kr(he, Le) {
        for (var we = -1, lt = he == null ? 0 : he.length, Ft = Array(lt); ++we < lt; )
          Ft[we] = Le(he[we], we, he);
        return Ft;
      }
      function sl(he, Le) {
        for (var we = -1, lt = Le.length, Ft = he.length; ++we < lt; )
          he[Ft + we] = Le[we];
        return he;
      }
      function Gy(he, Le, we, lt) {
        var Ft = -1, yr = he == null ? 0 : he.length;
        for (lt && yr && (we = he[++Ft]); ++Ft < yr; )
          we = Le(we, he[Ft], Ft, he);
        return we;
      }
      function SA(he, Le, we, lt) {
        var Ft = he == null ? 0 : he.length;
        for (lt && Ft && (we = he[--Ft]); Ft--; )
          we = Le(we, he[Ft], Ft, he);
        return we;
      }
      function Vy(he, Le) {
        for (var we = -1, lt = he == null ? 0 : he.length; ++we < lt; )
          if (Le(he[we], we, he))
            return !0;
        return !1;
      }
      var wA = Uy("length");
      function pS(he) {
        return he.split("");
      }
      function TA(he) {
        return he.match(lA) || [];
      }
      function gS(he, Le, we) {
        var lt;
        return we(he, function(Ft, yr, hn) {
          if (Le(Ft, yr, hn))
            return lt = yr, !1;
        }), lt;
      }
      function ap(he, Le, we, lt) {
        for (var Ft = he.length, yr = we + (lt ? 1 : -1); lt ? yr-- : ++yr < Ft; )
          if (Le(he[yr], yr, he))
            return yr;
        return -1;
      }
      function kf(he, Le, we) {
        return Le === Le ? lp(he, Le, we) : ap(he, mS, we);
      }
      function Hy(he, Le, we, lt) {
        for (var Ft = we - 1, yr = he.length; ++Ft < yr; )
          if (lt(he[Ft], Le))
            return Ft;
        return -1;
      }
      function mS(he) {
        return he !== he;
      }
      function yS(he, Le) {
        var we = he == null ? 0 : he.length;
        return we ? Wy(he, Le) / we : q;
      }
      function Uy(he) {
        return function(Le) {
          return Le == null ? r : Le[he];
        };
      }
      function op(he) {
        return function(Le) {
          return he == null ? r : he[Le];
        };
      }
      function _S(he, Le, we, lt, Ft) {
        return Ft(he, function(yr, hn, Lr) {
          we = lt ? (lt = !1, yr) : Le(we, yr, hn, Lr);
        }), we;
      }
      function bA(he, Le) {
        var we = he.length;
        for (he.sort(Le); we--; )
          he[we] = he[we].value;
        return he;
      }
      function Wy(he, Le) {
        for (var we, lt = -1, Ft = he.length; ++lt < Ft; ) {
          var yr = Le(he[lt]);
          yr !== r && (we = we === r ? yr : we + yr);
        }
        return we;
      }
      function Xy(he, Le) {
        for (var we = -1, lt = Array(he); ++we < he; )
          lt[we] = Le(we);
        return lt;
      }
      function CA(he, Le) {
        return kr(Le, function(we) {
          return [we, he[we]];
        });
      }
      function xS(he) {
        return he && he.slice(0, up(he) + 1).replace(Cy, "");
      }
      function oa(he) {
        return function(Le) {
          return he(Le);
        };
      }
      function Ah(he, Le) {
        return kr(Le, function(we) {
          return he[we];
        });
      }
      function gs(he, Le) {
        return he.has(Le);
      }
      function SS(he, Le) {
        for (var we = -1, lt = he.length; ++we < lt && kf(Le, he[we], 0) > -1; )
          ;
        return we;
      }
      function Yy(he, Le) {
        for (var we = he.length; we-- && kf(Le, he[we], 0) > -1; )
          ;
        return we;
      }
      function wS(he, Le) {
        for (var we = he.length, lt = 0; we--; )
          he[we] === Le && ++lt;
        return lt;
      }
      var TS = op(Rf), bS = op(Jd);
      function CS(he) {
        return "\\" + xA[he];
      }
      function Bf(he, Le) {
        return he == null ? r : he[Le];
      }
      function zf(he) {
        return cS.test(he);
      }
      function AA(he) {
        return Qd.test(he);
      }
      function MA(he) {
        for (var Le, we = []; !(Le = he.next()).done; )
          we.push(Le.value);
        return we;
      }
      function sp(he) {
        var Le = -1, we = Array(he.size);
        return he.forEach(function(lt, Ft) {
          we[++Le] = [Ft, lt];
        }), we;
      }
      function Zy(he, Le) {
        return function(we) {
          return he(Le(we));
        };
      }
      function Aa(he, Le) {
        for (var we = -1, lt = he.length, Ft = 0, yr = []; ++we < lt; ) {
          var hn = he[we];
          (hn === Le || hn === f) && (he[we] = f, yr[Ft++] = we);
        }
        return yr;
      }
      function ll(he) {
        var Le = -1, we = Array(he.size);
        return he.forEach(function(lt) {
          we[++Le] = lt;
        }), we;
      }
      function LA(he) {
        var Le = -1, we = Array(he.size);
        return he.forEach(function(lt) {
          we[++Le] = [lt, lt];
        }), we;
      }
      function lp(he, Le, we) {
        for (var lt = we - 1, Ft = he.length; ++lt < Ft; )
          if (he[lt] === Le)
            return lt;
        return -1;
      }
      function DA(he, Le, we) {
        for (var lt = we + 1; lt--; )
          if (he[lt] === Le)
            return lt;
        return lt;
      }
      function pu(he) {
        return zf(he) ? MS(he) : wA(he);
      }
      function sa(he) {
        return zf(he) ? LS(he) : pS(he);
      }
      function up(he) {
        for (var Le = he.length; Le-- && yh.test(he.charAt(Le)); )
          ;
        return Le;
      }
      var AS = op(_A);
      function MS(he) {
        for (var Le = vu.lastIndex = 0; vu.test(he); )
          ++Le;
        return Le;
      }
      function LS(he) {
        return he.match(vu) || [];
      }
      function EA(he) {
        return he.match(mA) || [];
      }
      var PA = (function he(Le) {
        Le = Le == null ? Wr : Ff.defaults(Wr.Object(), Le, Ff.pick(Wr, hS));
        var we = Le.Array, lt = Le.Date, Ft = Le.Error, yr = Le.Function, hn = Le.Math, Lr = Le.Object, Mh = Le.RegExp, IA = Le.String, Ma = Le.TypeError, ms = we.prototype, $y = yr.prototype, Eo = Lr.prototype, Gf = Le["__core-js_shared__"], Lh = $y.toString, hr = Eo.hasOwnProperty, Vf = 0, fp = (function() {
          var _ = /[^.]+$/.exec(Gf && Gf.keys && Gf.keys.IE_PROTO || "");
          return _ ? "Symbol(src)_1." + _ : "";
        })(), Dh = Eo.toString, cp = Lh.call(Lr), DS = Wr._, ES = Mh(
          "^" + Lh.call(hr).replace(gh, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
        ), Eh = Ny ? Le.Buffer : r, ys = Le.Symbol, Ph = Le.Uint8Array, qy = Eh ? Eh.allocUnsafe : r, to = Zy(Lr.getPrototypeOf, Lr), hp = Lr.create, vp = Eo.propertyIsEnumerable, dp = ms.splice, PS = ys ? ys.isConcatSpreadable : r, _s = ys ? ys.iterator : r, gu = ys ? ys.toStringTag : r, Ih = (function() {
          try {
            var _ = _l(Lr, "defineProperty");
            return _({}, "", {}), _;
          } catch {
          }
        })(), IS = Le.clearTimeout !== Wr.clearTimeout && Le.clearTimeout, Fr = lt && lt.now !== Wr.Date.now && lt.now, jy = Le.setTimeout !== Wr.setTimeout && Le.setTimeout, mu = hn.ceil, ul = hn.floor, pp = Lr.getOwnPropertySymbols, Ky = Eh ? Eh.isBuffer : r, Hf = Le.isFinite, gp = ms.join, Uf = Zy(Lr.keys, Lr), vn = hn.max, fi = hn.min, RA = lt.now, RS = Le.parseInt, Rh = hn.random, mp = ms.reverse, Oh = _l(Le, "DataView"), yu = _l(Le, "Map"), Nh = _l(Le, "Promise"), fl = _l(Le, "Set"), kh = _l(Le, "WeakMap"), Wf = _l(Lr, "create"), yp = kh && new kh(), Xf = {}, Qy = xl(Oh), cl = xl(yu), OS = xl(Nh), Yf = xl(fl), Po = xl(kh), hl = ys ? ys.prototype : r, la = hl ? hl.valueOf : r, _p = hl ? hl.toString : r;
        function $(_) {
          if (pn(_) && !$t(_) && !(_ instanceof Zt)) {
            if (_ instanceof ci)
              return _;
            if (hr.call(_, "__wrapped__"))
              return lw(_);
          }
          return new ci(_);
        }
        var Zf = /* @__PURE__ */ (function() {
          function _() {
          }
          return function(w) {
            if (!ln(w))
              return {};
            if (hp)
              return hp(w);
            _.prototype = w;
            var D = new _();
            return _.prototype = r, D;
          };
        })();
        function Io() {
        }
        function ci(_, w) {
          this.__wrapped__ = _, this.__actions__ = [], this.__chain__ = !!w, this.__index__ = 0, this.__values__ = r;
        }
        $.templateSettings = {
          /**
           * Used to detect `data` property values to be HTML-escaped.
           *
           * @memberOf _.templateSettings
           * @type {RegExp}
           */
          escape: $x,
          /**
           * Used to detect code to be evaluated.
           *
           * @memberOf _.templateSettings
           * @type {RegExp}
           */
          evaluate: qx,
          /**
           * Used to detect `data` property values to inject.
           *
           * @memberOf _.templateSettings
           * @type {RegExp}
           */
          interpolate: Ty,
          /**
           * Used to reference the data object in the template text.
           *
           * @memberOf _.templateSettings
           * @type {string}
           */
          variable: "",
          /**
           * Used to import variables into the compiled template.
           *
           * @memberOf _.templateSettings
           * @type {Object}
           */
          imports: {
            /**
             * A reference to the `lodash` function.
             *
             * @memberOf _.templateSettings.imports
             * @type {Function}
             */
            _: $
          }
        }, $.prototype = Io.prototype, $.prototype.constructor = $, ci.prototype = Zf(Io.prototype), ci.prototype.constructor = ci;
        function Zt(_) {
          this.__wrapped__ = _, this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = !1, this.__iteratees__ = [], this.__takeCount__ = X, this.__views__ = [];
        }
        function xp() {
          var _ = new Zt(this.__wrapped__);
          return _.__actions__ = Ri(this.__actions__), _.__dir__ = this.__dir__, _.__filtered__ = this.__filtered__, _.__iteratees__ = Ri(this.__iteratees__), _.__takeCount__ = this.__takeCount__, _.__views__ = Ri(this.__views__), _;
        }
        function Jy() {
          if (this.__filtered__) {
            var _ = new Zt(this);
            _.__dir__ = -1, _.__filtered__ = !0;
          } else
            _ = this.clone(), _.__dir__ *= -1;
          return _;
        }
        function $f() {
          var _ = this.__wrapped__.value(), w = this.__dir__, D = $t(_), k = w < 0, U = D ? _.length : 0, j = M0(0, U, this.__views__), ne = j.start, le = j.end, ge = le - ne, Pe = k ? le : ne - 1, Re = this.__iteratees__, ze = Re.length, at = 0, xt = fi(ge, this.__takeCount__);
          if (!D || !k && U == ge && xt == ge)
            return rc(_, this.__actions__);
          var Nt = [];
          e:
            for (; ge-- && at < xt; ) {
              Pe += w;
              for (var tr = -1, kt = _[Pe]; ++tr < ze; ) {
                var lr = Re[tr], dr = lr.iteratee, co = lr.type, va = dr(kt);
                if (co == W)
                  kt = va;
                else if (!va) {
                  if (co == H)
                    continue e;
                  break e;
                }
              }
              Nt[at++] = kt;
            }
          return Nt;
        }
        Zt.prototype = Zf(Io.prototype), Zt.prototype.constructor = Zt;
        function Yi(_) {
          var w = -1, D = _ == null ? 0 : _.length;
          for (this.clear(); ++w < D; ) {
            var k = _[w];
            this.set(k[0], k[1]);
          }
        }
        function Gr() {
          this.__data__ = Wf ? Wf(null) : {}, this.size = 0;
        }
        function Br(_) {
          var w = this.has(_) && delete this.__data__[_];
          return this.size -= w ? 1 : 0, w;
        }
        function vl(_) {
          var w = this.__data__;
          if (Wf) {
            var D = w[_];
            return D === l ? r : D;
          }
          return hr.call(w, _) ? w[_] : r;
        }
        function hi(_) {
          var w = this.__data__;
          return Wf ? w[_] !== r : hr.call(w, _);
        }
        function Zi(_, w) {
          var D = this.__data__;
          return this.size += this.has(_) ? 0 : 1, D[_] = Wf && w === r ? l : w, this;
        }
        Yi.prototype.clear = Gr, Yi.prototype.delete = Br, Yi.prototype.get = vl, Yi.prototype.has = hi, Yi.prototype.set = Zi;
        function Ii(_) {
          var w = -1, D = _ == null ? 0 : _.length;
          for (this.clear(); ++w < D; ) {
            var k = _[w];
            this.set(k[0], k[1]);
          }
        }
        function qf() {
          this.__data__ = [], this.size = 0;
        }
        function $i(_) {
          var w = this.__data__, D = di(w, _);
          if (D < 0)
            return !1;
          var k = w.length - 1;
          return D == k ? w.pop() : dp.call(w, D, 1), --this.size, !0;
        }
        function Sp(_) {
          var w = this.__data__, D = di(w, _);
          return D < 0 ? r : w[D][1];
        }
        function NS(_) {
          return di(this.__data__, _) > -1;
        }
        function kS(_, w) {
          var D = this.__data__, k = di(D, _);
          return k < 0 ? (++this.size, D.push([_, w])) : D[k][1] = w, this;
        }
        Ii.prototype.clear = qf, Ii.prototype.delete = $i, Ii.prototype.get = Sp, Ii.prototype.has = NS, Ii.prototype.set = kS;
        function La(_) {
          var w = -1, D = _ == null ? 0 : _.length;
          for (this.clear(); ++w < D; ) {
            var k = _[w];
            this.set(k[0], k[1]);
          }
        }
        function BS() {
          this.size = 0, this.__data__ = {
            hash: new Yi(),
            map: new (yu || Ii)(),
            string: new Yi()
          };
        }
        function xs(_) {
          var w = Qh(this, _).delete(_);
          return this.size -= w ? 1 : 0, w;
        }
        function wp(_) {
          return Qh(this, _).get(_);
        }
        function e0(_) {
          return Qh(this, _).has(_);
        }
        function zS(_, w) {
          var D = Qh(this, _), k = D.size;
          return D.set(_, w), this.size += D.size == k ? 0 : 1, this;
        }
        La.prototype.clear = BS, La.prototype.delete = xs, La.prototype.get = wp, La.prototype.has = e0, La.prototype.set = zS;
        function _u(_) {
          var w = -1, D = _ == null ? 0 : _.length;
          for (this.__data__ = new La(); ++w < D; )
            this.add(_[w]);
        }
        function dl(_) {
          return this.__data__.set(_, l), this;
        }
        function jf(_) {
          return this.__data__.has(_);
        }
        _u.prototype.add = _u.prototype.push = dl, _u.prototype.has = jf;
        function vi(_) {
          var w = this.__data__ = new Ii(_);
          this.size = w.size;
        }
        function Tp() {
          this.__data__ = new Ii(), this.size = 0;
        }
        function bp(_) {
          var w = this.__data__, D = w.delete(_);
          return this.size = w.size, D;
        }
        function Da(_) {
          return this.__data__.get(_);
        }
        function Ea(_) {
          return this.__data__.has(_);
        }
        function xu(_, w) {
          var D = this.__data__;
          if (D instanceof Ii) {
            var k = D.__data__;
            if (!yu || k.length < i - 1)
              return k.push([_, w]), this.size = ++D.size, this;
            D = this.__data__ = new La(k);
          }
          return D.set(_, w), this.size = D.size, this;
        }
        vi.prototype.clear = Tp, vi.prototype.delete = bp, vi.prototype.get = Da, vi.prototype.has = Ea, vi.prototype.set = xu;
        function Ro(_, w) {
          var D = $t(_), k = !D && fv(_), U = !D && !k && hc(_), j = !D && !k && !U && vg(_), ne = D || k || U || j, le = ne ? Xy(_.length, IA) : [], ge = le.length;
          for (var Pe in _)
            (w || hr.call(_, Pe)) && !(ne && // Safari 9 has enumerable `arguments.length` in strict mode.
            (Pe == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
            U && (Pe == "offset" || Pe == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
            j && (Pe == "buffer" || Pe == "byteLength" || Pe == "byteOffset") || // Skip index properties.
            Yr(Pe, ge))) && le.push(Pe);
          return le;
        }
        function Oo(_) {
          var w = _.length;
          return w ? _[ec(0, w - 1)] : r;
        }
        function Su(_, w) {
          return jp(Ri(_), Ss(w, 0, _.length));
        }
        function FS(_) {
          return jp(Ri(_));
        }
        function Bh(_, w, D) {
          (D !== r && !Ps(_[w], D) || D === r && !(w in _)) && No(_, w, D);
        }
        function wu(_, w, D) {
          var k = _[w];
          (!(hr.call(_, w) && Ps(k, D)) || D === r && !(w in _)) && No(_, w, D);
        }
        function di(_, w) {
          for (var D = _.length; D--; )
            if (Ps(_[D][0], w))
              return D;
          return -1;
        }
        function ua(_, w, D, k) {
          return Bo(_, function(U, j, ne) {
            w(k, U, D(U), ne);
          }), k;
        }
        function Vr(_, w) {
          return _ && no(w, mi(w), _);
        }
        function ro(_, w) {
          return _ && no(w, Fa(w), _);
        }
        function No(_, w, D) {
          w == "__proto__" && Ih ? Ih(_, w, {
            configurable: !0,
            enumerable: !0,
            value: D,
            writable: !0
          }) : _[w] = D;
        }
        function Cp(_, w) {
          for (var D = -1, k = w.length, U = we(k), j = _ == null; ++D < k; )
            U[D] = j ? r : nM(_, w[D]);
          return U;
        }
        function Ss(_, w, D) {
          return _ === _ && (D !== r && (_ = _ <= D ? _ : D), w !== r && (_ = _ >= w ? _ : w)), _;
        }
        function qi(_, w, D, k, U, j) {
          var ne, le = w & c, ge = w & h, Pe = w & v;
          if (D && (ne = U ? D(_, k, U, j) : D(_)), ne !== r)
            return ne;
          if (!ln(_))
            return _;
          var Re = $t(_);
          if (Re) {
            if (ne = ev(_), !le)
              return Ri(_, ne);
          } else {
            var ze = jn(_), at = ze == De || ze == Ue;
            if (hc(_))
              return p0(_, le);
            if (ze == Lt || ze == te || at && !U) {
              if (ne = ge || at ? {} : Kn(_), !le)
                return ge ? NA(_, ro(ne, _)) : zp(_, Vr(ne, _));
            } else {
              if (!br[ze])
                return U ? _ : {};
              ne = kA(_, ze, le);
            }
          }
          j || (j = new vi());
          var xt = j.get(_);
          if (xt)
            return xt;
          j.set(_, ne), h3(_) ? _.forEach(function(kt) {
            ne.add(qi(kt, w, D, kt, _, j));
          }) : f3(_) && _.forEach(function(kt, lr) {
            ne.set(lr, qi(kt, w, D, lr, _, j));
          });
          var Nt = Pe ? ge ? Kh : jh : ge ? Fa : mi, tr = Re ? r : Nt(_);
          return ui(tr || _, function(kt, lr) {
            tr && (lr = kt, kt = _[lr]), wu(ne, lr, qi(kt, w, D, lr, _, j));
          }), ne;
        }
        function GS(_) {
          var w = mi(_);
          return function(D) {
            return zh(D, _, w);
          };
        }
        function zh(_, w, D) {
          var k = D.length;
          if (_ == null)
            return !k;
          for (_ = Lr(_); k--; ) {
            var U = D[k], j = w[U], ne = _[U];
            if (ne === r && !(U in _) || !j(ne))
              return !1;
          }
          return !0;
        }
        function t0(_, w, D) {
          if (typeof _ != "function")
            throw new Ma(o);
          return uc(function() {
            _.apply(r, D);
          }, w);
        }
        function ko(_, w, D, k) {
          var U = -1, j = ip, ne = !0, le = _.length, ge = [], Pe = w.length;
          if (!le)
            return ge;
          D && (w = kr(w, oa(D))), k ? (j = Fy, ne = !1) : w.length >= i && (j = gs, ne = !1, w = new _u(w));
          e:
            for (; ++U < le; ) {
              var Re = _[U], ze = D == null ? Re : D(Re);
              if (Re = k || Re !== 0 ? Re : 0, ne && ze === ze) {
                for (var at = Pe; at--; )
                  if (w[at] === ze)
                    continue e;
                ge.push(Re);
              } else j(w, ze, k) || ge.push(Re);
            }
          return ge;
        }
        var Bo = Na(fa), VS = Na(pl, !0);
        function Fh(_, w) {
          var D = !0;
          return Bo(_, function(k, U, j) {
            return D = !!w(k, U, j), D;
          }), D;
        }
        function Tu(_, w, D) {
          for (var k = -1, U = _.length; ++k < U; ) {
            var j = _[k], ne = w(j);
            if (ne != null && (le === r ? ne === ne && !fo(ne) : D(ne, le)))
              var le = ne, ge = j;
          }
          return ge;
        }
        function HS(_, w, D, k) {
          var U = _.length;
          for (D = Jt(D), D < 0 && (D = -D > U ? 0 : U + D), k = k === r || k > U ? U : Jt(k), k < 0 && (k += U), k = D > k ? 0 : d3(k); D < k; )
            _[D++] = w;
          return _;
        }
        function r0(_, w) {
          var D = [];
          return Bo(_, function(k, U, j) {
            w(k, U, j) && D.push(k);
          }), D;
        }
        function tn(_, w, D, k, U) {
          var j = -1, ne = _.length;
          for (D || (D = Zp), U || (U = []); ++j < ne; ) {
            var le = _[j];
            w > 0 && D(le) ? w > 1 ? tn(le, w - 1, D, k, U) : sl(U, le) : k || (U[U.length] = le);
          }
          return U;
        }
        var Ap = Gp(), Gh = Gp(!0);
        function fa(_, w) {
          return _ && Ap(_, w, mi);
        }
        function pl(_, w) {
          return _ && Gh(_, w, mi);
        }
        function Kf(_, w) {
          return ol(w, function(D) {
            return ku(_[D]);
          });
        }
        function ws(_, w) {
          w = Go(w, _);
          for (var D = 0, k = w.length; _ != null && D < k; )
            _ = _[so(w[D++])];
          return D && D == k ? _ : r;
        }
        function Mp(_, w, D) {
          var k = w(_);
          return $t(_) ? k : sl(k, D(_));
        }
        function $n(_) {
          return _ == null ? _ === r ? Di : vt : gu && gu in Lr(_) ? Yp(_) : D0(_);
        }
        function gl(_, w) {
          return _ > w;
        }
        function Pa(_, w) {
          return _ != null && hr.call(_, w);
        }
        function bu(_, w) {
          return _ != null && w in Lr(_);
        }
        function n0(_, w, D) {
          return _ >= fi(w, D) && _ < vn(w, D);
        }
        function Lp(_, w, D) {
          for (var k = D ? Fy : ip, U = _[0].length, j = _.length, ne = j, le = we(j), ge = 1 / 0, Pe = []; ne--; ) {
            var Re = _[ne];
            ne && w && (Re = kr(Re, oa(w))), ge = fi(Re.length, ge), le[ne] = !D && (w || U >= 120 && Re.length >= 120) ? new _u(ne && Re) : r;
          }
          Re = _[0];
          var ze = -1, at = le[0];
          e:
            for (; ++ze < U && Pe.length < ge; ) {
              var xt = Re[ze], Nt = w ? w(xt) : xt;
              if (xt = D || xt !== 0 ? xt : 0, !(at ? gs(at, Nt) : k(Pe, Nt, D))) {
                for (ne = j; --ne; ) {
                  var tr = le[ne];
                  if (!(tr ? gs(tr, Nt) : k(_[ne], Nt, D)))
                    continue e;
                }
                at && at.push(Nt), Pe.push(xt);
              }
            }
          return Pe;
        }
        function Ts(_, w, D, k) {
          return fa(_, function(U, j, ne) {
            w(k, D(U), j, ne);
          }), k;
        }
        function Ia(_, w, D) {
          w = Go(w, _), _ = On(_, w);
          var k = _ == null ? _ : _[so(ki(w))];
          return k == null ? r : Pi(k, _, D);
        }
        function Dp(_) {
          return pn(_) && $n(_) == te;
        }
        function US(_) {
          return pn(_) && $n(_) == Mo;
        }
        function bs(_) {
          return pn(_) && $n(_) == ve;
        }
        function Ra(_, w, D, k, U) {
          return _ === w ? !0 : _ == null || w == null || !pn(_) && !pn(w) ? _ !== _ && w !== w : Ep(_, w, D, k, Ra, U);
        }
        function Ep(_, w, D, k, U, j) {
          var ne = $t(_), le = $t(w), ge = ne ? pe : jn(_), Pe = le ? pe : jn(w);
          ge = ge == te ? Lt : ge, Pe = Pe == te ? Lt : Pe;
          var Re = ge == Lt, ze = Pe == Lt, at = ge == Pe;
          if (at && hc(_)) {
            if (!hc(w))
              return !1;
            ne = !0, Re = !1;
          }
          if (at && !Re)
            return j || (j = new vi()), ne || vg(_) ? C0(_, w, D, k, U, j) : A0(_, w, ge, D, k, U, j);
          if (!(D & d)) {
            var xt = Re && hr.call(_, "__wrapped__"), Nt = ze && hr.call(w, "__wrapped__");
            if (xt || Nt) {
              var tr = xt ? _.value() : _, kt = Nt ? w.value() : w;
              return j || (j = new vi()), U(tr, kt, D, k, j);
            }
          }
          return at ? (j || (j = new vi()), ew(_, w, D, k, U, j)) : !1;
        }
        function WS(_) {
          return pn(_) && jn(_) == Xe;
        }
        function Qf(_, w, D, k) {
          var U = D.length, j = U, ne = !k;
          if (_ == null)
            return !j;
          for (_ = Lr(_); U--; ) {
            var le = D[U];
            if (ne && le[2] ? le[1] !== _[le[0]] : !(le[0] in _))
              return !1;
          }
          for (; ++U < j; ) {
            le = D[U];
            var ge = le[0], Pe = _[ge], Re = le[1];
            if (ne && le[2]) {
              if (Pe === r && !(ge in _))
                return !1;
            } else {
              var ze = new vi();
              if (k)
                var at = k(Pe, Re, ge, _, w, ze);
              if (!(at === r ? Ra(Re, Pe, d | g, k, ze) : at))
                return !1;
            }
          }
          return !0;
        }
        function i0(_) {
          if (!ln(_) || nw(_))
            return !1;
          var w = ku(_) ? ES : Qx;
          return w.test(xl(_));
        }
        function Vh(_) {
          return pn(_) && $n(_) == Kt;
        }
        function zo(_) {
          return pn(_) && jn(_) == wt;
        }
        function Hh(_) {
          return pn(_) && ww(_.length) && !!Ar[$n(_)];
        }
        function Jf(_) {
          return typeof _ == "function" ? _ : _ == null ? Ga : typeof _ == "object" ? $t(_) ? Xr(_[0], _[1]) : Pp(_) : C3(_);
        }
        function Cs(_) {
          if (!Ds(_))
            return Uf(_);
          var w = [];
          for (var D in Lr(_))
            hr.call(_, D) && D != "constructor" && w.push(D);
          return w;
        }
        function a0(_) {
          if (!ln(_))
            return ow(_);
          var w = Ds(_), D = [];
          for (var k in _)
            k == "constructor" && (w || !hr.call(_, k)) || D.push(k);
          return D;
        }
        function ml(_, w) {
          return _ < w;
        }
        function o0(_, w) {
          var D = -1, k = za(_) ? we(_.length) : [];
          return Bo(_, function(U, j, ne) {
            k[++D] = w(U, j, ne);
          }), k;
        }
        function Pp(_) {
          var w = Jh(_);
          return w.length == 1 && w[0][2] ? $p(w[0][0], w[0][1]) : function(D) {
            return D === _ || Qf(D, _, w);
          };
        }
        function Xr(_, w) {
          return dt(_) && rv(w) ? $p(so(_), w) : function(D) {
            var k = nM(D, _);
            return k === r && k === w ? iM(D, _) : Ra(w, k, d | g);
          };
        }
        function Cu(_, w, D, k, U) {
          _ !== w && Ap(w, function(j, ne) {
            if (U || (U = new vi()), ln(j))
              s0(_, w, ne, D, Cu, k, U);
            else {
              var le = k ? k(Uo(_, ne), j, ne + "", _, w, U) : r;
              le === r && (le = j), Bh(_, ne, le);
            }
          }, Fa);
        }
        function s0(_, w, D, k, U, j, ne) {
          var le = Uo(_, D), ge = Uo(w, D), Pe = ne.get(ge);
          if (Pe) {
            Bh(_, D, Pe);
            return;
          }
          var Re = j ? j(le, ge, D + "", _, w, ne) : r, ze = Re === r;
          if (ze) {
            var at = $t(ge), xt = !at && hc(ge), Nt = !at && !xt && vg(ge);
            Re = ge, at || xt || Nt ? $t(le) ? Re = le : Mn(le) ? Re = Ri(le) : xt ? (ze = !1, Re = p0(ge, !0)) : Nt ? (ze = !1, Re = qS(ge, !0)) : Re = [] : Z0(ge) || fv(ge) ? (Re = le, fv(le) ? Re = p3(le) : (!ln(le) || ku(le)) && (Re = Kn(ge))) : ze = !1;
          }
          ze && (ne.set(ge, Re), U(Re, ge, k, j, ne), ne.delete(ge)), Bh(_, D, Re);
        }
        function Ip(_, w) {
          var D = _.length;
          if (D)
            return w += w < 0 ? D : 0, Yr(w, D) ? _[w] : r;
        }
        function Uh(_, w, D) {
          w.length ? w = kr(w, function(j) {
            return $t(j) ? function(ne) {
              return ws(ne, j.length === 1 ? j[0] : j);
            } : j;
          }) : w = [Ga];
          var k = -1;
          w = kr(w, oa(Et()));
          var U = o0(_, function(j, ne, le) {
            var ge = kr(w, function(Pe) {
              return Pe(j);
            });
            return { criteria: ge, index: ++k, value: j };
          });
          return bA(U, function(j, ne) {
            return OA(j, ne, D);
          });
        }
        function l0(_, w) {
          return yl(_, w, function(D, k) {
            return iM(_, k);
          });
        }
        function yl(_, w, D) {
          for (var k = -1, U = w.length, j = {}; ++k < U; ) {
            var ne = w[k], le = ws(_, ne);
            D(le, ne) && Mu(j, Go(ne, _), le);
          }
          return j;
        }
        function Kr(_) {
          return function(w) {
            return ws(w, _);
          };
        }
        function on(_, w, D, k) {
          var U = k ? Hy : kf, j = -1, ne = w.length, le = _;
          for (_ === w && (w = Ri(w)), D && (le = kr(_, oa(D))); ++j < ne; )
            for (var ge = 0, Pe = w[j], Re = D ? D(Pe) : Pe; (ge = U(le, Re, ge, k)) > -1; )
              le !== _ && dp.call(le, ge, 1), dp.call(_, ge, 1);
          return _;
        }
        function Cn(_, w) {
          for (var D = _ ? w.length : 0, k = D - 1; D--; ) {
            var U = w[D];
            if (D == k || U !== j) {
              var j = U;
              Yr(U) ? dp.call(_, U, 1) : Np(_, U);
            }
          }
          return _;
        }
        function ec(_, w) {
          return _ + ul(Rh() * (w - _ + 1));
        }
        function Wh(_, w, D, k) {
          for (var U = -1, j = vn(mu((w - _) / (D || 1)), 0), ne = we(j); j--; )
            ne[k ? j : ++U] = _, _ += D;
          return ne;
        }
        function Au(_, w) {
          var D = "";
          if (!_ || w < 1 || w > V)
            return D;
          do
            w % 2 && (D += _), w = ul(w / 2), w && (_ += _);
          while (w);
          return D;
        }
        function Qt(_, w) {
          return ca(qp(_, w, Ga), _ + "");
        }
        function pi(_) {
          return Oo(dg(_));
        }
        function u0(_, w) {
          var D = dg(_);
          return jp(D, Ss(w, 0, D.length));
        }
        function Mu(_, w, D, k) {
          if (!ln(_))
            return _;
          w = Go(w, _);
          for (var U = -1, j = w.length, ne = j - 1, le = _; le != null && ++U < j; ) {
            var ge = so(w[U]), Pe = D;
            if (ge === "__proto__" || ge === "constructor" || ge === "prototype")
              return _;
            if (U != ne) {
              var Re = le[ge];
              Pe = k ? k(Re, ge, le) : r, Pe === r && (Pe = ln(Re) ? Re : Yr(w[U + 1]) ? [] : {});
            }
            wu(le, ge, Pe), le = le[ge];
          }
          return _;
        }
        var Rp = yp ? function(_, w) {
          return yp.set(_, w), _;
        } : Ga, Fo = Ih ? function(_, w) {
          return Ih(_, "toString", {
            configurable: !0,
            enumerable: !1,
            value: oM(w),
            writable: !0
          });
        } : Ga;
        function Oa(_) {
          return jp(dg(_));
        }
        function gi(_, w, D) {
          var k = -1, U = _.length;
          w < 0 && (w = -w > U ? 0 : U + w), D = D > U ? U : D, D < 0 && (D += U), U = w > D ? 0 : D - w >>> 0, w >>>= 0;
          for (var j = we(U); ++k < U; )
            j[k] = _[k + w];
          return j;
        }
        function f0(_, w) {
          var D;
          return Bo(_, function(k, U, j) {
            return D = w(k, U, j), !D;
          }), !!D;
        }
        function tc(_, w, D) {
          var k = 0, U = _ == null ? k : _.length;
          if (typeof w == "number" && w === w && U <= ue) {
            for (; k < U; ) {
              var j = k + U >>> 1, ne = _[j];
              ne !== null && !fo(ne) && (D ? ne <= w : ne < w) ? k = j + 1 : U = j;
            }
            return U;
          }
          return Op(_, w, Ga, D);
        }
        function Op(_, w, D, k) {
          var U = 0, j = _ == null ? 0 : _.length;
          if (j === 0)
            return 0;
          w = D(w);
          for (var ne = w !== w, le = w === null, ge = fo(w), Pe = w === r; U < j; ) {
            var Re = ul((U + j) / 2), ze = D(_[Re]), at = ze !== r, xt = ze === null, Nt = ze === ze, tr = fo(ze);
            if (ne)
              var kt = k || Nt;
            else Pe ? kt = Nt && (k || at) : le ? kt = Nt && at && (k || !xt) : ge ? kt = Nt && at && !xt && (k || !tr) : xt || tr ? kt = !1 : kt = k ? ze <= w : ze < w;
            kt ? U = Re + 1 : j = Re;
          }
          return fi(j, K);
        }
        function c0(_, w) {
          for (var D = -1, k = _.length, U = 0, j = []; ++D < k; ) {
            var ne = _[D], le = w ? w(ne) : ne;
            if (!D || !Ps(le, ge)) {
              var ge = le;
              j[U++] = ne === 0 ? 0 : ne;
            }
          }
          return j;
        }
        function h0(_) {
          return typeof _ == "number" ? _ : fo(_) ? q : +_;
        }
        function ji(_) {
          if (typeof _ == "string")
            return _;
          if ($t(_))
            return kr(_, ji) + "";
          if (fo(_))
            return _p ? _p.call(_) : "";
          var w = _ + "";
          return w == "0" && 1 / _ == -ee ? "-0" : w;
        }
        function As(_, w, D) {
          var k = -1, U = ip, j = _.length, ne = !0, le = [], ge = le;
          if (D)
            ne = !1, U = Fy;
          else if (j >= i) {
            var Pe = w ? null : JS(_);
            if (Pe)
              return ll(Pe);
            ne = !1, U = gs, ge = new _u();
          } else
            ge = w ? [] : le;
          e:
            for (; ++k < j; ) {
              var Re = _[k], ze = w ? w(Re) : Re;
              if (Re = D || Re !== 0 ? Re : 0, ne && ze === ze) {
                for (var at = ge.length; at--; )
                  if (ge[at] === ze)
                    continue e;
                w && ge.push(ze), le.push(Re);
              } else U(ge, ze, D) || (ge !== le && ge.push(ze), le.push(Re));
            }
          return le;
        }
        function Np(_, w) {
          w = Go(w, _);
          var D = -1, k = w.length;
          if (!k)
            return !0;
          for (var U = _ == null || typeof _ != "object" && typeof _ != "function"; ++D < k; ) {
            var j = w[D];
            if (typeof j == "string") {
              if (j === "__proto__" && !hr.call(_, "__proto__"))
                return !1;
              if (j === "constructor" && D + 1 < k && typeof w[D + 1] == "string" && w[D + 1] === "prototype") {
                if (U && D === 0)
                  continue;
                return !1;
              }
            }
          }
          var ne = On(_, w);
          return ne == null || delete ne[so(ki(w))];
        }
        function v0(_, w, D, k) {
          return Mu(_, w, D(ws(_, w)), k);
        }
        function Xh(_, w, D, k) {
          for (var U = _.length, j = k ? U : -1; (k ? j-- : ++j < U) && w(_[j], j, _); )
            ;
          return D ? gi(_, k ? 0 : j, k ? j + 1 : U) : gi(_, k ? j + 1 : 0, k ? U : j);
        }
        function rc(_, w) {
          var D = _;
          return D instanceof Zt && (D = D.value()), Gy(w, function(k, U) {
            return U.func.apply(U.thisArg, sl([k], U.args));
          }, D);
        }
        function kp(_, w, D) {
          var k = _.length;
          if (k < 2)
            return k ? As(_[0]) : [];
          for (var U = -1, j = we(k); ++U < k; )
            for (var ne = _[U], le = -1; ++le < k; )
              le != U && (j[U] = ko(j[U] || ne, _[le], w, D));
          return As(tn(j, 1), w, D);
        }
        function Yh(_, w, D) {
          for (var k = -1, U = _.length, j = w.length, ne = {}; ++k < U; ) {
            var le = k < j ? w[k] : r;
            D(ne, _[k], le);
          }
          return ne;
        }
        function nc(_) {
          return Mn(_) ? _ : [];
        }
        function Bp(_) {
          return typeof _ == "function" ? _ : Ga;
        }
        function Go(_, w) {
          return $t(_) ? _ : dt(_, w) ? [_] : I0(Dr(_));
        }
        var XS = Qt;
        function Ms(_, w, D) {
          var k = _.length;
          return D = D === r ? k : D, !w && D >= k ? _ : gi(_, w, D);
        }
        var d0 = IS || function(_) {
          return Wr.clearTimeout(_);
        };
        function p0(_, w) {
          if (w)
            return _.slice();
          var D = _.length, k = qy ? qy(D) : new _.constructor(D);
          return _.copy(k), k;
        }
        function Zh(_) {
          var w = new _.constructor(_.byteLength);
          return new Ph(w).set(new Ph(_)), w;
        }
        function YS(_, w) {
          var D = w ? Zh(_.buffer) : _.buffer;
          return new _.constructor(D, _.byteOffset, _.byteLength);
        }
        function ZS(_) {
          var w = new _.constructor(_.source, My.exec(_));
          return w.lastIndex = _.lastIndex, w;
        }
        function $S(_) {
          return la ? Lr(la.call(_)) : {};
        }
        function qS(_, w) {
          var D = w ? Zh(_.buffer) : _.buffer;
          return new _.constructor(D, _.byteOffset, _.length);
        }
        function g0(_, w) {
          if (_ !== w) {
            var D = _ !== r, k = _ === null, U = _ === _, j = fo(_), ne = w !== r, le = w === null, ge = w === w, Pe = fo(w);
            if (!le && !Pe && !j && _ > w || j && ne && ge && !le && !Pe || k && ne && ge || !D && ge || !U)
              return 1;
            if (!k && !j && !Pe && _ < w || Pe && D && U && !k && !j || le && D && U || !ne && U || !ge)
              return -1;
          }
          return 0;
        }
        function OA(_, w, D) {
          for (var k = -1, U = _.criteria, j = w.criteria, ne = U.length, le = D.length; ++k < ne; ) {
            var ge = g0(U[k], j[k]);
            if (ge) {
              if (k >= le)
                return ge;
              var Pe = D[k];
              return ge * (Pe == "desc" ? -1 : 1);
            }
          }
          return _.index - w.index;
        }
        function jS(_, w, D, k) {
          for (var U = -1, j = _.length, ne = D.length, le = -1, ge = w.length, Pe = vn(j - ne, 0), Re = we(ge + Pe), ze = !k; ++le < ge; )
            Re[le] = w[le];
          for (; ++U < ne; )
            (ze || U < j) && (Re[D[U]] = _[U]);
          for (; Pe--; )
            Re[le++] = _[U++];
          return Re;
        }
        function m0(_, w, D, k) {
          for (var U = -1, j = _.length, ne = -1, le = D.length, ge = -1, Pe = w.length, Re = vn(j - le, 0), ze = we(Re + Pe), at = !k; ++U < Re; )
            ze[U] = _[U];
          for (var xt = U; ++ge < Pe; )
            ze[xt + ge] = w[ge];
          for (; ++ne < le; )
            (at || U < j) && (ze[xt + D[ne]] = _[U++]);
          return ze;
        }
        function Ri(_, w) {
          var D = -1, k = _.length;
          for (w || (w = we(k)); ++D < k; )
            w[D] = _[D];
          return w;
        }
        function no(_, w, D, k) {
          var U = !D;
          D || (D = {});
          for (var j = -1, ne = w.length; ++j < ne; ) {
            var le = w[j], ge = k ? k(D[le], _[le], le, D, _) : r;
            ge === r && (ge = _[le]), U ? No(D, le, ge) : wu(D, le, ge);
          }
          return D;
        }
        function zp(_, w) {
          return no(_, io(_), w);
        }
        function NA(_, w) {
          return no(_, tw(_), w);
        }
        function Fp(_, w) {
          return function(D, k) {
            var U = $t(D) ? By : ua, j = w ? w() : {};
            return U(D, _, Et(k, 2), j);
          };
        }
        function ic(_) {
          return Qt(function(w, D) {
            var k = -1, U = D.length, j = U > 1 ? D[U - 1] : r, ne = U > 2 ? D[2] : r;
            for (j = _.length > 3 && typeof j == "function" ? (U--, j) : r, ne && Ni(D[0], D[1], ne) && (j = U < 3 ? r : j, U = 1), w = Lr(w); ++k < U; ) {
              var le = D[k];
              le && _(w, le, k, j);
            }
            return w;
          });
        }
        function Na(_, w) {
          return function(D, k) {
            if (D == null)
              return D;
            if (!za(D))
              return _(D, k);
            for (var U = D.length, j = w ? U : -1, ne = Lr(D); (w ? j-- : ++j < U) && k(ne[j], j, ne) !== !1; )
              ;
            return D;
          };
        }
        function Gp(_) {
          return function(w, D, k) {
            for (var U = -1, j = Lr(w), ne = k(w), le = ne.length; le--; ) {
              var ge = ne[_ ? le : ++U];
              if (D(j[ge], ge, j) === !1)
                break;
            }
            return w;
          };
        }
        function Vp(_, w, D) {
          var k = w & y, U = ac(_);
          function j() {
            var ne = this && this !== Wr && this instanceof j ? U : _;
            return ne.apply(k ? D : this, arguments);
          }
          return j;
        }
        function y0(_) {
          return function(w) {
            w = Dr(w);
            var D = zf(w) ? sa(w) : r, k = D ? D[0] : w.charAt(0), U = D ? Ms(D, 1).join("") : w.slice(1);
            return k[_]() + U;
          };
        }
        function Lu(_) {
          return function(w) {
            return Gy(T3(w3(w).replace(gA, "")), _, "");
          };
        }
        function ac(_) {
          return function() {
            var w = arguments;
            switch (w.length) {
              case 0:
                return new _();
              case 1:
                return new _(w[0]);
              case 2:
                return new _(w[0], w[1]);
              case 3:
                return new _(w[0], w[1], w[2]);
              case 4:
                return new _(w[0], w[1], w[2], w[3]);
              case 5:
                return new _(w[0], w[1], w[2], w[3], w[4]);
              case 6:
                return new _(w[0], w[1], w[2], w[3], w[4], w[5]);
              case 7:
                return new _(w[0], w[1], w[2], w[3], w[4], w[5], w[6]);
            }
            var D = Zf(_.prototype), k = _.apply(D, w);
            return ln(k) ? k : D;
          };
        }
        function _0(_, w, D) {
          var k = ac(_);
          function U() {
            for (var j = arguments.length, ne = we(j), le = j, ge = Ls(U); le--; )
              ne[le] = arguments[le];
            var Pe = j < 3 && ne[0] !== ge && ne[j - 1] !== ge ? [] : Aa(ne, ge);
            if (j -= Pe.length, j < D)
              return Oi(
                _,
                w,
                oc,
                U.placeholder,
                r,
                ne,
                Pe,
                r,
                r,
                D - j
              );
            var Re = this && this !== Wr && this instanceof U ? k : _;
            return Pi(Re, this, ne);
          }
          return U;
        }
        function Du(_) {
          return function(w, D, k) {
            var U = Lr(w);
            if (!za(w)) {
              var j = Et(D, 3);
              w = mi(w), D = function(le) {
                return j(U[le], le, U);
              };
            }
            var ne = _(w, D, k);
            return ne > -1 ? U[j ? w[ne] : ne] : r;
          };
        }
        function Hp(_) {
          return Ho(function(w) {
            var D = w.length, k = D, U = ci.prototype.thru;
            for (_ && w.reverse(); k--; ) {
              var j = w[k];
              if (typeof j != "function")
                throw new Ma(o);
              if (U && !ne && sc(j) == "wrapper")
                var ne = new ci([], !0);
            }
            for (k = ne ? k : D; ++k < D; ) {
              j = w[k];
              var le = sc(j), ge = le == "wrapper" ? Xp(j) : r;
              ge && tv(ge[0]) && ge[1] == (E | T | A | P) && !ge[4].length && ge[9] == 1 ? ne = ne[sc(ge[0])].apply(ne, ge[3]) : ne = j.length == 1 && tv(j) ? ne[le]() : ne.thru(j);
            }
            return function() {
              var Pe = arguments, Re = Pe[0];
              if (ne && Pe.length == 1 && $t(Re))
                return ne.plant(Re).value();
              for (var ze = 0, at = D ? w[ze].apply(this, Pe) : Re; ++ze < D; )
                at = w[ze].call(this, at);
              return at;
            };
          });
        }
        function oc(_, w, D, k, U, j, ne, le, ge, Pe) {
          var Re = w & E, ze = w & y, at = w & x, xt = w & (T | C), Nt = w & R, tr = at ? r : ac(_);
          function kt() {
            for (var lr = arguments.length, dr = we(lr), co = lr; co--; )
              dr[co] = arguments[co];
            if (xt)
              var va = Ls(kt), ho = wS(dr, va);
            if (k && (dr = jS(dr, k, U, xt)), j && (dr = m0(dr, j, ne, xt)), lr -= ho, xt && lr < Pe) {
              var Ln = Aa(dr, va);
              return Oi(
                _,
                w,
                oc,
                kt.placeholder,
                D,
                dr,
                Ln,
                le,
                ge,
                Pe - lr
              );
            }
            var Is = ze ? D : this, zu = at ? Is[_] : _;
            return lr = dr.length, le ? dr = ao(dr, le) : Nt && lr > 1 && dr.reverse(), Re && ge < lr && (dr.length = ge), this && this !== Wr && this instanceof kt && (zu = tr || ac(zu)), zu.apply(Is, dr);
          }
          return kt;
        }
        function KS(_, w) {
          return function(D, k) {
            return Ts(D, _, w(k), {});
          };
        }
        function $h(_, w) {
          return function(D, k) {
            var U;
            if (D === r && k === r)
              return w;
            if (D !== r && (U = D), k !== r) {
              if (U === r)
                return k;
              typeof D == "string" || typeof k == "string" ? (D = ji(D), k = ji(k)) : (D = h0(D), k = h0(k)), U = _(D, k);
            }
            return U;
          };
        }
        function Up(_) {
          return Ho(function(w) {
            return w = kr(w, oa(Et())), Qt(function(D) {
              var k = this;
              return _(w, function(U) {
                return Pi(U, k, D);
              });
            });
          });
        }
        function qh(_, w) {
          w = w === r ? " " : ji(w);
          var D = w.length;
          if (D < 2)
            return D ? Au(w, _) : w;
          var k = Au(w, mu(_ / pu(w)));
          return zf(w) ? Ms(sa(k), 0, _).join("") : k.slice(0, _);
        }
        function QS(_, w, D, k) {
          var U = w & y, j = ac(_);
          function ne() {
            for (var le = -1, ge = arguments.length, Pe = -1, Re = k.length, ze = we(Re + ge), at = this && this !== Wr && this instanceof ne ? j : _; ++Pe < Re; )
              ze[Pe] = k[Pe];
            for (; ge--; )
              ze[Pe++] = arguments[++le];
            return Pi(at, U ? D : this, ze);
          }
          return ne;
        }
        function x0(_) {
          return function(w, D, k) {
            return k && typeof k != "number" && Ni(w, D, k) && (D = k = r), w = Bu(w), D === r ? (D = w, w = 0) : D = Bu(D), k = k === r ? w < D ? 1 : -1 : Bu(k), Wh(w, D, k, _);
          };
        }
        function Wp(_) {
          return function(w, D) {
            return typeof w == "string" && typeof D == "string" || (w = Wo(w), D = Wo(D)), _(w, D);
          };
        }
        function Oi(_, w, D, k, U, j, ne, le, ge, Pe) {
          var Re = w & T, ze = Re ? ne : r, at = Re ? r : ne, xt = Re ? j : r, Nt = Re ? r : j;
          w |= Re ? A : M, w &= ~(Re ? M : A), w & S || (w &= -4);
          var tr = [
            _,
            w,
            U,
            xt,
            ze,
            Nt,
            at,
            le,
            ge,
            Pe
          ], kt = D.apply(r, tr);
          return tv(_) && E0(kt, tr), kt.placeholder = k, P0(kt, _, w);
        }
        function qn(_) {
          var w = hn[_];
          return function(D, k) {
            if (D = Wo(D), k = k == null ? 0 : fi(Jt(k), 292), k && Hf(D)) {
              var U = (Dr(D) + "e").split("e"), j = w(U[0] + "e" + (+U[1] + k));
              return U = (Dr(j) + "e").split("e"), +(U[0] + "e" + (+U[1] - k));
            }
            return w(D);
          };
        }
        var JS = fl && 1 / ll(new fl([, -0]))[1] == ee ? function(_) {
          return new fl(_);
        } : uM;
        function S0(_) {
          return function(w) {
            var D = jn(w);
            return D == Xe ? sp(w) : D == wt ? LA(w) : CA(w, _(w));
          };
        }
        function Vo(_, w, D, k, U, j, ne, le) {
          var ge = w & x;
          if (!ge && typeof _ != "function")
            throw new Ma(o);
          var Pe = k ? k.length : 0;
          if (Pe || (w &= -97, k = U = r), ne = ne === r ? ne : vn(Jt(ne), 0), le = le === r ? le : Jt(le), Pe -= U ? U.length : 0, w & M) {
            var Re = k, ze = U;
            k = U = r;
          }
          var at = ge ? r : Xp(_), xt = [
            _,
            w,
            D,
            k,
            U,
            Re,
            ze,
            j,
            ne,
            le
          ];
          if (at && aw(xt, at), _ = xt[0], w = xt[1], D = xt[2], k = xt[3], U = xt[4], le = xt[9] = xt[9] === r ? ge ? 0 : _.length : vn(xt[9] - Pe, 0), !le && w & (T | C) && (w &= -25), !w || w == y)
            var Nt = Vp(_, w, D);
          else w == T || w == C ? Nt = _0(_, w, le) : (w == A || w == (y | A)) && !U.length ? Nt = QS(_, w, D, k) : Nt = oc.apply(r, xt);
          var tr = at ? Rp : E0;
          return P0(tr(Nt, xt), _, w);
        }
        function w0(_, w, D, k) {
          return _ === r || Ps(_, Eo[D]) && !hr.call(k, D) ? w : _;
        }
        function T0(_, w, D, k, U, j) {
          return ln(_) && ln(w) && (j.set(w, _), Cu(_, w, r, T0, j), j.delete(w)), _;
        }
        function b0(_) {
          return Z0(_) ? r : _;
        }
        function C0(_, w, D, k, U, j) {
          var ne = D & d, le = _.length, ge = w.length;
          if (le != ge && !(ne && ge > le))
            return !1;
          var Pe = j.get(_), Re = j.get(w);
          if (Pe && Re)
            return Pe == w && Re == _;
          var ze = -1, at = !0, xt = D & g ? new _u() : r;
          for (j.set(_, w), j.set(w, _); ++ze < le; ) {
            var Nt = _[ze], tr = w[ze];
            if (k)
              var kt = ne ? k(tr, Nt, ze, w, _, j) : k(Nt, tr, ze, _, w, j);
            if (kt !== r) {
              if (kt)
                continue;
              at = !1;
              break;
            }
            if (xt) {
              if (!Vy(w, function(lr, dr) {
                if (!gs(xt, dr) && (Nt === lr || U(Nt, lr, D, k, j)))
                  return xt.push(dr);
              })) {
                at = !1;
                break;
              }
            } else if (!(Nt === tr || U(Nt, tr, D, k, j))) {
              at = !1;
              break;
            }
          }
          return j.delete(_), j.delete(w), at;
        }
        function A0(_, w, D, k, U, j, ne) {
          switch (D) {
            case Zn:
              if (_.byteLength != w.byteLength || _.byteOffset != w.byteOffset)
                return !1;
              _ = _.buffer, w = w.buffer;
            case Mo:
              return !(_.byteLength != w.byteLength || !j(new Ph(_), new Ph(w)));
            case de:
            case ve:
            case $e:
              return Ps(+_, +w);
            case be:
              return _.name == w.name && _.message == w.message;
            case Kt:
            case ir:
              return _ == w + "";
            case Xe:
              var le = sp;
            case wt:
              var ge = k & d;
              if (le || (le = ll), _.size != w.size && !ge)
                return !1;
              var Pe = ne.get(_);
              if (Pe)
                return Pe == w;
              k |= g, ne.set(_, w);
              var Re = C0(le(_), le(w), k, U, j, ne);
              return ne.delete(_), Re;
            case Nr:
              if (la)
                return la.call(_) == la.call(w);
          }
          return !1;
        }
        function ew(_, w, D, k, U, j) {
          var ne = D & d, le = jh(_), ge = le.length, Pe = jh(w), Re = Pe.length;
          if (ge != Re && !ne)
            return !1;
          for (var ze = ge; ze--; ) {
            var at = le[ze];
            if (!(ne ? at in w : hr.call(w, at)))
              return !1;
          }
          var xt = j.get(_), Nt = j.get(w);
          if (xt && Nt)
            return xt == w && Nt == _;
          var tr = !0;
          j.set(_, w), j.set(w, _);
          for (var kt = ne; ++ze < ge; ) {
            at = le[ze];
            var lr = _[at], dr = w[at];
            if (k)
              var co = ne ? k(dr, lr, at, w, _, j) : k(lr, dr, at, _, w, j);
            if (!(co === r ? lr === dr || U(lr, dr, D, k, j) : co)) {
              tr = !1;
              break;
            }
            kt || (kt = at == "constructor");
          }
          if (tr && !kt) {
            var va = _.constructor, ho = w.constructor;
            va != ho && "constructor" in _ && "constructor" in w && !(typeof va == "function" && va instanceof va && typeof ho == "function" && ho instanceof ho) && (tr = !1);
          }
          return j.delete(_), j.delete(w), tr;
        }
        function Ho(_) {
          return ca(qp(_, r, Qp), _ + "");
        }
        function jh(_) {
          return Mp(_, mi, io);
        }
        function Kh(_) {
          return Mp(_, Fa, tw);
        }
        var Xp = yp ? function(_) {
          return yp.get(_);
        } : uM;
        function sc(_) {
          for (var w = _.name + "", D = Xf[w], k = hr.call(Xf, w) ? D.length : 0; k--; ) {
            var U = D[k], j = U.func;
            if (j == null || j == _)
              return U.name;
          }
          return w;
        }
        function Ls(_) {
          var w = hr.call($, "placeholder") ? $ : _;
          return w.placeholder;
        }
        function Et() {
          var _ = $.iteratee || sM;
          return _ = _ === sM ? Jf : _, arguments.length ? _(arguments[0], arguments[1]) : _;
        }
        function Qh(_, w) {
          var D = _.__data__;
          return lc(w) ? D[typeof w == "string" ? "string" : "hash"] : D.map;
        }
        function Jh(_) {
          for (var w = mi(_), D = w.length; D--; ) {
            var k = w[D], U = _[k];
            w[D] = [k, U, rv(U)];
          }
          return w;
        }
        function _l(_, w) {
          var D = Bf(_, w);
          return i0(D) ? D : r;
        }
        function Yp(_) {
          var w = hr.call(_, gu), D = _[gu];
          try {
            _[gu] = r;
            var k = !0;
          } catch {
          }
          var U = Dh.call(_);
          return k && (w ? _[gu] = D : delete _[gu]), U;
        }
        var io = pp ? function(_) {
          return _ == null ? [] : (_ = Lr(_), ol(pp(_), function(w) {
            return vp.call(_, w);
          }));
        } : fM, tw = pp ? function(_) {
          for (var w = []; _; )
            sl(w, io(_)), _ = to(_);
          return w;
        } : fM, jn = $n;
        (Oh && jn(new Oh(new ArrayBuffer(1))) != Zn || yu && jn(new yu()) != Xe || Nh && jn(Nh.resolve()) != cr || fl && jn(new fl()) != wt || kh && jn(new kh()) != na) && (jn = function(_) {
          var w = $n(_), D = w == Lt ? _.constructor : r, k = D ? xl(D) : "";
          if (k)
            switch (k) {
              case Qy:
                return Zn;
              case cl:
                return Xe;
              case OS:
                return cr;
              case Yf:
                return wt;
              case Po:
                return na;
            }
          return w;
        });
        function M0(_, w, D) {
          for (var k = -1, U = D.length; ++k < U; ) {
            var j = D[k], ne = j.size;
            switch (j.type) {
              case "drop":
                _ += ne;
                break;
              case "dropRight":
                w -= ne;
                break;
              case "take":
                w = fi(w, _ + ne);
                break;
              case "takeRight":
                _ = vn(_, w - ne);
                break;
            }
          }
          return { start: _, end: w };
        }
        function rw(_) {
          var w = _.match(Xd);
          return w ? w[1].split(Ay) : [];
        }
        function L0(_, w, D) {
          w = Go(w, _);
          for (var k = -1, U = w.length, j = !1; ++k < U; ) {
            var ne = so(w[k]);
            if (!(j = _ != null && D(_, ne)))
              break;
            _ = _[ne];
          }
          return j || ++k != U ? j : (U = _ == null ? 0 : _.length, !!U && ww(U) && Yr(ne, U) && ($t(_) || fv(_)));
        }
        function ev(_) {
          var w = _.length, D = new _.constructor(w);
          return w && typeof _[0] == "string" && hr.call(_, "index") && (D.index = _.index, D.input = _.input), D;
        }
        function Kn(_) {
          return typeof _.constructor == "function" && !Ds(_) ? Zf(to(_)) : {};
        }
        function kA(_, w, D) {
          var k = _.constructor;
          switch (w) {
            case Mo:
              return Zh(_);
            case de:
            case ve:
              return new k(+_);
            case Zn:
              return YS(_, D);
            case ia:
            case Qa:
            case Ja:
            case aa:
            case hh:
            case tl:
            case _y:
            case vh:
            case dh:
              return qS(_, D);
            case Xe:
              return new k();
            case $e:
            case ir:
              return new k(_);
            case Kt:
              return ZS(_);
            case wt:
              return new k();
            case Nr:
              return $S(_);
          }
        }
        function BA(_, w) {
          var D = w.length;
          if (!D)
            return _;
          var k = D - 1;
          return w[k] = (D > 1 ? "& " : "") + w[k], w = w.join(D > 2 ? ", " : " "), _.replace(Wd, `{
/* [wrapped with ` + w + `] */
`);
        }
        function Zp(_) {
          return $t(_) || fv(_) || !!(PS && _ && _[PS]);
        }
        function Yr(_, w) {
          var D = typeof _;
          return w = w ?? V, !!w && (D == "number" || D != "symbol" && eS.test(_)) && _ > -1 && _ % 1 == 0 && _ < w;
        }
        function Ni(_, w, D) {
          if (!ln(D))
            return !1;
          var k = typeof w;
          return (k == "number" ? za(D) && Yr(w, D.length) : k == "string" && w in D) ? Ps(D[w], _) : !1;
        }
        function dt(_, w) {
          if ($t(_))
            return !1;
          var D = typeof _;
          return D == "number" || D == "symbol" || D == "boolean" || _ == null || fo(_) ? !0 : jx.test(_) || !by.test(_) || w != null && _ in Lr(w);
        }
        function lc(_) {
          var w = typeof _;
          return w == "string" || w == "number" || w == "symbol" || w == "boolean" ? _ !== "__proto__" : _ === null;
        }
        function tv(_) {
          var w = sc(_), D = $[w];
          if (typeof D != "function" || !(w in Zt.prototype))
            return !1;
          if (_ === D)
            return !0;
          var k = Xp(D);
          return !!k && _ === k[0];
        }
        function nw(_) {
          return !!fp && fp in _;
        }
        var zA = Gf ? ku : cM;
        function Ds(_) {
          var w = _ && _.constructor, D = typeof w == "function" && w.prototype || Eo;
          return _ === D;
        }
        function rv(_) {
          return _ === _ && !ln(_);
        }
        function $p(_, w) {
          return function(D) {
            return D == null ? !1 : D[_] === w && (w !== r || _ in Lr(D));
          };
        }
        function iw(_) {
          var w = _e(_, function(k) {
            return D.size === u && D.clear(), k;
          }), D = w.cache;
          return w;
        }
        function aw(_, w) {
          var D = _[1], k = w[1], U = D | k, j = U < (y | x | E), ne = k == E && D == T || k == E && D == P && _[7].length <= w[8] || k == (E | P) && w[7].length <= w[8] && D == T;
          if (!(j || ne))
            return _;
          k & y && (_[2] = w[2], U |= D & y ? 0 : S);
          var le = w[3];
          if (le) {
            var ge = _[3];
            _[3] = ge ? jS(ge, le, w[4]) : le, _[4] = ge ? Aa(_[3], f) : w[4];
          }
          return le = w[5], le && (ge = _[5], _[5] = ge ? m0(ge, le, w[6]) : le, _[6] = ge ? Aa(_[5], f) : w[6]), le = w[7], le && (_[7] = le), k & E && (_[8] = _[8] == null ? w[8] : fi(_[8], w[8])), _[9] == null && (_[9] = w[9]), _[0] = w[0], _[1] = U, _;
        }
        function ow(_) {
          var w = [];
          if (_ != null)
            for (var D in Lr(_))
              w.push(D);
          return w;
        }
        function D0(_) {
          return Dh.call(_);
        }
        function qp(_, w, D) {
          return w = vn(w === r ? _.length - 1 : w, 0), function() {
            for (var k = arguments, U = -1, j = vn(k.length - w, 0), ne = we(j); ++U < j; )
              ne[U] = k[w + U];
            U = -1;
            for (var le = we(w + 1); ++U < w; )
              le[U] = k[U];
            return le[w] = D(ne), Pi(_, this, le);
          };
        }
        function On(_, w) {
          return w.length < 2 ? _ : ws(_, gi(w, 0, -1));
        }
        function ao(_, w) {
          for (var D = _.length, k = fi(w.length, D), U = Ri(_); k--; ) {
            var j = w[k];
            _[k] = Yr(j, D) ? U[j] : r;
          }
          return _;
        }
        function Uo(_, w) {
          if (!(w === "constructor" && typeof _[w] == "function") && w != "__proto__")
            return _[w];
        }
        var E0 = oo(Rp), uc = jy || function(_, w) {
          return Wr.setTimeout(_, w);
        }, ca = oo(Fo);
        function P0(_, w, D) {
          var k = w + "";
          return ca(_, BA(k, sw(rw(k), D)));
        }
        function oo(_) {
          var w = 0, D = 0;
          return function() {
            var k = RA(), U = z - (k - D);
            if (D = k, U > 0) {
              if (++w >= G)
                return arguments[0];
            } else
              w = 0;
            return _.apply(r, arguments);
          };
        }
        function jp(_, w) {
          var D = -1, k = _.length, U = k - 1;
          for (w = w === r ? k : w; ++D < w; ) {
            var j = ec(D, U), ne = _[j];
            _[j] = _[D], _[D] = ne;
          }
          return _.length = w, _;
        }
        var I0 = iw(function(_) {
          var w = [];
          return _.charCodeAt(0) === 46 && w.push(""), _.replace(ph, function(D, k, U, j) {
            w.push(U ? j.replace(fA, "$1") : k || D);
          }), w;
        });
        function so(_) {
          if (typeof _ == "string" || fo(_))
            return _;
          var w = _ + "";
          return w == "0" && 1 / _ == -ee ? "-0" : w;
        }
        function xl(_) {
          if (_ != null) {
            try {
              return Lh.call(_);
            } catch {
            }
            try {
              return _ + "";
            } catch {
            }
          }
          return "";
        }
        function sw(_, w) {
          return ui(oe, function(D) {
            var k = "_." + D[0];
            w & D[1] && !ip(_, k) && _.push(k);
          }), _.sort();
        }
        function lw(_) {
          if (_ instanceof Zt)
            return _.clone();
          var w = new ci(_.__wrapped__, _.__chain__);
          return w.__actions__ = Ri(_.__actions__), w.__index__ = _.__index__, w.__values__ = _.__values__, w;
        }
        function Kp(_, w, D) {
          (D ? Ni(_, w, D) : w === r) ? w = 1 : w = vn(Jt(w), 0);
          var k = _ == null ? 0 : _.length;
          if (!k || w < 1)
            return [];
          for (var U = 0, j = 0, ne = we(mu(k / w)); U < k; )
            ne[j++] = gi(_, U, U += w);
          return ne;
        }
        function R0(_) {
          for (var w = -1, D = _ == null ? 0 : _.length, k = 0, U = []; ++w < D; ) {
            var j = _[w];
            j && (U[k++] = j);
          }
          return U;
        }
        function ka() {
          var _ = arguments.length;
          if (!_)
            return [];
          for (var w = we(_ - 1), D = arguments[0], k = _; k--; )
            w[k - 1] = arguments[k];
          return sl($t(D) ? Ri(D) : [D], tn(w, 1));
        }
        var vr = Qt(function(_, w) {
          return Mn(_) ? ko(_, tn(w, 1, Mn, !0)) : [];
        }), Nn = Qt(function(_, w) {
          var D = ki(w);
          return Mn(D) && (D = r), Mn(_) ? ko(_, tn(w, 1, Mn, !0), Et(D, 2)) : [];
        }), dn = Qt(function(_, w) {
          var D = ki(w);
          return Mn(D) && (D = r), Mn(_) ? ko(_, tn(w, 1, Mn, !0), r, D) : [];
        });
        function Qn(_, w, D) {
          var k = _ == null ? 0 : _.length;
          return k ? (w = D || w === r ? 1 : Jt(w), gi(_, w < 0 ? 0 : w, k)) : [];
        }
        function ha(_, w, D) {
          var k = _ == null ? 0 : _.length;
          return k ? (w = D || w === r ? 1 : Jt(w), w = k - w, gi(_, 0, w < 0 ? 0 : w)) : [];
        }
        function fc(_, w) {
          return _ && _.length ? Xh(_, Et(w, 3), !0, !0) : [];
        }
        function An(_, w) {
          return _ && _.length ? Xh(_, Et(w, 3), !0) : [];
        }
        function nv(_, w, D, k) {
          var U = _ == null ? 0 : _.length;
          return U ? (D && typeof D != "number" && Ni(_, w, D) && (D = 0, k = U), HS(_, w, D, k)) : [];
        }
        function Sl(_, w, D) {
          var k = _ == null ? 0 : _.length;
          if (!k)
            return -1;
          var U = D == null ? 0 : Jt(D);
          return U < 0 && (U = vn(k + U, 0)), ap(_, Et(w, 3), U);
        }
        function iv(_, w, D) {
          var k = _ == null ? 0 : _.length;
          if (!k)
            return -1;
          var U = k - 1;
          return D !== r && (U = Jt(D), U = D < 0 ? vn(k + U, 0) : fi(U, k - 1)), ap(_, Et(w, 3), U, !0);
        }
        function Qp(_) {
          var w = _ == null ? 0 : _.length;
          return w ? tn(_, 1) : [];
        }
        function av(_) {
          var w = _ == null ? 0 : _.length;
          return w ? tn(_, ee) : [];
        }
        function Ki(_, w) {
          var D = _ == null ? 0 : _.length;
          return D ? (w = w === r ? 1 : Jt(w), tn(_, w)) : [];
        }
        function O0(_) {
          for (var w = -1, D = _ == null ? 0 : _.length, k = {}; ++w < D; ) {
            var U = _[w];
            k[U[0]] = U[1];
          }
          return k;
        }
        function Eu(_) {
          return _ && _.length ? _[0] : r;
        }
        function Es(_, w, D) {
          var k = _ == null ? 0 : _.length;
          if (!k)
            return -1;
          var U = D == null ? 0 : Jt(D);
          return U < 0 && (U = vn(k + U, 0)), kf(_, w, U);
        }
        function Jp(_) {
          var w = _ == null ? 0 : _.length;
          return w ? gi(_, 0, -1) : [];
        }
        var N0 = Qt(function(_) {
          var w = kr(_, nc);
          return w.length && w[0] === _[0] ? Lp(w) : [];
        }), wl = Qt(function(_) {
          var w = ki(_), D = kr(_, nc);
          return w === ki(D) ? w = r : D.pop(), D.length && D[0] === _[0] ? Lp(D, Et(w, 2)) : [];
        }), eg = Qt(function(_) {
          var w = ki(_), D = kr(_, nc);
          return w = typeof w == "function" ? w : r, w && D.pop(), D.length && D[0] === _[0] ? Lp(D, r, w) : [];
        });
        function Tl(_, w) {
          return _ == null ? "" : gp.call(_, w);
        }
        function ki(_) {
          var w = _ == null ? 0 : _.length;
          return w ? _[w - 1] : r;
        }
        function ov(_, w, D) {
          var k = _ == null ? 0 : _.length;
          if (!k)
            return -1;
          var U = k;
          return D !== r && (U = Jt(D), U = U < 0 ? vn(k + U, 0) : fi(U, k - 1)), w === w ? DA(_, w, U) : ap(_, mS, U, !0);
        }
        function k0(_, w) {
          return _ && _.length ? Ip(_, Jt(w)) : r;
        }
        var tg = Qt(sv);
        function sv(_, w) {
          return _ && _.length && w && w.length ? on(_, w) : _;
        }
        function Bi(_, w, D) {
          return _ && _.length && w && w.length ? on(_, w, Et(D, 2)) : _;
        }
        function bl(_, w, D) {
          return _ && _.length && w && w.length ? on(_, w, r, D) : _;
        }
        var lo = Ho(function(_, w) {
          var D = _ == null ? 0 : _.length, k = Cp(_, w);
          return Cn(_, kr(w, function(U) {
            return Yr(U, D) ? +U : U;
          }).sort(g0)), k;
        });
        function Qi(_, w) {
          var D = [];
          if (!(_ && _.length))
            return D;
          var k = -1, U = [], j = _.length;
          for (w = Et(w, 3); ++k < j; ) {
            var ne = _[k];
            w(ne, k, _) && (D.push(ne), U.push(k));
          }
          return Cn(_, U), D;
        }
        function rg(_) {
          return _ == null ? _ : mp.call(_);
        }
        function B0(_, w, D) {
          var k = _ == null ? 0 : _.length;
          return k ? (D && typeof D != "number" && Ni(_, w, D) ? (w = 0, D = k) : (w = w == null ? 0 : Jt(w), D = D === r ? k : Jt(D)), gi(_, w, D)) : [];
        }
        function z0(_, w) {
          return tc(_, w);
        }
        function FA(_, w, D) {
          return Op(_, w, Et(D, 2));
        }
        function Cl(_, w) {
          var D = _ == null ? 0 : _.length;
          if (D) {
            var k = tc(_, w);
            if (k < D && Ps(_[k], w))
              return k;
          }
          return -1;
        }
        function uw(_, w) {
          return tc(_, w, !0);
        }
        function F0(_, w, D) {
          return Op(_, w, Et(D, 2), !0);
        }
        function Pu(_, w) {
          var D = _ == null ? 0 : _.length;
          if (D) {
            var k = tc(_, w, !0) - 1;
            if (Ps(_[k], w))
              return k;
          }
          return -1;
        }
        function G0(_) {
          return _ && _.length ? c0(_) : [];
        }
        function Iu(_, w) {
          return _ && _.length ? c0(_, Et(w, 2)) : [];
        }
        function fw(_) {
          var w = _ == null ? 0 : _.length;
          return w ? gi(_, 1, w) : [];
        }
        function cw(_, w, D) {
          return _ && _.length ? (w = D || w === r ? 1 : Jt(w), gi(_, 0, w < 0 ? 0 : w)) : [];
        }
        function V0(_, w, D) {
          var k = _ == null ? 0 : _.length;
          return k ? (w = D || w === r ? 1 : Jt(w), w = k - w, gi(_, w < 0 ? 0 : w, k)) : [];
        }
        function ng(_, w) {
          return _ && _.length ? Xh(_, Et(w, 3), !1, !0) : [];
        }
        function GA(_, w) {
          return _ && _.length ? Xh(_, Et(w, 3)) : [];
        }
        var VA = Qt(function(_) {
          return As(tn(_, 1, Mn, !0));
        }), hw = Qt(function(_) {
          var w = ki(_);
          return Mn(w) && (w = r), As(tn(_, 1, Mn, !0), Et(w, 2));
        }), vw = Qt(function(_) {
          var w = ki(_);
          return w = typeof w == "function" ? w : r, As(tn(_, 1, Mn, !0), r, w);
        });
        function Ru(_) {
          return _ && _.length ? As(_) : [];
        }
        function HA(_, w) {
          return _ && _.length ? As(_, Et(w, 2)) : [];
        }
        function cc(_, w) {
          return w = typeof w == "function" ? w : r, _ && _.length ? As(_, r, w) : [];
        }
        function ig(_) {
          if (!(_ && _.length))
            return [];
          var w = 0;
          return _ = ol(_, function(D) {
            if (Mn(D))
              return w = vn(D.length, w), !0;
          }), Xy(w, function(D) {
            return kr(_, Uy(D));
          });
        }
        function Qr(_, w) {
          if (!(_ && _.length))
            return [];
          var D = ig(_);
          return w == null ? D : kr(D, function(k) {
            return Pi(w, r, k);
          });
        }
        var UA = Qt(function(_, w) {
          return Mn(_) ? ko(_, w) : [];
        }), dw = Qt(function(_) {
          return kp(ol(_, Mn));
        }), WA = Qt(function(_) {
          var w = ki(_);
          return Mn(w) && (w = r), kp(ol(_, Mn), Et(w, 2));
        }), XA = Qt(function(_) {
          var w = ki(_);
          return w = typeof w == "function" ? w : r, kp(ol(_, Mn), r, w);
        }), pw = Qt(ig);
        function gw(_, w) {
          return Yh(_ || [], w || [], wu);
        }
        function YA(_, w) {
          return Yh(_ || [], w || [], Mu);
        }
        var Ba = Qt(function(_) {
          var w = _.length, D = w > 1 ? _[w - 1] : r;
          return D = typeof D == "function" ? (_.pop(), D) : r, Qr(_, D);
        });
        function ag(_) {
          var w = $(_);
          return w.__chain__ = !0, w;
        }
        function ZA(_, w) {
          return w(_), _;
        }
        function uo(_, w) {
          return w(_);
        }
        var og = Ho(function(_) {
          var w = _.length, D = w ? _[0] : 0, k = this.__wrapped__, U = function(j) {
            return Cp(j, _);
          };
          return w > 1 || this.__actions__.length || !(k instanceof Zt) || !Yr(D) ? this.thru(U) : (k = k.slice(D, +D + (w ? 1 : 0)), k.__actions__.push({
            func: uo,
            args: [U],
            thisArg: r
          }), new ci(k, this.__chain__).thru(function(j) {
            return w && !j.length && j.push(r), j;
          }));
        });
        function Ou() {
          return ag(this);
        }
        function sg() {
          return new ci(this.value(), this.__chain__);
        }
        function H0() {
          this.__values__ === r && (this.__values__ = v3(this.value()));
          var _ = this.__index__ >= this.__values__.length, w = _ ? r : this.__values__[this.__index__++];
          return { done: _, value: w };
        }
        function U0() {
          return this;
        }
        function $A(_) {
          for (var w, D = this; D instanceof Io; ) {
            var k = lw(D);
            k.__index__ = 0, k.__values__ = r, w ? U.__wrapped__ = k : w = k;
            var U = k;
            D = D.__wrapped__;
          }
          return U.__wrapped__ = _, w;
        }
        function W0() {
          var _ = this.__wrapped__;
          if (_ instanceof Zt) {
            var w = _;
            return this.__actions__.length && (w = new Zt(this)), w = w.reverse(), w.__actions__.push({
              func: uo,
              args: [rg],
              thisArg: r
            }), new ci(w, this.__chain__);
          }
          return this.thru(rg);
        }
        function qA() {
          return rc(this.__wrapped__, this.__actions__);
        }
        var mw = Fp(function(_, w, D) {
          hr.call(_, D) ? ++_[D] : No(_, D, 1);
        });
        function yw(_, w, D) {
          var k = $t(_) ? zy : Fh;
          return D && Ni(_, w, D) && (w = r), k(_, Et(w, 3));
        }
        function lg(_, w) {
          var D = $t(_) ? ol : r0;
          return D(_, Et(w, 3));
        }
        var ug = Du(Sl), _w = Du(iv);
        function X0(_, w) {
          return tn(Nu(_, w), 1);
        }
        function jA(_, w) {
          return tn(Nu(_, w), ee);
        }
        function xw(_, w, D) {
          return D = D === r ? 1 : Jt(D), tn(Nu(_, w), D);
        }
        function fg(_, w) {
          var D = $t(_) ? ui : Bo;
          return D(_, Et(w, 3));
        }
        function lv(_, w) {
          var D = $t(_) ? np : VS;
          return D(_, Et(w, 3));
        }
        var Y0 = Fp(function(_, w, D) {
          hr.call(_, D) ? _[D].push(w) : No(_, D, [w]);
        });
        function cg(_, w, D, k) {
          _ = za(_) ? _ : dg(_), D = D && !k ? Jt(D) : 0;
          var U = _.length;
          return D < 0 && (D = vn(U + D, 0)), Tw(_) ? D <= U && _.indexOf(w, D) > -1 : !!U && kf(_, w, D) > -1;
        }
        var Sw = Qt(function(_, w, D) {
          var k = -1, U = typeof w == "function", j = za(_) ? we(_.length) : [];
          return Bo(_, function(ne) {
            j[++k] = U ? Pi(w, ne, D) : Ia(ne, w, D);
          }), j;
        }), KA = Fp(function(_, w, D) {
          No(_, D, w);
        });
        function Nu(_, w) {
          var D = $t(_) ? kr : o0;
          return D(_, Et(w, 3));
        }
        function QA(_, w, D, k) {
          return _ == null ? [] : ($t(w) || (w = w == null ? [] : [w]), D = k ? r : D, $t(D) || (D = D == null ? [] : [D]), Uh(_, w, D));
        }
        var uv = Fp(function(_, w, D) {
          _[D ? 0 : 1].push(w);
        }, function() {
          return [[], []];
        });
        function JA(_, w, D) {
          var k = $t(_) ? Gy : _S, U = arguments.length < 3;
          return k(_, Et(w, 4), D, U, Bo);
        }
        function hg(_, w, D) {
          var k = $t(_) ? SA : _S, U = arguments.length < 3;
          return k(_, Et(w, 4), D, U, VS);
        }
        function p(_, w) {
          var D = $t(_) ? ol : r0;
          return D(_, Ye(Et(w, 3)));
        }
        function m(_) {
          var w = $t(_) ? Oo : pi;
          return w(_);
        }
        function b(_, w, D) {
          (D ? Ni(_, w, D) : w === r) ? w = 1 : w = Jt(w);
          var k = $t(_) ? Su : u0;
          return k(_, w);
        }
        function L(_) {
          var w = $t(_) ? FS : Oa;
          return w(_);
        }
        function I(_) {
          if (_ == null)
            return 0;
          if (za(_))
            return Tw(_) ? pu(_) : _.length;
          var w = jn(_);
          return w == Xe || w == wt ? _.size : Cs(_).length;
        }
        function B(_, w, D) {
          var k = $t(_) ? Vy : f0;
          return D && Ni(_, w, D) && (w = r), k(_, Et(w, 3));
        }
        var Y = Qt(function(_, w) {
          if (_ == null)
            return [];
          var D = w.length;
          return D > 1 && Ni(_, w[0], w[1]) ? w = [] : D > 2 && Ni(w[0], w[1], w[2]) && (w = [w[0]]), Uh(_, tn(w, 1), []);
        }), re = Fr || function() {
          return Wr.Date.now();
        };
        function se(_, w) {
          if (typeof w != "function")
            throw new Ma(o);
          return _ = Jt(_), function() {
            if (--_ < 1)
              return w.apply(this, arguments);
          };
        }
        function Te(_, w, D) {
          return w = D ? r : w, w = _ && w == null ? _.length : w, Vo(_, E, r, r, r, r, w);
        }
        function ke(_, w) {
          var D;
          if (typeof w != "function")
            throw new Ma(o);
          return _ = Jt(_), function() {
            return --_ > 0 && (D = w.apply(this, arguments)), _ <= 1 && (w = r), D;
          };
        }
        var Ve = Qt(function(_, w, D) {
          var k = y;
          if (D.length) {
            var U = Aa(D, Ls(Ve));
            k |= A;
          }
          return Vo(_, k, w, D, U);
        }), Ne = Qt(function(_, w, D) {
          var k = y | x;
          if (D.length) {
            var U = Aa(D, Ls(Ne));
            k |= A;
          }
          return Vo(w, k, _, D, U);
        });
        function ut(_, w, D) {
          w = D ? r : w;
          var k = Vo(_, T, r, r, r, r, r, w);
          return k.placeholder = ut.placeholder, k;
        }
        function gt(_, w, D) {
          w = D ? r : w;
          var k = Vo(_, C, r, r, r, r, r, w);
          return k.placeholder = gt.placeholder, k;
        }
        function mt(_, w, D) {
          var k, U, j, ne, le, ge, Pe = 0, Re = !1, ze = !1, at = !0;
          if (typeof _ != "function")
            throw new Ma(o);
          w = Wo(w) || 0, ln(D) && (Re = !!D.leading, ze = "maxWait" in D, j = ze ? vn(Wo(D.maxWait) || 0, w) : j, at = "trailing" in D ? !!D.trailing : at);
          function xt(Ln) {
            var Is = k, zu = U;
            return k = U = r, Pe = Ln, ne = _.apply(zu, Is), ne;
          }
          function Nt(Ln) {
            return Pe = Ln, le = uc(lr, w), Re ? xt(Ln) : ne;
          }
          function tr(Ln) {
            var Is = Ln - ge, zu = Ln - Pe, A3 = w - Is;
            return ze ? fi(A3, j - zu) : A3;
          }
          function kt(Ln) {
            var Is = Ln - ge, zu = Ln - Pe;
            return ge === r || Is >= w || Is < 0 || ze && zu >= j;
          }
          function lr() {
            var Ln = re();
            if (kt(Ln))
              return dr(Ln);
            le = uc(lr, tr(Ln));
          }
          function dr(Ln) {
            return le = r, at && k ? xt(Ln) : (k = U = r, ne);
          }
          function co() {
            le !== r && d0(le), Pe = 0, k = ge = U = le = r;
          }
          function va() {
            return le === r ? ne : dr(re());
          }
          function ho() {
            var Ln = re(), Is = kt(Ln);
            if (k = arguments, U = this, ge = Ln, Is) {
              if (le === r)
                return Nt(ge);
              if (ze)
                return d0(le), le = uc(lr, w), xt(ge);
            }
            return le === r && (le = uc(lr, w)), ne;
          }
          return ho.cancel = co, ho.flush = va, ho;
        }
        var sn = Qt(function(_, w) {
          return t0(_, 1, w);
        }), ye = Qt(function(_, w, D) {
          return t0(_, Wo(w) || 0, D);
        });
        function ce(_) {
          return Vo(_, R);
        }
        function _e(_, w) {
          if (typeof _ != "function" || w != null && typeof w != "function")
            throw new Ma(o);
          var D = function() {
            var k = arguments, U = w ? w.apply(this, k) : k[0], j = D.cache;
            if (j.has(U))
              return j.get(U);
            var ne = _.apply(this, k);
            return D.cache = j.set(U, ne) || j, ne;
          };
          return D.cache = new (_e.Cache || La)(), D;
        }
        _e.Cache = La;
        function Ye(_) {
          if (typeof _ != "function")
            throw new Ma(o);
          return function() {
            var w = arguments;
            switch (w.length) {
              case 0:
                return !_.call(this);
              case 1:
                return !_.call(this, w[0]);
              case 2:
                return !_.call(this, w[0], w[1]);
              case 3:
                return !_.call(this, w[0], w[1], w[2]);
            }
            return !_.apply(this, w);
          };
        }
        function yt(_) {
          return ke(2, _);
        }
        var Dt = XS(function(_, w) {
          w = w.length == 1 && $t(w[0]) ? kr(w[0], oa(Et())) : kr(tn(w, 1), oa(Et()));
          var D = w.length;
          return Qt(function(k) {
            for (var U = -1, j = fi(k.length, D); ++U < j; )
              k[U] = w[U].call(this, k[U]);
            return Pi(_, this, k);
          });
        }), Ct = Qt(function(_, w) {
          var D = Aa(w, Ls(Ct));
          return Vo(_, A, r, w, D);
        }), Ot = Qt(function(_, w) {
          var D = Aa(w, Ls(Ot));
          return Vo(_, M, r, w, D);
        }), kn = Ho(function(_, w) {
          return Vo(_, P, r, r, r, w);
        });
        function _r(_, w) {
          if (typeof _ != "function")
            throw new Ma(o);
          return w = w === r ? w : Jt(w), Qt(_, w);
        }
        function Al(_, w) {
          if (typeof _ != "function")
            throw new Ma(o);
          return w = w == null ? 0 : vn(Jt(w), 0), Qt(function(D) {
            var k = D[w], U = Ms(D, 0, w);
            return k && sl(U, k), Pi(_, this, U);
          });
        }
        function eM(_, w, D) {
          var k = !0, U = !0;
          if (typeof _ != "function")
            throw new Ma(o);
          return ln(D) && (k = "leading" in D ? !!D.leading : k, U = "trailing" in D ? !!D.trailing : U), mt(_, w, {
            leading: k,
            maxWait: w,
            trailing: U
          });
        }
        function DZ(_) {
          return Te(_, 1);
        }
        function EZ(_, w) {
          return Ct(Bp(w), _);
        }
        function PZ() {
          if (!arguments.length)
            return [];
          var _ = arguments[0];
          return $t(_) ? _ : [_];
        }
        function IZ(_) {
          return qi(_, v);
        }
        function RZ(_, w) {
          return w = typeof w == "function" ? w : r, qi(_, v, w);
        }
        function OZ(_) {
          return qi(_, c | v);
        }
        function NZ(_, w) {
          return w = typeof w == "function" ? w : r, qi(_, c | v, w);
        }
        function kZ(_, w) {
          return w == null || zh(_, w, mi(w));
        }
        function Ps(_, w) {
          return _ === w || _ !== _ && w !== w;
        }
        var BZ = Wp(gl), zZ = Wp(function(_, w) {
          return _ >= w;
        }), fv = Dp(/* @__PURE__ */ (function() {
          return arguments;
        })()) ? Dp : function(_) {
          return pn(_) && hr.call(_, "callee") && !vp.call(_, "callee");
        }, $t = we.isArray, FZ = ky ? oa(ky) : US;
        function za(_) {
          return _ != null && ww(_.length) && !ku(_);
        }
        function Mn(_) {
          return pn(_) && za(_);
        }
        function GZ(_) {
          return _ === !0 || _ === !1 || pn(_) && $n(_) == de;
        }
        var hc = Ky || cM, VZ = Xi ? oa(Xi) : bs;
        function HZ(_) {
          return pn(_) && _.nodeType === 1 && !Z0(_);
        }
        function UZ(_) {
          if (_ == null)
            return !0;
          if (za(_) && ($t(_) || typeof _ == "string" || typeof _.splice == "function" || hc(_) || vg(_) || fv(_)))
            return !_.length;
          var w = jn(_);
          if (w == Xe || w == wt)
            return !_.size;
          if (Ds(_))
            return !Cs(_).length;
          for (var D in _)
            if (hr.call(_, D))
              return !1;
          return !0;
        }
        function WZ(_, w) {
          return Ra(_, w);
        }
        function XZ(_, w, D) {
          D = typeof D == "function" ? D : r;
          var k = D ? D(_, w) : r;
          return k === r ? Ra(_, w, r, D) : !!k;
        }
        function tM(_) {
          if (!pn(_))
            return !1;
          var w = $n(_);
          return w == be || w == Ae || typeof _.message == "string" && typeof _.name == "string" && !Z0(_);
        }
        function YZ(_) {
          return typeof _ == "number" && Hf(_);
        }
        function ku(_) {
          if (!ln(_))
            return !1;
          var w = $n(_);
          return w == De || w == Ue || w == me || w == mr;
        }
        function u3(_) {
          return typeof _ == "number" && _ == Jt(_);
        }
        function ww(_) {
          return typeof _ == "number" && _ > -1 && _ % 1 == 0 && _ <= V;
        }
        function ln(_) {
          var w = typeof _;
          return _ != null && (w == "object" || w == "function");
        }
        function pn(_) {
          return _ != null && typeof _ == "object";
        }
        var f3 = du ? oa(du) : WS;
        function ZZ(_, w) {
          return _ === w || Qf(_, w, Jh(w));
        }
        function $Z(_, w, D) {
          return D = typeof D == "function" ? D : r, Qf(_, w, Jh(w), D);
        }
        function qZ(_) {
          return c3(_) && _ != +_;
        }
        function jZ(_) {
          if (zA(_))
            throw new Ft(a);
          return i0(_);
        }
        function KZ(_) {
          return _ === null;
        }
        function QZ(_) {
          return _ == null;
        }
        function c3(_) {
          return typeof _ == "number" || pn(_) && $n(_) == $e;
        }
        function Z0(_) {
          if (!pn(_) || $n(_) != Lt)
            return !1;
          var w = to(_);
          if (w === null)
            return !0;
          var D = hr.call(w, "constructor") && w.constructor;
          return typeof D == "function" && D instanceof D && Lh.call(D) == cp;
        }
        var rM = rp ? oa(rp) : Vh;
        function JZ(_) {
          return u3(_) && _ >= -V && _ <= V;
        }
        var h3 = Nf ? oa(Nf) : zo;
        function Tw(_) {
          return typeof _ == "string" || !$t(_) && pn(_) && $n(_) == ir;
        }
        function fo(_) {
          return typeof _ == "symbol" || pn(_) && $n(_) == Nr;
        }
        var vg = dS ? oa(dS) : Hh;
        function e$(_) {
          return _ === r;
        }
        function t$(_) {
          return pn(_) && jn(_) == na;
        }
        function r$(_) {
          return pn(_) && $n(_) == su;
        }
        var n$ = Wp(ml), i$ = Wp(function(_, w) {
          return _ <= w;
        });
        function v3(_) {
          if (!_)
            return [];
          if (za(_))
            return Tw(_) ? sa(_) : Ri(_);
          if (_s && _[_s])
            return MA(_[_s]());
          var w = jn(_), D = w == Xe ? sp : w == wt ? ll : dg;
          return D(_);
        }
        function Bu(_) {
          if (!_)
            return _ === 0 ? _ : 0;
          if (_ = Wo(_), _ === ee || _ === -ee) {
            var w = _ < 0 ? -1 : 1;
            return w * Q;
          }
          return _ === _ ? _ : 0;
        }
        function Jt(_) {
          var w = Bu(_), D = w % 1;
          return w === w ? D ? w - D : w : 0;
        }
        function d3(_) {
          return _ ? Ss(Jt(_), 0, X) : 0;
        }
        function Wo(_) {
          if (typeof _ == "number")
            return _;
          if (fo(_))
            return q;
          if (ln(_)) {
            var w = typeof _.valueOf == "function" ? _.valueOf() : _;
            _ = ln(w) ? w + "" : w;
          }
          if (typeof _ != "string")
            return _ === 0 ? _ : +_;
          _ = xS(_);
          var D = cA.test(_);
          return D || Jx.test(_) ? ep(_.slice(2), D ? 2 : 8) : Kx.test(_) ? q : +_;
        }
        function p3(_) {
          return no(_, Fa(_));
        }
        function a$(_) {
          return _ ? Ss(Jt(_), -V, V) : _ === 0 ? _ : 0;
        }
        function Dr(_) {
          return _ == null ? "" : ji(_);
        }
        var o$ = ic(function(_, w) {
          if (Ds(w) || za(w)) {
            no(w, mi(w), _);
            return;
          }
          for (var D in w)
            hr.call(w, D) && wu(_, D, w[D]);
        }), g3 = ic(function(_, w) {
          no(w, Fa(w), _);
        }), bw = ic(function(_, w, D, k) {
          no(w, Fa(w), _, k);
        }), s$ = ic(function(_, w, D, k) {
          no(w, mi(w), _, k);
        }), l$ = Ho(Cp);
        function u$(_, w) {
          var D = Zf(_);
          return w == null ? D : Vr(D, w);
        }
        var f$ = Qt(function(_, w) {
          _ = Lr(_);
          var D = -1, k = w.length, U = k > 2 ? w[2] : r;
          for (U && Ni(w[0], w[1], U) && (k = 1); ++D < k; )
            for (var j = w[D], ne = Fa(j), le = -1, ge = ne.length; ++le < ge; ) {
              var Pe = ne[le], Re = _[Pe];
              (Re === r || Ps(Re, Eo[Pe]) && !hr.call(_, Pe)) && (_[Pe] = j[Pe]);
            }
          return _;
        }), c$ = Qt(function(_) {
          return _.push(r, T0), Pi(m3, r, _);
        });
        function h$(_, w) {
          return gS(_, Et(w, 3), fa);
        }
        function v$(_, w) {
          return gS(_, Et(w, 3), pl);
        }
        function d$(_, w) {
          return _ == null ? _ : Ap(_, Et(w, 3), Fa);
        }
        function p$(_, w) {
          return _ == null ? _ : Gh(_, Et(w, 3), Fa);
        }
        function g$(_, w) {
          return _ && fa(_, Et(w, 3));
        }
        function m$(_, w) {
          return _ && pl(_, Et(w, 3));
        }
        function y$(_) {
          return _ == null ? [] : Kf(_, mi(_));
        }
        function _$(_) {
          return _ == null ? [] : Kf(_, Fa(_));
        }
        function nM(_, w, D) {
          var k = _ == null ? r : ws(_, w);
          return k === r ? D : k;
        }
        function x$(_, w) {
          return _ != null && L0(_, w, Pa);
        }
        function iM(_, w) {
          return _ != null && L0(_, w, bu);
        }
        var S$ = KS(function(_, w, D) {
          w != null && typeof w.toString != "function" && (w = Dh.call(w)), _[w] = D;
        }, oM(Ga)), w$ = KS(function(_, w, D) {
          w != null && typeof w.toString != "function" && (w = Dh.call(w)), hr.call(_, w) ? _[w].push(D) : _[w] = [D];
        }, Et), T$ = Qt(Ia);
        function mi(_) {
          return za(_) ? Ro(_) : Cs(_);
        }
        function Fa(_) {
          return za(_) ? Ro(_, !0) : a0(_);
        }
        function b$(_, w) {
          var D = {};
          return w = Et(w, 3), fa(_, function(k, U, j) {
            No(D, w(k, U, j), k);
          }), D;
        }
        function C$(_, w) {
          var D = {};
          return w = Et(w, 3), fa(_, function(k, U, j) {
            No(D, U, w(k, U, j));
          }), D;
        }
        var A$ = ic(function(_, w, D) {
          Cu(_, w, D);
        }), m3 = ic(function(_, w, D, k) {
          Cu(_, w, D, k);
        }), M$ = Ho(function(_, w) {
          var D = {};
          if (_ == null)
            return D;
          var k = !1;
          w = kr(w, function(j) {
            return j = Go(j, _), k || (k = j.length > 1), j;
          }), no(_, Kh(_), D), k && (D = qi(D, c | h | v, b0));
          for (var U = w.length; U--; )
            Np(D, w[U]);
          return D;
        });
        function L$(_, w) {
          return y3(_, Ye(Et(w)));
        }
        var D$ = Ho(function(_, w) {
          return _ == null ? {} : l0(_, w);
        });
        function y3(_, w) {
          if (_ == null)
            return {};
          var D = kr(Kh(_), function(k) {
            return [k];
          });
          return w = Et(w), yl(_, D, function(k, U) {
            return w(k, U[0]);
          });
        }
        function E$(_, w, D) {
          w = Go(w, _);
          var k = -1, U = w.length;
          for (U || (U = 1, _ = r); ++k < U; ) {
            var j = _ == null ? r : _[so(w[k])];
            j === r && (k = U, j = D), _ = ku(j) ? j.call(_) : j;
          }
          return _;
        }
        function P$(_, w, D) {
          return _ == null ? _ : Mu(_, w, D);
        }
        function I$(_, w, D, k) {
          return k = typeof k == "function" ? k : r, _ == null ? _ : Mu(_, w, D, k);
        }
        var _3 = S0(mi), x3 = S0(Fa);
        function R$(_, w, D) {
          var k = $t(_), U = k || hc(_) || vg(_);
          if (w = Et(w, 4), D == null) {
            var j = _ && _.constructor;
            U ? D = k ? new j() : [] : ln(_) ? D = ku(j) ? Zf(to(_)) : {} : D = {};
          }
          return (U ? ui : fa)(_, function(ne, le, ge) {
            return w(D, ne, le, ge);
          }), D;
        }
        function O$(_, w) {
          return _ == null ? !0 : Np(_, w);
        }
        function N$(_, w, D) {
          return _ == null ? _ : v0(_, w, Bp(D));
        }
        function k$(_, w, D, k) {
          return k = typeof k == "function" ? k : r, _ == null ? _ : v0(_, w, Bp(D), k);
        }
        function dg(_) {
          return _ == null ? [] : Ah(_, mi(_));
        }
        function B$(_) {
          return _ == null ? [] : Ah(_, Fa(_));
        }
        function z$(_, w, D) {
          return D === r && (D = w, w = r), D !== r && (D = Wo(D), D = D === D ? D : 0), w !== r && (w = Wo(w), w = w === w ? w : 0), Ss(Wo(_), w, D);
        }
        function F$(_, w, D) {
          return w = Bu(w), D === r ? (D = w, w = 0) : D = Bu(D), _ = Wo(_), n0(_, w, D);
        }
        function G$(_, w, D) {
          if (D && typeof D != "boolean" && Ni(_, w, D) && (w = D = r), D === r && (typeof w == "boolean" ? (D = w, w = r) : typeof _ == "boolean" && (D = _, _ = r)), _ === r && w === r ? (_ = 0, w = 1) : (_ = Bu(_), w === r ? (w = _, _ = 0) : w = Bu(w)), _ > w) {
            var k = _;
            _ = w, w = k;
          }
          if (D || _ % 1 || w % 1) {
            var U = Rh();
            return fi(_ + U * (w - _ + Oy("1e-" + ((U + "").length - 1))), w);
          }
          return ec(_, w);
        }
        var V$ = Lu(function(_, w, D) {
          return w = w.toLowerCase(), _ + (D ? S3(w) : w);
        });
        function S3(_) {
          return aM(Dr(_).toLowerCase());
        }
        function w3(_) {
          return _ = Dr(_), _ && _.replace(tS, TS).replace(fS, "");
        }
        function H$(_, w, D) {
          _ = Dr(_), w = ji(w);
          var k = _.length;
          D = D === r ? k : Ss(Jt(D), 0, k);
          var U = D;
          return D -= w.length, D >= 0 && _.slice(D, U) == w;
        }
        function U$(_) {
          return _ = Dr(_), _ && Zx.test(_) ? _.replace(uu, bS) : _;
        }
        function W$(_) {
          return _ = Dr(_), _ && mh.test(_) ? _.replace(gh, "\\$&") : _;
        }
        var X$ = Lu(function(_, w, D) {
          return _ + (D ? "-" : "") + w.toLowerCase();
        }), Y$ = Lu(function(_, w, D) {
          return _ + (D ? " " : "") + w.toLowerCase();
        }), Z$ = y0("toLowerCase");
        function $$(_, w, D) {
          _ = Dr(_), w = Jt(w);
          var k = w ? pu(_) : 0;
          if (!w || k >= w)
            return _;
          var U = (w - k) / 2;
          return qh(ul(U), D) + _ + qh(mu(U), D);
        }
        function q$(_, w, D) {
          _ = Dr(_), w = Jt(w);
          var k = w ? pu(_) : 0;
          return w && k < w ? _ + qh(w - k, D) : _;
        }
        function j$(_, w, D) {
          _ = Dr(_), w = Jt(w);
          var k = w ? pu(_) : 0;
          return w && k < w ? qh(w - k, D) + _ : _;
        }
        function K$(_, w, D) {
          return D || w == null ? w = 0 : w && (w = +w), RS(Dr(_).replace(Cy, ""), w || 0);
        }
        function Q$(_, w, D) {
          return (D ? Ni(_, w, D) : w === r) ? w = 1 : w = Jt(w), Au(Dr(_), w);
        }
        function J$() {
          var _ = arguments, w = Dr(_[0]);
          return _.length < 3 ? w : w.replace(_[1], _[2]);
        }
        var eq = Lu(function(_, w, D) {
          return _ + (D ? "_" : "") + w.toLowerCase();
        });
        function tq(_, w, D) {
          return D && typeof D != "number" && Ni(_, w, D) && (w = D = r), D = D === r ? X : D >>> 0, D ? (_ = Dr(_), _ && (typeof w == "string" || w != null && !rM(w)) && (w = ji(w), !w && zf(_)) ? Ms(sa(_), 0, D) : _.split(w, D)) : [];
        }
        var rq = Lu(function(_, w, D) {
          return _ + (D ? " " : "") + aM(w);
        });
        function nq(_, w, D) {
          return _ = Dr(_), D = D == null ? 0 : Ss(Jt(D), 0, _.length), w = ji(w), _.slice(D, D + w.length) == w;
        }
        function iq(_, w, D) {
          var k = $.templateSettings;
          D && Ni(_, w, D) && (w = r), _ = Dr(_), w = bw({}, w, k, w0);
          var U = bw({}, w.imports, k.imports, w0), j = mi(U), ne = Ah(U, j), le, ge, Pe = 0, Re = w.interpolate || Yd, ze = "__p += '", at = Mh(
            (w.escape || Yd).source + "|" + Re.source + "|" + (Re === Ty ? fu : Yd).source + "|" + (w.evaluate || Yd).source + "|$",
            "g"
          ), xt = "//# sourceURL=" + (hr.call(w, "sourceURL") ? (w.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++yA + "]") + `
`;
          _.replace(at, function(kt, lr, dr, co, va, ho) {
            return dr || (dr = co), ze += _.slice(Pe, ho).replace(hA, CS), lr && (le = !0, ze += `' +
__e(` + lr + `) +
'`), va && (ge = !0, ze += `';
` + va + `;
__p += '`), dr && (ze += `' +
((__t = (` + dr + `)) == null ? '' : __t) +
'`), Pe = ho + kt.length, kt;
          }), ze += `';
`;
          var Nt = hr.call(w, "variable") && w.variable;
          if (!Nt)
            ze = `with (obj) {
` + ze + `
}
`;
          else if (uA.test(Nt))
            throw new Ft(s);
          ze = (ge ? ze.replace(xy, "") : ze).replace(Sy, "$1").replace(wy, "$1;"), ze = "function(" + (Nt || "obj") + `) {
` + (Nt ? "" : `obj || (obj = {});
`) + "var __t, __p = ''" + (le ? ", __e = _.escape" : "") + (ge ? `, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
` : `;
`) + ze + `return __p
}`;
          var tr = b3(function() {
            return yr(j, xt + "return " + ze).apply(r, ne);
          });
          if (tr.source = ze, tM(tr))
            throw tr;
          return tr;
        }
        function aq(_) {
          return Dr(_).toLowerCase();
        }
        function oq(_) {
          return Dr(_).toUpperCase();
        }
        function sq(_, w, D) {
          if (_ = Dr(_), _ && (D || w === r))
            return xS(_);
          if (!_ || !(w = ji(w)))
            return _;
          var k = sa(_), U = sa(w), j = SS(k, U), ne = Yy(k, U) + 1;
          return Ms(k, j, ne).join("");
        }
        function lq(_, w, D) {
          if (_ = Dr(_), _ && (D || w === r))
            return _.slice(0, up(_) + 1);
          if (!_ || !(w = ji(w)))
            return _;
          var k = sa(_), U = Yy(k, sa(w)) + 1;
          return Ms(k, 0, U).join("");
        }
        function uq(_, w, D) {
          if (_ = Dr(_), _ && (D || w === r))
            return _.replace(Cy, "");
          if (!_ || !(w = ji(w)))
            return _;
          var k = sa(_), U = SS(k, sa(w));
          return Ms(k, U).join("");
        }
        function fq(_, w) {
          var D = O, k = N;
          if (ln(w)) {
            var U = "separator" in w ? w.separator : U;
            D = "length" in w ? Jt(w.length) : D, k = "omission" in w ? ji(w.omission) : k;
          }
          _ = Dr(_);
          var j = _.length;
          if (zf(_)) {
            var ne = sa(_);
            j = ne.length;
          }
          if (D >= j)
            return _;
          var le = D - pu(k);
          if (le < 1)
            return k;
          var ge = ne ? Ms(ne, 0, le).join("") : _.slice(0, le);
          if (U === r)
            return ge + k;
          if (ne && (le += ge.length - le), rM(U)) {
            if (_.slice(le).search(U)) {
              var Pe, Re = ge;
              for (U.global || (U = Mh(U.source, Dr(My.exec(U)) + "g")), U.lastIndex = 0; Pe = U.exec(Re); )
                var ze = Pe.index;
              ge = ge.slice(0, ze === r ? le : ze);
            }
          } else if (_.indexOf(ji(U), le) != le) {
            var at = ge.lastIndexOf(U);
            at > -1 && (ge = ge.slice(0, at));
          }
          return ge + k;
        }
        function cq(_) {
          return _ = Dr(_), _ && Yx.test(_) ? _.replace(lu, AS) : _;
        }
        var hq = Lu(function(_, w, D) {
          return _ + (D ? " " : "") + w.toUpperCase();
        }), aM = y0("toUpperCase");
        function T3(_, w, D) {
          return _ = Dr(_), w = D ? r : w, w === r ? AA(_) ? EA(_) : TA(_) : _.match(w) || [];
        }
        var b3 = Qt(function(_, w) {
          try {
            return Pi(_, r, w);
          } catch (D) {
            return tM(D) ? D : new Ft(D);
          }
        }), vq = Ho(function(_, w) {
          return ui(w, function(D) {
            D = so(D), No(_, D, Ve(_[D], _));
          }), _;
        });
        function dq(_) {
          var w = _ == null ? 0 : _.length, D = Et();
          return _ = w ? kr(_, function(k) {
            if (typeof k[1] != "function")
              throw new Ma(o);
            return [D(k[0]), k[1]];
          }) : [], Qt(function(k) {
            for (var U = -1; ++U < w; ) {
              var j = _[U];
              if (Pi(j[0], this, k))
                return Pi(j[1], this, k);
            }
          });
        }
        function pq(_) {
          return GS(qi(_, c));
        }
        function oM(_) {
          return function() {
            return _;
          };
        }
        function gq(_, w) {
          return _ == null || _ !== _ ? w : _;
        }
        var mq = Hp(), yq = Hp(!0);
        function Ga(_) {
          return _;
        }
        function sM(_) {
          return Jf(typeof _ == "function" ? _ : qi(_, c));
        }
        function _q(_) {
          return Pp(qi(_, c));
        }
        function xq(_, w) {
          return Xr(_, qi(w, c));
        }
        var Sq = Qt(function(_, w) {
          return function(D) {
            return Ia(D, _, w);
          };
        }), wq = Qt(function(_, w) {
          return function(D) {
            return Ia(_, D, w);
          };
        });
        function lM(_, w, D) {
          var k = mi(w), U = Kf(w, k);
          D == null && !(ln(w) && (U.length || !k.length)) && (D = w, w = _, _ = this, U = Kf(w, mi(w)));
          var j = !(ln(D) && "chain" in D) || !!D.chain, ne = ku(_);
          return ui(U, function(le) {
            var ge = w[le];
            _[le] = ge, ne && (_.prototype[le] = function() {
              var Pe = this.__chain__;
              if (j || Pe) {
                var Re = _(this.__wrapped__), ze = Re.__actions__ = Ri(this.__actions__);
                return ze.push({ func: ge, args: arguments, thisArg: _ }), Re.__chain__ = Pe, Re;
              }
              return ge.apply(_, sl([this.value()], arguments));
            });
          }), _;
        }
        function Tq() {
          return Wr._ === this && (Wr._ = DS), this;
        }
        function uM() {
        }
        function bq(_) {
          return _ = Jt(_), Qt(function(w) {
            return Ip(w, _);
          });
        }
        var Cq = Up(kr), Aq = Up(zy), Mq = Up(Vy);
        function C3(_) {
          return dt(_) ? Uy(so(_)) : Kr(_);
        }
        function Lq(_) {
          return function(w) {
            return _ == null ? r : ws(_, w);
          };
        }
        var Dq = x0(), Eq = x0(!0);
        function fM() {
          return [];
        }
        function cM() {
          return !1;
        }
        function Pq() {
          return {};
        }
        function Iq() {
          return "";
        }
        function Rq() {
          return !0;
        }
        function Oq(_, w) {
          if (_ = Jt(_), _ < 1 || _ > V)
            return [];
          var D = X, k = fi(_, X);
          w = Et(w), _ -= X;
          for (var U = Xy(k, w); ++D < _; )
            w(D);
          return U;
        }
        function Nq(_) {
          return $t(_) ? kr(_, so) : fo(_) ? [_] : Ri(I0(Dr(_)));
        }
        function kq(_) {
          var w = ++Vf;
          return Dr(_) + w;
        }
        var Bq = $h(function(_, w) {
          return _ + w;
        }, 0), zq = qn("ceil"), Fq = $h(function(_, w) {
          return _ / w;
        }, 1), Gq = qn("floor");
        function Vq(_) {
          return _ && _.length ? Tu(_, Ga, gl) : r;
        }
        function Hq(_, w) {
          return _ && _.length ? Tu(_, Et(w, 2), gl) : r;
        }
        function Uq(_) {
          return yS(_, Ga);
        }
        function Wq(_, w) {
          return yS(_, Et(w, 2));
        }
        function Xq(_) {
          return _ && _.length ? Tu(_, Ga, ml) : r;
        }
        function Yq(_, w) {
          return _ && _.length ? Tu(_, Et(w, 2), ml) : r;
        }
        var Zq = $h(function(_, w) {
          return _ * w;
        }, 1), $q = qn("round"), qq = $h(function(_, w) {
          return _ - w;
        }, 0);
        function jq(_) {
          return _ && _.length ? Wy(_, Ga) : 0;
        }
        function Kq(_, w) {
          return _ && _.length ? Wy(_, Et(w, 2)) : 0;
        }
        return $.after = se, $.ary = Te, $.assign = o$, $.assignIn = g3, $.assignInWith = bw, $.assignWith = s$, $.at = l$, $.before = ke, $.bind = Ve, $.bindAll = vq, $.bindKey = Ne, $.castArray = PZ, $.chain = ag, $.chunk = Kp, $.compact = R0, $.concat = ka, $.cond = dq, $.conforms = pq, $.constant = oM, $.countBy = mw, $.create = u$, $.curry = ut, $.curryRight = gt, $.debounce = mt, $.defaults = f$, $.defaultsDeep = c$, $.defer = sn, $.delay = ye, $.difference = vr, $.differenceBy = Nn, $.differenceWith = dn, $.drop = Qn, $.dropRight = ha, $.dropRightWhile = fc, $.dropWhile = An, $.fill = nv, $.filter = lg, $.flatMap = X0, $.flatMapDeep = jA, $.flatMapDepth = xw, $.flatten = Qp, $.flattenDeep = av, $.flattenDepth = Ki, $.flip = ce, $.flow = mq, $.flowRight = yq, $.fromPairs = O0, $.functions = y$, $.functionsIn = _$, $.groupBy = Y0, $.initial = Jp, $.intersection = N0, $.intersectionBy = wl, $.intersectionWith = eg, $.invert = S$, $.invertBy = w$, $.invokeMap = Sw, $.iteratee = sM, $.keyBy = KA, $.keys = mi, $.keysIn = Fa, $.map = Nu, $.mapKeys = b$, $.mapValues = C$, $.matches = _q, $.matchesProperty = xq, $.memoize = _e, $.merge = A$, $.mergeWith = m3, $.method = Sq, $.methodOf = wq, $.mixin = lM, $.negate = Ye, $.nthArg = bq, $.omit = M$, $.omitBy = L$, $.once = yt, $.orderBy = QA, $.over = Cq, $.overArgs = Dt, $.overEvery = Aq, $.overSome = Mq, $.partial = Ct, $.partialRight = Ot, $.partition = uv, $.pick = D$, $.pickBy = y3, $.property = C3, $.propertyOf = Lq, $.pull = tg, $.pullAll = sv, $.pullAllBy = Bi, $.pullAllWith = bl, $.pullAt = lo, $.range = Dq, $.rangeRight = Eq, $.rearg = kn, $.reject = p, $.remove = Qi, $.rest = _r, $.reverse = rg, $.sampleSize = b, $.set = P$, $.setWith = I$, $.shuffle = L, $.slice = B0, $.sortBy = Y, $.sortedUniq = G0, $.sortedUniqBy = Iu, $.split = tq, $.spread = Al, $.tail = fw, $.take = cw, $.takeRight = V0, $.takeRightWhile = ng, $.takeWhile = GA, $.tap = ZA, $.throttle = eM, $.thru = uo, $.toArray = v3, $.toPairs = _3, $.toPairsIn = x3, $.toPath = Nq, $.toPlainObject = p3, $.transform = R$, $.unary = DZ, $.union = VA, $.unionBy = hw, $.unionWith = vw, $.uniq = Ru, $.uniqBy = HA, $.uniqWith = cc, $.unset = O$, $.unzip = ig, $.unzipWith = Qr, $.update = N$, $.updateWith = k$, $.values = dg, $.valuesIn = B$, $.without = UA, $.words = T3, $.wrap = EZ, $.xor = dw, $.xorBy = WA, $.xorWith = XA, $.zip = pw, $.zipObject = gw, $.zipObjectDeep = YA, $.zipWith = Ba, $.entries = _3, $.entriesIn = x3, $.extend = g3, $.extendWith = bw, lM($, $), $.add = Bq, $.attempt = b3, $.camelCase = V$, $.capitalize = S3, $.ceil = zq, $.clamp = z$, $.clone = IZ, $.cloneDeep = OZ, $.cloneDeepWith = NZ, $.cloneWith = RZ, $.conformsTo = kZ, $.deburr = w3, $.defaultTo = gq, $.divide = Fq, $.endsWith = H$, $.eq = Ps, $.escape = U$, $.escapeRegExp = W$, $.every = yw, $.find = ug, $.findIndex = Sl, $.findKey = h$, $.findLast = _w, $.findLastIndex = iv, $.findLastKey = v$, $.floor = Gq, $.forEach = fg, $.forEachRight = lv, $.forIn = d$, $.forInRight = p$, $.forOwn = g$, $.forOwnRight = m$, $.get = nM, $.gt = BZ, $.gte = zZ, $.has = x$, $.hasIn = iM, $.head = Eu, $.identity = Ga, $.includes = cg, $.indexOf = Es, $.inRange = F$, $.invoke = T$, $.isArguments = fv, $.isArray = $t, $.isArrayBuffer = FZ, $.isArrayLike = za, $.isArrayLikeObject = Mn, $.isBoolean = GZ, $.isBuffer = hc, $.isDate = VZ, $.isElement = HZ, $.isEmpty = UZ, $.isEqual = WZ, $.isEqualWith = XZ, $.isError = tM, $.isFinite = YZ, $.isFunction = ku, $.isInteger = u3, $.isLength = ww, $.isMap = f3, $.isMatch = ZZ, $.isMatchWith = $Z, $.isNaN = qZ, $.isNative = jZ, $.isNil = QZ, $.isNull = KZ, $.isNumber = c3, $.isObject = ln, $.isObjectLike = pn, $.isPlainObject = Z0, $.isRegExp = rM, $.isSafeInteger = JZ, $.isSet = h3, $.isString = Tw, $.isSymbol = fo, $.isTypedArray = vg, $.isUndefined = e$, $.isWeakMap = t$, $.isWeakSet = r$, $.join = Tl, $.kebabCase = X$, $.last = ki, $.lastIndexOf = ov, $.lowerCase = Y$, $.lowerFirst = Z$, $.lt = n$, $.lte = i$, $.max = Vq, $.maxBy = Hq, $.mean = Uq, $.meanBy = Wq, $.min = Xq, $.minBy = Yq, $.stubArray = fM, $.stubFalse = cM, $.stubObject = Pq, $.stubString = Iq, $.stubTrue = Rq, $.multiply = Zq, $.nth = k0, $.noConflict = Tq, $.noop = uM, $.now = re, $.pad = $$, $.padEnd = q$, $.padStart = j$, $.parseInt = K$, $.random = G$, $.reduce = JA, $.reduceRight = hg, $.repeat = Q$, $.replace = J$, $.result = E$, $.round = $q, $.runInContext = he, $.sample = m, $.size = I, $.snakeCase = eq, $.some = B, $.sortedIndex = z0, $.sortedIndexBy = FA, $.sortedIndexOf = Cl, $.sortedLastIndex = uw, $.sortedLastIndexBy = F0, $.sortedLastIndexOf = Pu, $.startCase = rq, $.startsWith = nq, $.subtract = qq, $.sum = jq, $.sumBy = Kq, $.template = iq, $.times = Oq, $.toFinite = Bu, $.toInteger = Jt, $.toLength = d3, $.toLower = aq, $.toNumber = Wo, $.toSafeInteger = a$, $.toString = Dr, $.toUpper = oq, $.trim = sq, $.trimEnd = lq, $.trimStart = uq, $.truncate = fq, $.unescape = cq, $.uniqueId = kq, $.upperCase = hq, $.upperFirst = aM, $.each = fg, $.eachRight = lv, $.first = Eu, lM($, (function() {
          var _ = {};
          return fa($, function(w, D) {
            hr.call($.prototype, D) || (_[D] = w);
          }), _;
        })(), { chain: !1 }), $.VERSION = n, ui(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(_) {
          $[_].placeholder = $;
        }), ui(["drop", "take"], function(_, w) {
          Zt.prototype[_] = function(D) {
            D = D === r ? 1 : vn(Jt(D), 0);
            var k = this.__filtered__ && !w ? new Zt(this) : this.clone();
            return k.__filtered__ ? k.__takeCount__ = fi(D, k.__takeCount__) : k.__views__.push({
              size: fi(D, X),
              type: _ + (k.__dir__ < 0 ? "Right" : "")
            }), k;
          }, Zt.prototype[_ + "Right"] = function(D) {
            return this.reverse()[_](D).reverse();
          };
        }), ui(["filter", "map", "takeWhile"], function(_, w) {
          var D = w + 1, k = D == H || D == Z;
          Zt.prototype[_] = function(U) {
            var j = this.clone();
            return j.__iteratees__.push({
              iteratee: Et(U, 3),
              type: D
            }), j.__filtered__ = j.__filtered__ || k, j;
          };
        }), ui(["head", "last"], function(_, w) {
          var D = "take" + (w ? "Right" : "");
          Zt.prototype[_] = function() {
            return this[D](1).value()[0];
          };
        }), ui(["initial", "tail"], function(_, w) {
          var D = "drop" + (w ? "" : "Right");
          Zt.prototype[_] = function() {
            return this.__filtered__ ? new Zt(this) : this[D](1);
          };
        }), Zt.prototype.compact = function() {
          return this.filter(Ga);
        }, Zt.prototype.find = function(_) {
          return this.filter(_).head();
        }, Zt.prototype.findLast = function(_) {
          return this.reverse().find(_);
        }, Zt.prototype.invokeMap = Qt(function(_, w) {
          return typeof _ == "function" ? new Zt(this) : this.map(function(D) {
            return Ia(D, _, w);
          });
        }), Zt.prototype.reject = function(_) {
          return this.filter(Ye(Et(_)));
        }, Zt.prototype.slice = function(_, w) {
          _ = Jt(_);
          var D = this;
          return D.__filtered__ && (_ > 0 || w < 0) ? new Zt(D) : (_ < 0 ? D = D.takeRight(-_) : _ && (D = D.drop(_)), w !== r && (w = Jt(w), D = w < 0 ? D.dropRight(-w) : D.take(w - _)), D);
        }, Zt.prototype.takeRightWhile = function(_) {
          return this.reverse().takeWhile(_).reverse();
        }, Zt.prototype.toArray = function() {
          return this.take(X);
        }, fa(Zt.prototype, function(_, w) {
          var D = /^(?:filter|find|map|reject)|While$/.test(w), k = /^(?:head|last)$/.test(w), U = $[k ? "take" + (w == "last" ? "Right" : "") : w], j = k || /^find/.test(w);
          U && ($.prototype[w] = function() {
            var ne = this.__wrapped__, le = k ? [1] : arguments, ge = ne instanceof Zt, Pe = le[0], Re = ge || $t(ne), ze = function(lr) {
              var dr = U.apply($, sl([lr], le));
              return k && at ? dr[0] : dr;
            };
            Re && D && typeof Pe == "function" && Pe.length != 1 && (ge = Re = !1);
            var at = this.__chain__, xt = !!this.__actions__.length, Nt = j && !at, tr = ge && !xt;
            if (!j && Re) {
              ne = tr ? ne : new Zt(this);
              var kt = _.apply(ne, le);
              return kt.__actions__.push({ func: uo, args: [ze], thisArg: r }), new ci(kt, at);
            }
            return Nt && tr ? _.apply(this, le) : (kt = this.thru(ze), Nt ? k ? kt.value()[0] : kt.value() : kt);
          });
        }), ui(["pop", "push", "shift", "sort", "splice", "unshift"], function(_) {
          var w = ms[_], D = /^(?:push|sort|unshift)$/.test(_) ? "tap" : "thru", k = /^(?:pop|shift)$/.test(_);
          $.prototype[_] = function() {
            var U = arguments;
            if (k && !this.__chain__) {
              var j = this.value();
              return w.apply($t(j) ? j : [], U);
            }
            return this[D](function(ne) {
              return w.apply($t(ne) ? ne : [], U);
            });
          };
        }), fa(Zt.prototype, function(_, w) {
          var D = $[w];
          if (D) {
            var k = D.name + "";
            hr.call(Xf, k) || (Xf[k] = []), Xf[k].push({ name: w, func: D });
          }
        }), Xf[oc(r, x).name] = [{
          name: "wrapper",
          func: r
        }], Zt.prototype.clone = xp, Zt.prototype.reverse = Jy, Zt.prototype.value = $f, $.prototype.at = og, $.prototype.chain = Ou, $.prototype.commit = sg, $.prototype.next = H0, $.prototype.plant = $A, $.prototype.reverse = W0, $.prototype.toJSON = $.prototype.valueOf = $.prototype.value = qA, $.prototype.first = $.prototype.head, _s && ($.prototype[_s] = U0), $;
      }), Ff = PA();
      Do ? ((Do.exports = Ff)._ = Ff, Ch._ = Ff) : Wr._ = Ff;
    }).call(lj);
  })(F_, F_.exports)), F_.exports;
}
var i1 = uj();
var LE = function(e, t) {
  return LE = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
    r.__proto__ = n;
  } || function(r, n) {
    for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (r[i] = n[i]);
  }, LE(e, t);
};
function ae(e, t) {
  if (typeof t != "function" && t !== null)
    throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
  LE(e, t);
  function r() {
    this.constructor = e;
  }
  e.prototype = t === null ? Object.create(t) : (r.prototype = t.prototype, new r());
}
var a1 = function() {
  return a1 = Object.assign || function(t) {
    for (var r, n = 1, i = arguments.length; n < i; n++) {
      r = arguments[n];
      for (var a in r) Object.prototype.hasOwnProperty.call(r, a) && (t[a] = r[a]);
    }
    return t;
  }, a1.apply(this, arguments);
};
function fj(e, t) {
  var r = {};
  for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
    for (var i = 0, n = Object.getOwnPropertySymbols(e); i < n.length; i++)
      t.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[i]) && (r[n[i]] = e[n[i]]);
  return r;
}
function B3(e, t, r, n) {
  function i(a) {
    return a instanceof r ? a : new r(function(o) {
      o(a);
    });
  }
  return new (r || (r = Promise))(function(a, o) {
    function s(f) {
      try {
        u(n.next(f));
      } catch (c) {
        o(c);
      }
    }
    function l(f) {
      try {
        u(n.throw(f));
      } catch (c) {
        o(c);
      }
    }
    function u(f) {
      f.done ? a(f.value) : i(f.value).then(s, l);
    }
    u((n = n.apply(e, [])).next());
  });
}
function z3(e, t) {
  var r = { label: 0, sent: function() {
    if (a[0] & 1) throw a[1];
    return a[1];
  }, trys: [], ops: [] }, n, i, a, o;
  return o = { next: s(0), throw: s(1), return: s(2) }, typeof Symbol == "function" && (o[Symbol.iterator] = function() {
    return this;
  }), o;
  function s(u) {
    return function(f) {
      return l([u, f]);
    };
  }
  function l(u) {
    if (n) throw new TypeError("Generator is already executing.");
    for (; r; ) try {
      if (n = 1, i && (a = u[0] & 2 ? i.return : u[0] ? i.throw || ((a = i.return) && a.call(i), 0) : i.next) && !(a = a.call(i, u[1])).done) return a;
      switch (i = 0, a && (u = [u[0] & 2, a.value]), u[0]) {
        case 0:
        case 1:
          a = u;
          break;
        case 4:
          return r.label++, { value: u[1], done: !1 };
        case 5:
          r.label++, i = u[1], u = [0];
          continue;
        case 7:
          u = r.ops.pop(), r.trys.pop();
          continue;
        default:
          if (a = r.trys, !(a = a.length > 0 && a[a.length - 1]) && (u[0] === 6 || u[0] === 2)) {
            r = 0;
            continue;
          }
          if (u[0] === 3 && (!a || u[1] > a[0] && u[1] < a[3])) {
            r.label = u[1];
            break;
          }
          if (u[0] === 6 && r.label < a[1]) {
            r.label = a[1], a = u;
            break;
          }
          if (a && r.label < a[2]) {
            r.label = a[2], r.ops.push(u);
            break;
          }
          a[2] && r.ops.pop(), r.trys.pop();
          continue;
      }
      u = t.call(e, r);
    } catch (f) {
      u = [6, f], i = 0;
    } finally {
      n = a = 0;
    }
    if (u[0] & 5) throw u[1];
    return { value: u[0] ? u[1] : void 0, done: !0 };
  }
}
var cj = /* @__PURE__ */ (function() {
  function e() {
    this.firefox = !1, this.ie = !1, this.edge = !1, this.newEdge = !1, this.weChat = !1;
  }
  return e;
})(), hj = /* @__PURE__ */ (function() {
  function e() {
    this.browser = new cj(), 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 e;
})(), Gt = new hj();
typeof wx == "object" && typeof wx.getSystemInfoSync == "function" ? (Gt.wxa = !0, Gt.touchEventsSupported = !0) : typeof document > "u" && typeof self < "u" ? Gt.worker = !0 : !Gt.hasGlobalWindow || "Deno" in window || typeof navigator < "u" && typeof navigator.userAgent == "string" && navigator.userAgent.indexOf("Node.js") > -1 ? (Gt.node = !0, Gt.svgSupported = !0) : vj(navigator.userAgent, Gt);
function vj(e, t) {
  var r = t.browser, n = e.match(/Firefox\/([\d.]+)/), i = e.match(/MSIE\s([\d.]+)/) || e.match(/Trident\/.+?rv:(([\d.]+))/), a = e.match(/Edge?\/([\d.]+)/), o = /micromessenger/i.test(e);
  n && (r.firefox = !0, r.version = n[1]), i && (r.ie = !0, r.version = i[1]), a && (r.edge = !0, r.version = a[1], r.newEdge = +a[1].split(".")[0] > 18), o && (r.weChat = !0), t.svgSupported = typeof SVGRect < "u", t.touchEventsSupported = "ontouchstart" in window && !r.ie && !r.edge, t.pointerEventsSupported = "onpointerdown" in window && (r.edge || r.ie && +r.version >= 11);
  var s = t.domSupported = typeof document < "u";
  if (s) {
    var l = document.documentElement.style;
    t.transform3dSupported = (r.ie && "transition" in l || r.edge || "WebKitCSSMatrix" in window && "m11" in new WebKitCSSMatrix() || "MozPerspective" in l) && !("OTransition" in l), t.transformSupported = t.transform3dSupported || r.ie && +r.version >= 9;
  }
}
var nR = 12, qH = "sans-serif", pf = nR + "px " + qH, dj = 20, pj = 100, gj = "007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";
function mj(e) {
  var t = {};
  if (typeof JSON > "u")
    return t;
  for (var r = 0; r < e.length; r++) {
    var n = String.fromCharCode(r + 32), i = (e.charCodeAt(r) - dj) / pj;
    t[n] = i;
  }
  return t;
}
var yj = mj(gj), ja = {
  createCanvas: function() {
    return typeof document < "u" && document.createElement("canvas");
  },
  measureText: /* @__PURE__ */ (function() {
    var e, t;
    return function(r, n) {
      if (!e) {
        var i = ja.createCanvas();
        e = i && i.getContext("2d");
      }
      if (e)
        return t !== n && (t = e.font = n || pf), e.measureText(r);
      r = r || "", n = n || pf;
      var a = /((?:\d+)?\.?\d*)px/.exec(n), o = a && +a[1] || nR, s = 0;
      if (n.indexOf("mono") >= 0)
        s = o * r.length;
      else
        for (var l = 0; l < r.length; l++) {
          var u = yj[r[l]];
          s += u == null ? o : u * o;
        }
      return { width: s };
    };
  })(),
  loadImage: function(e, t, r) {
    var n = new Image();
    return n.onload = t, n.onerror = r, n.src = e, n;
  }
};
function jH(e) {
  for (var t in ja)
    e[t] && (ja[t] = e[t]);
}
var KH = bo([
  "Function",
  "RegExp",
  "Date",
  "Error",
  "CanvasGradient",
  "CanvasPattern",
  "Image",
  "Canvas"
], function(e, t) {
  return e["[object " + t + "]"] = !0, e;
}, {}), QH = bo([
  "Int8",
  "Uint8",
  "Uint8Clamped",
  "Int16",
  "Uint16",
  "Int32",
  "Uint32",
  "Float32",
  "Float64"
], function(e, t) {
  return e["[object " + t + "Array]"] = !0, e;
}, {}), Xm = Object.prototype.toString, lC = Array.prototype, _j = lC.forEach, xj = lC.filter, iR = lC.slice, Sj = lC.map, F3 = (function() {
}).constructor, Mw = F3 ? F3.prototype : null, aR = "__proto__", wj = 2311;
function oR() {
  return wj++;
}
function uC() {
  for (var e = [], t = 0; t < arguments.length; t++)
    e[t] = arguments[t];
  typeof console < "u" && console.error.apply(console, e);
}
function it(e) {
  if (e == null || typeof e != "object")
    return e;
  var t = e, r = Xm.call(e);
  if (r === "[object Array]") {
    if (!hm(e)) {
      t = [];
      for (var n = 0, i = e.length; n < i; n++)
        t[n] = it(e[n]);
    }
  } else if (QH[r]) {
    if (!hm(e)) {
      var a = e.constructor;
      if (a.from)
        t = a.from(e);
      else {
        t = new a(e.length);
        for (var n = 0, i = e.length; n < i; n++)
          t[n] = e[n];
      }
    }
  } else if (!KH[r] && !hm(e) && !yd(e)) {
    t = {};
    for (var o in e)
      e.hasOwnProperty(o) && o !== aR && (t[o] = it(e[o]));
  }
  return t;
}
function je(e, t, r) {
  if (!ot(t) || !ot(e))
    return r ? it(t) : e;
  for (var n in t)
    if (t.hasOwnProperty(n) && n !== aR) {
      var i = e[n], a = t[n];
      ot(a) && ot(i) && !Se(a) && !Se(i) && !yd(a) && !yd(i) && !DE(a) && !DE(i) && !hm(a) && !hm(i) ? je(i, a, r) : (r || !(n in e)) && (e[n] = it(t[n]));
    }
  return e;
}
function fC(e, t) {
  for (var r = e[0], n = 1, i = e.length; n < i; n++)
    r = je(r, e[n], t);
  return r;
}
function xe(e, t) {
  if (Object.assign)
    Object.assign(e, t);
  else
    for (var r in t)
      t.hasOwnProperty(r) && r !== aR && (e[r] = t[r]);
  return e;
}
function tt(e, t, r) {
  for (var n = Ht(t), i = 0, a = n.length; i < a; i++) {
    var o = n[i];
    (r ? t[o] != null : e[o] == null) && (e[o] = t[o]);
  }
  return e;
}
var Tj = ja.createCanvas;
function Tt(e, t) {
  if (e) {
    if (e.indexOf)
      return e.indexOf(t);
    for (var r = 0, n = e.length; r < n; r++)
      if (e[r] === t)
        return r;
  }
  return -1;
}
function mx(e, t) {
  var r = e.prototype;
  function n() {
  }
  n.prototype = t.prototype, e.prototype = new n();
  for (var i in r)
    r.hasOwnProperty(i) && (e.prototype[i] = r[i]);
  e.prototype.constructor = e, e.superClass = t;
}
function cn(e, t, r) {
  if (e = "prototype" in e ? e.prototype : e, 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" && (r ? t[a] != null : e[a] == null) && (e[a] = t[a]);
    }
  else
    tt(e, t, r);
}
function Vi(e) {
  return !e || typeof e == "string" ? !1 : typeof e.length == "number";
}
function F(e, t, r) {
  if (e && t)
    if (e.forEach && e.forEach === _j)
      e.forEach(t, r);
    else if (e.length === +e.length)
      for (var n = 0, i = e.length; n < i; n++)
        t.call(r, e[n], n, e);
    else
      for (var a in e)
        e.hasOwnProperty(a) && t.call(r, e[a], a, e);
}
function Ce(e, t, r) {
  if (!e)
    return [];
  if (!t)
    return cC(e);
  if (e.map && e.map === Sj)
    return e.map(t, r);
  for (var n = [], i = 0, a = e.length; i < a; i++)
    n.push(t.call(r, e[i], i, e));
  return n;
}
function bo(e, t, r, n) {
  if (e && t) {
    for (var i = 0, a = e.length; i < a; i++)
      r = t.call(n, r, e[i], i, e);
    return r;
  }
}
function nr(e, t, r) {
  if (!e)
    return [];
  if (!t)
    return cC(e);
  if (e.filter && e.filter === xj)
    return e.filter(t, r);
  for (var n = [], i = 0, a = e.length; i < a; i++)
    t.call(r, e[i], i, e) && n.push(e[i]);
  return n;
}
function eh(e, t, r) {
  if (e && t) {
    for (var n = 0, i = e.length; n < i; n++)
      if (t.call(r, e[n], n, e))
        return e[n];
  }
}
function Ht(e) {
  if (!e)
    return [];
  if (Object.keys)
    return Object.keys(e);
  var t = [];
  for (var r in e)
    e.hasOwnProperty(r) && t.push(r);
  return t;
}
function bj(e, t) {
  for (var r = [], n = 2; n < arguments.length; n++)
    r[n - 2] = arguments[n];
  return function() {
    return e.apply(t, r.concat(iR.call(arguments)));
  };
}
var Ge = Mw && nt(Mw.bind) ? Mw.call.bind(Mw.bind) : bj;
function St(e) {
  for (var t = [], r = 1; r < arguments.length; r++)
    t[r - 1] = arguments[r];
  return function() {
    return e.apply(this, t.concat(iR.call(arguments)));
  };
}
function Se(e) {
  return Array.isArray ? Array.isArray(e) : Xm.call(e) === "[object Array]";
}
function nt(e) {
  return typeof e == "function";
}
function Fe(e) {
  return typeof e == "string";
}
function B2(e) {
  return Xm.call(e) === "[object String]";
}
function Xt(e) {
  return typeof e == "number";
}
function ot(e) {
  var t = typeof e;
  return t === "function" || !!e && t === "object";
}
function DE(e) {
  return !!KH[Xm.call(e)];
}
function wa(e) {
  return !!QH[Xm.call(e)];
}
function yd(e) {
  return typeof e == "object" && typeof e.nodeType == "number" && typeof e.ownerDocument == "object";
}
function yx(e) {
  return e.colorStops != null;
}
function JH(e) {
  return e.image != null;
}
function eU(e) {
  return Xm.call(e) === "[object RegExp]";
}
function Gi(e) {
  return e !== e;
}
function Ti() {
  for (var e = [], t = 0; t < arguments.length; t++)
    e[t] = arguments[t];
  for (var r = 0, n = e.length; r < n; r++)
    if (e[r] != null)
      return e[r];
}
function et(e, t) {
  return e ?? t;
}
function $a(e, t, r) {
  return e ?? t ?? r;
}
function cC(e) {
  for (var t = [], r = 1; r < arguments.length; r++)
    t[r - 1] = arguments[r];
  return iR.apply(e, t);
}
function _x(e) {
  if (typeof e == "number")
    return [e, e, e, e];
  var t = e.length;
  return t === 2 ? [e[0], e[1], e[0], e[1]] : t === 3 ? [e[0], e[1], e[2], e[1]] : e;
}
function Hi(e, t) {
  if (!e)
    throw new Error(t);
}
function _o(e) {
  return e == null ? null : typeof e.trim == "function" ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
}
var tU = "__ec_primitive__";
function L1(e) {
  e[tU] = !0;
}
function hm(e) {
  return e[tU];
}
var Cj = (function() {
  function e() {
    this.data = {};
  }
  return e.prototype.delete = function(t) {
    var r = this.has(t);
    return r && delete this.data[t], r;
  }, e.prototype.has = function(t) {
    return this.data.hasOwnProperty(t);
  }, e.prototype.get = function(t) {
    return this.data[t];
  }, e.prototype.set = function(t, r) {
    return this.data[t] = r, this;
  }, e.prototype.keys = function() {
    return Ht(this.data);
  }, e.prototype.forEach = function(t) {
    var r = this.data;
    for (var n in r)
      r.hasOwnProperty(n) && t(r[n], n);
  }, e;
})(), rU = typeof Map == "function";
function Aj() {
  return rU ? /* @__PURE__ */ new Map() : new Cj();
}
var nU = (function() {
  function e(t) {
    var r = Se(t);
    this.data = Aj();
    var n = this;
    t instanceof e ? t.each(i) : t && F(t, i);
    function i(a, o) {
      r ? n.set(a, o) : n.set(o, a);
    }
  }
  return e.prototype.hasKey = function(t) {
    return this.data.has(t);
  }, e.prototype.get = function(t) {
    return this.data.get(t);
  }, e.prototype.set = function(t, r) {
    return this.data.set(t, r), r;
  }, e.prototype.each = function(t, r) {
    this.data.forEach(function(n, i) {
      t.call(r, n, i);
    });
  }, e.prototype.keys = function() {
    var t = this.data.keys();
    return rU ? Array.from(t) : t;
  }, e.prototype.removeKey = function(t) {
    this.data.delete(t);
  }, e;
})();
function Je(e) {
  return new nU(e);
}
function _m(e, t) {
  for (var r = new e.constructor(e.length + t.length), n = 0; n < e.length; n++)
    r[n] = e[n];
  for (var i = e.length, n = 0; n < t.length; n++)
    r[n + i] = t[n];
  return r;
}
function xx(e, t) {
  var r;
  if (Object.create)
    r = Object.create(e);
  else {
    var n = function() {
    };
    n.prototype = e, r = new n();
  }
  return t && xe(r, t), r;
}
function sR(e) {
  var t = e.style;
  t.webkitUserSelect = "none", t.userSelect = "none", t.webkitTapHighlightColor = "rgba(0,0,0,0)", t["-webkit-touch-callout"] = "none";
}
function qe(e, t) {
  return e.hasOwnProperty(t);
}
function un() {
}
var o1 = 180 / Math.PI, Mj = Number.EPSILON || Math.pow(2, -52);
const Lj = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  EPSILON: Mj,
  HashMap: nU,
  RADIAN_TO_DEGREE: o1,
  assert: Hi,
  bind: Ge,
  clone: it,
  concatArray: _m,
  createCanvas: Tj,
  createHashMap: Je,
  createObject: xx,
  curry: St,
  defaults: tt,
  disableUserSelect: sR,
  each: F,
  eqNaN: Gi,
  extend: xe,
  filter: nr,
  find: eh,
  guid: oR,
  hasOwn: qe,
  indexOf: Tt,
  inherits: mx,
  isArray: Se,
  isArrayLike: Vi,
  isBuiltInObject: DE,
  isDom: yd,
  isFunction: nt,
  isGradientObject: yx,
  isImagePatternObject: JH,
  isNumber: Xt,
  isObject: ot,
  isPrimitive: hm,
  isRegExp: eU,
  isString: Fe,
  isStringSafe: B2,
  isTypedArray: wa,
  keys: Ht,
  logError: uC,
  map: Ce,
  merge: je,
  mergeAll: fC,
  mixin: cn,
  noop: un,
  normalizeCssArray: _x,
  reduce: bo,
  retrieve: Ti,
  retrieve2: et,
  retrieve3: $a,
  setAsPrimitive: L1,
  slice: cC,
  trim: _o
}, Symbol.toStringTag, { value: "Module" }));
function th(e, t) {
  return e == null && (e = 0), t == null && (t = 0), [e, t];
}
function ea(e, t) {
  return e[0] = t[0], e[1] = t[1], e;
}
function Zl(e) {
  return [e[0], e[1]];
}
function hC(e, t, r) {
  return e[0] = t, e[1] = r, e;
}
function EE(e, t, r) {
  return e[0] = t[0] + r[0], e[1] = t[1] + r[1], e;
}
function z2(e, t, r, n) {
  return e[0] = t[0] + r[0] * n, e[1] = t[1] + r[1] * n, e;
}
function Ec(e, t, r) {
  return e[0] = t[0] - r[0], e[1] = t[1] - r[1], e;
}
function D1(e) {
  return Math.sqrt(lR(e));
}
var Dj = D1;
function lR(e) {
  return e[0] * e[0] + e[1] * e[1];
}
var Ej = lR;
function Pj(e, t, r) {
  return e[0] = t[0] * r[0], e[1] = t[1] * r[1], e;
}
function Ij(e, t, r) {
  return e[0] = t[0] / r[0], e[1] = t[1] / r[1], e;
}
function Rj(e, t) {
  return e[0] * t[0] + e[1] * t[1];
}
function s1(e, t, r) {
  return e[0] = t[0] * r, e[1] = t[1] * r, e;
}
function Od(e, t) {
  var r = D1(t);
  return r === 0 ? (e[0] = 0, e[1] = 0) : (e[0] = t[0] / r, e[1] = t[1] / r), e;
}
function F2(e, t) {
  return Math.sqrt((e[0] - t[0]) * (e[0] - t[0]) + (e[1] - t[1]) * (e[1] - t[1]));
}
var rf = F2;
function iU(e, t) {
  return (e[0] - t[0]) * (e[0] - t[0]) + (e[1] - t[1]) * (e[1] - t[1]);
}
var Fc = iU;
function Oj(e, t) {
  return e[0] = -t[0], e[1] = -t[1], e;
}
function l1(e, t, r, n) {
  return e[0] = t[0] + n * (r[0] - t[0]), e[1] = t[1] + n * (r[1] - t[1]), e;
}
function fn(e, t, r) {
  var n = t[0], i = t[1];
  return e[0] = r[0] * n + r[2] * i + r[4], e[1] = r[1] * n + r[3] * i + r[5], e;
}
function nf(e, t, r) {
  return e[0] = Math.min(t[0], r[0]), e[1] = Math.min(t[1], r[1]), e;
}
function af(e, t, r) {
  return e[0] = Math.max(t[0], r[0]), e[1] = Math.max(t[1], r[1]), e;
}
const Nj = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  add: EE,
  applyTransform: fn,
  clone: Zl,
  copy: ea,
  create: th,
  dist: rf,
  distSquare: Fc,
  distance: F2,
  distanceSquare: iU,
  div: Ij,
  dot: Rj,
  len: D1,
  lenSquare: lR,
  length: Dj,
  lengthSquare: Ej,
  lerp: l1,
  max: af,
  min: nf,
  mul: Pj,
  negate: Oj,
  normalize: Od,
  scale: s1,
  scaleAndAdd: z2,
  set: hC,
  sub: Ec
}, Symbol.toStringTag, { value: "Module" }));
var pg = /* @__PURE__ */ (function() {
  function e(t, r) {
    this.target = t, this.topTarget = r && r.topTarget;
  }
  return e;
})(), kj = (function() {
  function e(t) {
    this.handler = t, t.on("mousedown", this._dragStart, this), t.on("mousemove", this._drag, this), t.on("mouseup", this._dragEnd, this);
  }
  return e.prototype._dragStart = function(t) {
    for (var r = t.target; r && !r.draggable; )
      r = r.parent || r.__hostTarget;
    r && (this._draggingTarget = r, r.dragging = !0, this._x = t.offsetX, this._y = t.offsetY, this.handler.dispatchToElement(new pg(r, t), "dragstart", t.event));
  }, e.prototype._drag = function(t) {
    var r = this._draggingTarget;
    if (r) {
      var n = t.offsetX, i = t.offsetY, a = n - this._x, o = i - this._y;
      this._x = n, this._y = i, r.drift(a, o, t), this.handler.dispatchToElement(new pg(r, t), "drag", t.event);
      var s = this.handler.findHover(n, i, r).target, l = this._dropTarget;
      this._dropTarget = s, r !== s && (l && s !== l && this.handler.dispatchToElement(new pg(l, t), "dragleave", t.event), s && s !== l && this.handler.dispatchToElement(new pg(s, t), "dragenter", t.event));
    }
  }, e.prototype._dragEnd = function(t) {
    var r = this._draggingTarget;
    r && (r.dragging = !1), this.handler.dispatchToElement(new pg(r, t), "dragend", t.event), this._dropTarget && this.handler.dispatchToElement(new pg(this._dropTarget, t), "drop", t.event), this._draggingTarget = null, this._dropTarget = null;
  }, e;
})(), ds = (function() {
  function e(t) {
    t && (this._$eventProcessor = t);
  }
  return e.prototype.on = function(t, r, n, i) {
    this._$handlers || (this._$handlers = {});
    var a = this._$handlers;
    if (typeof r == "function" && (i = n, n = r, r = null), !n || !t)
      return this;
    var o = this._$eventProcessor;
    r != null && o && o.normalizeQuery && (r = o.normalizeQuery(r)), 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: r,
      ctx: i || this,
      callAtLast: n.zrEventfulCallAtLast
    }, u = a[t].length - 1, f = a[t][u];
    return f && f.callAtLast ? a[t].splice(u, 0, l) : a[t].push(l), this;
  }, e.prototype.isSilent = function(t) {
    var r = this._$handlers;
    return !r || !r[t] || !r[t].length;
  }, e.prototype.off = function(t, r) {
    var n = this._$handlers;
    if (!n)
      return this;
    if (!t)
      return this._$handlers = {}, this;
    if (r) {
      if (n[t]) {
        for (var i = [], a = 0, o = n[t].length; a < o; a++)
          n[t][a].h !== r && i.push(n[t][a]);
        n[t] = i;
      }
      n[t] && n[t].length === 0 && delete n[t];
    } else
      delete n[t];
    return this;
  }, e.prototype.trigger = function(t) {
    for (var r = [], n = 1; n < arguments.length; n++)
      r[n - 1] = arguments[n];
    if (!this._$handlers)
      return this;
    var i = this._$handlers[t], a = this._$eventProcessor;
    if (i)
      for (var o = r.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, r[0]);
              break;
            case 2:
              u.h.call(u.ctx, r[0], r[1]);
              break;
            default:
              u.h.apply(u.ctx, r);
              break;
          }
      }
    return a && a.afterTrigger && a.afterTrigger(t), this;
  }, e.prototype.triggerWithContext = function(t) {
    for (var r = [], n = 1; n < arguments.length; n++)
      r[n - 1] = arguments[n];
    if (!this._$handlers)
      return this;
    var i = this._$handlers[t], a = this._$eventProcessor;
    if (i)
      for (var o = r.length, s = r[o - 1], l = i.length, u = 0; u < l; u++) {
        var f = i[u];
        if (!(a && a.filter && f.query != null && !a.filter(t, f.query)))
          switch (o) {
            case 0:
              f.h.call(s);
              break;
            case 1:
              f.h.call(s, r[0]);
              break;
            case 2:
              f.h.call(s, r[0], r[1]);
              break;
            default:
              f.h.apply(s, r.slice(1, o - 1));
              break;
          }
      }
    return a && a.afterTrigger && a.afterTrigger(t), this;
  }, e;
})(), Bj = Math.log(2);
function PE(e, t, r, n, i, a) {
  var o = n + "-" + i, s = e.length;
  if (a.hasOwnProperty(o))
    return a[o];
  if (t === 1) {
    var l = Math.round(Math.log((1 << s) - 1 & ~i) / Bj);
    return e[r][l];
  }
  for (var u = n | 1 << r, f = r + 1; n & 1 << f; )
    f++;
  for (var c = 0, h = 0, v = 0; h < s; h++) {
    var d = 1 << h;
    d & i || (c += (v % 2 ? -1 : 1) * e[r][h] * PE(e, t - 1, f, u, i | d, a), v++);
  }
  return a[o] = c, c;
}
function G3(e, t) {
  var r = [
    [e[0], e[1], 1, 0, 0, 0, -t[0] * e[0], -t[0] * e[1]],
    [0, 0, 0, e[0], e[1], 1, -t[1] * e[0], -t[1] * e[1]],
    [e[2], e[3], 1, 0, 0, 0, -t[2] * e[2], -t[2] * e[3]],
    [0, 0, 0, e[2], e[3], 1, -t[3] * e[2], -t[3] * e[3]],
    [e[4], e[5], 1, 0, 0, 0, -t[4] * e[4], -t[4] * e[5]],
    [0, 0, 0, e[4], e[5], 1, -t[5] * e[4], -t[5] * e[5]],
    [e[6], e[7], 1, 0, 0, 0, -t[6] * e[6], -t[6] * e[7]],
    [0, 0, 0, e[6], e[7], 1, -t[7] * e[6], -t[7] * e[7]]
  ], n = {}, i = PE(r, 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) * PE(r, 7, o === 0 ? 1 : 0, 1 << o, 1 << s, n) / i * t[o];
    return function(l, u, f) {
      var c = u * a[6] + f * a[7] + 1;
      l[0] = (u * a[0] + f * a[1] + a[2]) / c, l[1] = (u * a[3] + f * a[4] + a[5]) / c;
    };
  }
}
var G2 = "___zrEVENTSAVED", mM = [];
function zj(e, t, r, n, i) {
  return IE(mM, t, n, i, !0) && IE(e, r, mM[0], mM[1]);
}
function Fj(e, t) {
  e && r(e), t && r(t);
  function r(n) {
    var i = n[G2];
    i && (i.clearMarkers && i.clearMarkers(), delete n[G2]);
  }
}
function IE(e, t, r, n, i) {
  if (t.getBoundingClientRect && Gt.domSupported && !aU(t)) {
    var a = t[G2] || (t[G2] = {}), o = Gj(t, a), s = Vj(o, a, i);
    if (s)
      return s(e, r, n), !0;
  }
  return !1;
}
function Gj(e, t) {
  var r = t.markers;
  if (r)
    return r;
  r = 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;"), e.appendChild(o), r.push(o);
  }
  return t.clearMarkers = function() {
    F(r, function(f) {
      f.parentNode && f.parentNode.removeChild(f);
    });
  }, r;
}
function Vj(e, t, r) {
  for (var n = r ? "invTrans" : "trans", i = t[n], a = t.srcCoords, o = [], s = [], l = !0, u = 0; u < 4; u++) {
    var f = e[u].getBoundingClientRect(), c = 2 * u, h = f.left, v = f.top;
    o.push(h, v), l = l && a && h === a[c] && v === a[c + 1], s.push(e[u].offsetLeft, e[u].offsetTop);
  }
  return l && i ? i : (t.srcCoords = o, t[n] = r ? G3(s, o) : G3(o, s));
}
function aU(e) {
  return e.nodeName.toUpperCase() === "CANVAS";
}
var Hj = /([&<>"'])/g, Uj = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;",
  "'": "&#39;"
};
function _n(e) {
  return e == null ? "" : (e + "").replace(Hj, function(t, r) {
    return Uj[r];
  });
}
var Wj = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, yM = [], Xj = Gt.browser.firefox && +Gt.browser.version.split(".")[0] < 39;
function RE(e, t, r, n) {
  return r = r || {}, n ? V3(e, t, r) : Xj && t.layerX != null && t.layerX !== t.offsetX ? (r.zrX = t.layerX, r.zrY = t.layerY) : t.offsetX != null ? (r.zrX = t.offsetX, r.zrY = t.offsetY) : V3(e, t, r), r;
}
function V3(e, t, r) {
  if (Gt.domSupported && e.getBoundingClientRect) {
    var n = t.clientX, i = t.clientY;
    if (aU(e)) {
      var a = e.getBoundingClientRect();
      r.zrX = n - a.left, r.zrY = i - a.top;
      return;
    } else if (IE(yM, e, n, i)) {
      r.zrX = yM[0], r.zrY = yM[1];
      return;
    }
  }
  r.zrX = r.zrY = 0;
}
function uR(e) {
  return e || window.event;
}
function Ko(e, t, r) {
  if (t = uR(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 && RE(e, o, t, r);
  } else {
    RE(e, t, t, r);
    var a = Yj(t);
    t.zrDelta = a ? a / 120 : -(t.detail || 0) / 3;
  }
  var s = t.button;
  return t.which == null && s !== void 0 && Wj.test(t.type) && (t.which = s & 1 ? 1 : s & 2 ? 3 : s & 4 ? 2 : 0), t;
}
function Yj(e) {
  var t = e.wheelDelta;
  if (t)
    return t;
  var r = e.deltaX, n = e.deltaY;
  if (r == null || n == null)
    return t;
  var i = Math.abs(n !== 0 ? n : r), a = n > 0 ? -1 : n < 0 ? 1 : r > 0 ? -1 : 1;
  return 3 * i * a;
}
function OE(e, t, r, n) {
  e.addEventListener(t, r, n);
}
function Zj(e, t, r, n) {
  e.removeEventListener(t, r, n);
}
var gf = function(e) {
  e.preventDefault(), e.stopPropagation(), e.cancelBubble = !0;
};
function H3(e) {
  return e.which === 2 || e.which === 3;
}
var $j = (function() {
  function e() {
    this._track = [];
  }
  return e.prototype.recognize = function(t, r, n) {
    return this._doTrack(t, r, n), this._recognize(t);
  }, e.prototype.clear = function() {
    return this._track.length = 0, this;
  }, e.prototype._doTrack = function(t, r, n) {
    var i = t.touches;
    if (i) {
      for (var a = {
        points: [],
        touches: [],
        target: r,
        event: t
      }, o = 0, s = i.length; o < s; o++) {
        var l = i[o], u = RE(n, l, {});
        a.points.push([u.zrX, u.zrY]), a.touches.push(l);
      }
      this._track.push(a);
    }
  }, e.prototype._recognize = function(t) {
    for (var r in _M)
      if (_M.hasOwnProperty(r)) {
        var n = _M[r](this._track, t);
        if (n)
          return n;
      }
  }, e;
})();
function U3(e) {
  var t = e[1][0] - e[0][0], r = e[1][1] - e[0][1];
  return Math.sqrt(t * t + r * r);
}
function qj(e) {
  return [
    (e[0][0] + e[1][0]) / 2,
    (e[0][1] + e[1][1]) / 2
  ];
}
var _M = {
  pinch: function(e, t) {
    var r = e.length;
    if (r) {
      var n = (e[r - 1] || {}).points, i = (e[r - 2] || {}).points || n;
      if (i && i.length > 1 && n && n.length > 1) {
        var a = U3(n) / U3(i);
        !isFinite(a) && (a = 1), t.pinchScale = a;
        var o = qj(n);
        return t.pinchX = o[0], t.pinchY = o[1], {
          type: "pinch",
          target: e[0].target,
          event: t
        };
      }
    }
  }
};
function ii() {
  return [1, 0, 0, 1, 0, 0];
}
function Sx(e) {
  return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 1, e[4] = 0, e[5] = 0, e;
}
function Tx(e, t) {
  return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[4] = t[4], e[5] = t[5], e;
}
function Hs(e, t, r) {
  var n = t[0] * r[0] + t[2] * r[1], i = t[1] * r[0] + t[3] * r[1], a = t[0] * r[2] + t[2] * r[3], o = t[1] * r[2] + t[3] * r[3], s = t[0] * r[4] + t[2] * r[5] + t[4], l = t[1] * r[4] + t[3] * r[5] + t[5];
  return e[0] = n, e[1] = i, e[2] = a, e[3] = o, e[4] = s, e[5] = l, e;
}
function Zs(e, t, r) {
  return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[4] = t[4] + r[0], e[5] = t[5] + r[1], e;
}
function Tf(e, t, r, 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], f = Math.sin(r), c = Math.cos(r);
  return e[0] = i * c + s * f, e[1] = -i * f + s * c, e[2] = a * c + l * f, e[3] = -a * f + c * l, e[4] = c * (o - n[0]) + f * (u - n[1]) + n[0], e[5] = c * (u - n[1]) - f * (o - n[0]) + n[1], e;
}
function vC(e, t, r) {
  var n = r[0], i = r[1];
  return e[0] = t[0] * n, e[1] = t[1] * i, e[2] = t[2] * n, e[3] = t[3] * i, e[4] = t[4] * n, e[5] = t[5] * i, e;
}
function cs(e, t) {
  var r = t[0], n = t[2], i = t[4], a = t[1], o = t[3], s = t[5], l = r * o - a * n;
  return l ? (l = 1 / l, e[0] = o * l, e[1] = -a * l, e[2] = -n * l, e[3] = r * l, e[4] = (n * s - o * i) * l, e[5] = (a * i - r * s) * l, e) : null;
}
function oU(e) {
  var t = ii();
  return Tx(t, e), t;
}
const jj = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  clone: oU,
  copy: Tx,
  create: ii,
  identity: Sx,
  invert: cs,
  mul: Hs,
  rotate: Tf,
  scale: vC,
  translate: Zs
}, Symbol.toStringTag, { value: "Module" }));
var ht = (function() {
  function e(t, r) {
    this.x = t || 0, this.y = r || 0;
  }
  return e.prototype.copy = function(t) {
    return this.x = t.x, this.y = t.y, this;
  }, e.prototype.clone = function() {
    return new e(this.x, this.y);
  }, e.prototype.set = function(t, r) {
    return this.x = t, this.y = r, this;
  }, e.prototype.equal = function(t) {
    return t.x === this.x && t.y === this.y;
  }, e.prototype.add = function(t) {
    return this.x += t.x, this.y += t.y, this;
  }, e.prototype.scale = function(t) {
    this.x *= t, this.y *= t;
  }, e.prototype.scaleAndAdd = function(t, r) {
    this.x += t.x * r, this.y += t.y * r;
  }, e.prototype.sub = function(t) {
    return this.x -= t.x, this.y -= t.y, this;
  }, e.prototype.dot = function(t) {
    return this.x * t.x + this.y * t.y;
  }, e.prototype.len = function() {
    return Math.sqrt(this.x * this.x + this.y * this.y);
  }, e.prototype.lenSquare = function() {
    return this.x * this.x + this.y * this.y;
  }, e.prototype.normalize = function() {
    var t = this.len();
    return this.x /= t, this.y /= t, this;
  }, e.prototype.distance = function(t) {
    var r = this.x - t.x, n = this.y - t.y;
    return Math.sqrt(r * r + n * n);
  }, e.prototype.distanceSquare = function(t) {
    var r = this.x - t.x, n = this.y - t.y;
    return r * r + n * n;
  }, e.prototype.negate = function() {
    return this.x = -this.x, this.y = -this.y, this;
  }, e.prototype.transform = function(t) {
    if (t) {
      var r = this.x, n = this.y;
      return this.x = t[0] * r + t[2] * n + t[4], this.y = t[1] * r + t[3] * n + t[5], this;
    }
  }, e.prototype.toArray = function(t) {
    return t[0] = this.x, t[1] = this.y, t;
  }, e.prototype.fromArray = function(t) {
    this.x = t[0], this.y = t[1];
  }, e.set = function(t, r, n) {
    t.x = r, t.y = n;
  }, e.copy = function(t, r) {
    t.x = r.x, t.y = r.y;
  }, e.len = function(t) {
    return Math.sqrt(t.x * t.x + t.y * t.y);
  }, e.lenSquare = function(t) {
    return t.x * t.x + t.y * t.y;
  }, e.dot = function(t, r) {
    return t.x * r.x + t.y * r.y;
  }, e.add = function(t, r, n) {
    t.x = r.x + n.x, t.y = r.y + n.y;
  }, e.sub = function(t, r, n) {
    t.x = r.x - n.x, t.y = r.y - n.y;
  }, e.scale = function(t, r, n) {
    t.x = r.x * n, t.y = r.y * n;
  }, e.scaleAndAdd = function(t, r, n, i) {
    t.x = r.x + n.x * i, t.y = r.y + n.y * i;
  }, e.lerp = function(t, r, n, i) {
    var a = 1 - i;
    t.x = a * r.x + i * n.x, t.y = a * r.y + i * n.y;
  }, e;
})(), ed = Math.min, nm = Math.max, NE = Math.abs, W3 = ["x", "y"], Kj = ["width", "height"], cv = new ht(), hv = new ht(), vv = new ht(), dv = new ht(), go = sU(), G_ = go.minTv, kE = go.maxTv, u1 = [0, 0], st = (function() {
  function e(t, r, n, i) {
    e.set(this, t, r, n, i);
  }
  return e.set = function(t, r, n, i, a) {
    return i < 0 && (r = r + i, i = -i), a < 0 && (n = n + a, a = -a), t.x = r, t.y = n, t.width = i, t.height = a, t;
  }, e.prototype.union = function(t) {
    var r = ed(t.x, this.x), n = ed(t.y, this.y);
    isFinite(this.x) && isFinite(this.width) ? this.width = nm(t.x + t.width, this.x + this.width) - r : this.width = t.width, isFinite(this.y) && isFinite(this.height) ? this.height = nm(t.y + t.height, this.y + this.height) - n : this.height = t.height, this.x = r, this.y = n;
  }, e.prototype.applyTransform = function(t) {
    e.applyTransform(this, this, t);
  }, e.prototype.calculateTransform = function(t) {
    var r = this, n = t.width / r.width, i = t.height / r.height, a = ii();
    return Zs(a, a, [-r.x, -r.y]), vC(a, a, [n, i]), Zs(a, a, [t.x, t.y]), a;
  }, e.prototype.intersect = function(t, r, n) {
    return e.intersect(this, t, r, n);
  }, e.intersect = function(t, r, n, i) {
    n && ht.set(n, 0, 0);
    var a = i && i.outIntersectRect || null, o = i && i.clamp;
    if (a && (a.x = a.y = a.width = a.height = NaN), !t || !r)
      return !1;
    t instanceof e || (t = e.set(Qj, t.x, t.y, t.width, t.height)), r instanceof e || (r = e.set(Jj, r.x, r.y, r.width, r.height));
    var s = !!n;
    go.reset(i, s);
    var l = go.touchThreshold, u = t.x + l, f = t.x + t.width - l, c = t.y + l, h = t.y + t.height - l, v = r.x + l, d = r.x + r.width - l, g = r.y + l, y = r.y + r.height - l;
    if (u > f || c > h || v > d || g > y)
      return !1;
    var x = !(f < v || d < u || h < g || y < c);
    return (s || a) && (u1[0] = 1 / 0, u1[1] = 0, X3(u, f, v, d, 0, s, a, o), X3(c, h, g, y, 1, s, a, o), s && ht.copy(n, x ? go.useDir ? go.dirMinTv : G_ : kE)), x;
  }, e.contain = function(t, r, n) {
    return r >= t.x && r <= t.x + t.width && n >= t.y && n <= t.y + t.height;
  }, e.prototype.contain = function(t, r) {
    return e.contain(this, t, r);
  }, e.prototype.clone = function() {
    return new e(this.x, this.y, this.width, this.height);
  }, e.prototype.copy = function(t) {
    e.copy(this, t);
  }, e.prototype.plain = function() {
    return {
      x: this.x,
      y: this.y,
      width: this.width,
      height: this.height
    };
  }, e.prototype.isFinite = function() {
    return isFinite(this.x) && isFinite(this.y) && isFinite(this.width) && isFinite(this.height);
  }, e.prototype.isZero = function() {
    return this.width === 0 || this.height === 0;
  }, e.create = function(t) {
    return new e(t.x, t.y, t.width, t.height);
  }, e.copy = function(t, r) {
    return t.x = r.x, t.y = r.y, t.width = r.width, t.height = r.height, t;
  }, e.applyTransform = function(t, r, n) {
    if (!n) {
      t !== r && e.copy(t, r);
      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 = r.x * i + o, t.y = r.y * a + s, t.width = r.width * i, t.height = r.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;
    }
    cv.x = vv.x = r.x, cv.y = dv.y = r.y, hv.x = dv.x = r.x + r.width, hv.y = vv.y = r.y + r.height, cv.transform(n), dv.transform(n), hv.transform(n), vv.transform(n), t.x = ed(cv.x, hv.x, vv.x, dv.x), t.y = ed(cv.y, hv.y, vv.y, dv.y);
    var l = nm(cv.x, hv.x, vv.x, dv.x), u = nm(cv.y, hv.y, vv.y, dv.y);
    t.width = l - t.x, t.height = u - t.y;
  }, e;
})(), Qj = new st(0, 0, 0, 0), Jj = new st(0, 0, 0, 0);
function X3(e, t, r, n, i, a, o, s) {
  var l = NE(t - r), u = NE(n - e), f = ed(l, u), c = W3[i], h = W3[1 - i], v = Kj[i];
  t < r || n < e ? l < u ? (a && (kE[c] = -l), s && (o[c] = t, o[v] = 0)) : (a && (kE[c] = u), s && (o[c] = e, o[v] = 0)) : (o && (o[c] = nm(e, r), o[v] = ed(t, n) - o[c]), a && (f < u1[0] || go.useDir) && (u1[0] = ed(f, u1[0]), (l < u || !go.bidirectional) && (G_[c] = l, G_[h] = 0, go.useDir && go.calcDirMTV()), (l >= u || !go.bidirectional) && (G_[c] = -u, G_[h] = 0, go.useDir && go.calcDirMTV())));
}
function sU() {
  var e = 0, t = new ht(), r = new ht(), n = {
    minTv: new ht(),
    maxTv: new ht(),
    useDir: !1,
    dirMinTv: new ht(),
    touchThreshold: 0,
    bidirectional: !0,
    negativeSize: !1,
    reset: function(a, o) {
      n.touchThreshold = 0, a && a.touchThreshold != null && (n.touchThreshold = nm(0, a.touchThreshold)), n.negativeSize = !1, o && (n.minTv.set(1 / 0, 1 / 0), n.maxTv.set(0, 0), n.useDir = !1, a && a.direction != null && (n.useDir = !0, n.dirMinTv.copy(n.minTv), r.copy(n.minTv), e = a.direction, n.bidirectional = a.bidirectional == null || !!a.bidirectional, n.bidirectional || t.set(Math.cos(e), Math.sin(e))));
    },
    calcDirMTV: function() {
      var a = n.minTv, o = n.dirMinTv, s = a.y * a.y + a.x * a.x, l = Math.sin(e), u = Math.cos(e), f = l * a.y + u * a.x;
      if (i(f)) {
        i(a.x) && i(a.y) && o.set(0, 0);
        return;
      }
      if (r.x = s * u / f, r.y = s * l / f, i(r.x) && i(r.y)) {
        o.set(0, 0);
        return;
      }
      (n.bidirectional || t.dot(r) > 0) && r.len() < o.len() && o.copy(r);
    }
  };
  function i(a) {
    return NE(a) < 1e-10;
  }
  return n;
}
var lU = "silent";
function eK(e, t, r) {
  return {
    type: e,
    event: r,
    target: t.target,
    topTarget: t.topTarget,
    cancelBubble: !1,
    offsetX: r.zrX,
    offsetY: r.zrY,
    gestureEvent: r.gestureEvent,
    pinchX: r.pinchX,
    pinchY: r.pinchY,
    pinchScale: r.pinchScale,
    wheelDelta: r.zrDelta,
    zrByTouch: r.zrByTouch,
    which: r.which,
    stop: tK
  };
}
function tK() {
  gf(this.event);
}
var rK = (function(e) {
  ae(t, e);
  function t() {
    var r = e !== null && e.apply(this, arguments) || this;
    return r.handler = null, r;
  }
  return t.prototype.dispose = function() {
  }, t.prototype.setCursor = function() {
  }, t;
})(ds), q0 = /* @__PURE__ */ (function() {
  function e(t, r) {
    this.x = t, this.y = r;
  }
  return e;
})(), nK = [
  "click",
  "dblclick",
  "mousewheel",
  "mouseout",
  "mouseup",
  "mousedown",
  "mousemove",
  "contextmenu"
], xM = new st(0, 0, 0, 0), uU = (function(e) {
  ae(t, e);
  function t(r, n, i, a, o) {
    var s = e.call(this) || this;
    return s._hovered = new q0(0, 0), s.storage = r, s.painter = n, s.painterRoot = a, s._pointerSize = o, i = i || new rK(), s.proxy = null, s.setHandlerProxy(i), s._draggingMgr = new kj(s), s;
  }
  return t.prototype.setHandlerProxy = function(r) {
    this.proxy && this.proxy.dispose(), r && (F(nK, function(n) {
      r.on && r.on(n, this[n], this);
    }, this), r.handler = this), this.proxy = r;
  }, t.prototype.mousemove = function(r) {
    var n = r.zrX, i = r.zrY, a = fU(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 q0(n, i) : this.findHover(n, i), u = l.target, f = this.proxy;
    f.setCursor && f.setCursor(u ? u.cursor : "default"), s && u !== s && this.dispatchToElement(o, "mouseout", r), this.dispatchToElement(l, "mousemove", r), u && u !== s && this.dispatchToElement(l, "mouseover", r);
  }, t.prototype.mouseout = function(r) {
    var n = r.zrEventControl;
    n !== "only_globalout" && this.dispatchToElement(this._hovered, "mouseout", r), n !== "no_globalout" && this.trigger("globalout", { type: "globalout", event: r });
  }, t.prototype.resize = function() {
    this._hovered = new q0(0, 0);
  }, t.prototype.dispatch = function(r, n) {
    var i = this[r];
    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(r) {
    var n = this.proxy;
    n.setCursor && n.setCursor(r);
  }, t.prototype.dispatchToElement = function(r, n, i) {
    r = r || {};
    var a = r.target;
    if (!(a && a.silent)) {
      for (var o = "on" + n, s = eK(n, r, 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(r, n, i) {
    var a = this.storage.getDisplayList(), o = new q0(r, n);
    if (Y3(a, o, r, n, i), this._pointerSize && !o.target) {
      for (var s = [], l = this._pointerSize, u = l / 2, f = new st(r - u, n - u, l, l), c = a.length - 1; c >= 0; c--) {
        var h = a[c];
        h !== i && !h.ignore && !h.ignoreCoarsePointer && (!h.parent || !h.parent.ignoreCoarsePointer) && (xM.copy(h.getBoundingRect()), h.transform && xM.applyTransform(h.transform), xM.intersect(f) && s.push(h));
      }
      if (s.length)
        for (var v = 4, d = Math.PI / 12, g = Math.PI * 2, y = 0; y < u; y += v)
          for (var x = 0; x < g; x += d) {
            var S = r + y * Math.cos(x), T = n + y * Math.sin(x);
            if (Y3(s, o, S, T, i), o.target)
              return o;
          }
    }
    return o;
  }, t.prototype.processGesture = function(r, n) {
    this._gestureMgr || (this._gestureMgr = new $j());
    var i = this._gestureMgr;
    n === "start" && i.clear();
    var a = i.recognize(r, this.findHover(r.zrX, r.zrY, null).target, this.proxy.dom);
    if (n === "end" && i.clear(), a) {
      var o = a.type;
      r.gestureEvent = o;
      var s = new q0();
      s.target = a.target, this.dispatchToElement(s, o, a.event);
    }
  }, t;
})(ds);
F(["click", "mousedown", "mouseup", "mousewheel", "dblclick", "contextmenu"], function(e) {
  uU.prototype[e] = function(t) {
    var r = t.zrX, n = t.zrY, i = fU(this, r, n), a, o;
    if ((e !== "mouseup" || !i) && (a = this.findHover(r, n), o = a.target), e === "mousedown")
      this._downEl = o, this._downPoint = [t.zrX, t.zrY], this._upEl = o;
    else if (e === "mouseup")
      this._upEl = o;
    else if (e === "click") {
      if (this._downEl !== this._upEl || !this._downPoint || rf(this._downPoint, [t.zrX, t.zrY]) > 4)
        return;
      this._downPoint = null;
    }
    this.dispatchToElement(a, e, t);
  };
});
function iK(e, t, r) {
  if (e[e.rectHover ? "rectContain" : "contain"](t, r)) {
    for (var n = e, i = void 0, a = !1; n; ) {
      if (n.ignoreClip && (a = !0), !a) {
        var o = n.getClipPath();
        if (o && !o.contain(t, r))
          return !1;
      }
      n.silent && (i = !0);
      var s = n.__hostTarget;
      n = s ? n.ignoreHostSilent ? null : s : n.parent;
    }
    return i ? lU : !0;
  }
  return !1;
}
function Y3(e, t, r, n, i) {
  for (var a = e.length - 1; a >= 0; a--) {
    var o = e[a], s = void 0;
    if (o !== i && !o.ignore && (s = iK(o, r, n)) && (!t.topTarget && (t.topTarget = o), s !== lU)) {
      t.target = o;
      break;
    }
  }
}
function fU(e, t, r) {
  var n = e.painter;
  return t < 0 || t > n.getWidth() || r < 0 || r > n.getHeight();
}
var cU = 32, j0 = 7;
function aK(e) {
  for (var t = 0; e >= cU; )
    t |= e & 1, e >>= 1;
  return e + t;
}
function Z3(e, t, r, n) {
  var i = t + 1;
  if (i === r)
    return 1;
  if (n(e[i++], e[t]) < 0) {
    for (; i < r && n(e[i], e[i - 1]) < 0; )
      i++;
    oK(e, t, i);
  } else
    for (; i < r && n(e[i], e[i - 1]) >= 0; )
      i++;
  return i - t;
}
function oK(e, t, r) {
  for (r--; t < r; ) {
    var n = e[t];
    e[t++] = e[r], e[r--] = n;
  }
}
function $3(e, t, r, n, i) {
  for (n === t && n++; n < r; n++) {
    for (var a = e[n], o = t, s = n, l; o < s; )
      l = o + s >>> 1, i(a, e[l]) < 0 ? s = l : o = l + 1;
    var u = n - o;
    switch (u) {
      case 3:
        e[o + 3] = e[o + 2];
      case 2:
        e[o + 2] = e[o + 1];
      case 1:
        e[o + 1] = e[o];
        break;
      default:
        for (; u > 0; )
          e[o + u] = e[o + u - 1], u--;
    }
    e[o] = a;
  }
}
function SM(e, t, r, n, i, a) {
  var o = 0, s = 0, l = 1;
  if (a(e, t[r + i]) > 0) {
    for (s = n - i; l < s && a(e, t[r + 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(e, t[r + 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 f = o + (l - o >>> 1);
    a(e, t[r + f]) > 0 ? o = f + 1 : l = f;
  }
  return l;
}
function wM(e, t, r, n, i, a) {
  var o = 0, s = 0, l = 1;
  if (a(e, t[r + i]) < 0) {
    for (s = i + 1; l < s && a(e, t[r + 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(e, t[r + 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 f = o + (l - o >>> 1);
    a(e, t[r + f]) < 0 ? l = f : o = f + 1;
  }
  return l;
}
function sK(e, t) {
  var r = j0, 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;
      f(v);
    }
  }
  function u() {
    for (; a > 1; ) {
      var v = a - 2;
      v > 0 && i[v - 1] < i[v + 1] && v--, f(v);
    }
  }
  function f(v) {
    var d = n[v], g = i[v], y = n[v + 1], x = i[v + 1];
    i[v] = g + x, v === a - 3 && (n[v + 1] = n[v + 2], i[v + 1] = i[v + 2]), a--;
    var S = wM(e[y], e, d, g, 0, t);
    d += S, g -= S, g !== 0 && (x = SM(e[d + g - 1], e, y, x, x - 1, t), x !== 0 && (g <= x ? c(d, g, y, x) : h(d, g, y, x)));
  }
  function c(v, d, g, y) {
    var x = 0;
    for (x = 0; x < d; x++)
      o[x] = e[v + x];
    var S = 0, T = g, C = v;
    if (e[C++] = e[T++], --y === 0) {
      for (x = 0; x < d; x++)
        e[C + x] = o[S + x];
      return;
    }
    if (d === 1) {
      for (x = 0; x < y; x++)
        e[C + x] = e[T + x];
      e[C + y] = o[S];
      return;
    }
    for (var A = r, M, E, P; ; ) {
      M = 0, E = 0, P = !1;
      do
        if (t(e[T], o[S]) < 0) {
          if (e[C++] = e[T++], E++, M = 0, --y === 0) {
            P = !0;
            break;
          }
        } else if (e[C++] = o[S++], M++, E = 0, --d === 1) {
          P = !0;
          break;
        }
      while ((M | E) < A);
      if (P)
        break;
      do {
        if (M = wM(e[T], o, S, d, 0, t), M !== 0) {
          for (x = 0; x < M; x++)
            e[C + x] = o[S + x];
          if (C += M, S += M, d -= M, d <= 1) {
            P = !0;
            break;
          }
        }
        if (e[C++] = e[T++], --y === 0) {
          P = !0;
          break;
        }
        if (E = SM(o[S], e, T, y, 0, t), E !== 0) {
          for (x = 0; x < E; x++)
            e[C + x] = e[T + x];
          if (C += E, T += E, y -= E, y === 0) {
            P = !0;
            break;
          }
        }
        if (e[C++] = o[S++], --d === 1) {
          P = !0;
          break;
        }
        A--;
      } while (M >= j0 || E >= j0);
      if (P)
        break;
      A < 0 && (A = 0), A += 2;
    }
    if (r = A, r < 1 && (r = 1), d === 1) {
      for (x = 0; x < y; x++)
        e[C + x] = e[T + x];
      e[C + y] = o[S];
    } else {
      if (d === 0)
        throw new Error();
      for (x = 0; x < d; x++)
        e[C + x] = o[S + x];
    }
  }
  function h(v, d, g, y) {
    var x = 0;
    for (x = 0; x < y; x++)
      o[x] = e[g + x];
    var S = v + d - 1, T = y - 1, C = g + y - 1, A = 0, M = 0;
    if (e[C--] = e[S--], --d === 0) {
      for (A = C - (y - 1), x = 0; x < y; x++)
        e[A + x] = o[x];
      return;
    }
    if (y === 1) {
      for (C -= d, S -= d, M = C + 1, A = S + 1, x = d - 1; x >= 0; x--)
        e[M + x] = e[A + x];
      e[C] = o[T];
      return;
    }
    for (var E = r; ; ) {
      var P = 0, R = 0, O = !1;
      do
        if (t(o[T], e[S]) < 0) {
          if (e[C--] = e[S--], P++, R = 0, --d === 0) {
            O = !0;
            break;
          }
        } else if (e[C--] = o[T--], R++, P = 0, --y === 1) {
          O = !0;
          break;
        }
      while ((P | R) < E);
      if (O)
        break;
      do {
        if (P = d - wM(o[T], e, v, d, d - 1, t), P !== 0) {
          for (C -= P, S -= P, d -= P, M = C + 1, A = S + 1, x = P - 1; x >= 0; x--)
            e[M + x] = e[A + x];
          if (d === 0) {
            O = !0;
            break;
          }
        }
        if (e[C--] = o[T--], --y === 1) {
          O = !0;
          break;
        }
        if (R = y - SM(e[S], o, 0, y, y - 1, t), R !== 0) {
          for (C -= R, T -= R, y -= R, M = C + 1, A = T + 1, x = 0; x < R; x++)
            e[M + x] = o[A + x];
          if (y <= 1) {
            O = !0;
            break;
          }
        }
        if (e[C--] = e[S--], --d === 0) {
          O = !0;
          break;
        }
        E--;
      } while (P >= j0 || R >= j0);
      if (O)
        break;
      E < 0 && (E = 0), E += 2;
    }
    if (r = E, r < 1 && (r = 1), y === 1) {
      for (C -= d, S -= d, M = C + 1, A = S + 1, x = d - 1; x >= 0; x--)
        e[M + x] = e[A + x];
      e[C] = o[T];
    } else {
      if (y === 0)
        throw new Error();
      for (A = C - (y - 1), x = 0; x < y; x++)
        e[A + x] = o[x];
    }
  }
  return {
    mergeRuns: l,
    forceMergeRuns: u,
    pushRun: s
  };
}
function c2(e, t, r, n) {
  r || (r = 0), n || (n = e.length);
  var i = n - r;
  if (!(i < 2)) {
    var a = 0;
    if (i < cU) {
      a = Z3(e, r, n, t), $3(e, r, n, r + a, t);
      return;
    }
    var o = sK(e, t), s = aK(i);
    do {
      if (a = Z3(e, r, n, t), a < s) {
        var l = i;
        l > s && (l = s), $3(e, r, r + l, r + a, t), a = l;
      }
      o.pushRun(r, a), o.mergeRuns(), i -= a, r += a;
    } while (i !== 0);
    o.forceMergeRuns();
  }
}
var mo = 1, V_ = 2, Jg = 4, q3 = !1;
function TM() {
  q3 || (q3 = !0, console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"));
}
function j3(e, t) {
  return e.zlevel === t.zlevel ? e.z === t.z ? e.z2 - t.z2 : e.z - t.z : e.zlevel - t.zlevel;
}
var lK = (function() {
  function e() {
    this._roots = [], this._displayList = [], this._displayListLen = 0, this.displayableSortFunc = j3;
  }
  return e.prototype.traverse = function(t, r) {
    for (var n = 0; n < this._roots.length; n++)
      this._roots[n].traverse(t, r);
  }, e.prototype.getDisplayList = function(t, r) {
    r = r || !1;
    var n = this._displayList;
    return (t || !n.length) && this.updateDisplayList(r), n;
  }, e.prototype.updateDisplayList = function(t) {
    this._displayListLen = 0;
    for (var r = this._roots, n = this._displayList, i = 0, a = r.length; i < a; i++)
      this._updateAndAddDisplayable(r[i], null, t);
    n.length = this._displayListLen, c2(n, j3);
  }, e.prototype._updateAndAddDisplayable = function(t, r, n) {
    if (!(t.ignore && !n)) {
      t.beforeUpdate(), t.update(), t.afterUpdate();
      var i = t.getClipPath(), a = r && r.length, o = 0, s = t.__clipPaths;
      if (!t.ignoreClip && (a || i)) {
        if (s || (s = t.__clipPaths = []), a)
          for (var l = 0; l < r.length; l++)
            s[o++] = r[l];
        for (var u = i, f = t; u; )
          u.parent = f, u.updateTransform(), s[o++] = u, f = u, u = u.getClipPath();
      }
      if (s && (s.length = o), t.childrenRef) {
        for (var c = t.childrenRef(), h = 0; h < c.length; h++) {
          var v = c[h];
          t.__dirty && (v.__dirty |= mo), this._updateAndAddDisplayable(v, s, n);
        }
        t.__dirty = 0;
      } else {
        var d = t;
        isNaN(d.z) && (TM(), d.z = 0), isNaN(d.z2) && (TM(), d.z2 = 0), isNaN(d.zlevel) && (TM(), d.zlevel = 0), this._displayList[this._displayListLen++] = d;
      }
      var g = t.getDecalElement && t.getDecalElement();
      g && this._updateAndAddDisplayable(g, s, n);
      var y = t.getTextGuideLine();
      y && this._updateAndAddDisplayable(y, s, n);
      var x = t.getTextContent();
      x && this._updateAndAddDisplayable(x, s, n);
    }
  }, e.prototype.addRoot = function(t) {
    t.__zr && t.__zr.storage === this || this._roots.push(t);
  }, e.prototype.delRoot = function(t) {
    if (t instanceof Array) {
      for (var r = 0, n = t.length; r < n; r++)
        this.delRoot(t[r]);
      return;
    }
    var i = Tt(this._roots, t);
    i >= 0 && this._roots.splice(i, 1);
  }, e.prototype.delAllRoots = function() {
    this._roots = [], this._displayList = [], this._displayListLen = 0;
  }, e.prototype.getRoots = function() {
    return this._roots;
  }, e.prototype.dispose = function() {
    this._displayList = null, this._roots = null;
  }, e;
})(), V2;
V2 = Gt.hasGlobalWindow && (window.requestAnimationFrame && window.requestAnimationFrame.bind(window) || window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window) || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame) || function(e) {
  return setTimeout(e, 16);
};
var f1 = {
  linear: function(e) {
    return e;
  },
  quadraticIn: function(e) {
    return e * e;
  },
  quadraticOut: function(e) {
    return e * (2 - e);
  },
  quadraticInOut: function(e) {
    return (e *= 2) < 1 ? 0.5 * e * e : -0.5 * (--e * (e - 2) - 1);
  },
  cubicIn: function(e) {
    return e * e * e;
  },
  cubicOut: function(e) {
    return --e * e * e + 1;
  },
  cubicInOut: function(e) {
    return (e *= 2) < 1 ? 0.5 * e * e * e : 0.5 * ((e -= 2) * e * e + 2);
  },
  quarticIn: function(e) {
    return e * e * e * e;
  },
  quarticOut: function(e) {
    return 1 - --e * e * e * e;
  },
  quarticInOut: function(e) {
    return (e *= 2) < 1 ? 0.5 * e * e * e * e : -0.5 * ((e -= 2) * e * e * e - 2);
  },
  quinticIn: function(e) {
    return e * e * e * e * e;
  },
  quinticOut: function(e) {
    return --e * e * e * e * e + 1;
  },
  quinticInOut: function(e) {
    return (e *= 2) < 1 ? 0.5 * e * e * e * e * e : 0.5 * ((e -= 2) * e * e * e * e + 2);
  },
  sinusoidalIn: function(e) {
    return 1 - Math.cos(e * Math.PI / 2);
  },
  sinusoidalOut: function(e) {
    return Math.sin(e * Math.PI / 2);
  },
  sinusoidalInOut: function(e) {
    return 0.5 * (1 - Math.cos(Math.PI * e));
  },
  exponentialIn: function(e) {
    return e === 0 ? 0 : Math.pow(1024, e - 1);
  },
  exponentialOut: function(e) {
    return e === 1 ? 1 : 1 - Math.pow(2, -10 * e);
  },
  exponentialInOut: function(e) {
    return e === 0 ? 0 : e === 1 ? 1 : (e *= 2) < 1 ? 0.5 * Math.pow(1024, e - 1) : 0.5 * (-Math.pow(2, -10 * (e - 1)) + 2);
  },
  circularIn: function(e) {
    return 1 - Math.sqrt(1 - e * e);
  },
  circularOut: function(e) {
    return Math.sqrt(1 - --e * e);
  },
  circularInOut: function(e) {
    return (e *= 2) < 1 ? -0.5 * (Math.sqrt(1 - e * e) - 1) : 0.5 * (Math.sqrt(1 - (e -= 2) * e) + 1);
  },
  elasticIn: function(e) {
    var t, r = 0.1, n = 0.4;
    return e === 0 ? 0 : e === 1 ? 1 : (!r || r < 1 ? (r = 1, t = n / 4) : t = n * Math.asin(1 / r) / (2 * Math.PI), -(r * Math.pow(2, 10 * (e -= 1)) * Math.sin((e - t) * (2 * Math.PI) / n)));
  },
  elasticOut: function(e) {
    var t, r = 0.1, n = 0.4;
    return e === 0 ? 0 : e === 1 ? 1 : (!r || r < 1 ? (r = 1, t = n / 4) : t = n * Math.asin(1 / r) / (2 * Math.PI), r * Math.pow(2, -10 * e) * Math.sin((e - t) * (2 * Math.PI) / n) + 1);
  },
  elasticInOut: function(e) {
    var t, r = 0.1, n = 0.4;
    return e === 0 ? 0 : e === 1 ? 1 : (!r || r < 1 ? (r = 1, t = n / 4) : t = n * Math.asin(1 / r) / (2 * Math.PI), (e *= 2) < 1 ? -0.5 * (r * Math.pow(2, 10 * (e -= 1)) * Math.sin((e - t) * (2 * Math.PI) / n)) : r * Math.pow(2, -10 * (e -= 1)) * Math.sin((e - t) * (2 * Math.PI) / n) * 0.5 + 1);
  },
  backIn: function(e) {
    var t = 1.70158;
    return e * e * ((t + 1) * e - t);
  },
  backOut: function(e) {
    var t = 1.70158;
    return --e * e * ((t + 1) * e + t) + 1;
  },
  backInOut: function(e) {
    var t = 2.5949095;
    return (e *= 2) < 1 ? 0.5 * (e * e * ((t + 1) * e - t)) : 0.5 * ((e -= 2) * e * ((t + 1) * e + t) + 2);
  },
  bounceIn: function(e) {
    return 1 - f1.bounceOut(1 - e);
  },
  bounceOut: function(e) {
    return e < 1 / 2.75 ? 7.5625 * e * e : e < 2 / 2.75 ? 7.5625 * (e -= 1.5 / 2.75) * e + 0.75 : e < 2.5 / 2.75 ? 7.5625 * (e -= 2.25 / 2.75) * e + 0.9375 : 7.5625 * (e -= 2.625 / 2.75) * e + 0.984375;
  },
  bounceInOut: function(e) {
    return e < 0.5 ? f1.bounceIn(e * 2) * 0.5 : f1.bounceOut(e * 2 - 1) * 0.5 + 0.5;
  }
}, Lw = Math.pow, Gc = Math.sqrt, H2 = 1e-8, hU = 1e-4, K3 = Gc(3), Dw = 1 / 3, Fl = th(), ts = th(), vm = th();
function Pc(e) {
  return e > -H2 && e < H2;
}
function vU(e) {
  return e > H2 || e < -H2;
}
function Jn(e, t, r, n, i) {
  var a = 1 - i;
  return a * a * (a * e + 3 * i * t) + i * i * (i * n + 3 * a * r);
}
function Q3(e, t, r, n, i) {
  var a = 1 - i;
  return 3 * (((t - e) * a + 2 * (r - t) * i) * a + (n - r) * i * i);
}
function U2(e, t, r, n, i, a) {
  var o = n + 3 * (t - r) - e, s = 3 * (r - t * 2 + e), l = 3 * (t - e), u = e - i, f = s * s - 3 * o * l, c = s * l - 9 * o * u, h = l * l - 3 * s * u, v = 0;
  if (Pc(f) && Pc(c))
    if (Pc(s))
      a[0] = 0;
    else {
      var d = -l / s;
      d >= 0 && d <= 1 && (a[v++] = d);
    }
  else {
    var g = c * c - 4 * f * h;
    if (Pc(g)) {
      var y = c / f, d = -s / o + y, x = -y / 2;
      d >= 0 && d <= 1 && (a[v++] = d), x >= 0 && x <= 1 && (a[v++] = x);
    } else if (g > 0) {
      var S = Gc(g), T = f * s + 1.5 * o * (-c + S), C = f * s + 1.5 * o * (-c - S);
      T < 0 ? T = -Lw(-T, Dw) : T = Lw(T, Dw), C < 0 ? C = -Lw(-C, Dw) : C = Lw(C, Dw);
      var d = (-s - (T + C)) / (3 * o);
      d >= 0 && d <= 1 && (a[v++] = d);
    } else {
      var A = (2 * f * s - 3 * o * c) / (2 * Gc(f * f * f)), M = Math.acos(A) / 3, E = Gc(f), P = Math.cos(M), d = (-s - 2 * E * P) / (3 * o), x = (-s + E * (P + K3 * Math.sin(M))) / (3 * o), R = (-s + E * (P - K3 * Math.sin(M))) / (3 * o);
      d >= 0 && d <= 1 && (a[v++] = d), x >= 0 && x <= 1 && (a[v++] = x), R >= 0 && R <= 1 && (a[v++] = R);
    }
  }
  return v;
}
function dU(e, t, r, n, i) {
  var a = 6 * r - 12 * t + 6 * e, o = 9 * t + 3 * n - 3 * e - 9 * r, s = 3 * t - 3 * e, l = 0;
  if (Pc(o)) {
    if (vU(a)) {
      var u = -s / a;
      u >= 0 && u <= 1 && (i[l++] = u);
    }
  } else {
    var f = a * a - 4 * o * s;
    if (Pc(f))
      i[0] = -a / (2 * o);
    else if (f > 0) {
      var c = Gc(f), u = (-a + c) / (2 * o), h = (-a - c) / (2 * o);
      u >= 0 && u <= 1 && (i[l++] = u), h >= 0 && h <= 1 && (i[l++] = h);
    }
  }
  return l;
}
function Yc(e, t, r, n, i, a) {
  var o = (t - e) * i + e, s = (r - t) * i + t, l = (n - r) * i + r, u = (s - o) * i + o, f = (l - s) * i + s, c = (f - u) * i + u;
  a[0] = e, a[1] = o, a[2] = u, a[3] = c, a[4] = c, a[5] = f, a[6] = l, a[7] = n;
}
function pU(e, t, r, n, i, a, o, s, l, u, f) {
  var c, h = 5e-3, v = 1 / 0, d, g, y, x;
  Fl[0] = l, Fl[1] = u;
  for (var S = 0; S < 1; S += 0.05)
    ts[0] = Jn(e, r, i, o, S), ts[1] = Jn(t, n, a, s, S), y = Fc(Fl, ts), y < v && (c = S, v = y);
  v = 1 / 0;
  for (var T = 0; T < 32 && !(h < hU); T++)
    d = c - h, g = c + h, ts[0] = Jn(e, r, i, o, d), ts[1] = Jn(t, n, a, s, d), y = Fc(ts, Fl), d >= 0 && y < v ? (c = d, v = y) : (vm[0] = Jn(e, r, i, o, g), vm[1] = Jn(t, n, a, s, g), x = Fc(vm, Fl), g <= 1 && x < v ? (c = g, v = x) : h *= 0.5);
  return f && (f[0] = Jn(e, r, i, o, c), f[1] = Jn(t, n, a, s, c)), Gc(v);
}
function uK(e, t, r, n, i, a, o, s, l) {
  for (var u = e, f = t, c = 0, h = 1 / l, v = 1; v <= l; v++) {
    var d = v * h, g = Jn(e, r, i, o, d), y = Jn(t, n, a, s, d), x = g - u, S = y - f;
    c += Math.sqrt(x * x + S * S), u = g, f = y;
  }
  return c;
}
function Si(e, t, r, n) {
  var i = 1 - n;
  return i * (i * e + 2 * n * t) + n * n * r;
}
function BE(e, t, r, n) {
  return 2 * ((1 - n) * (t - e) + n * (r - t));
}
function fK(e, t, r, n, i) {
  var a = e - 2 * t + r, o = 2 * (t - e), s = e - n, l = 0;
  if (Pc(a)) {
    if (vU(o)) {
      var u = -s / o;
      u >= 0 && u <= 1 && (i[l++] = u);
    }
  } else {
    var f = o * o - 4 * a * s;
    if (Pc(f)) {
      var u = -o / (2 * a);
      u >= 0 && u <= 1 && (i[l++] = u);
    } else if (f > 0) {
      var c = Gc(f), u = (-o + c) / (2 * a), h = (-o - c) / (2 * a);
      u >= 0 && u <= 1 && (i[l++] = u), h >= 0 && h <= 1 && (i[l++] = h);
    }
  }
  return l;
}
function gU(e, t, r) {
  var n = e + r - 2 * t;
  return n === 0 ? 0.5 : (e - t) / n;
}
function E1(e, t, r, n, i) {
  var a = (t - e) * n + e, o = (r - t) * n + t, s = (o - a) * n + a;
  i[0] = e, i[1] = a, i[2] = s, i[3] = s, i[4] = o, i[5] = r;
}
function mU(e, t, r, n, i, a, o, s, l) {
  var u, f = 5e-3, c = 1 / 0;
  Fl[0] = o, Fl[1] = s;
  for (var h = 0; h < 1; h += 0.05) {
    ts[0] = Si(e, r, i, h), ts[1] = Si(t, n, a, h);
    var v = Fc(Fl, ts);
    v < c && (u = h, c = v);
  }
  c = 1 / 0;
  for (var d = 0; d < 32 && !(f < hU); d++) {
    var g = u - f, y = u + f;
    ts[0] = Si(e, r, i, g), ts[1] = Si(t, n, a, g);
    var v = Fc(ts, Fl);
    if (g >= 0 && v < c)
      u = g, c = v;
    else {
      vm[0] = Si(e, r, i, y), vm[1] = Si(t, n, a, y);
      var x = Fc(vm, Fl);
      y <= 1 && x < c ? (u = y, c = x) : f *= 0.5;
    }
  }
  return l && (l[0] = Si(e, r, i, u), l[1] = Si(t, n, a, u)), Gc(c);
}
function cK(e, t, r, n, i, a, o) {
  for (var s = e, l = t, u = 0, f = 1 / o, c = 1; c <= o; c++) {
    var h = c * f, v = Si(e, r, i, h), d = Si(t, n, a, h), g = v - s, y = d - l;
    u += Math.sqrt(g * g + y * y), s = v, l = d;
  }
  return u;
}
var hK = /cubic-bezier\(([0-9,\.e ]+)\)/;
function fR(e) {
  var t = e && hK.exec(e);
  if (t) {
    var r = t[1].split(","), n = +_o(r[0]), i = +_o(r[1]), a = +_o(r[2]), o = +_o(r[3]);
    if (isNaN(n + i + a + o))
      return;
    var s = [];
    return function(l) {
      return l <= 0 ? 0 : l >= 1 ? 1 : U2(0, n, a, 1, l, s) && Jn(0, i, o, 1, s[0]);
    };
  }
}
var vK = (function() {
  function e(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 || un, this.ondestroy = t.ondestroy || un, this.onrestart = t.onrestart || un, t.easing && this.setEasing(t.easing);
  }
  return e.prototype.step = function(t, r) {
    if (this._inited || (this._startTime = t + this._delay, this._inited = !0), this._paused) {
      this._pausedTime += r;
      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;
  }, e.prototype.pause = function() {
    this._paused = !0;
  }, e.prototype.resume = function() {
    this._paused = !1;
  }, e.prototype.setEasing = function(t) {
    this.easing = t, this.easingFunc = nt(t) ? t : f1[t] || fR(t);
  }, e;
})(), yU = /* @__PURE__ */ (function() {
  function e(t) {
    this.value = t;
  }
  return e;
})(), dK = (function() {
  function e() {
    this._len = 0;
  }
  return e.prototype.insert = function(t) {
    var r = new yU(t);
    return this.insertEntry(r), r;
  }, e.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++;
  }, e.prototype.remove = function(t) {
    var r = t.prev, n = t.next;
    r ? r.next = n : this.head = n, n ? n.prev = r : this.tail = r, t.next = t.prev = null, this._len--;
  }, e.prototype.len = function() {
    return this._len;
  }, e.prototype.clear = function() {
    this.head = this.tail = null, this._len = 0;
  }, e;
})(), xm = (function() {
  function e(t) {
    this._list = new dK(), this._maxSize = 10, this._map = {}, this._maxSize = t;
  }
  return e.prototype.put = function(t, r) {
    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 = r : s = new yU(r), s.key = t, n.insertEntry(s), i[t] = s;
    }
    return a;
  }, e.prototype.get = function(t) {
    var r = this._map[t], n = this._list;
    if (r != null)
      return r !== n.tail && (n.remove(r), n.insertEntry(r)), r.value;
  }, e.prototype.clear = function() {
    this._list.clear(), this._map = {};
  }, e.prototype.len = function() {
    return this._list.len();
  }, e;
})(), J3 = {
  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 Us(e) {
  return e = Math.round(e), e < 0 ? 0 : e > 255 ? 255 : e;
}
function pK(e) {
  return e = Math.round(e), e < 0 ? 0 : e > 360 ? 360 : e;
}
function P1(e) {
  return e < 0 ? 0 : e > 1 ? 1 : e;
}
function h2(e) {
  var t = e;
  return t.length && t.charAt(t.length - 1) === "%" ? Us(parseFloat(t) / 100 * 255) : Us(parseInt(t, 10));
}
function lf(e) {
  var t = e;
  return t.length && t.charAt(t.length - 1) === "%" ? P1(parseFloat(t) / 100) : P1(parseFloat(t));
}
function bM(e, t, r) {
  return r < 0 ? r += 1 : r > 1 && (r -= 1), r * 6 < 1 ? e + (t - e) * r * 6 : r * 2 < 1 ? t : r * 3 < 2 ? e + (t - e) * (2 / 3 - r) * 6 : e;
}
function Ic(e, t, r) {
  return e + (t - e) * r;
}
function qo(e, t, r, n, i) {
  return e[0] = t, e[1] = r, e[2] = n, e[3] = i, e;
}
function zE(e, t) {
  return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e;
}
var _U = new xm(20), Ew = null;
function gg(e, t) {
  Ew && zE(Ew, t), Ew = _U.put(e, Ew || t.slice());
}
function bi(e, t) {
  if (e) {
    t = t || [];
    var r = _U.get(e);
    if (r)
      return zE(t, r);
    e = e + "";
    var n = e.replace(/ /g, "").toLowerCase();
    if (n in J3)
      return zE(t, J3[n]), gg(e, 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)) {
          qo(t, 0, 0, 0, 1);
          return;
        }
        return qo(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), gg(e, t), t;
      } else if (i === 7 || i === 9) {
        var a = parseInt(n.slice(1, 7), 16);
        if (!(a >= 0 && a <= 16777215)) {
          qo(t, 0, 0, 0, 1);
          return;
        }
        return qo(t, (a & 16711680) >> 16, (a & 65280) >> 8, a & 255, i === 9 ? parseInt(n.slice(7), 16) / 255 : 1), gg(e, 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(","), f = 1;
      switch (l) {
        case "rgba":
          if (u.length !== 4)
            return u.length === 3 ? qo(t, +u[0], +u[1], +u[2], 1) : qo(t, 0, 0, 0, 1);
          f = lf(u.pop());
        case "rgb":
          if (u.length >= 3)
            return qo(t, h2(u[0]), h2(u[1]), h2(u[2]), u.length === 3 ? f : lf(u[3])), gg(e, t), t;
          qo(t, 0, 0, 0, 1);
          return;
        case "hsla":
          if (u.length !== 4) {
            qo(t, 0, 0, 0, 1);
            return;
          }
          return u[3] = lf(u[3]), FE(u, t), gg(e, t), t;
        case "hsl":
          if (u.length !== 3) {
            qo(t, 0, 0, 0, 1);
            return;
          }
          return FE(u, t), gg(e, t), t;
        default:
          return;
      }
    }
    qo(t, 0, 0, 0, 1);
  }
}
function FE(e, t) {
  var r = (parseFloat(e[0]) % 360 + 360) % 360 / 360, n = lf(e[1]), i = lf(e[2]), a = i <= 0.5 ? i * (n + 1) : i + n - i * n, o = i * 2 - a;
  return t = t || [], qo(t, Us(bM(o, a, r + 1 / 3) * 255), Us(bM(o, a, r) * 255), Us(bM(o, a, r - 1 / 3) * 255), 1), e.length === 4 && (t[3] = e[3]), t;
}
function gK(e) {
  if (e) {
    var t = e[0] / 255, r = e[1] / 255, n = e[2] / 255, i = Math.min(t, r, n), a = Math.max(t, r, 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 f = ((a - t) / 6 + o / 2) / o, c = ((a - r) / 6 + o / 2) / o, h = ((a - n) / 6 + o / 2) / o;
      t === a ? l = h - c : r === a ? l = 1 / 3 + f - h : n === a && (l = 2 / 3 + c - f), l < 0 && (l += 1), l > 1 && (l -= 1);
    }
    var v = [l * 360, u, s];
    return e[3] != null && v.push(e[3]), v;
  }
}
function _d(e, t) {
  var r = bi(e);
  if (r) {
    for (var n = 0; n < 3; n++)
      t < 0 ? r[n] = r[n] * (1 - t) | 0 : r[n] = (255 - r[n]) * t + r[n] | 0, r[n] > 255 ? r[n] = 255 : r[n] < 0 && (r[n] = 0);
    return os(r, r.length === 4 ? "rgba" : "rgb");
  }
}
function mK(e) {
  var t = bi(e);
  if (t)
    return ((1 << 24) + (t[0] << 16) + (t[1] << 8) + +t[2]).toString(16).slice(1);
}
function c1(e, t, r) {
  if (!(!(t && t.length) || !(e >= 0 && e <= 1))) {
    r = r || [];
    var n = e * (t.length - 1), i = Math.floor(n), a = Math.ceil(n), o = t[i], s = t[a], l = n - i;
    return r[0] = Us(Ic(o[0], s[0], l)), r[1] = Us(Ic(o[1], s[1], l)), r[2] = Us(Ic(o[2], s[2], l)), r[3] = P1(Ic(o[3], s[3], l)), r;
  }
}
var yK = c1;
function cR(e, t, r) {
  if (!(!(t && t.length) || !(e >= 0 && e <= 1))) {
    var n = e * (t.length - 1), i = Math.floor(n), a = Math.ceil(n), o = bi(t[i]), s = bi(t[a]), l = n - i, u = os([
      Us(Ic(o[0], s[0], l)),
      Us(Ic(o[1], s[1], l)),
      Us(Ic(o[2], s[2], l)),
      P1(Ic(o[3], s[3], l))
    ], "rgba");
    return r ? {
      color: u,
      leftIndex: i,
      rightIndex: a,
      value: n
    } : u;
  }
}
var _K = cR;
function uf(e, t, r, n) {
  var i = bi(e);
  if (e)
    return i = gK(i), t != null && (i[0] = pK(nt(t) ? t(i[0]) : t)), r != null && (i[1] = lf(nt(r) ? r(i[1]) : r)), n != null && (i[2] = lf(nt(n) ? n(i[2]) : n)), os(FE(i), "rgba");
}
function I1(e, t) {
  var r = bi(e);
  if (r && t != null)
    return r[3] = P1(t), os(r, "rgba");
}
function os(e, t) {
  if (!(!e || !e.length)) {
    var r = e[0] + "," + e[1] + "," + e[2];
    return (t === "rgba" || t === "hsva" || t === "hsla") && (r += "," + e[3]), t + "(" + r + ")";
  }
}
function R1(e, t) {
  var r = bi(e);
  return r ? (0.299 * r[0] + 0.587 * r[1] + 0.114 * r[2]) * r[3] / 255 + (1 - r[3]) * t : 0;
}
function xK() {
  return os([
    Math.round(Math.random() * 255),
    Math.round(Math.random() * 255),
    Math.round(Math.random() * 255)
  ], "rgb");
}
var ek = new xm(100);
function W2(e) {
  if (Fe(e)) {
    var t = ek.get(e);
    return t || (t = _d(e, -0.1), ek.put(e, t)), t;
  } else if (yx(e)) {
    var r = xe({}, e);
    return r.colorStops = Ce(e.colorStops, function(n) {
      return {
        offset: n.offset,
        color: _d(n.color, -0.1)
      };
    }), r;
  }
  return e;
}
const SK = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  fastLerp: c1,
  fastMapToColor: yK,
  lerp: cR,
  lift: _d,
  liftColor: W2,
  lum: R1,
  mapToColor: _K,
  modifyAlpha: I1,
  modifyHSL: uf,
  parse: bi,
  parseCssFloat: lf,
  parseCssInt: h2,
  random: xK,
  stringify: os,
  toHex: mK
}, Symbol.toStringTag, { value: "Module" }));
var X2 = Math.round;
function O1(e) {
  var t;
  if (!e || e === "transparent")
    e = "none";
  else if (typeof e == "string" && e.indexOf("rgba") > -1) {
    var r = bi(e);
    r && (e = "rgb(" + r[0] + "," + r[1] + "," + r[2] + ")", t = r[3]);
  }
  return {
    color: e,
    opacity: t ?? 1
  };
}
var tk = 1e-4;
function Rc(e) {
  return e < tk && e > -tk;
}
function Pw(e) {
  return X2(e * 1e3) / 1e3;
}
function GE(e) {
  return X2(e * 1e4) / 1e4;
}
function wK(e) {
  return "matrix(" + Pw(e[0]) + "," + Pw(e[1]) + "," + Pw(e[2]) + "," + Pw(e[3]) + "," + GE(e[4]) + "," + GE(e[5]) + ")";
}
var TK = {
  left: "start",
  right: "end",
  center: "middle",
  middle: "middle"
};
function bK(e, t, r) {
  return r === "top" ? e += t / 2 : r === "bottom" && (e -= t / 2), e;
}
function CK(e) {
  return e && (e.shadowBlur || e.shadowOffsetX || e.shadowOffsetY);
}
function AK(e) {
  var t = e.style, r = e.getGlobalScale();
  return [
    t.shadowColor,
    (t.shadowBlur || 0).toFixed(2),
    (t.shadowOffsetX || 0).toFixed(2),
    (t.shadowOffsetY || 0).toFixed(2),
    r[0],
    r[1]
  ].join(",");
}
function xU(e) {
  return e && !!e.image;
}
function MK(e) {
  return e && !!e.svgElement;
}
function hR(e) {
  return xU(e) || MK(e);
}
function SU(e) {
  return e.type === "linear";
}
function wU(e) {
  return e.type === "radial";
}
function TU(e) {
  return e && (e.type === "linear" || e.type === "radial");
}
function dC(e) {
  return "url(#" + e + ")";
}
function bU(e) {
  var t = e.getGlobalScale(), r = Math.max(t[0], t[1]);
  return Math.max(Math.ceil(Math.log(r) / Math.log(10)), 1);
}
function CU(e) {
  var t = e.x || 0, r = e.y || 0, n = (e.rotation || 0) * o1, i = et(e.scaleX, 1), a = et(e.scaleY, 1), o = e.skewX || 0, s = e.skewY || 0, l = [];
  return (t || r) && l.push("translate(" + t + "px," + r + "px)"), n && l.push("rotate(" + n + ")"), (i !== 1 || a !== 1) && l.push("scale(" + i + "," + a + ")"), (o || s) && l.push("skew(" + X2(o * o1) + "deg, " + X2(s * o1) + "deg)"), l.join(" ");
}
var LK = (function() {
  return Gt.hasGlobalWindow && nt(window.btoa) ? function(e) {
    return window.btoa(unescape(encodeURIComponent(e)));
  } : typeof Buffer < "u" ? function(e) {
    return Buffer.from(e).toString("base64");
  } : function(e) {
    return null;
  };
})(), VE = Array.prototype.slice;
function ju(e, t, r) {
  return (t - e) * r + e;
}
function CM(e, t, r, n) {
  for (var i = t.length, a = 0; a < i; a++)
    e[a] = ju(t[a], r[a], n);
  return e;
}
function DK(e, t, r, n) {
  for (var i = t.length, a = i && t[0].length, o = 0; o < i; o++) {
    e[o] || (e[o] = []);
    for (var s = 0; s < a; s++)
      e[o][s] = ju(t[o][s], r[o][s], n);
  }
  return e;
}
function Iw(e, t, r, n) {
  for (var i = t.length, a = 0; a < i; a++)
    e[a] = t[a] + r[a] * n;
  return e;
}
function rk(e, t, r, n) {
  for (var i = t.length, a = i && t[0].length, o = 0; o < i; o++) {
    e[o] || (e[o] = []);
    for (var s = 0; s < a; s++)
      e[o][s] = t[o][s] + r[o][s] * n;
  }
  return e;
}
function EK(e, t) {
  for (var r = e.length, n = t.length, i = r > n ? t : e, a = Math.min(r, n), o = i[a - 1] || { color: [0, 0, 0, 0], offset: 0 }, s = a; s < Math.max(r, n); s++)
    i.push({
      offset: o.offset,
      color: o.color.slice()
    });
}
function PK(e, t, r) {
  var n = e, 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(r === 1 ? i[l] : VE.call(i[l]));
    }
    for (var u = n[0] && n[0].length, l = 0; l < n.length; l++)
      if (r === 1)
        isNaN(n[l]) && (n[l] = i[l]);
      else
        for (var f = 0; f < u; f++)
          isNaN(n[l][f]) && (n[l][f] = i[l][f]);
  }
}
function h1(e) {
  if (Vi(e)) {
    var t = e.length;
    if (Vi(e[0])) {
      for (var r = [], n = 0; n < t; n++)
        r.push(VE.call(e[n]));
      return r;
    }
    return VE.call(e);
  }
  return e;
}
function v2(e) {
  return e[0] = Math.floor(e[0]) || 0, e[1] = Math.floor(e[1]) || 0, e[2] = Math.floor(e[2]) || 0, e[3] = e[3] == null ? 1 : e[3], "rgba(" + e.join(",") + ")";
}
function IK(e) {
  return Vi(e && e[0]) ? 2 : 1;
}
var Rw = 0, d2 = 1, AU = 2, H_ = 3, HE = 4, UE = 5, nk = 6;
function ik(e) {
  return e === HE || e === UE;
}
function Ow(e) {
  return e === d2 || e === AU;
}
var K0 = [0, 0, 0, 0], RK = (function() {
  function e(t) {
    this.keyframes = [], this.discrete = !1, this._invalid = !1, this._needsSort = !1, this._lastFr = 0, this._lastFrP = 0, this.propName = t;
  }
  return e.prototype.isFinished = function() {
    return this._finished;
  }, e.prototype.setFinished = function() {
    this._finished = !0, this._additiveTrack && this._additiveTrack.setFinished();
  }, e.prototype.needsAnimate = function() {
    return this.keyframes.length >= 1;
  }, e.prototype.getAdditiveTrack = function() {
    return this._additiveTrack;
  }, e.prototype.addKeyframe = function(t, r, n) {
    this._needsSort = !0;
    var i = this.keyframes, a = i.length, o = !1, s = nk, l = r;
    if (Vi(r)) {
      var u = IK(r);
      s = u, (u === 1 && !Xt(r[0]) || u === 2 && !Xt(r[0][0])) && (o = !0);
    } else if (Xt(r) && !Gi(r))
      s = Rw;
    else if (Fe(r))
      if (!isNaN(+r))
        s = Rw;
      else {
        var f = bi(r);
        f && (l = f, s = H_);
      }
    else if (yx(r)) {
      var c = xe({}, l);
      c.colorStops = Ce(r.colorStops, function(v) {
        return {
          offset: v.offset,
          color: bi(v.color)
        };
      }), SU(r) ? s = HE : wU(r) && (s = UE), l = c;
    }
    a === 0 ? this.valType = s : (s !== this.valType || s === nk) && (o = !0), this.discrete = this.discrete || o;
    var h = {
      time: t,
      value: l,
      rawValue: r,
      percent: 0
    };
    return n && (h.easing = n, h.easingFunc = nt(n) ? n : f1[n] || fR(n)), i.push(h), h;
  }, e.prototype.prepare = function(t, r) {
    var n = this.keyframes;
    this._needsSort && n.sort(function(g, y) {
      return g.time - y.time;
    });
    for (var i = this.valType, a = n.length, o = n[a - 1], s = this.discrete, l = Ow(i), u = ik(i), f = 0; f < a; f++) {
      var c = n[f], h = c.value, v = o.value;
      c.percent = c.time / t, s || (l && f !== a - 1 ? PK(h, v, i) : u && EK(h.colorStops, v.colorStops));
    }
    if (!s && i !== UE && r && this.needsAnimate() && r.needsAnimate() && i === r.valType && !r._finished) {
      this._additiveTrack = r;
      for (var d = n[0].value, f = 0; f < a; f++)
        i === Rw ? n[f].additiveValue = n[f].value - d : i === H_ ? n[f].additiveValue = Iw([], n[f].value, d, -1) : Ow(i) && (n[f].additiveValue = i === d2 ? Iw([], n[f].value, d, -1) : rk([], n[f].value, d, -1));
    }
  }, e.prototype.step = function(t, r) {
    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 === H_, f, c = this._lastFr, h = Math.min, v, d;
      if (s === 1)
        v = d = o[0];
      else {
        if (r < 0)
          f = 0;
        else if (r < this._lastFrP) {
          var g = h(c + 1, s - 1);
          for (f = g; f >= 0 && !(o[f].percent <= r); f--)
            ;
          f = h(f, s - 2);
        } else {
          for (f = c; f < s && !(o[f].percent > r); f++)
            ;
          f = h(f - 1, s - 2);
        }
        d = o[f + 1], v = o[f];
      }
      if (v && d) {
        this._lastFr = f, this._lastFrP = r;
        var y = d.percent - v.percent, x = y === 0 ? 1 : h((r - v.percent) / y, 1);
        d.easingFunc && (x = d.easingFunc(x));
        var S = n ? this._additiveValue : u ? K0 : t[l];
        if ((Ow(a) || u) && !S && (S = this._additiveValue = []), this.discrete)
          t[l] = x < 1 ? v.rawValue : d.rawValue;
        else if (Ow(a))
          a === d2 ? CM(S, v[i], d[i], x) : DK(S, v[i], d[i], x);
        else if (ik(a)) {
          var T = v[i], C = d[i], A = a === HE;
          t[l] = {
            type: A ? "linear" : "radial",
            x: ju(T.x, C.x, x),
            y: ju(T.y, C.y, x),
            colorStops: Ce(T.colorStops, function(E, P) {
              var R = C.colorStops[P];
              return {
                offset: ju(E.offset, R.offset, x),
                color: v2(CM([], E.color, R.color, x))
              };
            }),
            global: C.global
          }, A ? (t[l].x2 = ju(T.x2, C.x2, x), t[l].y2 = ju(T.y2, C.y2, x)) : t[l].r = ju(T.r, C.r, x);
        } else if (u)
          CM(S, v[i], d[i], x), n || (t[l] = v2(S));
        else {
          var M = ju(v[i], d[i], x);
          n ? this._additiveValue = M : t[l] = M;
        }
        n && this._addToTarget(t);
      }
    }
  }, e.prototype._addToTarget = function(t) {
    var r = this.valType, n = this.propName, i = this._additiveValue;
    r === Rw ? t[n] = t[n] + i : r === H_ ? (bi(t[n], K0), Iw(K0, K0, i, 1), t[n] = v2(K0)) : r === d2 ? Iw(t[n], t[n], i, 1) : r === AU && rk(t[n], t[n], i, 1);
  }, e;
})(), vR = (function() {
  function e(t, r, n, i) {
    if (this._tracks = {}, this._trackKeys = [], this._maxTime = 0, this._started = 0, this._clip = null, this._target = t, this._loop = r, r && i) {
      uC("Can' use additive animation on looped animation.");
      return;
    }
    this._additiveAnimators = i, this._allowDiscrete = n;
  }
  return e.prototype.getMaxTime = function() {
    return this._maxTime;
  }, e.prototype.getDelay = function() {
    return this._delay;
  }, e.prototype.getLoop = function() {
    return this._loop;
  }, e.prototype.getTarget = function() {
    return this._target;
  }, e.prototype.changeTarget = function(t) {
    this._target = t;
  }, e.prototype.when = function(t, r, n) {
    return this.whenWithKeys(t, r, Ht(r), n);
  }, e.prototype.whenWithKeys = function(t, r, 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 RK(s);
        var u = void 0, f = this._getAdditiveTrack(s);
        if (f) {
          var c = f.keyframes, h = c[c.length - 1];
          u = h && h.value, f.valType === H_ && u && (u = v2(u));
        } else
          u = this._target[s];
        if (u == null)
          continue;
        t > 0 && l.addKeyframe(0, h1(u), i), this._trackKeys.push(s);
      }
      l.addKeyframe(t, h1(r[s]), i);
    }
    return this._maxTime = Math.max(this._maxTime, t), this;
  }, e.prototype.pause = function() {
    this._clip.pause(), this._paused = !0;
  }, e.prototype.resume = function() {
    this._clip.resume(), this._paused = !1;
  }, e.prototype.isPaused = function() {
    return !!this._paused;
  }, e.prototype.duration = function(t) {
    return this._maxTime = t, this._force = !0, this;
  }, e.prototype._doneCallback = function() {
    this._setTracksFinished(), this._clip = null;
    var t = this._doneCbs;
    if (t)
      for (var r = t.length, n = 0; n < r; n++)
        t[n].call(this);
  }, e.prototype._abortedCallback = function() {
    this._setTracksFinished();
    var t = this.animation, r = this._abortedCbs;
    if (t && t.removeClip(this._clip), this._clip = null, r)
      for (var n = 0; n < r.length; n++)
        r[n].call(this);
  }, e.prototype._setTracksFinished = function() {
    for (var t = this._tracks, r = this._trackKeys, n = 0; n < r.length; n++)
      t[r[n]].setFinished();
  }, e.prototype._getAdditiveTrack = function(t) {
    var r, n = this._additiveAnimators;
    if (n)
      for (var i = 0; i < n.length; i++) {
        var a = n[i].getTrack(t);
        a && (r = a);
      }
    return r;
  }, e.prototype.start = function(t) {
    if (!(this._started > 0)) {
      this._started = 1;
      for (var r = 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, f = u.length;
        if (s.prepare(i, l), s.needsAnimate())
          if (!this._allowDiscrete && s.discrete) {
            var c = u[f - 1];
            c && (r._target[s.propName] = c.rawValue), s.setFinished();
          } else
            n.push(s);
      }
      if (n.length || this._force) {
        var h = new vK({
          life: i,
          loop: this._loop,
          delay: this._delay || 0,
          onframe: function(v) {
            r._started = 2;
            var d = r._additiveAnimators;
            if (d) {
              for (var g = !1, y = 0; y < d.length; y++)
                if (d[y]._clip) {
                  g = !0;
                  break;
                }
              g || (r._additiveAnimators = null);
            }
            for (var y = 0; y < n.length; y++)
              n[y].step(r._target, v);
            var x = r._onframeCbs;
            if (x)
              for (var y = 0; y < x.length; y++)
                x[y](r._target, v);
          },
          ondestroy: function() {
            r._doneCallback();
          }
        });
        this._clip = h, this.animation && this.animation.addClip(h), t && h.setEasing(t);
      } else
        this._doneCallback();
      return this;
    }
  }, e.prototype.stop = function(t) {
    if (this._clip) {
      var r = this._clip;
      t && r.onframe(1), this._abortedCallback();
    }
  }, e.prototype.delay = function(t) {
    return this._delay = t, this;
  }, e.prototype.during = function(t) {
    return t && (this._onframeCbs || (this._onframeCbs = []), this._onframeCbs.push(t)), this;
  }, e.prototype.done = function(t) {
    return t && (this._doneCbs || (this._doneCbs = []), this._doneCbs.push(t)), this;
  }, e.prototype.aborted = function(t) {
    return t && (this._abortedCbs || (this._abortedCbs = []), this._abortedCbs.push(t)), this;
  }, e.prototype.getClip = function() {
    return this._clip;
  }, e.prototype.getTrack = function(t) {
    return this._tracks[t];
  }, e.prototype.getTracks = function() {
    var t = this;
    return Ce(this._trackKeys, function(r) {
      return t._tracks[r];
    });
  }, e.prototype.stopTracks = function(t, r) {
    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() && (r ? 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;
  }, e.prototype.saveTo = function(t, r, n) {
    if (t) {
      r = r || this._trackKeys;
      for (var i = 0; i < r.length; i++) {
        var a = r[i], o = this._tracks[a];
        if (!(!o || o.isFinished())) {
          var s = o.keyframes, l = s[n ? 0 : s.length - 1];
          l && (t[a] = h1(l.rawValue));
        }
      }
    }
  }, e.prototype.__changeFinalValue = function(t, r) {
    r = r || Ht(t);
    for (var n = 0; n < r.length; n++) {
      var i = r[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());
        }
      }
    }
  }, e;
})();
function im() {
  return (/* @__PURE__ */ new Date()).getTime();
}
var OK = (function(e) {
  ae(t, e);
  function t(r) {
    var n = e.call(this) || this;
    return n._running = !1, n._time = 0, n._pausedTime = 0, n._pauseStart = 0, n._paused = !1, r = r || {}, n.stage = r.stage || {}, n;
  }
  return t.prototype.addClip = function(r) {
    r.animation && this.removeClip(r), this._head ? (this._tail.next = r, r.prev = this._tail, r.next = null, this._tail = r) : this._head = this._tail = r, r.animation = this;
  }, t.prototype.addAnimator = function(r) {
    r.animation = this;
    var n = r.getClip();
    n && this.addClip(n);
  }, t.prototype.removeClip = function(r) {
    if (r.animation) {
      var n = r.prev, i = r.next;
      n ? n.next = i : this._head = i, i ? i.prev = n : this._tail = n, r.next = r.prev = r.animation = null;
    }
  }, t.prototype.removeAnimator = function(r) {
    var n = r.getClip();
    n && this.removeClip(n), r.animation = null;
  }, t.prototype.update = function(r) {
    for (var n = im() - 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, r || (this.trigger("frame", i), this.stage.update && this.stage.update());
  }, t.prototype._startLoop = function() {
    var r = this;
    this._running = !0;
    function n() {
      r._running && (V2(n), !r._paused && r.update());
    }
    V2(n);
  }, t.prototype.start = function() {
    this._running || (this._time = im(), this._pausedTime = 0, this._startLoop());
  }, t.prototype.stop = function() {
    this._running = !1;
  }, t.prototype.pause = function() {
    this._paused || (this._pauseStart = im(), this._paused = !0);
  }, t.prototype.resume = function() {
    this._paused && (this._pausedTime += im() - this._pauseStart, this._paused = !1);
  }, t.prototype.clear = function() {
    for (var r = this._head; r; ) {
      var n = r.next;
      r.prev = r.next = r.animation = null, r = n;
    }
    this._head = this._tail = null;
  }, t.prototype.isFinished = function() {
    return this._head == null;
  }, t.prototype.animate = function(r, n) {
    n = n || {}, this.start();
    var i = new vR(r, n.loop);
    return this.addAnimator(i), i;
  }, t;
})(ds), NK = 300, AM = Gt.domSupported, MM = (function() {
  var e = [
    "click",
    "dblclick",
    "mousewheel",
    "wheel",
    "mouseout",
    "mouseup",
    "mousedown",
    "mousemove",
    "contextmenu"
  ], t = [
    "touchstart",
    "touchend",
    "touchmove"
  ], r = {
    pointerdown: 1,
    pointerup: 1,
    pointermove: 1,
    pointerout: 1
  }, n = Ce(e, function(i) {
    var a = i.replace("mouse", "pointer");
    return r.hasOwnProperty(a) ? a : i;
  });
  return {
    mouse: e,
    touch: t,
    pointer: n
  };
})(), ak = {
  mouse: ["mousemove", "mouseup"],
  pointer: ["pointermove", "pointerup"]
}, ok = !1;
function WE(e) {
  var t = e.pointerType;
  return t === "pen" || t === "touch";
}
function kK(e) {
  e.touching = !0, e.touchTimer != null && (clearTimeout(e.touchTimer), e.touchTimer = null), e.touchTimer = setTimeout(function() {
    e.touching = !1, e.touchTimer = null;
  }, 700);
}
function LM(e) {
  e && (e.zrByTouch = !0);
}
function BK(e, t) {
  return Ko(e.dom, new zK(e, t), !0);
}
function MU(e, t) {
  for (var r = t, n = !1; r && r.nodeType !== 9 && !(n = r.domBelongToZr || r !== t && r === e.painterRoot); )
    r = r.parentNode;
  return n;
}
var zK = /* @__PURE__ */ (function() {
  function e(t, r) {
    this.stopPropagation = un, this.stopImmediatePropagation = un, this.preventDefault = un, this.type = r.type, this.target = this.currentTarget = t.dom, this.pointerType = r.pointerType, this.clientX = r.clientX, this.clientY = r.clientY;
  }
  return e;
})(), Bs = {
  mousedown: function(e) {
    e = Ko(this.dom, e), this.__mayPointerCapture = [e.zrX, e.zrY], this.trigger("mousedown", e);
  },
  mousemove: function(e) {
    e = Ko(this.dom, e);
    var t = this.__mayPointerCapture;
    t && (e.zrX !== t[0] || e.zrY !== t[1]) && this.__togglePointerCapture(!0), this.trigger("mousemove", e);
  },
  mouseup: function(e) {
    e = Ko(this.dom, e), this.__togglePointerCapture(!1), this.trigger("mouseup", e);
  },
  mouseout: function(e) {
    e = Ko(this.dom, e);
    var t = e.toElement || e.relatedTarget;
    MU(this, t) || (this.__pointerCapturing && (e.zrEventControl = "no_globalout"), this.trigger("mouseout", e));
  },
  wheel: function(e) {
    ok = !0, e = Ko(this.dom, e), this.trigger("mousewheel", e);
  },
  mousewheel: function(e) {
    ok || (e = Ko(this.dom, e), this.trigger("mousewheel", e));
  },
  touchstart: function(e) {
    e = Ko(this.dom, e), LM(e), this.__lastTouchMoment = /* @__PURE__ */ new Date(), this.handler.processGesture(e, "start"), Bs.mousemove.call(this, e), Bs.mousedown.call(this, e);
  },
  touchmove: function(e) {
    e = Ko(this.dom, e), LM(e), this.handler.processGesture(e, "change"), Bs.mousemove.call(this, e);
  },
  touchend: function(e) {
    e = Ko(this.dom, e), LM(e), this.handler.processGesture(e, "end"), Bs.mouseup.call(this, e), +/* @__PURE__ */ new Date() - +this.__lastTouchMoment < NK && Bs.click.call(this, e);
  },
  pointerdown: function(e) {
    Bs.mousedown.call(this, e);
  },
  pointermove: function(e) {
    WE(e) || Bs.mousemove.call(this, e);
  },
  pointerup: function(e) {
    Bs.mouseup.call(this, e);
  },
  pointerout: function(e) {
    WE(e) || Bs.mouseout.call(this, e);
  }
};
F(["click", "dblclick", "contextmenu"], function(e) {
  Bs[e] = function(t) {
    t = Ko(this.dom, t), this.trigger(e, t);
  };
});
var XE = {
  pointermove: function(e) {
    WE(e) || XE.mousemove.call(this, e);
  },
  pointerup: function(e) {
    XE.mouseup.call(this, e);
  },
  mousemove: function(e) {
    this.trigger("mousemove", e);
  },
  mouseup: function(e) {
    var t = this.__pointerCapturing;
    this.__togglePointerCapture(!1), this.trigger("mouseup", e), t && (e.zrEventControl = "only_globalout", this.trigger("mouseout", e));
  }
};
function FK(e, t) {
  var r = t.domHandlers;
  Gt.pointerEventsSupported ? F(MM.pointer, function(n) {
    p2(t, n, function(i) {
      r[n].call(e, i);
    });
  }) : (Gt.touchEventsSupported && F(MM.touch, function(n) {
    p2(t, n, function(i) {
      r[n].call(e, i), kK(t);
    });
  }), F(MM.mouse, function(n) {
    p2(t, n, function(i) {
      i = uR(i), t.touching || r[n].call(e, i);
    });
  }));
}
function GK(e, t) {
  Gt.pointerEventsSupported ? F(ak.pointer, r) : Gt.touchEventsSupported || F(ak.mouse, r);
  function r(n) {
    function i(a) {
      a = uR(a), MU(e, a.target) || (a = BK(e, a), t.domHandlers[n].call(e, a));
    }
    p2(t, n, i, { capture: !0 });
  }
}
function p2(e, t, r, n) {
  e.mounted[t] = r, e.listenerOpts[t] = n, OE(e.domTarget, t, r, n);
}
function DM(e) {
  var t = e.mounted;
  for (var r in t)
    t.hasOwnProperty(r) && Zj(e.domTarget, r, t[r], e.listenerOpts[r]);
  e.mounted = {};
}
var sk = /* @__PURE__ */ (function() {
  function e(t, r) {
    this.mounted = {}, this.listenerOpts = {}, this.touching = !1, this.domTarget = t, this.domHandlers = r;
  }
  return e;
})(), VK = (function(e) {
  ae(t, e);
  function t(r, n) {
    var i = e.call(this) || this;
    return i.__pointerCapturing = !1, i.dom = r, i.painterRoot = n, i._localHandlerScope = new sk(r, Bs), AM && (i._globalHandlerScope = new sk(document, XE)), FK(i, i._localHandlerScope), i;
  }
  return t.prototype.dispose = function() {
    DM(this._localHandlerScope), AM && DM(this._globalHandlerScope);
  }, t.prototype.setCursor = function(r) {
    this.dom.style && (this.dom.style.cursor = r || "default");
  }, t.prototype.__togglePointerCapture = function(r) {
    if (this.__mayPointerCapture = null, AM && +this.__pointerCapturing ^ +r) {
      this.__pointerCapturing = r;
      var n = this._globalHandlerScope;
      r ? GK(this, n) : DM(n);
    }
  }, t;
})(ds), LU = 1;
Gt.hasGlobalWindow && (LU = Math.max(window.devicePixelRatio || window.screen && window.screen.deviceXDPI / window.screen.logicalXDPI || 1, 1));
var Y2 = LU, YE = 0.4, ZE = "#333", $E = "#ccc", HK = "#eee", lk = Sx, uk = 5e-5;
function pv(e) {
  return e > uk || e < -uk;
}
var gv = [], mg = [], EM = ii(), PM = Math.abs, of = (function() {
  function e() {
  }
  return e.prototype.getLocalTransform = function(t) {
    return e.getLocalTransform(this, t);
  }, e.prototype.setPosition = function(t) {
    this.x = t[0], this.y = t[1];
  }, e.prototype.setScale = function(t) {
    this.scaleX = t[0], this.scaleY = t[1];
  }, e.prototype.setSkew = function(t) {
    this.skewX = t[0], this.skewY = t[1];
  }, e.prototype.setOrigin = function(t) {
    this.originX = t[0], this.originY = t[1];
  }, e.prototype.needLocalTransform = function() {
    return pv(this.rotation) || pv(this.x) || pv(this.y) || pv(this.scaleX - 1) || pv(this.scaleY - 1) || pv(this.skewX) || pv(this.skewY);
  }, e.prototype.updateTransform = function() {
    var t = this.parent && this.parent.transform, r = this.needLocalTransform(), n = this.transform;
    if (!(r || t)) {
      n && (lk(n), this.invTransform = null);
      return;
    }
    n = n || ii(), r ? this.getLocalTransform(n) : lk(n), t && (r ? Hs(n, t, n) : Tx(n, t)), this.transform = n, this._resolveGlobalScaleRatio(n);
  }, e.prototype._resolveGlobalScaleRatio = function(t) {
    var r = this.globalScaleRatio;
    if (r != null && r !== 1) {
      this.getGlobalScale(gv);
      var n = gv[0] < 0 ? -1 : 1, i = gv[1] < 0 ? -1 : 1, a = ((gv[0] - n) * r + n) / gv[0] || 0, o = ((gv[1] - i) * r + i) / gv[1] || 0;
      t[0] *= a, t[1] *= a, t[2] *= o, t[3] *= o;
    }
    this.invTransform = this.invTransform || ii(), cs(this.invTransform, t);
  }, e.prototype.getComputedTransform = function() {
    for (var t = this, r = []; t; )
      r.push(t), t = t.parent;
    for (; t = r.pop(); )
      t.updateTransform();
    return this.transform;
  }, e.prototype.setLocalTransform = function(t) {
    if (t) {
      var r = 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), r = Math.sqrt(r), this.skewX = a, this.skewY = 0, this.rotation = -i, this.x = +t[4], this.y = +t[5], this.scaleX = r, this.scaleY = n, this.originX = 0, this.originY = 0;
    }
  }, e.prototype.decomposeTransform = function() {
    if (this.transform) {
      var t = this.parent, r = this.transform;
      t && t.transform && (t.invTransform = t.invTransform || ii(), Hs(mg, t.invTransform, r), r = mg);
      var n = this.originX, i = this.originY;
      (n || i) && (EM[4] = n, EM[5] = i, Hs(mg, r, EM), mg[4] -= n, mg[5] -= i, r = mg), this.setLocalTransform(r);
    }
  }, e.prototype.getGlobalScale = function(t) {
    var r = this.transform;
    return t = t || [], r ? (t[0] = Math.sqrt(r[0] * r[0] + r[1] * r[1]), t[1] = Math.sqrt(r[2] * r[2] + r[3] * r[3]), r[0] < 0 && (t[0] = -t[0]), r[3] < 0 && (t[1] = -t[1]), t) : (t[0] = 1, t[1] = 1, t);
  }, e.prototype.transformCoordToLocal = function(t, r) {
    var n = [t, r], i = this.invTransform;
    return i && fn(n, n, i), n;
  }, e.prototype.transformCoordToGlobal = function(t, r) {
    var n = [t, r], i = this.transform;
    return i && fn(n, n, i), n;
  }, e.prototype.getLineScale = function() {
    var t = this.transform;
    return t && PM(t[0] - 1) > 1e-10 && PM(t[3] - 1) > 1e-10 ? Math.sqrt(PM(t[0] * t[3] - t[2] * t[1])) : 1;
  }, e.prototype.copyTransform = function(t) {
    Z2(this, t);
  }, e.getLocalTransform = function(t, r) {
    r = r || [];
    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, f = t.x, c = 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, g = i + l;
      r[4] = -d * a - h * g * o, r[5] = -g * o - v * d * a;
    } else
      r[4] = r[5] = 0;
    return r[0] = a, r[3] = o, r[1] = v * a, r[2] = h * o, u && Tf(r, r, u), r[4] += n + f, r[5] += i + c, r;
  }, e.initDefaultProps = (function() {
    var t = e.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;
  })(), e;
})(), eu = [
  "x",
  "y",
  "originX",
  "originY",
  "anchorX",
  "anchorY",
  "rotation",
  "scaleX",
  "scaleY",
  "skewX",
  "skewY"
];
function Z2(e, t) {
  for (var r = 0; r < eu.length; r++) {
    var n = eu[r];
    e[n] = t[n];
  }
}
function $l(e) {
  Nw || (Nw = new xm(100)), e = e || pf;
  var t = Nw.get(e);
  return t || (t = {
    font: e,
    strWidthCache: new xm(500),
    asciiWidthMap: null,
    asciiWidthMapTried: !1,
    stWideCharWidth: ja.measureText("国", e).width,
    asciiCharWidth: ja.measureText("a", e).width
  }, Nw.put(e, t)), t;
}
var Nw;
function UK(e) {
  if (!(IM >= fk)) {
    e = e || pf;
    for (var t = [], r = +/* @__PURE__ */ new Date(), n = 0; n <= 127; n++)
      t[n] = ja.measureText(String.fromCharCode(n), e).width;
    var i = +/* @__PURE__ */ new Date() - r;
    return i > 16 ? IM = fk : i > 2 && IM++, t;
  }
}
var IM = 0, fk = 5;
function DU(e, t) {
  return e.asciiWidthMapTried || (e.asciiWidthMap = UK(e.font), e.asciiWidthMapTried = !0), 0 <= t && t <= 127 ? e.asciiWidthMap != null ? e.asciiWidthMap[t] : e.asciiCharWidth : e.stWideCharWidth;
}
function ql(e, t) {
  var r = e.strWidthCache, n = r.get(t);
  return n == null && (n = ja.measureText(t, e.font).width, r.put(t, n)), n;
}
function ck(e, t, r, n) {
  var i = ql($l(t), e), a = bx(t), o = Sm(0, i, r), s = fd(0, a, n), l = new st(o, s, i, a);
  return l;
}
function pC(e, t, r, n) {
  var i = ((e || "") + "").split(`
`), a = i.length;
  if (a === 1)
    return ck(i[0], t, r, n);
  for (var o = new st(0, 0, 0, 0), s = 0; s < i.length; s++) {
    var l = ck(i[s], t, r, n);
    s === 0 ? o.copy(l) : o.union(l);
  }
  return o;
}
function Sm(e, t, r, n) {
  return r === "right" ? n ? e += t : e -= t : r === "center" && (n ? e += t / 2 : e -= t / 2), e;
}
function fd(e, t, r, n) {
  return r === "middle" ? n ? e += t / 2 : e -= t / 2 : r === "bottom" && (n ? e += t : e -= t), e;
}
function bx(e) {
  return $l(e).stWideCharWidth;
}
function $s(e, t) {
  return typeof e == "string" ? e.lastIndexOf("%") >= 0 ? parseFloat(e) / 100 * t : parseFloat(e) : e;
}
function $2(e, t, r) {
  var n = t.position || "inside", i = t.distance != null ? t.distance : 5, a = r.height, o = r.width, s = a / 2, l = r.x, u = r.y, f = "left", c = "top";
  if (n instanceof Array)
    l += $s(n[0], r.width), u += $s(n[1], r.height), f = null, c = null;
  else
    switch (n) {
      case "left":
        l -= i, u += s, f = "right", c = "middle";
        break;
      case "right":
        l += i + o, u += s, c = "middle";
        break;
      case "top":
        l += o / 2, u -= i, f = "center", c = "bottom";
        break;
      case "bottom":
        l += o / 2, u += a + i, f = "center";
        break;
      case "inside":
        l += o / 2, u += s, f = "center", c = "middle";
        break;
      case "insideLeft":
        l += i, u += s, c = "middle";
        break;
      case "insideRight":
        l += o - i, u += s, f = "right", c = "middle";
        break;
      case "insideTop":
        l += o / 2, u += i, f = "center";
        break;
      case "insideBottom":
        l += o / 2, u += a - i, f = "center", c = "bottom";
        break;
      case "insideTopLeft":
        l += i, u += i;
        break;
      case "insideTopRight":
        l += o - i, u += i, f = "right";
        break;
      case "insideBottomLeft":
        l += i, u += a - i, c = "bottom";
        break;
      case "insideBottomRight":
        l += o - i, u += a - i, f = "right", c = "bottom";
        break;
    }
  return e = e || {}, e.x = l, e.y = u, e.align = f, e.verticalAlign = c, e;
}
var RM = "__zr_normal__", OM = eu.concat(["ignore"]), WK = bo(eu, function(e, t) {
  return e[t] = !0, e;
}, { ignore: !1 }), yg = {}, XK = new st(0, 0, 0, 0), kw = [], gC = (function() {
  function e(t) {
    this.id = oR(), this.animators = [], this.currentStates = [], this.states = {}, this._init(t);
  }
  return e.prototype._init = function(t) {
    this.attr(t);
  }, e.prototype.drift = function(t, r, n) {
    switch (this.draggable) {
      case "horizontal":
        r = 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] += r, this.decomposeTransform(), this.markRedraw();
  }, e.prototype.beforeUpdate = function() {
  }, e.prototype.afterUpdate = function() {
  }, e.prototype.update = function() {
    this.updateTransform(), this.__dirty && this.updateInnerText();
  }, e.prototype.updateInnerText = function(t) {
    var r = this._textContent;
    if (r && (!r.ignore || t)) {
      this.textConfig || (this.textConfig = {});
      var n = this.textConfig, i = n.local, a = r.innerTransformable, o = void 0, s = void 0, l = !1;
      a.parent = i ? this : null;
      var u = !1;
      a.copyTransform(r);
      var f = n.position != null, c = n.autoOverflowArea, h = void 0;
      if ((c || f) && (h = XK, n.layoutRect ? h.copy(n.layoutRect) : h.copy(this.getBoundingRect()), i || h.applyTransform(this.transform)), f) {
        this.calculateTextPosition ? this.calculateTextPosition(yg, n, h) : $2(yg, n, h), a.x = yg.x, a.y = yg.y, o = yg.align, s = yg.verticalAlign;
        var v = n.origin;
        if (v && n.rotation != null) {
          var d = void 0, g = void 0;
          v === "center" ? (d = h.width * 0.5, g = h.height * 0.5) : (d = $s(v[0], h.width), g = $s(v[1], h.height)), u = !0, a.originX = -a.x + d + (i ? 0 : h.x), a.originY = -a.y + g + (i ? 0 : h.y);
        }
      }
      n.rotation != null && (a.rotation = n.rotation);
      var y = n.offset;
      y && (a.x += y[0], a.y += y[1], u || (a.originX = -y[0], a.originY = -y[1]));
      var x = this._innerTextDefaultStyle || (this._innerTextDefaultStyle = {});
      if (c) {
        var S = x.overflowRect = x.overflowRect || new st(0, 0, 0, 0);
        a.getLocalTransform(kw), cs(kw, kw), st.copy(S, h), S.applyTransform(kw);
      } else
        x.overflowRect = null;
      var T = n.inside == null ? typeof n.position == "string" && n.position.indexOf("inside") >= 0 : n.inside, C = void 0, A = void 0, M = void 0;
      T && this.canBeInsideText() ? (C = n.insideFill, A = n.insideStroke, (C == null || C === "auto") && (C = this.getInsideTextFill()), (A == null || A === "auto") && (A = this.getInsideTextStroke(C), M = !0)) : (C = n.outsideFill, A = n.outsideStroke, (C == null || C === "auto") && (C = this.getOutsideFill()), (A == null || A === "auto") && (A = this.getOutsideStroke(C), M = !0)), C = C || "#000", (C !== x.fill || A !== x.stroke || M !== x.autoStroke || o !== x.align || s !== x.verticalAlign) && (l = !0, x.fill = C, x.stroke = A, x.autoStroke = M, x.align = o, x.verticalAlign = s, r.setDefaultTextStyle(x)), r.__dirty |= mo, l && r.dirtyStyle(!0);
    }
  }, e.prototype.canBeInsideText = function() {
    return !0;
  }, e.prototype.getInsideTextFill = function() {
    return "#fff";
  }, e.prototype.getInsideTextStroke = function(t) {
    return "#000";
  }, e.prototype.getOutsideFill = function() {
    return this.__zr && this.__zr.isDarkMode() ? $E : ZE;
  }, e.prototype.getOutsideStroke = function(t) {
    var r = this.__zr && this.__zr.getBackgroundColor(), n = typeof r == "string" && bi(r);
    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, os(n, "rgba");
  }, e.prototype.traverse = function(t, r) {
  }, e.prototype.attrKV = function(t, r) {
    t === "textConfig" ? this.setTextConfig(r) : t === "textContent" ? this.setTextContent(r) : t === "clipPath" ? this.setClipPath(r) : t === "extra" ? (this.extra = this.extra || {}, xe(this.extra, r)) : this[t] = r;
  }, e.prototype.hide = function() {
    this.ignore = !0, this.markRedraw();
  }, e.prototype.show = function() {
    this.ignore = !1, this.markRedraw();
  }, e.prototype.attr = function(t, r) {
    if (typeof t == "string")
      this.attrKV(t, r);
    else if (ot(t))
      for (var n = t, i = Ht(n), a = 0; a < i.length; a++) {
        var o = i[a];
        this.attrKV(o, t[o]);
      }
    return this.markRedraw(), this;
  }, e.prototype.saveCurrentToNormalState = function(t) {
    this._innerSaveToNormal(t);
    for (var r = this._normalState, n = 0; n < this.animators.length; n++) {
      var i = this.animators[n], a = i.__fromStateTransition;
      if (!(i.getLoop() || a && a !== RM)) {
        var o = i.targetName, s = o ? r[o] : r;
        i.saveTo(s);
      }
    }
  }, e.prototype._innerSaveToNormal = function(t) {
    var r = this._normalState;
    r || (r = this._normalState = {}), t.textConfig && !r.textConfig && (r.textConfig = this.textConfig), this._savePrimaryToNormal(t, r, OM);
  }, e.prototype._savePrimaryToNormal = function(t, r, n) {
    for (var i = 0; i < n.length; i++) {
      var a = n[i];
      t[a] != null && !(a in r) && (r[a] = this[a]);
    }
  }, e.prototype.hasState = function() {
    return this.currentStates.length > 0;
  }, e.prototype.getState = function(t) {
    return this.states[t];
  }, e.prototype.ensureState = function(t) {
    var r = this.states;
    return r[t] || (r[t] = {}), r[t];
  }, e.prototype.clearStates = function(t) {
    this.useState(RM, !1, t);
  }, e.prototype.useState = function(t, r, n, i) {
    var a = t === RM, o = this.hasState();
    if (!(!o && a)) {
      var s = this.currentStates, l = this.stateTransition;
      if (!(Tt(s, t) >= 0 && (r || s.length === 1))) {
        var u;
        if (this.stateProxy && !a && (u = this.stateProxy(t)), u || (u = this.states && this.states[t]), !u && !a) {
          uC("State " + t + " not exists.");
          return;
        }
        a || this.saveCurrentToNormalState(u);
        var f = !!(u && u.hoverLayer || i);
        f && this._toggleHoverLayerFlag(!0), this._applyStateObj(t, u, this._normalState, r, !n && !this.__inHover && l && l.duration > 0, l);
        var c = this._textContent, h = this._textGuide;
        return c && c.useState(t, r, n, f), h && h.useState(t, r, n, f), a ? (this.currentStates = [], this._normalState = {}) : r ? this.currentStates.push(t) : this.currentStates = [t], this._updateAnimationTargets(), this.markRedraw(), !f && this.__inHover && (this._toggleHoverLayerFlag(!1), this.__dirty &= ~mo), u;
      }
    }
  }, e.prototype.useStates = function(t, r, 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], f = void 0;
        this.stateProxy && (f = this.stateProxy(u, t)), f || (f = this.states[u]), f && i.push(f);
      }
      var c = i[o - 1], h = !!(c && c.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, !r && !this.__inHover && d && d.duration > 0, d);
      var g = this._textContent, y = this._textGuide;
      g && g.useStates(t, r, h), y && y.useStates(t, r, h), this._updateAnimationTargets(), this.currentStates = t.slice(), this.markRedraw(), !h && this.__inHover && (this._toggleHoverLayerFlag(!1), this.__dirty &= ~mo);
    }
  }, e.prototype.isSilent = function() {
    for (var t = this; t; ) {
      if (t.silent)
        return !0;
      var r = t.__hostTarget;
      t = r ? t.ignoreHostSilent ? null : r : t.parent;
    }
    return !1;
  }, e.prototype._updateAnimationTargets = function() {
    for (var t = 0; t < this.animators.length; t++) {
      var r = this.animators[t];
      r.targetName && r.changeTarget(this[r.targetName]);
    }
  }, e.prototype.removeState = function(t) {
    var r = Tt(this.currentStates, t);
    if (r >= 0) {
      var n = this.currentStates.slice();
      n.splice(r, 1), this.useStates(n);
    }
  }, e.prototype.replaceState = function(t, r, n) {
    var i = this.currentStates.slice(), a = Tt(i, t), o = Tt(i, r) >= 0;
    a >= 0 ? o ? i.splice(a, 1) : i[a] = r : n && !o && i.push(r), this.useStates(i);
  }, e.prototype.toggleState = function(t, r) {
    r ? this.useState(t, !0) : this.removeState(t);
  }, e.prototype._mergeStates = function(t) {
    for (var r = {}, n, i = 0; i < t.length; i++) {
      var a = t[i];
      xe(r, a), a.textConfig && (n = n || {}, xe(n, a.textConfig));
    }
    return n && (r.textConfig = n), r;
  }, e.prototype._applyStateObj = function(t, r, n, i, a, o) {
    var s = !(r && i);
    r && r.textConfig ? (this.textConfig = xe({}, i ? this.textConfig : n.textConfig), xe(this.textConfig, r.textConfig)) : s && n.textConfig && (this.textConfig = n.textConfig);
    for (var l = {}, u = !1, f = 0; f < OM.length; f++) {
      var c = OM[f], h = a && WK[c];
      r && r[c] != null ? h ? (u = !0, l[c] = r[c]) : this[c] = r[c] : s && n[c] != null && (h ? (u = !0, l[c] = n[c]) : this[c] = n[c]);
    }
    if (!a)
      for (var f = 0; f < this.animators.length; f++) {
        var v = this.animators[f], d = v.targetName;
        v.getLoop() || v.__changeFinalValue(d ? (r || n)[d] : r || n);
      }
    u && this._transitionState(t, l, o);
  }, e.prototype._attachComponent = function(t) {
    if (!(t.__zr && !t.__hostTarget) && t !== this) {
      var r = this.__zr;
      r && t.addSelfToZr(r), t.__zr = r, t.__hostTarget = this;
    }
  }, e.prototype._detachComponent = function(t) {
    t.__zr && t.removeSelfFromZr(t.__zr), t.__zr = null, t.__hostTarget = null;
  }, e.prototype.getClipPath = function() {
    return this._clipPath;
  }, e.prototype.setClipPath = function(t) {
    this._clipPath && this._clipPath !== t && this.removeClipPath(), this._attachComponent(t), this._clipPath = t, this.markRedraw();
  }, e.prototype.removeClipPath = function() {
    var t = this._clipPath;
    t && (this._detachComponent(t), this._clipPath = null, this.markRedraw());
  }, e.prototype.getTextContent = function() {
    return this._textContent;
  }, e.prototype.setTextContent = function(t) {
    var r = this._textContent;
    r !== t && (r && r !== t && this.removeTextContent(), t.innerTransformable = new of(), this._attachComponent(t), this._textContent = t, this.markRedraw());
  }, e.prototype.setTextConfig = function(t) {
    this.textConfig || (this.textConfig = {}), xe(this.textConfig, t), this.markRedraw();
  }, e.prototype.removeTextConfig = function() {
    this.textConfig = null, this.markRedraw();
  }, e.prototype.removeTextContent = function() {
    var t = this._textContent;
    t && (t.innerTransformable = null, this._detachComponent(t), this._textContent = null, this._innerTextDefaultStyle = null, this.markRedraw());
  }, e.prototype.getTextGuideLine = function() {
    return this._textGuide;
  }, e.prototype.setTextGuideLine = function(t) {
    this._textGuide && this._textGuide !== t && this.removeTextGuideLine(), this._attachComponent(t), this._textGuide = t, this.markRedraw();
  }, e.prototype.removeTextGuideLine = function() {
    var t = this._textGuide;
    t && (this._detachComponent(t), this._textGuide = null, this.markRedraw());
  }, e.prototype.markRedraw = function() {
    this.__dirty |= mo;
    var t = this.__zr;
    t && (this.__inHover ? t.refreshHover() : t.refresh()), this.__hostTarget && this.__hostTarget.markRedraw();
  }, e.prototype.dirty = function() {
    this.markRedraw();
  }, e.prototype._toggleHoverLayerFlag = function(t) {
    this.__inHover = t;
    var r = this._textContent, n = this._textGuide;
    r && (r.__inHover = t), n && (n.__inHover = t);
  }, e.prototype.addSelfToZr = function(t) {
    if (this.__zr !== t) {
      this.__zr = t;
      var r = this.animators;
      if (r)
        for (var n = 0; n < r.length; n++)
          t.animation.addAnimator(r[n]);
      this._clipPath && this._clipPath.addSelfToZr(t), this._textContent && this._textContent.addSelfToZr(t), this._textGuide && this._textGuide.addSelfToZr(t);
    }
  }, e.prototype.removeSelfFromZr = function(t) {
    if (this.__zr) {
      this.__zr = null;
      var r = this.animators;
      if (r)
        for (var n = 0; n < r.length; n++)
          t.animation.removeAnimator(r[n]);
      this._clipPath && this._clipPath.removeSelfFromZr(t), this._textContent && this._textContent.removeSelfFromZr(t), this._textGuide && this._textGuide.removeSelfFromZr(t);
    }
  }, e.prototype.animate = function(t, r, n) {
    var i = t ? this[t] : this, a = new vR(i, r, n);
    return t && (a.targetName = t), this.addAnimator(a, t), a;
  }, e.prototype.addAnimator = function(t, r) {
    var n = this.__zr, i = this;
    t.during(function() {
      i.updateDuringAnimation(r);
    }).done(function() {
      var a = i.animators, o = Tt(a, t);
      o >= 0 && a.splice(o, 1);
    }), this.animators.push(t), n && n.animation.addAnimator(t), n && n.wakeUp();
  }, e.prototype.updateDuringAnimation = function(t) {
    this.markRedraw();
  }, e.prototype.stopAnimation = function(t, r) {
    for (var n = this.animators, i = n.length, a = [], o = 0; o < i; o++) {
      var s = n[o];
      !t || t === s.scope ? s.stop(r) : a.push(s);
    }
    return this.animators = a, this;
  }, e.prototype.animateTo = function(t, r, n) {
    NM(this, t, r, n);
  }, e.prototype.animateFrom = function(t, r, n) {
    NM(this, t, r, n, !0);
  }, e.prototype._transitionState = function(t, r, n, i) {
    for (var a = NM(this, r, n, i), o = 0; o < a.length; o++)
      a[o].__fromStateTransition = t;
  }, e.prototype.getBoundingRect = function() {
    return null;
  }, e.prototype.getPaintRect = function() {
    return null;
  }, e.initDefaultProps = (function() {
    var t = e.prototype;
    t.type = "element", t.name = "", t.ignore = t.silent = t.ignoreHostSilent = t.isGroup = t.draggable = t.dragging = t.ignoreClip = t.__inHover = !1, t.__dirty = mo;
    function r(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(f) {
            l[a] = f;
          }
        }), Object.defineProperty(u, 1, {
          get: function() {
            return l[o];
          },
          set: function(f) {
            l[o] = f;
          }
        });
      }
    }
    Object.defineProperty && (r("position", "_legacyPos", "x", "y"), r("scale", "_legacyScale", "scaleX", "scaleY"), r("origin", "_legacyOrigin", "originX", "originY"));
  })(), e;
})();
cn(gC, ds);
cn(gC, of);
function NM(e, t, r, n, i) {
  r = r || {};
  var a = [];
  EU(e, "", e, t, r, n, a, i);
  var o = a.length, s = !1, l = r.done, u = r.aborted, f = function() {
    s = !0, o--, o <= 0 && (s ? l && l() : u && u());
  }, c = function() {
    o--, o <= 0 && (s ? l && l() : u && u());
  };
  o || l && l(), a.length > 0 && r.during && a[0].during(function(d, g) {
    r.during(g);
  });
  for (var h = 0; h < a.length; h++) {
    var v = a[h];
    f && v.done(f), c && v.aborted(c), r.force && v.duration(r.duration), v.start(r.easing);
  }
  return a;
}
function kM(e, t, r) {
  for (var n = 0; n < r; n++)
    e[n] = t[n];
}
function YK(e) {
  return Vi(e[0]);
}
function ZK(e, t, r) {
  if (Vi(t[r]))
    if (Vi(e[r]) || (e[r] = []), wa(t[r])) {
      var n = t[r].length;
      e[r].length !== n && (e[r] = new t[r].constructor(n), kM(e[r], t[r], n));
    } else {
      var i = t[r], a = e[r], o = i.length;
      if (YK(i))
        for (var s = i[0].length, l = 0; l < o; l++)
          a[l] ? kM(a[l], i[l], s) : a[l] = Array.prototype.slice.call(i[l]);
      else
        kM(a, i, o);
      a.length = i.length;
    }
  else
    e[r] = t[r];
}
function $K(e, t) {
  return e === t || Vi(e) && Vi(t) && qK(e, t);
}
function qK(e, t) {
  var r = e.length;
  if (r !== t.length)
    return !1;
  for (var n = 0; n < r; n++)
    if (e[n] !== t[n])
      return !1;
  return !0;
}
function EU(e, t, r, n, i, a, o, s) {
  for (var l = Ht(n), u = i.duration, f = i.delay, c = i.additive, h = i.setToFinal, v = !ot(a), d = e.animators, g = [], y = 0; y < l.length; y++) {
    var x = l[y], S = n[x];
    if (S != null && r[x] != null && (v || a[x]))
      if (ot(S) && !Vi(S) && !yx(S)) {
        if (t) {
          s || (r[x] = S, e.updateDuringAnimation(t));
          continue;
        }
        EU(e, x, r[x], S, i, a && a[x], o, s);
      } else
        g.push(x);
    else s || (r[x] = S, e.updateDuringAnimation(t), g.push(x));
  }
  var T = g.length;
  if (!c && T)
    for (var C = 0; C < d.length; C++) {
      var A = d[C];
      if (A.targetName === t) {
        var M = A.stopTracks(g);
        if (M) {
          var E = Tt(d, A);
          d.splice(E, 1);
        }
      }
    }
  if (i.force || (g = nr(g, function(N) {
    return !$K(n[N], r[N]);
  }), T = g.length), T > 0 || i.force && !o.length) {
    var P = void 0, R = void 0, O = void 0;
    if (s) {
      R = {}, h && (P = {});
      for (var C = 0; C < T; C++) {
        var x = g[C];
        R[x] = r[x], h ? P[x] = n[x] : r[x] = n[x];
      }
    } else if (h) {
      O = {};
      for (var C = 0; C < T; C++) {
        var x = g[C];
        O[x] = h1(r[x]), ZK(r, n, x);
      }
    }
    var A = new vR(r, !1, !1, c ? nr(d, function(G) {
      return G.targetName === t;
    }) : null);
    A.targetName = t, i.scope && (A.scope = i.scope), h && P && A.whenWithKeys(0, P, g), O && A.whenWithKeys(0, O, g), A.whenWithKeys(u ?? 500, s ? R : n, g).delay(f || 0), e.addAnimator(A, t), o.push(A);
  }
}
var rt = (function(e) {
  ae(t, e);
  function t(r) {
    var n = e.call(this) || this;
    return n.isGroup = !0, n._children = [], n.attr(r), n;
  }
  return t.prototype.childrenRef = function() {
    return this._children;
  }, t.prototype.children = function() {
    return this._children.slice();
  }, t.prototype.childAt = function(r) {
    return this._children[r];
  }, t.prototype.childOfName = function(r) {
    for (var n = this._children, i = 0; i < n.length; i++)
      if (n[i].name === r)
        return n[i];
  }, t.prototype.childCount = function() {
    return this._children.length;
  }, t.prototype.add = function(r) {
    return r && r !== this && r.parent !== this && (this._children.push(r), this._doAdd(r)), this;
  }, t.prototype.addBefore = function(r, n) {
    if (r && r !== this && r.parent !== this && n && n.parent === this) {
      var i = this._children, a = i.indexOf(n);
      a >= 0 && (i.splice(a, 0, r), this._doAdd(r));
    }
    return this;
  }, t.prototype.replace = function(r, n) {
    var i = Tt(this._children, r);
    return i >= 0 && this.replaceAt(n, i), this;
  }, t.prototype.replaceAt = function(r, n) {
    var i = this._children, a = i[n];
    if (r && r !== this && r.parent !== this && r !== a) {
      i[n] = r, a.parent = null;
      var o = this.__zr;
      o && a.removeSelfFromZr(o), this._doAdd(r);
    }
    return this;
  }, t.prototype._doAdd = function(r) {
    r.parent && r.parent.remove(r), r.parent = this;
    var n = this.__zr;
    n && n !== r.__zr && r.addSelfToZr(n), n && n.refresh();
  }, t.prototype.remove = function(r) {
    var n = this.__zr, i = this._children, a = Tt(i, r);
    return a < 0 ? this : (i.splice(a, 1), r.parent = null, n && r.removeSelfFromZr(n), n && n.refresh(), this);
  }, t.prototype.removeAll = function() {
    for (var r = this._children, n = this.__zr, i = 0; i < r.length; i++) {
      var a = r[i];
      n && a.removeSelfFromZr(n), a.parent = null;
    }
    return r.length = 0, this;
  }, t.prototype.eachChild = function(r, n) {
    for (var i = this._children, a = 0; a < i.length; a++) {
      var o = i[a];
      r.call(n, o, a);
    }
    return this;
  }, t.prototype.traverse = function(r, n) {
    for (var i = 0; i < this._children.length; i++) {
      var a = this._children[i], o = r.call(n, a);
      a.isGroup && !o && a.traverse(r, n);
    }
    return this;
  }, t.prototype.addSelfToZr = function(r) {
    e.prototype.addSelfToZr.call(this, r);
    for (var n = 0; n < this._children.length; n++) {
      var i = this._children[n];
      i.addSelfToZr(r);
    }
  }, t.prototype.removeSelfFromZr = function(r) {
    e.prototype.removeSelfFromZr.call(this, r);
    for (var n = 0; n < this._children.length; n++) {
      var i = this._children[n];
      i.removeSelfFromZr(r);
    }
  }, t.prototype.getBoundingRect = function(r) {
    for (var n = new st(0, 0, 0, 0), i = r || this._children, a = [], o = null, s = 0; s < i.length; s++) {
      var l = i[s];
      if (!(l.ignore || l.invisible)) {
        var u = l.getBoundingRect(), f = l.getLocalTransform(a);
        f ? (st.applyTransform(n, u, f), o = o || n.clone(), o.union(n)) : (o = o || u.clone(), o.union(u));
      }
    }
    return o || n;
  }, t;
})(gC);
rt.prototype.type = "group";
var g2 = {}, td = {};
function jK(e) {
  delete td[e];
}
function KK(e) {
  if (!e)
    return !1;
  if (typeof e == "string")
    return R1(e, 1) < YE;
  if (e.colorStops) {
    for (var t = e.colorStops, r = 0, n = t.length, i = 0; i < n; i++)
      r += R1(t[i].color, 1);
    return r /= n, r < YE;
  }
  return !1;
}
var QK = (function() {
  function e(t, r, n) {
    var i = this;
    this._sleepAfterStill = 10, this._stillFrameAccum = 0, this._needsRefresh = !0, this._needsRefreshHover = !0, this._darkMode = !1, n = n || {}, this.dom = r, this.id = t;
    var a = new lK(), o = n.renderer || "canvas";
    g2[o] || (o = Ht(g2)[0]), n.useDirtyRect = n.useDirtyRect == null ? !1 : n.useDirtyRect;
    var s = new g2[o](r, a, n, t), l = n.ssr || s.ssrOnly;
    this.storage = a, this.painter = s;
    var u = !Gt.node && !Gt.worker && !l ? new VK(s.getViewportRoot(), s.root) : null, f = n.useCoarsePointer, c = f == null || f === "auto" ? Gt.touchEventsSupported : !!f, h = 44, v;
    c && (v = et(n.pointerSize, h)), this.handler = new uU(a, s, u, s.root, v), this.animation = new OK({
      stage: {
        update: l ? null : function() {
          return i._flush(!0);
        }
      }
    }), l || this.animation.start();
  }
  return e.prototype.add = function(t) {
    this._disposed || !t || (this.storage.addRoot(t), t.addSelfToZr(this), this.refresh());
  }, e.prototype.remove = function(t) {
    this._disposed || !t || (this.storage.delRoot(t), t.removeSelfFromZr(this), this.refresh());
  }, e.prototype.configLayer = function(t, r) {
    this._disposed || (this.painter.configLayer && this.painter.configLayer(t, r), this.refresh());
  }, e.prototype.setBackgroundColor = function(t) {
    this._disposed || (this.painter.setBackgroundColor && this.painter.setBackgroundColor(t), this.refresh(), this._backgroundColor = t, this._darkMode = KK(t));
  }, e.prototype.getBackgroundColor = function() {
    return this._backgroundColor;
  }, e.prototype.setDarkMode = function(t) {
    this._darkMode = t;
  }, e.prototype.isDarkMode = function() {
    return this._darkMode;
  }, e.prototype.refreshImmediately = function(t) {
    this._disposed || (t || this.animation.update(!0), this._needsRefresh = !1, this.painter.refresh(), this._needsRefresh = !1);
  }, e.prototype.refresh = function() {
    this._disposed || (this._needsRefresh = !0, this.animation.start());
  }, e.prototype.flush = function() {
    this._disposed || this._flush(!1);
  }, e.prototype._flush = function(t) {
    var r, n = im();
    this._needsRefresh && (r = !0, this.refreshImmediately(t)), this._needsRefreshHover && (r = !0, this.refreshHoverImmediately());
    var i = im();
    r ? (this._stillFrameAccum = 0, this.trigger("rendered", {
      elapsedTime: i - n
    })) : this._sleepAfterStill > 0 && (this._stillFrameAccum++, this._stillFrameAccum > this._sleepAfterStill && this.animation.stop());
  }, e.prototype.setSleepAfterStill = function(t) {
    this._sleepAfterStill = t;
  }, e.prototype.wakeUp = function() {
    this._disposed || (this.animation.start(), this._stillFrameAccum = 0);
  }, e.prototype.refreshHover = function() {
    this._needsRefreshHover = !0;
  }, e.prototype.refreshHoverImmediately = function() {
    this._disposed || (this._needsRefreshHover = !1, this.painter.refreshHover && this.painter.getType() === "canvas" && this.painter.refreshHover());
  }, e.prototype.resize = function(t) {
    this._disposed || (t = t || {}, this.painter.resize(t.width, t.height), this.handler.resize());
  }, e.prototype.clearAnimation = function() {
    this._disposed || this.animation.clear();
  }, e.prototype.getWidth = function() {
    if (!this._disposed)
      return this.painter.getWidth();
  }, e.prototype.getHeight = function() {
    if (!this._disposed)
      return this.painter.getHeight();
  }, e.prototype.setCursorStyle = function(t) {
    this._disposed || this.handler.setCursorStyle(t);
  }, e.prototype.findHover = function(t, r) {
    if (!this._disposed)
      return this.handler.findHover(t, r);
  }, e.prototype.on = function(t, r, n) {
    return this._disposed || this.handler.on(t, r, n), this;
  }, e.prototype.off = function(t, r) {
    this._disposed || this.handler.off(t, r);
  }, e.prototype.trigger = function(t, r) {
    this._disposed || this.handler.trigger(t, r);
  }, e.prototype.clear = function() {
    if (!this._disposed) {
      for (var t = this.storage.getRoots(), r = 0; r < t.length; r++)
        t[r] instanceof rt && t[r].removeSelfFromZr(this);
      this.storage.delAllRoots(), this.painter.clear();
    }
  }, e.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, jK(this.id));
  }, e;
})();
function q2(e, t) {
  var r = new QK(oR(), e, t);
  return td[r.id] = r, r;
}
function JK(e) {
  e.dispose();
}
function eQ() {
  for (var e in td)
    td.hasOwnProperty(e) && td[e].dispose();
  td = {};
}
function tQ(e) {
  return td[e];
}
function PU(e, t) {
  g2[e] = t;
}
var qE;
function IU(e) {
  if (typeof qE == "function")
    return qE(e);
}
function RU(e) {
  qE = e;
}
var rQ = "6.0.0";
const nQ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  dispose: JK,
  disposeAll: eQ,
  getElementSSRData: IU,
  getInstance: tQ,
  init: q2,
  registerPainter: PU,
  registerSSRDataGetter: RU,
  version: rQ
}, Symbol.toStringTag, { value: "Module" }));
var hk = 1e-4, OU = 20;
function iQ(e) {
  return e.replace(/^\s+|\s+$/g, "");
}
var To = Math.min, Sn = Math.max, Hl = Math.abs;
function er(e, t, r, n) {
  var i = t[0], a = t[1], o = r[0], s = r[1], l = a - i, u = s - o;
  if (l === 0)
    return u === 0 ? o : (o + s) / 2;
  if (n)
    if (l > 0) {
      if (e <= i)
        return o;
      if (e >= a)
        return s;
    } else {
      if (e >= i)
        return o;
      if (e <= a)
        return s;
    }
  else {
    if (e === i)
      return o;
    if (e === a)
      return s;
  }
  return (e - i) / l * u + o;
}
var Be = aQ;
function aQ(e, t, r) {
  switch (e) {
    case "center":
    case "middle":
      e = "50%";
      break;
    case "left":
    case "top":
      e = "0%";
      break;
    case "right":
    case "bottom":
      e = "100%";
      break;
  }
  return j2(e, t, r);
}
function j2(e, t, r) {
  return Fe(e) ? iQ(e).match(/%$/) ? parseFloat(e) / 100 * t + (r || 0) : parseFloat(e) : e == null ? NaN : +e;
}
function jr(e, t, r) {
  return t == null && (t = 10), t = Math.min(Math.max(0, t), OU), e = (+e).toFixed(t), r ? e : +e;
}
function xo(e) {
  return e.sort(function(t, r) {
    return t - r;
  }), e;
}
function Gs(e) {
  if (e = +e, isNaN(e))
    return 0;
  if (e > 1e-14) {
    for (var t = 1, r = 0; r < 15; r++, t *= 10)
      if (Math.round(e * t) / t === e)
        return r;
  }
  return mC(e);
}
function mC(e) {
  var t = e.toString().toLowerCase(), r = t.indexOf("e"), n = r > 0 ? +t.slice(r + 1) : 0, i = r > 0 ? r : t.length, a = t.indexOf("."), o = a < 0 ? 0 : i - 1 - a;
  return Math.max(0, o - n);
}
function dR(e, t) {
  var r = Math.log, n = Math.LN10, i = Math.floor(r(e[1] - e[0]) / n), a = Math.round(r(Hl(t[1] - t[0])) / n), o = Math.min(Math.max(-i + a, 0), 20);
  return isFinite(o) ? o : 20;
}
function oQ(e, t, r) {
  if (!e[t])
    return 0;
  var n = NU(e, r);
  return n[t] || 0;
}
function NU(e, t) {
  var r = bo(e, function(v, d) {
    return v + (isNaN(d) ? 0 : d);
  }, 0);
  if (r === 0)
    return [];
  for (var n = Math.pow(10, t), i = Ce(e, function(v) {
    return (isNaN(v) ? 0 : v) / r * n * 100;
  }), a = n * 100, o = Ce(i, function(v) {
    return Math.floor(v);
  }), s = bo(o, function(v, d) {
    return v + d;
  }, 0), l = Ce(i, function(v, d) {
    return v - o[d];
  }); s < a; ) {
    for (var u = Number.NEGATIVE_INFINITY, f = null, c = 0, h = l.length; c < h; ++c)
      l[c] > u && (u = l[c], f = c);
    ++o[f], l[f] = 0, ++s;
  }
  return Ce(o, function(v) {
    return v / n;
  });
}
function sQ(e, t) {
  var r = Math.max(Gs(e), Gs(t)), n = e + t;
  return r > OU ? n : jr(n, r);
}
var jE = 9007199254740991;
function pR(e) {
  var t = Math.PI * 2;
  return (e % t + t) % t;
}
function wm(e) {
  return e > -hk && e < hk;
}
var lQ = /^(?:(\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 Ks(e) {
  if (e instanceof Date)
    return e;
  if (Fe(e)) {
    var t = lQ.exec(e);
    if (!t)
      return /* @__PURE__ */ new Date(NaN);
    if (t[8]) {
      var r = +t[4] || 0;
      return t[8].toUpperCase() !== "Z" && (r -= +t[8].slice(0, 3)), new Date(Date.UTC(+t[1], +(t[2] || 1) - 1, +t[3] || 1, r, +(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 (e == null)
    return /* @__PURE__ */ new Date(NaN);
  return new Date(Math.round(e));
}
function kU(e) {
  return Math.pow(10, yC(e));
}
function yC(e) {
  if (e === 0)
    return 0;
  var t = Math.floor(Math.log(e) / Math.LN10);
  return e / Math.pow(10, t) >= 10 && t++, t;
}
function gR(e, t) {
  var r = yC(e), n = Math.pow(10, r), i = e / n, a;
  return t ? i < 1.5 ? a = 1 : i < 2.5 ? a = 2 : i < 4 ? a = 3 : i < 7 ? a = 5 : a = 10 : i < 1 ? a = 1 : i < 2 ? a = 2 : i < 3 ? a = 3 : i < 5 ? a = 5 : a = 10, e = a * n, r >= -20 ? +e.toFixed(r < 0 ? -r : 0) : e;
}
function m2(e, t) {
  var r = (e.length - 1) * t + 1, n = Math.floor(r), i = +e[n - 1], a = r - n;
  return a ? i + a * (e[n] - i) : i;
}
function KE(e) {
  e.sort(function(l, u) {
    return s(l, u, 0) ? -1 : 1;
  });
  for (var t = -1 / 0, r = 1, n = 0; n < e.length; ) {
    for (var i = e[n].interval, a = e[n].close, o = 0; o < 2; o++)
      i[o] <= t && (i[o] = t, a[o] = o ? 1 : 1 - r), t = i[o], r = a[o];
    i[0] === i[1] && a[0] * a[1] !== 1 ? e.splice(n, 1) : n++;
  }
  return e;
  function s(l, u, f) {
    return l.interval[f] < u.interval[f] || l.interval[f] === u.interval[f] && (l.close[f] - u.close[f] === (f ? -1 : 1) || !f && s(l, u, 1));
  }
}
function tu(e) {
  var t = parseFloat(e);
  return t == e && (t !== 0 || !Fe(e) || e.indexOf("x") <= 0) ? t : NaN;
}
function mR(e) {
  return !isNaN(tu(e));
}
function BU() {
  return Math.round(Math.random() * 9);
}
function zU(e, t) {
  return t === 0 ? e : zU(t, e % t);
}
function vk(e, t) {
  return e == null ? t : t == null ? e : e * t / zU(e, t);
}
var uQ = "[ECharts] ", fQ = typeof console < "u" && console.warn && console.log;
function cQ(e, t, r) {
  fQ && console[e](uQ + t);
}
function FU(e, t) {
  cQ("error", e);
}
function or(e) {
  throw new Error(e);
}
function dk(e, t, r) {
  return (t - e) * r + e;
}
var GU = "series\0", VU = "\0_ec_\0";
function Mr(e) {
  return e instanceof Array ? e : e == null ? [] : [e];
}
function xd(e, t, r) {
  if (e) {
    e[t] = e[t] || {}, e.emphasis = e.emphasis || {}, e.emphasis[t] = e.emphasis[t] || {};
    for (var n = 0, i = r.length; n < i; n++) {
      var a = r[n];
      !e.emphasis[t].hasOwnProperty(a) && e[t].hasOwnProperty(a) && (e.emphasis[t][a] = e[t][a]);
    }
  }
}
var pk = ["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 Ym(e) {
  return ot(e) && !Se(e) && !(e instanceof Date) ? e.value : e;
}
function hQ(e) {
  return ot(e) && !(e instanceof Array);
}
function HU(e, t, r) {
  var n = r === "normalMerge", i = r === "replaceMerge", a = r === "replaceAll";
  e = e || [], t = (t || []).slice();
  var o = Je();
  F(t, function(l, u) {
    if (!ot(l)) {
      t[u] = null;
      return;
    }
  });
  var s = vQ(e, o, r);
  return (n || i) && dQ(s, e, o, t), n && pQ(s, t), n || i ? gQ(s, t, i) : a && mQ(s, t), yQ(s), s;
}
function vQ(e, t, r) {
  var n = [];
  if (r === "replaceAll")
    return n;
  for (var i = 0; i < e.length; i++) {
    var a = e[i];
    a && a.id != null && t.set(a.id, i), n.push({
      existing: r === "replaceMerge" || N1(a) ? null : a,
      newOption: null,
      keyInfo: null,
      brandNew: null
    });
  }
  return n;
}
function dQ(e, t, r, n) {
  F(n, function(i, a) {
    if (!(!i || i.id == null)) {
      var o = v1(i.id), s = r.get(o);
      if (s != null) {
        var l = e[s];
        Hi(!l.newOption, 'Duplicated option on id "' + o + '".'), l.newOption = i, l.existing = t[s], n[a] = null;
      }
    }
  });
}
function pQ(e, t) {
  F(t, function(r, n) {
    if (!(!r || r.name == null))
      for (var i = 0; i < e.length; i++) {
        var a = e[i].existing;
        if (!e[i].newOption && a && (a.id == null || r.id == null) && !N1(r) && !N1(a) && UU("name", a, r)) {
          e[i].newOption = r, t[n] = null;
          return;
        }
      }
  });
}
function gQ(e, t, r) {
  F(t, function(n) {
    if (n) {
      for (
        var i, a = 0;
        // Be `!resultItem` only when `nextIdx >= result.length`.
        (i = e[a]) && (i.newOption || N1(i.existing) || // In mode "replaceMerge", here no not-mapped-non-internal-existing.
        i.existing && n.id != null && !UU("id", n, i.existing));
      )
        a++;
      i ? (i.newOption = n, i.brandNew = r) : e.push({
        newOption: n,
        brandNew: r,
        existing: null,
        keyInfo: null
      }), a++;
    }
  });
}
function mQ(e, t) {
  F(t, function(r) {
    e.push({
      newOption: r,
      brandNew: !0,
      existing: null,
      keyInfo: null
    });
  });
}
function yQ(e) {
  var t = Je();
  F(e, function(r) {
    var n = r.existing;
    n && t.set(n.id, r);
  }), F(e, function(r) {
    var n = r.newOption;
    Hi(!n || n.id == null || !t.get(n.id) || t.get(n.id) === r, "id duplicates: " + (n && n.id)), n && n.id != null && t.set(n.id, r), !r.keyInfo && (r.keyInfo = {});
  }), F(e, function(r, n) {
    var i = r.existing, a = r.newOption, o = r.keyInfo;
    if (ot(a)) {
      if (o.name = a.name != null ? v1(a.name) : i ? i.name : GU + n, i)
        o.id = v1(i.id);
      else if (a.id != null)
        o.id = v1(a.id);
      else {
        var s = 0;
        do
          o.id = "\0" + o.name + "\0" + s++;
        while (t.get(o.id));
      }
      t.set(o.id, r);
    }
  });
}
function UU(e, t, r) {
  var n = Gn(t[e], null), i = Gn(r[e], null);
  return n != null && i != null && n === i;
}
function v1(e) {
  return Gn(e, "");
}
function Gn(e, t) {
  return e == null ? t : Fe(e) ? e : Xt(e) || B2(e) ? e + "" : t;
}
function yR(e) {
  var t = e.name;
  return !!(t && t.indexOf(GU));
}
function N1(e) {
  return e && e.id != null && v1(e.id).indexOf(VU) === 0;
}
function _Q(e) {
  return VU + e;
}
function xQ(e, t, r) {
  F(e, function(n) {
    var i = n.newOption;
    ot(i) && (n.keyInfo.mainType = t, n.keyInfo.subType = SQ(t, i, n.existing, r));
  });
}
function SQ(e, t, r, n) {
  var i = t.type ? t.type : r ? r.subType : n.determineSubType(e, t);
  return i;
}
function wQ(e, t) {
  var r = {}, n = {};
  return i(e || [], r), i(t || [], n, r), [a(r), a(n)];
  function i(o, s, l) {
    for (var u = 0, f = o.length; u < f; u++) {
      var c = Gn(o[u].seriesId, null);
      if (c == null)
        return;
      for (var h = Mr(o[u].dataIndex), v = l && l[c], d = 0, g = h.length; d < g; d++) {
        var y = h[d];
        v && v[y] ? v[y] = null : (s[c] || (s[c] = {}))[y] = 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 f = a(o[u], !0);
          f.length && l.push({
            seriesId: u,
            dataIndex: f
          });
        }
    return l;
  }
}
function Sd(e, t) {
  if (t.dataIndexInside != null)
    return t.dataIndexInside;
  if (t.dataIndex != null)
    return Se(t.dataIndex) ? Ce(t.dataIndex, function(r) {
      return e.indexOfRawIndex(r);
    }) : e.indexOfRawIndex(t.dataIndex);
  if (t.name != null)
    return Se(t.name) ? Ce(t.name, function(r) {
      return e.indexOfName(r);
    }) : e.indexOfName(t.name);
}
function Bt() {
  var e = "__ec_inner_" + TQ++;
  return function(t) {
    return t[e] || (t[e] = {});
  };
}
var TQ = BU();
function dm(e, t, r) {
  var n = _R(t, r), i = n.mainTypeSpecified, a = n.queryOptionMap, o = n.others, s = o, l = r ? r.defaultMainType : null;
  return !i && l && a.set(l, {}), a.each(function(u, f) {
    var c = Zm(e, f, u, {
      useDefault: l === f,
      enableAll: r && r.enableAll != null ? r.enableAll : !0,
      enableNone: r && r.enableNone != null ? r.enableNone : !0
    });
    s[f + "Models"] = c.models, s[f + "Model"] = c.models[0];
  }), s;
}
function _R(e, t) {
  var r;
  if (Fe(e)) {
    var n = {};
    n[e + "Index"] = 0, r = n;
  } else
    r = e;
  var i = Je(), a = {}, o = !1;
  return F(r, function(s, l) {
    if (l === "dataIndex" || l === "dataIndexInside") {
      a[l] = s;
      return;
    }
    var u = l.match(/^(\w+)(Index|Id|Name)$/) || [], f = u[1], c = (u[2] || "").toLowerCase();
    if (!(!f || !c || t && t.includeMainTypes && Tt(t.includeMainTypes, f) < 0)) {
      o = o || !!f;
      var h = i.get(f) || i.set(f, {});
      h[c] = s;
    }
  }), {
    mainTypeSpecified: o,
    queryOptionMap: i,
    others: a
  };
}
var an = {
  useDefault: !0,
  enableAll: !1,
  enableNone: !1
}, bQ = {
  useDefault: !1,
  enableAll: !0,
  enableNone: !0
};
function Zm(e, t, r, n) {
  n = n || an;
  var i = r.index, a = r.id, o = r.name, s = {
    models: null,
    specified: i != null || a != null || o != null
  };
  if (!s.specified) {
    var l = void 0;
    return s.models = n.useDefault && (l = e.getComponent(t)) ? [l] : [], s;
  }
  if (i === "none" || i === !1) {
    if (n.enableNone)
      return s.models = [], s;
    i = -1;
  }
  return i === "all" && (n.enableAll ? i = a = o = null : i = -1), s.models = e.queryComponents({
    mainType: t,
    index: i,
    id: a,
    name: o
  }), s;
}
function WU(e, t, r) {
  e.setAttribute ? e.setAttribute(t, r) : e[t] = r;
}
function CQ(e, t) {
  return e.getAttribute ? e.getAttribute(t) : e[t];
}
function AQ(e) {
  return e === "auto" ? Gt.domSupported ? "html" : "richText" : e || "html";
}
function QE(e, t) {
  var r = Je(), n = [];
  return F(e, function(i) {
    var a = t(i);
    (r.get(a) || (n.push(a), r.set(a, []))).push(i);
  }), {
    keys: n,
    buckets: r
  };
}
function XU(e, t, r, n, i) {
  var a = t == null || t === "auto";
  if (n == null)
    return n;
  if (Xt(n)) {
    var o = dk(r || 0, n, i);
    return jr(o, a ? Math.max(Gs(r || 0), Gs(n)) : t);
  } else {
    if (Fe(n))
      return i < 1 ? r : n;
    for (var s = [], l = r, u = n, f = Math.max(l ? l.length : 0, u.length), c = 0; c < f; ++c) {
      var h = e.getDimensionInfo(c);
      if (h && h.type === "ordinal")
        s[c] = (i < 1 && l ? l : u)[c];
      else {
        var v = l && l[c] ? l[c] : 0, d = u[c], o = dk(v, d, i);
        s[c] = jr(o, a ? Math.max(Gs(v), Gs(d)) : t);
      }
    }
    return s;
  }
}
var Vc = (
  /** @class */
  (function() {
    function e() {
    }
    return e.prototype.reset = function(t, r, n, i) {
      return this._list = t, this._step = i = i || 1, this._idx = r, this._end = n ?? (i > 0 ? t.length : 0), this.item = null, this.key = NaN, this;
    }, e.prototype.next = function() {
      return (this._step > 0 ? this._idx < this._end : this._idx >= this._end) ? (this.item = this._list[this._idx], this.key = this._idx = this._idx + this._step, !0) : !1;
    }, e;
  })()
);
function BM(e) {
  e.option = e.parentModel = e.ecModel = null;
}
var MQ = ".", mv = "___EC__COMPONENT__CONTAINER___", YU = "___EC__EXTENDED_CLASS___";
function Ul(e) {
  var t = {
    main: "",
    sub: ""
  };
  if (e) {
    var r = e.split(MQ);
    t.main = r[0] || "", t.sub = r[1] || "";
  }
  return t;
}
function LQ(e) {
  Hi(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e), 'componentType "' + e + '" illegal');
}
function DQ(e) {
  return !!(e && e[YU]);
}
function xR(e, t) {
  e.$constructor = e, e.extend = function(r) {
    var n = this, i;
    return EQ(n) ? i = /** @class */
    (function(a) {
      ae(o, a);
      function o() {
        return a.apply(this, arguments) || this;
      }
      return o;
    })(n) : (i = function() {
      (r.$constructor || n).apply(this, arguments);
    }, mx(i, this)), xe(i.prototype, r), i[YU] = !0, i.extend = this.extend, i.superCall = RQ, i.superApply = OQ, i.superClass = n, i;
  };
}
function EQ(e) {
  return nt(e) && /^class\s/.test(Function.prototype.toString.call(e));
}
function ZU(e, t) {
  e.extend = t.extend;
}
var PQ = Math.round(Math.random() * 10);
function IQ(e) {
  var t = ["__\0is_clz", PQ++].join("_");
  e.prototype[t] = !0, e.isInstance = function(r) {
    return !!(r && r[t]);
  };
}
function RQ(e, t) {
  for (var r = [], n = 2; n < arguments.length; n++)
    r[n - 2] = arguments[n];
  return this.superClass.prototype[t].apply(e, r);
}
function OQ(e, t, r) {
  return this.superClass.prototype[t].apply(e, r);
}
function _C(e) {
  var t = {};
  e.registerClass = function(n) {
    var i = n.type || n.prototype.type;
    if (i) {
      LQ(i), n.prototype.type = i;
      var a = Ul(i);
      if (!a.sub)
        t[a.main] = n;
      else if (a.sub !== mv) {
        var o = r(a);
        o[a.sub] = n;
      }
    }
    return n;
  }, e.getClass = function(n, i, a) {
    var o = t[n];
    if (o && o[mv] && (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;
  }, e.getClassesByMainType = function(n) {
    var i = Ul(n), a = [], o = t[i.main];
    return o && o[mv] ? F(o, function(s, l) {
      l !== mv && a.push(s);
    }) : a.push(o), a;
  }, e.hasClass = function(n) {
    var i = Ul(n);
    return !!t[i.main];
  }, e.getAllClassMainTypes = function() {
    var n = [];
    return F(t, function(i, a) {
      n.push(a);
    }), n;
  }, e.hasSubTypes = function(n) {
    var i = Ul(n), a = t[i.main];
    return a && a[mv];
  };
  function r(n) {
    var i = t[n.main];
    return (!i || !i[mv]) && (i = t[n.main] = {}, i[mv] = !0), i;
  }
}
function wd(e, t) {
  for (var r = 0; r < e.length; r++)
    e[r][1] || (e[r][1] = e[r][0]);
  return t = t || !1, function(n, i, a) {
    for (var o = {}, s = 0; s < e.length; s++) {
      var l = e[s][1];
      if (!(i && Tt(i, l) >= 0 || a && Tt(a, l) < 0)) {
        var u = n.getShallow(l, t);
        u != null && (o[e[s][0]] = u);
      }
    }
    return o;
  };
}
var NQ = [
  ["fill", "color"],
  ["shadowBlur"],
  ["shadowOffsetX"],
  ["shadowOffsetY"],
  ["opacity"],
  ["shadowColor"]
  // Option decal is in `DecalObject` but style.decal is in `PatternObject`.
  // So do not transfer decal directly.
], kQ = wd(NQ), BQ = (
  /** @class */
  (function() {
    function e() {
    }
    return e.prototype.getAreaStyle = function(t, r) {
      return kQ(this, t, r);
    }, e;
  })()
), JE = new xm(50);
function zQ(e) {
  if (typeof e == "string") {
    var t = JE.get(e);
    return t && t.image;
  } else
    return e;
}
function SR(e, t, r, n, i) {
  if (e)
    if (typeof e == "string") {
      if (t && t.__zrImageSrc === e || !r)
        return t;
      var a = JE.get(e), o = { hostEl: r, cb: n, cbPayload: i };
      return a ? (t = a.image, !xC(t) && a.pending.push(o)) : (t = ja.loadImage(e, gk, gk), t.__zrImageSrc = e, JE.put(e, t.__cachedImgObj = {
        image: t,
        pending: [o]
      })), t;
    } else
      return e;
  else return t;
}
function gk() {
  var e = this.__cachedImgObj;
  this.onload = this.onerror = this.__cachedImgObj = null;
  for (var t = 0; t < e.pending.length; t++) {
    var r = e.pending[t], n = r.cb;
    n && n(this, r.cbPayload), r.hostEl.dirty();
  }
  e.pending.length = 0;
}
function xC(e) {
  return e && e.width && e.height;
}
var zM = /\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;
function FQ(e, t, r, n, i) {
  var a = {};
  return $U(a, e, t, r, n, i), a.text;
}
function $U(e, t, r, n, i, a) {
  if (!r) {
    e.text = "", e.isTruncated = !1;
    return;
  }
  var o = (t + "").split(`
`);
  a = qU(r, n, i, a);
  for (var s = !1, l = {}, u = 0, f = o.length; u < f; u++)
    jU(l, o[u], a), o[u] = l.textLine, s = s || l.isTruncated;
  e.text = o.join(`
`), e.isTruncated = s;
}
function qU(e, t, r, n) {
  n = n || {};
  var i = xe({}, n);
  r = et(r, "..."), i.maxIterations = et(n.maxIterations, 2);
  var a = i.minChar = et(n.minChar, 0), o = i.fontMeasureInfo = $l(t), s = o.asciiCharWidth;
  i.placeholder = et(n.placeholder, "");
  for (var l = e = Math.max(0, e - 1), u = 0; u < a && l >= s; u++)
    l -= s;
  var f = ql(o, r);
  return f > l && (r = "", f = 0), l = e - f, i.ellipsis = r, i.ellipsisWidth = f, i.contentWidth = l, i.containerWidth = e, i;
}
function jU(e, t, r) {
  var n = r.containerWidth, i = r.contentWidth, a = r.fontMeasureInfo;
  if (!n) {
    e.textLine = "", e.isTruncated = !1;
    return;
  }
  var o = ql(a, t);
  if (o <= n) {
    e.textLine = t, e.isTruncated = !1;
    return;
  }
  for (var s = 0; ; s++) {
    if (o <= i || s >= r.maxIterations) {
      t += r.ellipsis;
      break;
    }
    var l = s === 0 ? GQ(t, i, a) : o > 0 ? Math.floor(t.length * i / o) : 0;
    t = t.substr(0, l), o = ql(a, t);
  }
  t === "" && (t = r.placeholder), e.textLine = t, e.isTruncated = !0;
}
function GQ(e, t, r) {
  for (var n = 0, i = 0, a = e.length; i < a && n < t; i++)
    n += DU(r, e.charCodeAt(i));
  return i;
}
function VQ(e, t, r, n) {
  var i = wR(e), a = t.overflow, o = t.padding, s = o ? o[1] + o[3] : 0, l = o ? o[0] + o[2] : 0, u = t.font, f = a === "truncate", c = bx(u), h = et(t.lineHeight, c), v = t.lineOverflow === "truncate", d = !1, g = t.width;
  g == null && r != null && (g = r - s);
  var y = t.height;
  y == null && n != null && (y = n - l);
  var x;
  g != null && (a === "break" || a === "breakAll") ? x = i ? KU(i, t.font, g, a === "breakAll", 0).lines : [] : x = i ? i.split(`
`) : [];
  var S = x.length * h;
  if (y == null && (y = S), S > y && v) {
    var T = Math.floor(y / h);
    d = d || x.length > T, x = x.slice(0, T), S = x.length * h;
  }
  if (i && f && g != null)
    for (var C = qU(g, u, t.ellipsis, {
      minChar: t.truncateMinChar,
      placeholder: t.placeholder
    }), A = {}, M = 0; M < x.length; M++)
      jU(A, x[M], C), x[M] = A.textLine, d = d || A.isTruncated;
  for (var E = y, P = 0, R = $l(u), M = 0; M < x.length; M++)
    P = Math.max(ql(R, x[M]), P);
  g == null && (g = P);
  var O = g;
  return E += l, O += s, {
    lines: x,
    height: y,
    outerWidth: O,
    outerHeight: E,
    lineHeight: h,
    calculatedLineHeight: c,
    contentWidth: P,
    contentHeight: S,
    width: g,
    isTruncated: d
  };
}
var HQ = /* @__PURE__ */ (function() {
  function e() {
  }
  return e;
})(), mk = /* @__PURE__ */ (function() {
  function e(t) {
    this.tokens = [], t && (this.tokens = t);
  }
  return e;
})(), UQ = /* @__PURE__ */ (function() {
  function e() {
    this.width = 0, this.height = 0, this.contentWidth = 0, this.contentHeight = 0, this.outerWidth = 0, this.outerHeight = 0, this.lines = [], this.isTruncated = !1;
  }
  return e;
})();
function WQ(e, t, r, n, i) {
  var a = new UQ(), o = wR(e);
  if (!o)
    return a;
  var s = t.padding, l = s ? s[1] + s[3] : 0, u = s ? s[0] + s[2] : 0, f = t.width;
  f == null && r != null && (f = r - l);
  var c = t.height;
  c == null && n != null && (c = n - u);
  for (var h = t.overflow, v = (h === "break" || h === "breakAll") && f != null ? { width: f, accumWidth: 0, breakAll: h === "breakAll" } : null, d = zM.lastIndex = 0, g; (g = zM.exec(o)) != null; ) {
    var y = g.index;
    y > d && FM(a, o.substring(d, y), t, v), FM(a, g[2], t, v, g[1]), d = zM.lastIndex;
  }
  d < o.length && FM(a, o.substring(d, o.length), t, v);
  var x = [], S = 0, T = 0, C = h === "truncate", A = t.lineOverflow === "truncate", M = {};
  function E(pe, me, de) {
    pe.width = me, pe.lineHeight = de, S += de, T = Math.max(T, me);
  }
  e: for (var P = 0; P < a.lines.length; P++) {
    for (var R = a.lines[P], O = 0, N = 0, G = 0; G < R.tokens.length; G++) {
      var z = R.tokens[G], H = z.styleName && t.rich[z.styleName] || {}, W = z.textPadding = H.padding, Z = W ? W[1] + W[3] : 0, ee = z.font = H.font || t.font;
      z.contentHeight = bx(ee);
      var V = et(H.height, z.contentHeight);
      if (z.innerHeight = V, W && (V += W[0] + W[2]), z.height = V, z.lineHeight = $a(H.lineHeight, t.lineHeight, V), z.align = H && H.align || i, z.verticalAlign = H && H.verticalAlign || "middle", A && c != null && S + z.lineHeight > c) {
        var Q = a.lines.length;
        G > 0 ? (R.tokens = R.tokens.slice(0, G), E(R, N, O), a.lines = a.lines.slice(0, P + 1)) : a.lines = a.lines.slice(0, P), a.isTruncated = a.isTruncated || a.lines.length < Q;
        break e;
      }
      var q = H.width, X = q == null || q === "auto";
      if (typeof q == "string" && q.charAt(q.length - 1) === "%")
        z.percentWidth = q, x.push(z), z.contentWidth = ql($l(ee), z.text);
      else {
        if (X) {
          var K = H.backgroundColor, ue = K && K.image;
          ue && (ue = zQ(ue), xC(ue) && (z.width = Math.max(z.width, ue.width * V / ue.height)));
        }
        var oe = C && f != null ? f - N : null;
        oe != null && oe < z.width ? !X || oe < Z ? (z.text = "", z.width = z.contentWidth = 0) : ($U(M, z.text, oe - Z, ee, t.ellipsis, { minChar: t.truncateMinChar }), z.text = M.text, a.isTruncated = a.isTruncated || M.isTruncated, z.width = z.contentWidth = ql($l(ee), z.text)) : z.contentWidth = ql($l(ee), z.text);
      }
      z.width += Z, N += z.width, H && (O = Math.max(O, z.lineHeight));
    }
    E(R, N, O);
  }
  a.outerWidth = a.width = et(f, T), a.outerHeight = a.height = et(c, S), a.contentHeight = S, a.contentWidth = T, a.outerWidth += l, a.outerHeight += u;
  for (var P = 0; P < x.length; P++) {
    var z = x[P], te = z.percentWidth;
    z.width = parseInt(te, 10) / 100 * a.width;
  }
  return a;
}
function FM(e, t, r, n, i) {
  var a = t === "", o = i && r.rich[i] || {}, s = e.lines, l = o.font || r.font, u = !1, f, c;
  if (n) {
    var h = o.padding, v = h ? h[1] + h[3] : 0;
    if (o.width != null && o.width !== "auto") {
      var d = $s(o.width, n.width) + v;
      s.length > 0 && d + n.accumWidth > n.width && (f = t.split(`
`), u = !0), n.accumWidth = d;
    } else {
      var g = KU(t, l, n.width, n.breakAll, n.accumWidth);
      n.accumWidth = g.accumWidth + v, c = g.linesWidths, f = g.lines;
    }
  }
  f || (f = t.split(`
`));
  for (var y = $l(l), x = 0; x < f.length; x++) {
    var S = f[x], T = new HQ();
    if (T.styleName = i, T.text = S, T.isLineHolder = !S && !a, typeof o.width == "number" ? T.width = o.width : T.width = c ? c[x] : ql(y, S), !x && !u) {
      var C = (s[s.length - 1] || (s[0] = new mk())).tokens, A = C.length;
      A === 1 && C[0].isLineHolder ? C[0] = T : (S || !A || a) && C.push(T);
    } else
      s.push(new mk([T]));
  }
}
function XQ(e) {
  var t = e.charCodeAt(0);
  return t >= 32 && t <= 591 || t >= 880 && t <= 4351 || t >= 4608 && t <= 5119 || t >= 7680 && t <= 8303;
}
var YQ = bo(",&?/;] ".split(""), function(e, t) {
  return e[t] = !0, e;
}, {});
function ZQ(e) {
  return XQ(e) ? !!YQ[e] : !0;
}
function KU(e, t, r, n, i) {
  for (var a = [], o = [], s = "", l = "", u = 0, f = 0, c = $l(t), h = 0; h < e.length; h++) {
    var v = e.charAt(h);
    if (v === `
`) {
      l && (s += l, f += u), a.push(s), o.push(f), s = "", l = "", u = 0, f = 0;
      continue;
    }
    var d = DU(c, v.charCodeAt(0)), g = n ? !1 : !ZQ(v);
    if (a.length ? f + d > r : i + f + d > r) {
      f ? (s || l) && (g ? (s || (s = l, l = "", u = 0, f = u), a.push(s), o.push(f - u), l += v, u += d, s = "", f = u) : (l && (s += l, l = "", u = 0), a.push(s), o.push(f), s = v, f = d)) : g ? (a.push(l), o.push(u), l = v, u = d) : (a.push(v), o.push(d));
      continue;
    }
    f += d, g ? (l += v, u += d) : (l && (s += l, l = "", u = 0), s += v);
  }
  return l && (s += l), s && (a.push(s), o.push(f)), a.length === 1 && (f += i), {
    accumWidth: f,
    lines: a,
    linesWidths: o
  };
}
function yk(e, t, r, n, i, a) {
  if (e.baseX = r, e.baseY = n, e.outerWidth = e.outerHeight = null, !!t) {
    var o = t.width * 2, s = t.height * 2;
    st.set(_k, Sm(r, o, i), fd(n, s, a), o, s), st.intersect(t, _k, null, xk);
    var l = xk.outIntersectRect;
    e.outerWidth = l.width, e.outerHeight = l.height, e.baseX = Sm(l.x, l.width, i, !0), e.baseY = fd(l.y, l.height, a, !0);
  }
}
var _k = new st(0, 0, 0, 0), xk = { outIntersectRect: {}, clamp: !0 };
function wR(e) {
  return e != null ? e += "" : e = "";
}
function $Q(e) {
  var t = wR(e.text), r = e.font, n = ql($l(r), t), i = bx(r);
  return eP(e, n, i, null);
}
function eP(e, t, r, n) {
  var i = new st(Sm(e.x || 0, t, e.textAlign), fd(e.y || 0, r, e.textBaseline), t, r), a = n ?? (QU(e) ? e.lineWidth : 0);
  return a > 0 && (i.x -= a / 2, i.y -= a / 2, i.width += a, i.height += a), i;
}
function QU(e) {
  var t = e.stroke;
  return t != null && t !== "none" && e.lineWidth > 0;
}
var tP = "__zr_style_" + Math.round(Math.random() * 10), cd = {
  shadowBlur: 0,
  shadowOffsetX: 0,
  shadowOffsetY: 0,
  shadowColor: "#000",
  opacity: 1,
  blend: "source-over"
}, SC = {
  style: {
    shadowBlur: !0,
    shadowOffsetX: !0,
    shadowOffsetY: !0,
    shadowColor: !0,
    opacity: !0
  }
};
cd[tP] = !0;
var Sk = ["z", "z2", "invisible"], qQ = ["invisible"], hs = (function(e) {
  ae(t, e);
  function t(r) {
    return e.call(this, r) || this;
  }
  return t.prototype._init = function(r) {
    for (var n = Ht(r), i = 0; i < n.length; i++) {
      var a = n[i];
      a === "style" ? this.useStyle(r[a]) : e.prototype.attrKV.call(this, a, r[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(r, n, i, a) {
    var o = this.transform;
    if (this.ignore || this.invisible || this.style.opacity === 0 || this.culling && jQ(this, r, n) || o && !o[0] && !o[3])
      return !1;
    if (i && this.__clipPaths && this.__clipPaths.length) {
      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(r, n) {
    return this.rectContain(r, n);
  }, t.prototype.traverse = function(r, n) {
    r.call(n, this);
  }, t.prototype.rectContain = function(r, n) {
    var i = this.transformCoordToLocal(r, n), a = this.getBoundingRect();
    return a.contain(i[0], i[1]);
  }, t.prototype.getPaintRect = function() {
    var r = 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;
      r = this._paintRect || (this._paintRect = new st(0, 0, 0, 0)), n ? st.applyTransform(r, i, n) : r.copy(i), (o || s || l) && (r.width += o * 2 + Math.abs(s), r.height += o * 2 + Math.abs(l), r.x = Math.min(r.x, r.x + s - o), r.y = Math.min(r.y, r.y + l - o));
      var u = this.dirtyRectTolerance;
      r.isZero() || (r.x = Math.floor(r.x - u), r.y = Math.floor(r.y - u), r.width = Math.ceil(r.width + 1 + u * 2), r.height = Math.ceil(r.height + 1 + u * 2));
    }
    return r;
  }, t.prototype.setPrevPaintRect = function(r) {
    r ? (this._prevPaintRect = this._prevPaintRect || new st(0, 0, 0, 0), this._prevPaintRect.copy(r)) : this._prevPaintRect = null;
  }, t.prototype.getPrevPaintRect = function() {
    return this._prevPaintRect;
  }, t.prototype.animateStyle = function(r) {
    return this.animate("style", r);
  }, t.prototype.updateDuringAnimation = function(r) {
    r === "style" ? this.dirtyStyle() : this.markRedraw();
  }, t.prototype.attrKV = function(r, n) {
    r !== "style" ? e.prototype.attrKV.call(this, r, n) : this.style ? this.setStyle(n) : this.useStyle(n);
  }, t.prototype.setStyle = function(r, n) {
    return typeof r == "string" ? this.style[r] = n : xe(this.style, r), this.dirtyStyle(), this;
  }, t.prototype.dirtyStyle = function(r) {
    r || this.markRedraw(), this.__dirty |= V_, this._rect && (this._rect = null);
  }, t.prototype.dirty = function() {
    this.dirtyStyle();
  }, t.prototype.styleChanged = function() {
    return !!(this.__dirty & V_);
  }, t.prototype.styleUpdated = function() {
    this.__dirty &= ~V_;
  }, t.prototype.createStyle = function(r) {
    return xx(cd, r);
  }, t.prototype.useStyle = function(r) {
    r[tP] || (r = this.createStyle(r)), this.__inHover ? this.__hoverStyle = r : this.style = r, this.dirtyStyle();
  }, t.prototype.isStyleObject = function(r) {
    return r[tP];
  }, t.prototype._innerSaveToNormal = function(r) {
    e.prototype._innerSaveToNormal.call(this, r);
    var n = this._normalState;
    r.style && !n.style && (n.style = this._mergeStyle(this.createStyle(), this.style)), this._savePrimaryToNormal(r, n, Sk);
  }, t.prototype._applyStateObj = function(r, n, i, a, o, s) {
    e.prototype._applyStateObj.call(this, r, 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 f = this.style;
        if (this.style = this.createStyle(l ? {} : f), l)
          for (var c = Ht(f), h = 0; h < c.length; h++) {
            var v = c[h];
            v in u && (u[v] = u[v], this.style[v] = f[v]);
          }
        for (var d = Ht(u), h = 0; h < d.length; h++) {
          var v = d[h];
          this.style[v] = this.style[v];
        }
        this._transitionState(r, {
          style: u
        }, s, this.getAnimationStyleProps());
      } else
        this.useStyle(u);
    for (var g = this.__inHover ? qQ : Sk, h = 0; h < g.length; h++) {
      var v = g[h];
      n && n[v] != null ? this[v] = n[v] : l && i[v] != null && (this[v] = i[v]);
    }
  }, t.prototype._mergeStates = function(r) {
    for (var n = e.prototype._mergeStates.call(this, r), i, a = 0; a < r.length; a++) {
      var o = r[a];
      o.style && (i = i || {}, this._mergeStyle(i, o.style));
    }
    return i && (n.style = i), n;
  }, t.prototype._mergeStyle = function(r, n) {
    return xe(r, n), r;
  }, t.prototype.getAnimationStyleProps = function() {
    return SC;
  }, t.initDefaultProps = (function() {
    var r = t.prototype;
    r.type = "displayable", r.invisible = !1, r.z = 0, r.z2 = 0, r.zlevel = 0, r.culling = !1, r.cursor = "pointer", r.rectHover = !1, r.incremental = !1, r._rect = null, r.dirtyRectTolerance = 0, r.__dirty = mo | V_;
  })(), t;
})(gC), GM = new st(0, 0, 0, 0), VM = new st(0, 0, 0, 0);
function jQ(e, t, r) {
  return GM.copy(e.getBoundingRect()), e.transform && GM.applyTransform(e.transform), VM.width = t, VM.height = r, !GM.intersect(VM);
}
var Xa = Math.min, Ya = Math.max, HM = Math.sin, UM = Math.cos, yv = Math.PI * 2, Bw = th(), zw = th(), Fw = th();
function wC(e, t, r) {
  if (e.length !== 0) {
    for (var n = e[0], i = n[0], a = n[0], o = n[1], s = n[1], l = 1; l < e.length; l++)
      n = e[l], i = Xa(i, n[0]), a = Ya(a, n[0]), o = Xa(o, n[1]), s = Ya(s, n[1]);
    t[0] = i, t[1] = o, r[0] = a, r[1] = s;
  }
}
function wk(e, t, r, n, i, a) {
  i[0] = Xa(e, r), i[1] = Xa(t, n), a[0] = Ya(e, r), a[1] = Ya(t, n);
}
var Tk = [], bk = [];
function KQ(e, t, r, n, i, a, o, s, l, u) {
  var f = dU, c = Jn, h = f(e, r, i, o, Tk);
  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 = c(e, r, i, o, Tk[v]);
    l[0] = Xa(d, l[0]), u[0] = Ya(d, u[0]);
  }
  h = f(t, n, a, s, bk);
  for (var v = 0; v < h; v++) {
    var g = c(t, n, a, s, bk[v]);
    l[1] = Xa(g, l[1]), u[1] = Ya(g, u[1]);
  }
  l[0] = Xa(e, l[0]), u[0] = Ya(e, u[0]), l[0] = Xa(o, l[0]), u[0] = Ya(o, u[0]), l[1] = Xa(t, l[1]), u[1] = Ya(t, u[1]), l[1] = Xa(s, l[1]), u[1] = Ya(s, u[1]);
}
function QQ(e, t, r, n, i, a, o, s) {
  var l = gU, u = Si, f = Ya(Xa(l(e, r, i), 1), 0), c = Ya(Xa(l(t, n, a), 1), 0), h = u(e, r, i, f), v = u(t, n, a, c);
  o[0] = Xa(e, i, h), o[1] = Xa(t, a, v), s[0] = Ya(e, i, h), s[1] = Ya(t, a, v);
}
function JQ(e, t, r, n, i, a, o, s, l) {
  var u = nf, f = af, c = Math.abs(i - a);
  if (c % yv < 1e-4 && c > 1e-4) {
    s[0] = e - r, s[1] = t - n, l[0] = e + r, l[1] = t + n;
    return;
  }
  if (Bw[0] = UM(i) * r + e, Bw[1] = HM(i) * n + t, zw[0] = UM(a) * r + e, zw[1] = HM(a) * n + t, u(s, Bw, zw), f(l, Bw, zw), i = i % yv, i < 0 && (i = i + yv), a = a % yv, a < 0 && (a = a + yv), i > a && !o ? a += yv : i < a && o && (i += yv), o) {
    var h = a;
    a = i, i = h;
  }
  for (var v = 0; v < a; v += Math.PI / 2)
    v > i && (Fw[0] = UM(v) * r + e, Fw[1] = HM(v) * n + t, u(s, Fw, s), f(l, Fw, l));
}
var Er = {
  M: 1,
  L: 2,
  C: 3,
  Q: 4,
  A: 5,
  Z: 6,
  R: 7
}, _v = [], xv = [], Ml = [], vc = [], Ll = [], Dl = [], WM = Math.min, XM = Math.max, Sv = Math.cos, wv = Math.sin, Fu = Math.abs, rP = Math.PI, Ac = rP * 2, YM = typeof Float32Array < "u", Q0 = [];
function ZM(e) {
  var t = Math.round(e / rP * 1e8) / 1e8;
  return t % 2 * rP;
}
function TC(e, t) {
  var r = ZM(e[0]);
  r < 0 && (r += Ac);
  var n = r - e[0], i = e[1];
  i += n, !t && i - r >= Ac ? i = r + Ac : t && r - i >= Ac ? i = r - Ac : !t && r > i ? i = r + (Ac - ZM(r - i)) : t && r < i && (i = r - (Ac - ZM(i - r))), e[0] = r, e[1] = i;
}
var ru = (function() {
  function e(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 e.prototype.increaseVersion = function() {
    this._version++;
  }, e.prototype.getVersion = function() {
    return this._version;
  }, e.prototype.setScale = function(t, r, n) {
    n = n || 0, n > 0 && (this._ux = Fu(n / Y2 / t) || 0, this._uy = Fu(n / Y2 / r) || 0);
  }, e.prototype.setDPR = function(t) {
    this.dpr = t;
  }, e.prototype.setContext = function(t) {
    this._ctx = t;
  }, e.prototype.getContext = function() {
    return this._ctx;
  }, e.prototype.beginPath = function() {
    return this._ctx && this._ctx.beginPath(), this.reset(), this;
  }, e.prototype.reset = function() {
    this._saveData && (this._len = 0), this._pathSegLen && (this._pathSegLen = null, this._pathLen = 0), this._version++;
  }, e.prototype.moveTo = function(t, r) {
    return this._drawPendingPt(), this.addData(Er.M, t, r), this._ctx && this._ctx.moveTo(t, r), this._x0 = t, this._y0 = r, this._xi = t, this._yi = r, this;
  }, e.prototype.lineTo = function(t, r) {
    var n = Fu(t - this._xi), i = Fu(r - this._yi), a = n > this._ux || i > this._uy;
    if (this.addData(Er.L, t, r), this._ctx && a && this._ctx.lineTo(t, r), a)
      this._xi = t, this._yi = r, this._pendingPtDist = 0;
    else {
      var o = n * n + i * i;
      o > this._pendingPtDist && (this._pendingPtX = t, this._pendingPtY = r, this._pendingPtDist = o);
    }
    return this;
  }, e.prototype.bezierCurveTo = function(t, r, n, i, a, o) {
    return this._drawPendingPt(), this.addData(Er.C, t, r, n, i, a, o), this._ctx && this._ctx.bezierCurveTo(t, r, n, i, a, o), this._xi = a, this._yi = o, this;
  }, e.prototype.quadraticCurveTo = function(t, r, n, i) {
    return this._drawPendingPt(), this.addData(Er.Q, t, r, n, i), this._ctx && this._ctx.quadraticCurveTo(t, r, n, i), this._xi = n, this._yi = i, this;
  }, e.prototype.arc = function(t, r, n, i, a, o) {
    this._drawPendingPt(), Q0[0] = i, Q0[1] = a, TC(Q0, o), i = Q0[0], a = Q0[1];
    var s = a - i;
    return this.addData(Er.A, t, r, n, n, i, s, 0, o ? 0 : 1), this._ctx && this._ctx.arc(t, r, n, i, a, o), this._xi = Sv(a) * n + t, this._yi = wv(a) * n + r, this;
  }, e.prototype.arcTo = function(t, r, n, i, a) {
    return this._drawPendingPt(), this._ctx && this._ctx.arcTo(t, r, n, i, a), this;
  }, e.prototype.rect = function(t, r, n, i) {
    return this._drawPendingPt(), this._ctx && this._ctx.rect(t, r, n, i), this.addData(Er.R, t, r, n, i), this;
  }, e.prototype.closePath = function() {
    this._drawPendingPt(), this.addData(Er.Z);
    var t = this._ctx, r = this._x0, n = this._y0;
    return t && t.closePath(), this._xi = r, this._yi = n, this;
  }, e.prototype.fill = function(t) {
    t && t.fill(), this.toStatic();
  }, e.prototype.stroke = function(t) {
    t && t.stroke(), this.toStatic();
  }, e.prototype.len = function() {
    return this._len;
  }, e.prototype.setData = function(t) {
    if (this._saveData) {
      var r = t.length;
      !(this.data && this.data.length === r) && YM && (this.data = new Float32Array(r));
      for (var n = 0; n < r; n++)
        this.data[n] = t[n];
      this._len = r;
    }
  }, e.prototype.appendPath = function(t) {
    if (this._saveData) {
      t instanceof Array || (t = [t]);
      for (var r = t.length, n = 0, i = this._len, a = 0; a < r; a++)
        n += t[a].len();
      var o = this.data;
      if (YM && (o instanceof Float32Array || !o) && (this.data = new Float32Array(i + n), i > 0 && o))
        for (var s = 0; s < i; s++)
          this.data[s] = o[s];
      for (var a = 0; a < r; a++)
        for (var l = t[a].data, s = 0; s < l.length; s++)
          this.data[i++] = l[s];
      this._len = i;
    }
  }, e.prototype.addData = function(t, r, n, i, a, o, s, l, u) {
    if (this._saveData) {
      var f = this.data;
      this._len + arguments.length > f.length && (this._expandData(), f = this.data);
      for (var c = 0; c < arguments.length; c++)
        f[this._len++] = arguments[c];
    }
  }, e.prototype._drawPendingPt = function() {
    this._pendingPtDist > 0 && (this._ctx && this._ctx.lineTo(this._pendingPtX, this._pendingPtY), this._pendingPtDist = 0);
  }, e.prototype._expandData = function() {
    if (!(this.data instanceof Array)) {
      for (var t = [], r = 0; r < this._len; r++)
        t[r] = this.data[r];
      this.data = t;
    }
  }, e.prototype.toStatic = function() {
    if (this._saveData) {
      this._drawPendingPt();
      var t = this.data;
      t instanceof Array && (t.length = this._len, YM && this._len > 11 && (this.data = new Float32Array(t)));
    }
  }, e.prototype.getBoundingRect = function() {
    Ml[0] = Ml[1] = Ll[0] = Ll[1] = Number.MAX_VALUE, vc[0] = vc[1] = Dl[0] = Dl[1] = -Number.MAX_VALUE;
    var t = this.data, r = 0, n = 0, i = 0, a = 0, o;
    for (o = 0; o < this._len; ) {
      var s = t[o++], l = o === 1;
      switch (l && (r = t[o], n = t[o + 1], i = r, a = n), s) {
        case Er.M:
          r = i = t[o++], n = a = t[o++], Ll[0] = i, Ll[1] = a, Dl[0] = i, Dl[1] = a;
          break;
        case Er.L:
          wk(r, n, t[o], t[o + 1], Ll, Dl), r = t[o++], n = t[o++];
          break;
        case Er.C:
          KQ(r, n, t[o++], t[o++], t[o++], t[o++], t[o], t[o + 1], Ll, Dl), r = t[o++], n = t[o++];
          break;
        case Er.Q:
          QQ(r, n, t[o++], t[o++], t[o], t[o + 1], Ll, Dl), r = t[o++], n = t[o++];
          break;
        case Er.A:
          var u = t[o++], f = t[o++], c = t[o++], h = t[o++], v = t[o++], d = t[o++] + v;
          o += 1;
          var g = !t[o++];
          l && (i = Sv(v) * c + u, a = wv(v) * h + f), JQ(u, f, c, h, v, d, g, Ll, Dl), r = Sv(d) * c + u, n = wv(d) * h + f;
          break;
        case Er.R:
          i = r = t[o++], a = n = t[o++];
          var y = t[o++], x = t[o++];
          wk(i, a, i + y, a + x, Ll, Dl);
          break;
        case Er.Z:
          r = i, n = a;
          break;
      }
      nf(Ml, Ml, Ll), af(vc, vc, Dl);
    }
    return o === 0 && (Ml[0] = Ml[1] = vc[0] = vc[1] = 0), new st(Ml[0], Ml[1], vc[0] - Ml[0], vc[1] - Ml[1]);
  }, e.prototype._calculateLength = function() {
    var t = this.data, r = 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, f = 0, c = 0, h = 0; h < r; ) {
      var v = t[h++], d = h === 1;
      d && (a = t[h], o = t[h + 1], s = a, l = o);
      var g = -1;
      switch (v) {
        case Er.M:
          a = s = t[h++], o = l = t[h++];
          break;
        case Er.L: {
          var y = t[h++], x = t[h++], S = y - a, T = x - o;
          (Fu(S) > n || Fu(T) > i || h === r - 1) && (g = Math.sqrt(S * S + T * T), a = y, o = x);
          break;
        }
        case Er.C: {
          var C = t[h++], A = t[h++], y = t[h++], x = t[h++], M = t[h++], E = t[h++];
          g = uK(a, o, C, A, y, x, M, E, 10), a = M, o = E;
          break;
        }
        case Er.Q: {
          var C = t[h++], A = t[h++], y = t[h++], x = t[h++];
          g = cK(a, o, C, A, y, x, 10), a = y, o = x;
          break;
        }
        case Er.A:
          var P = t[h++], R = t[h++], O = t[h++], N = t[h++], G = t[h++], z = t[h++], H = z + G;
          h += 1, d && (s = Sv(G) * O + P, l = wv(G) * N + R), g = XM(O, N) * WM(Ac, Math.abs(z)), a = Sv(H) * O + P, o = wv(H) * N + R;
          break;
        case Er.R: {
          s = a = t[h++], l = o = t[h++];
          var W = t[h++], Z = t[h++];
          g = W * 2 + Z * 2;
          break;
        }
        case Er.Z: {
          var S = s - a, T = l - o;
          g = Math.sqrt(S * S + T * T), a = s, o = l;
          break;
        }
      }
      g >= 0 && (u[c++] = g, f += g);
    }
    return this._pathLen = f, f;
  }, e.prototype.rebuildPath = function(t, r) {
    var n = this.data, i = this._ux, a = this._uy, o = this._len, s, l, u, f, c, h, v = r < 1, d, g, y = 0, x = 0, S, T = 0, C, A;
    if (!(v && (this._pathSegLen || this._calculateLength(), d = this._pathSegLen, g = this._pathLen, S = r * g, !S)))
      e: for (var M = 0; M < o; ) {
        var E = n[M++], P = M === 1;
        switch (P && (u = n[M], f = n[M + 1], s = u, l = f), E !== Er.L && T > 0 && (t.lineTo(C, A), T = 0), E) {
          case Er.M:
            s = u = n[M++], l = f = n[M++], t.moveTo(u, f);
            break;
          case Er.L: {
            c = n[M++], h = n[M++];
            var R = Fu(c - u), O = Fu(h - f);
            if (R > i || O > a) {
              if (v) {
                var N = d[x++];
                if (y + N > S) {
                  var G = (S - y) / N;
                  t.lineTo(u * (1 - G) + c * G, f * (1 - G) + h * G);
                  break e;
                }
                y += N;
              }
              t.lineTo(c, h), u = c, f = h, T = 0;
            } else {
              var z = R * R + O * O;
              z > T && (C = c, A = h, T = z);
            }
            break;
          }
          case Er.C: {
            var H = n[M++], W = n[M++], Z = n[M++], ee = n[M++], V = n[M++], Q = n[M++];
            if (v) {
              var N = d[x++];
              if (y + N > S) {
                var G = (S - y) / N;
                Yc(u, H, Z, V, G, _v), Yc(f, W, ee, Q, G, xv), t.bezierCurveTo(_v[1], xv[1], _v[2], xv[2], _v[3], xv[3]);
                break e;
              }
              y += N;
            }
            t.bezierCurveTo(H, W, Z, ee, V, Q), u = V, f = Q;
            break;
          }
          case Er.Q: {
            var H = n[M++], W = n[M++], Z = n[M++], ee = n[M++];
            if (v) {
              var N = d[x++];
              if (y + N > S) {
                var G = (S - y) / N;
                E1(u, H, Z, G, _v), E1(f, W, ee, G, xv), t.quadraticCurveTo(_v[1], xv[1], _v[2], xv[2]);
                break e;
              }
              y += N;
            }
            t.quadraticCurveTo(H, W, Z, ee), u = Z, f = ee;
            break;
          }
          case Er.A:
            var q = n[M++], X = n[M++], K = n[M++], ue = n[M++], oe = n[M++], te = n[M++], pe = n[M++], me = !n[M++], de = K > ue ? K : ue, ve = Fu(K - ue) > 1e-3, Ae = oe + te, be = !1;
            if (v) {
              var N = d[x++];
              y + N > S && (Ae = oe + te * (S - y) / N, be = !0), y += N;
            }
            if (ve && t.ellipse ? t.ellipse(q, X, K, ue, pe, oe, Ae, me) : t.arc(q, X, de, oe, Ae, me), be)
              break e;
            P && (s = Sv(oe) * K + q, l = wv(oe) * ue + X), u = Sv(Ae) * K + q, f = wv(Ae) * ue + X;
            break;
          case Er.R:
            s = u = n[M], l = f = n[M + 1], c = n[M++], h = n[M++];
            var De = n[M++], Ue = n[M++];
            if (v) {
              var N = d[x++];
              if (y + N > S) {
                var Xe = S - y;
                t.moveTo(c, h), t.lineTo(c + WM(Xe, De), h), Xe -= De, Xe > 0 && t.lineTo(c + De, h + WM(Xe, Ue)), Xe -= Ue, Xe > 0 && t.lineTo(c + XM(De - Xe, 0), h + Ue), Xe -= De, Xe > 0 && t.lineTo(c, h + XM(Ue - Xe, 0));
                break e;
              }
              y += N;
            }
            t.rect(c, h, De, Ue);
            break;
          case Er.Z:
            if (v) {
              var N = d[x++];
              if (y + N > S) {
                var G = (S - y) / N;
                t.lineTo(u * (1 - G) + s * G, f * (1 - G) + l * G);
                break e;
              }
              y += N;
            }
            t.closePath(), u = s, f = l;
        }
      }
  }, e.prototype.clone = function() {
    var t = new e(), r = this.data;
    return t.data = r.slice ? r.slice() : Array.prototype.slice.call(r), t._len = this._len, t;
  }, e.prototype.canSave = function() {
    return !!this._saveData;
  }, e.CMD = Er, e.initDefaultProps = (function() {
    var t = e.prototype;
    t._saveData = !0, t._ux = 0, t._uy = 0, t._pendingPtDist = 0, t._version = 0;
  })(), e;
})();
function Lc(e, t, r, n, i, a, o) {
  if (i === 0)
    return !1;
  var s = i, l = 0, u = e;
  if (o > t + s && o > n + s || o < t - s && o < n - s || a > e + s && a > r + s || a < e - s && a < r - s)
    return !1;
  if (e !== r)
    l = (t - n) / (e - r), u = (e * n - r * t) / (e - r);
  else
    return Math.abs(a - e) <= s / 2;
  var f = l * a - o + u, c = f * f / (l * l + 1);
  return c <= s / 2 * s / 2;
}
function eJ(e, t, r, n, i, a, o, s, l, u, f) {
  if (l === 0)
    return !1;
  var c = l;
  if (f > t + c && f > n + c && f > a + c && f > s + c || f < t - c && f < n - c && f < a - c && f < s - c || u > e + c && u > r + c && u > i + c && u > o + c || u < e - c && u < r - c && u < i - c && u < o - c)
    return !1;
  var h = pU(e, t, r, n, i, a, o, s, u, f, null);
  return h <= c / 2;
}
function JU(e, t, r, 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 > e + u && s > r + u && s > i + u || s < e - u && s < r - u && s < i - u)
    return !1;
  var f = mU(e, t, r, n, i, a, s, l, null);
  return f <= u / 2;
}
var Ck = Math.PI * 2;
function So(e) {
  return e %= Ck, e < 0 && (e += Ck), e;
}
var J0 = Math.PI * 2;
function tJ(e, t, r, n, i, a, o, s, l) {
  if (o === 0)
    return !1;
  var u = o;
  s -= e, l -= t;
  var f = Math.sqrt(s * s + l * l);
  if (f - u > r || f + u < r)
    return !1;
  if (Math.abs(n - i) % J0 < 1e-4)
    return !0;
  if (a) {
    var c = n;
    n = So(i), i = So(c);
  } else
    n = So(n), i = So(i);
  n > i && (i += J0);
  var h = Math.atan2(l, s);
  return h < 0 && (h += J0), h >= n && h <= i || h + J0 >= n && h + J0 <= i;
}
function Ku(e, t, r, 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 * (r - e) + e;
  return l === i ? 1 / 0 : l > i ? s : 0;
}
var dc = ru.CMD, Tv = Math.PI * 2, rJ = 1e-4;
function nJ(e, t) {
  return Math.abs(e - t) < rJ;
}
var ga = [-1, -1, -1], Jo = [-1, -1];
function iJ() {
  var e = Jo[0];
  Jo[0] = Jo[1], Jo[1] = e;
}
function aJ(e, t, r, 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 f = U2(t, n, a, s, u, ga);
  if (f === 0)
    return 0;
  for (var c = 0, h = -1, v = void 0, d = void 0, g = 0; g < f; g++) {
    var y = ga[g], x = y === 0 || y === 1 ? 0.5 : 1, S = Jn(e, r, i, o, y);
    S < l || (h < 0 && (h = dU(t, n, a, s, Jo), Jo[1] < Jo[0] && h > 1 && iJ(), v = Jn(t, n, a, s, Jo[0]), h > 1 && (d = Jn(t, n, a, s, Jo[1]))), h === 2 ? y < Jo[0] ? c += v < t ? x : -x : y < Jo[1] ? c += d < v ? x : -x : c += s < d ? x : -x : y < Jo[0] ? c += v < t ? x : -x : c += s < v ? x : -x);
  }
  return c;
}
function oJ(e, t, r, n, i, a, o, s) {
  if (s > t && s > n && s > a || s < t && s < n && s < a)
    return 0;
  var l = fK(t, n, a, s, ga);
  if (l === 0)
    return 0;
  var u = gU(t, n, a);
  if (u >= 0 && u <= 1) {
    for (var f = 0, c = Si(t, n, a, u), h = 0; h < l; h++) {
      var v = ga[h] === 0 || ga[h] === 1 ? 0.5 : 1, d = Si(e, r, i, ga[h]);
      d < o || (ga[h] < u ? f += c < t ? v : -v : f += a < c ? v : -v);
    }
    return f;
  } else {
    var v = ga[0] === 0 || ga[0] === 1 ? 0.5 : 1, d = Si(e, r, i, ga[0]);
    return d < o ? 0 : a < t ? v : -v;
  }
}
function sJ(e, t, r, n, i, a, o, s) {
  if (s -= t, s > r || s < -r)
    return 0;
  var l = Math.sqrt(r * r - s * s);
  ga[0] = -l, ga[1] = l;
  var u = Math.abs(n - i);
  if (u < 1e-4)
    return 0;
  if (u >= Tv - 1e-4) {
    n = 0, i = Tv;
    var f = a ? 1 : -1;
    return o >= ga[0] + e && o <= ga[1] + e ? f : 0;
  }
  if (n > i) {
    var c = n;
    n = i, i = c;
  }
  n < 0 && (n += Tv, i += Tv);
  for (var h = 0, v = 0; v < 2; v++) {
    var d = ga[v];
    if (d + e > o) {
      var g = Math.atan2(s, d), f = a ? 1 : -1;
      g < 0 && (g = Tv + g), (g >= n && g <= i || g + Tv >= n && g + Tv <= i) && (g > Math.PI / 2 && g < Math.PI * 1.5 && (f = -f), h += f);
    }
  }
  return h;
}
function eW(e, t, r, n, i) {
  for (var a = e.data, o = e.len(), s = 0, l = 0, u = 0, f = 0, c = 0, h, v, d = 0; d < o; ) {
    var g = a[d++], y = d === 1;
    switch (g === dc.M && d > 1 && (r || (s += Ku(l, u, f, c, n, i))), y && (l = a[d], u = a[d + 1], f = l, c = u), g) {
      case dc.M:
        f = a[d++], c = a[d++], l = f, u = c;
        break;
      case dc.L:
        if (r) {
          if (Lc(l, u, a[d], a[d + 1], t, n, i))
            return !0;
        } else
          s += Ku(l, u, a[d], a[d + 1], n, i) || 0;
        l = a[d++], u = a[d++];
        break;
      case dc.C:
        if (r) {
          if (eJ(l, u, a[d++], a[d++], a[d++], a[d++], a[d], a[d + 1], t, n, i))
            return !0;
        } else
          s += aJ(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 dc.Q:
        if (r) {
          if (JU(l, u, a[d++], a[d++], a[d], a[d + 1], t, n, i))
            return !0;
        } else
          s += oJ(l, u, a[d++], a[d++], a[d], a[d + 1], n, i) || 0;
        l = a[d++], u = a[d++];
        break;
      case dc.A:
        var x = a[d++], S = a[d++], T = a[d++], C = a[d++], A = a[d++], M = a[d++];
        d += 1;
        var E = !!(1 - a[d++]);
        h = Math.cos(A) * T + x, v = Math.sin(A) * C + S, y ? (f = h, c = v) : s += Ku(l, u, h, v, n, i);
        var P = (n - x) * C / T + x;
        if (r) {
          if (tJ(x, S, C, A, A + M, E, t, P, i))
            return !0;
        } else
          s += sJ(x, S, C, A, A + M, E, P, i);
        l = Math.cos(A + M) * T + x, u = Math.sin(A + M) * C + S;
        break;
      case dc.R:
        f = l = a[d++], c = u = a[d++];
        var R = a[d++], O = a[d++];
        if (h = f + R, v = c + O, r) {
          if (Lc(f, c, h, c, t, n, i) || Lc(h, c, h, v, t, n, i) || Lc(h, v, f, v, t, n, i) || Lc(f, v, f, c, t, n, i))
            return !0;
        } else
          s += Ku(h, c, h, v, n, i), s += Ku(f, v, f, c, n, i);
        break;
      case dc.Z:
        if (r) {
          if (Lc(l, u, f, c, t, n, i))
            return !0;
        } else
          s += Ku(l, u, f, c, n, i);
        l = f, u = c;
        break;
    }
  }
  return !r && !nJ(u, c) && (s += Ku(l, u, f, c, n, i) || 0), s !== 0;
}
function lJ(e, t, r) {
  return eW(e, 0, !1, t, r);
}
function uJ(e, t, r, n) {
  return eW(e, t, !0, r, n);
}
var K2 = tt({
  fill: "#000",
  stroke: null,
  strokePercent: 1,
  fillOpacity: 1,
  strokeOpacity: 1,
  lineDashOffset: 0,
  lineWidth: 1,
  lineCap: "butt",
  miterLimit: 10,
  strokeNoScale: !1,
  strokeFirst: !1
}, cd), fJ = {
  style: tt({
    fill: !0,
    stroke: !0,
    strokePercent: !0,
    fillOpacity: !0,
    strokeOpacity: !0,
    lineDashOffset: !0,
    lineWidth: !0,
    miterLimit: !0
  }, SC.style)
}, $M = eu.concat([
  "invisible",
  "culling",
  "z",
  "z2",
  "zlevel",
  "parent"
]), zt = (function(e) {
  ae(t, e);
  function t(r) {
    return e.call(this, r) || this;
  }
  return t.prototype.update = function() {
    var r = this;
    e.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) {
        r.buildPath(l, r.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 < $M.length; ++s)
        i[$M[s]] = this[$M[s]];
      i.__dirty |= mo;
    } else this._decalEl && (this._decalEl = null);
  }, t.prototype.getDecalElement = function() {
    return this._decalEl;
  }, t.prototype._init = function(r) {
    var n = Ht(r);
    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 = r[o];
      o === "style" ? this.style ? xe(this.style, s) : this.useStyle(s) : o === "shape" ? xe(this.shape, s) : e.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 r = this.style.fill;
    if (r !== "none") {
      if (Fe(r)) {
        var n = R1(r, 0);
        return n > 0.5 ? ZE : n > 0.2 ? HK : $E;
      } else if (r)
        return $E;
    }
    return ZE;
  }, t.prototype.getInsideTextStroke = function(r) {
    var n = this.style.fill;
    if (Fe(n)) {
      var i = this.__zr, a = !!(i && i.isDarkMode()), o = R1(r, 0) < YE;
      if (a === o)
        return n;
    }
  }, t.prototype.buildPath = function(r, n, i) {
  }, t.prototype.pathUpdated = function() {
    this.__dirty &= ~Jg;
  }, t.prototype.getUpdatedPathProxy = function(r) {
    return !this.path && this.createPathProxy(), this.path.beginPath(), this.buildPath(this.path, this.shape, r), this.path;
  }, t.prototype.createPathProxy = function() {
    this.path = new ru(!1);
  }, t.prototype.hasStroke = function() {
    var r = this.style, n = r.stroke;
    return !(n == null || n === "none" || !(r.lineWidth > 0));
  }, t.prototype.hasFill = function() {
    var r = this.style, n = r.fill;
    return n != null && n !== "none";
  }, t.prototype.getBoundingRect = function() {
    var r = this._rect, n = this.style, i = !r;
    if (i) {
      var a = !1;
      this.path || (a = !0, this.createPathProxy());
      var o = this.path;
      (a || this.__dirty & Jg) && (o.beginPath(), this.buildPath(o, this.shape, !1), this.pathUpdated()), r = o.getBoundingRect();
    }
    if (this._rect = r, this.hasStroke() && this.path && this.path.len() > 0) {
      var s = this._rectStroke || (this._rectStroke = r.clone());
      if (this.__dirty || i) {
        s.copy(r);
        var l = n.strokeNoScale ? this.getLineScale() : 1, u = n.lineWidth;
        if (!this.hasFill()) {
          var f = this.strokeContainThreshold;
          u = Math.max(u, f ?? 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 r;
  }, t.prototype.contain = function(r, n) {
    var i = this.transformCoordToLocal(r, n), a = this.getBoundingRect(), o = this.style;
    if (r = i[0], n = i[1], a.contain(r, 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)), uJ(s, l / u, r, n)))
          return !0;
      }
      if (this.hasFill())
        return lJ(s, r, n);
    }
    return !1;
  }, t.prototype.dirtyShape = function() {
    this.__dirty |= Jg, this._rect && (this._rect = null), this._decalEl && this._decalEl.dirtyShape(), this.markRedraw();
  }, t.prototype.dirty = function() {
    this.dirtyStyle(), this.dirtyShape();
  }, t.prototype.animateShape = function(r) {
    return this.animate("shape", r);
  }, t.prototype.updateDuringAnimation = function(r) {
    r === "style" ? this.dirtyStyle() : r === "shape" ? this.dirtyShape() : this.markRedraw();
  }, t.prototype.attrKV = function(r, n) {
    r === "shape" ? this.setShape(n) : e.prototype.attrKV.call(this, r, n);
  }, t.prototype.setShape = function(r, n) {
    var i = this.shape;
    return i || (i = this.shape = {}), typeof r == "string" ? i[r] = n : xe(i, r), this.dirtyShape(), this;
  }, t.prototype.shapeChanged = function() {
    return !!(this.__dirty & Jg);
  }, t.prototype.createStyle = function(r) {
    return xx(K2, r);
  }, t.prototype._innerSaveToNormal = function(r) {
    e.prototype._innerSaveToNormal.call(this, r);
    var n = this._normalState;
    r.shape && !n.shape && (n.shape = xe({}, this.shape));
  }, t.prototype._applyStateObj = function(r, n, i, a, o, s) {
    e.prototype._applyStateObj.call(this, r, n, i, a, o, s);
    var l = !(n && a), u;
    if (n && n.shape ? o ? a ? u = n.shape : (u = xe({}, i.shape), xe(u, n.shape)) : (u = xe({}, a ? this.shape : i.shape), xe(u, n.shape)) : l && (u = i.shape), u)
      if (o) {
        this.shape = xe({}, this.shape);
        for (var f = {}, c = Ht(u), h = 0; h < c.length; h++) {
          var v = c[h];
          typeof u[v] == "object" ? this.shape[v] = u[v] : f[v] = u[v];
        }
        this._transitionState(r, {
          shape: f
        }, s);
      } else
        this.shape = u, this.dirtyShape();
  }, t.prototype._mergeStates = function(r) {
    for (var n = e.prototype._mergeStates.call(this, r), i, a = 0; a < r.length; a++) {
      var o = r[a];
      o.shape && (i = i || {}, this._mergeStyle(i, o.shape));
    }
    return i && (n.shape = i), n;
  }, t.prototype.getAnimationStyleProps = function() {
    return fJ;
  }, t.prototype.isZeroArea = function() {
    return !1;
  }, t.extend = function(r) {
    var n = (function(a) {
      ae(o, a);
      function o(s) {
        var l = a.call(this, s) || this;
        return r.init && r.init.call(l, s), l;
      }
      return o.prototype.getDefaultStyle = function() {
        return it(r.style);
      }, o.prototype.getDefaultShape = function() {
        return it(r.shape);
      }, o;
    })(t);
    for (var i in r)
      typeof r[i] == "function" && (n.prototype[i] = r[i]);
    return n;
  }, t.initDefaultProps = (function() {
    var r = t.prototype;
    r.type = "path", r.strokeContainThreshold = 5, r.segmentIgnoreThreshold = 0, r.subPixelOptimize = !1, r.autoBatch = !1, r.__dirty = mo | V_ | Jg;
  })(), t;
})(hs), cJ = tt({
  strokeFirst: !0,
  font: pf,
  x: 0,
  y: 0,
  textAlign: "left",
  textBaseline: "top",
  miterLimit: 2
}, K2), Tm = (function(e) {
  ae(t, e);
  function t() {
    return e !== null && e.apply(this, arguments) || this;
  }
  return t.prototype.hasStroke = function() {
    return QU(this.style);
  }, t.prototype.hasFill = function() {
    var r = this.style, n = r.fill;
    return n != null && n !== "none";
  }, t.prototype.createStyle = function(r) {
    return xx(cJ, r);
  }, t.prototype.setBoundingRect = function(r) {
    this._rect = r;
  }, t.prototype.getBoundingRect = function() {
    return this._rect || (this._rect = $Q(this.style)), this._rect;
  }, t.initDefaultProps = (function() {
    var r = t.prototype;
    r.dirtyRectTolerance = 10;
  })(), t;
})(hs);
Tm.prototype.type = "tspan";
var hJ = tt({
  x: 0,
  y: 0
}, cd), vJ = {
  style: tt({
    x: !0,
    y: !0,
    width: !0,
    height: !0,
    sx: !0,
    sy: !0,
    sWidth: !0,
    sHeight: !0
  }, SC.style)
};
function dJ(e) {
  return !!(e && typeof e != "string" && e.width && e.height);
}
var Xn = (function(e) {
  ae(t, e);
  function t() {
    return e !== null && e.apply(this, arguments) || this;
  }
  return t.prototype.createStyle = function(r) {
    return xx(hJ, r);
  }, t.prototype._getSize = function(r) {
    var n = this.style, i = n[r];
    if (i != null)
      return i;
    var a = dJ(n.image) ? n.image : this.__image;
    if (!a)
      return 0;
    var o = r === "width" ? "height" : "width", s = n[o];
    return s == null ? a[r] : a[r] / a[o] * s;
  }, t.prototype.getWidth = function() {
    return this._getSize("width");
  }, t.prototype.getHeight = function() {
    return this._getSize("height");
  }, t.prototype.getAnimationStyleProps = function() {
    return vJ;
  }, t.prototype.getBoundingRect = function() {
    var r = this.style;
    return this._rect || (this._rect = new st(r.x || 0, r.y || 0, this.getWidth(), this.getHeight())), this._rect;
  }, t;
})(hs);
Xn.prototype.type = "image";
function pJ(e, t) {
  var r = t.x, n = t.y, i = t.width, a = t.height, o = t.r, s, l, u, f;
  i < 0 && (r = r + i, i = -i), a < 0 && (n = n + a, a = -a), typeof o == "number" ? s = l = u = f = o : o instanceof Array ? o.length === 1 ? s = l = u = f = o[0] : o.length === 2 ? (s = u = o[0], l = f = o[1]) : o.length === 3 ? (s = o[0], l = f = o[1], u = o[2]) : (s = o[0], l = o[1], u = o[2], f = o[3]) : s = l = u = f = 0;
  var c;
  s + l > i && (c = s + l, s *= i / c, l *= i / c), u + f > i && (c = u + f, u *= i / c, f *= i / c), l + u > a && (c = l + u, l *= a / c, u *= a / c), s + f > a && (c = s + f, s *= a / c, f *= a / c), e.moveTo(r + s, n), e.lineTo(r + i - l, n), l !== 0 && e.arc(r + i - l, n + l, l, -Math.PI / 2, 0), e.lineTo(r + i, n + a - u), u !== 0 && e.arc(r + i - u, n + a - u, u, 0, Math.PI / 2), e.lineTo(r + f, n + a), f !== 0 && e.arc(r + f, n + a - f, f, Math.PI / 2, Math.PI), e.lineTo(r, n + s), s !== 0 && e.arc(r + s, n + s, s, Math.PI, Math.PI * 1.5);
}
var am = Math.round;
function bC(e, t, r) {
  if (t) {
    var n = t.x1, i = t.x2, a = t.y1, o = t.y2;
    e.x1 = n, e.x2 = i, e.y1 = a, e.y2 = o;
    var s = r && r.lineWidth;
    return s && (am(n * 2) === am(i * 2) && (e.x1 = e.x2 = wo(n, s, !0)), am(a * 2) === am(o * 2) && (e.y1 = e.y2 = wo(a, s, !0))), e;
  }
}
function tW(e, t, r) {
  if (t) {
    var n = t.x, i = t.y, a = t.width, o = t.height;
    e.x = n, e.y = i, e.width = a, e.height = o;
    var s = r && r.lineWidth;
    return s && (e.x = wo(n, s, !0), e.y = wo(i, s, !0), e.width = Math.max(wo(n + a, s, !1) - e.x, a === 0 ? 0 : 1), e.height = Math.max(wo(i + o, s, !1) - e.y, o === 0 ? 0 : 1)), e;
  }
}
function wo(e, t, r) {
  if (!t)
    return e;
  var n = am(e * 2);
  return (n + am(t)) % 2 === 0 ? n / 2 : (n + (r ? 1 : -1)) / 2;
}
var gJ = /* @__PURE__ */ (function() {
  function e() {
    this.x = 0, this.y = 0, this.width = 0, this.height = 0;
  }
  return e;
})(), mJ = {}, Mt = (function(e) {
  ae(t, e);
  function t(r) {
    return e.call(this, r) || this;
  }
  return t.prototype.getDefaultShape = function() {
    return new gJ();
  }, t.prototype.buildPath = function(r, n) {
    var i, a, o, s;
    if (this.subPixelOptimize) {
      var l = tW(mJ, 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 ? pJ(r, n) : r.rect(i, a, o, s);
  }, t.prototype.isZeroArea = function() {
    return !this.shape.width || !this.shape.height;
  }, t;
})(zt);
Mt.prototype.type = "rect";
var Ak = {
  fill: "#000"
}, Mk = 2, El = {}, yJ = {
  style: tt({
    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
  }, SC.style)
}, Rt = (function(e) {
  ae(t, e);
  function t(r) {
    var n = e.call(this) || this;
    return n.type = "text", n._children = [], n._defaultStyle = Ak, n.attr(r), n;
  }
  return t.prototype.childrenRef = function() {
    return this._children;
  }, t.prototype.update = function() {
    e.prototype.update.call(this), this.styleChanged() && this._updateSubTexts();
    for (var r = 0; r < this._children.length; r++) {
      var n = this._children[r];
      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 r = this.innerTransformable;
    r ? (r.updateTransform(), r.transform && (this.transform = r.transform)) : e.prototype.updateTransform.call(this);
  }, t.prototype.getLocalTransform = function(r) {
    var n = this.innerTransformable;
    return n ? n.getLocalTransform(r) : e.prototype.getLocalTransform.call(this, r);
  }, t.prototype.getComputedTransform = function() {
    return this.__hostTarget && (this.__hostTarget.getComputedTransform(), this.__hostTarget.updateInnerText(!0)), e.prototype.getComputedTransform.call(this);
  }, t.prototype._updateSubTexts = function() {
    this._childCursor = 0, SJ(this.style), this.style.rich ? this._updateRichTexts() : this._updatePlainTexts(), this._children.length = this._childCursor, this.styleUpdated();
  }, t.prototype.addSelfToZr = function(r) {
    e.prototype.addSelfToZr.call(this, r);
    for (var n = 0; n < this._children.length; n++)
      this._children[n].__zr = r;
  }, t.prototype.removeSelfFromZr = function(r) {
    e.prototype.removeSelfFromZr.call(this, r);
    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 r = new st(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 ? (r.copy(l), r.applyTransform(u), a = a || r.clone(), a.union(r)) : (a = a || l.clone(), a.union(l));
      }
      this._rect = a || r;
    }
    return this._rect;
  }, t.prototype.setDefaultTextStyle = function(r) {
    this._defaultStyle = r || Ak;
  }, t.prototype.setTextContent = function(r) {
  }, t.prototype._mergeStyle = function(r, n) {
    if (!n)
      return r;
    var i = n.rich, a = r.rich || i && {};
    return xe(r, n), i && a ? (this._mergeRich(a, i), r.rich = a) : a && (r.rich = a), r;
  }, t.prototype._mergeRich = function(r, n) {
    for (var i = Ht(n), a = 0; a < i.length; a++) {
      var o = i[a];
      r[o] = r[o] || {}, xe(r[o], n[o]);
    }
  }, t.prototype.getAnimationStyleProps = function() {
    return yJ;
  }, t.prototype._getOrCreateChild = function(r) {
    var n = this._children[this._childCursor];
    return (!n || !(n instanceof r)) && (n = new r()), this._children[this._childCursor++] = n, n.__zr = this.__zr, n.parent = this, n;
  }, t.prototype._updatePlainTexts = function() {
    var r = this.style, n = r.font || pf, i = r.padding, a = this._defaultStyle, o = r.x || 0, s = r.y || 0, l = r.align || a.align || "left", u = r.verticalAlign || a.verticalAlign || "top";
    yk(El, a.overflowRect, o, s, l, u), o = El.baseX, s = El.baseY;
    var f = Ok(r), c = VQ(f, r, El.outerWidth, El.outerHeight), h = qM(r), v = !!r.backgroundColor, d = c.outerHeight, g = c.outerWidth, y = c.lines, x = c.lineHeight;
    this.isTruncated = !!c.isTruncated;
    var S = o, T = fd(s, c.contentHeight, u);
    if (h || i) {
      var C = Sm(o, g, l), A = fd(s, d, u);
      h && this._renderBackground(r, r, C, A, g, d);
    }
    T += x / 2, i && (S = Rk(o, l, i), u === "top" ? T += i[0] : u === "bottom" && (T -= i[2]));
    for (var M = 0, E = !1, P = !1, R = Ik("fill" in r ? r.fill : (P = !0, a.fill)), O = Pk("stroke" in r ? r.stroke : !v && (!a.autoStroke || P) ? (M = Mk, E = !0, a.stroke) : null), N = r.textShadowBlur > 0, G = 0; G < y.length; G++) {
      var z = this._getOrCreateChild(Tm), H = z.createStyle();
      z.useStyle(H), H.text = y[G], H.x = S, H.y = T, H.textAlign = l, H.textBaseline = "middle", H.opacity = r.opacity, H.strokeFirst = !0, N && (H.shadowBlur = r.textShadowBlur || 0, H.shadowColor = r.textShadowColor || "transparent", H.shadowOffsetX = r.textShadowOffsetX || 0, H.shadowOffsetY = r.textShadowOffsetY || 0), H.stroke = O, H.fill = R, O && (H.lineWidth = r.lineWidth || M, H.lineDash = r.lineDash, H.lineDashOffset = r.lineDashOffset || 0), H.font = n, Dk(H, r), T += x, z.setBoundingRect(eP(H, c.contentWidth, c.calculatedLineHeight, E ? 0 : null));
    }
  }, t.prototype._updateRichTexts = function() {
    var r = this.style, n = this._defaultStyle, i = r.align || n.align, a = r.verticalAlign || n.verticalAlign, o = r.x || 0, s = r.y || 0;
    yk(El, n.overflowRect, o, s, i, a), o = El.baseX, s = El.baseY;
    var l = Ok(r), u = WQ(l, r, El.outerWidth, El.outerHeight, i), f = u.width, c = u.outerWidth, h = u.outerHeight, v = r.padding;
    this.isTruncated = !!u.isTruncated;
    var d = Sm(o, c, i), g = fd(s, h, a), y = d, x = g;
    v && (y += v[3], x += v[0]);
    var S = y + f;
    qM(r) && this._renderBackground(r, r, d, g, c, h);
    for (var T = !!r.backgroundColor, C = 0; C < u.lines.length; C++) {
      for (var A = u.lines[C], M = A.tokens, E = M.length, P = A.lineHeight, R = A.width, O = 0, N = y, G = S, z = E - 1, H = void 0; O < E && (H = M[O], !H.align || H.align === "left"); )
        this._placeToken(H, r, P, x, N, "left", T), R -= H.width, N += H.width, O++;
      for (; z >= 0 && (H = M[z], H.align === "right"); )
        this._placeToken(H, r, P, x, G, "right", T), R -= H.width, G -= H.width, z--;
      for (N += (f - (N - y) - (S - G) - R) / 2; O <= z; )
        H = M[O], this._placeToken(H, r, P, x, N + H.width / 2, "center", T), N += H.width, O++;
      x += P;
    }
  }, t.prototype._placeToken = function(r, n, i, a, o, s, l) {
    var u = n.rich[r.styleName] || {};
    u.text = r.text;
    var f = r.verticalAlign, c = a + i / 2;
    f === "top" ? c = a + r.height / 2 : f === "bottom" && (c = a + i - r.height / 2);
    var h = !r.isLineHolder && qM(u);
    h && this._renderBackground(u, n, s === "right" ? o - r.width : s === "center" ? o - r.width / 2 : o, c - r.height / 2, r.width, r.height);
    var v = !!u.backgroundColor, d = r.textPadding;
    d && (o = Rk(o, s, d), c -= r.height / 2 - d[0] - r.innerHeight / 2);
    var g = this._getOrCreateChild(Tm), y = g.createStyle();
    g.useStyle(y);
    var x = this._defaultStyle, S = !1, T = 0, C = !1, A = Ik("fill" in u ? u.fill : "fill" in n ? n.fill : (S = !0, x.fill)), M = Pk("stroke" in u ? u.stroke : "stroke" in n ? n.stroke : !v && !l && (!x.autoStroke || S) ? (T = Mk, C = !0, x.stroke) : null), E = u.textShadowBlur > 0 || n.textShadowBlur > 0;
    y.text = r.text, y.x = o, y.y = c, E && (y.shadowBlur = u.textShadowBlur || n.textShadowBlur || 0, y.shadowColor = u.textShadowColor || n.textShadowColor || "transparent", y.shadowOffsetX = u.textShadowOffsetX || n.textShadowOffsetX || 0, y.shadowOffsetY = u.textShadowOffsetY || n.textShadowOffsetY || 0), y.textAlign = s, y.textBaseline = "middle", y.font = r.font || pf, y.opacity = $a(u.opacity, n.opacity, 1), Dk(y, u), M && (y.lineWidth = $a(u.lineWidth, n.lineWidth, T), y.lineDash = et(u.lineDash, n.lineDash), y.lineDashOffset = n.lineDashOffset || 0, y.stroke = M), A && (y.fill = A), g.setBoundingRect(eP(y, r.contentWidth, r.contentHeight, C ? 0 : null));
  }, t.prototype._renderBackground = function(r, n, i, a, o, s) {
    var l = r.backgroundColor, u = r.borderWidth, f = r.borderColor, c = l && l.image, h = l && !c, v = r.borderRadius, d = this, g, y;
    if (h || r.lineHeight || u && f) {
      g = this._getOrCreateChild(Mt), g.useStyle(g.createStyle()), g.style.fill = null;
      var x = g.shape;
      x.x = i, x.y = a, x.width = o, x.height = s, x.r = v, g.dirtyShape();
    }
    if (h) {
      var S = g.style;
      S.fill = l || null, S.fillOpacity = et(r.fillOpacity, 1);
    } else if (c) {
      y = this._getOrCreateChild(Xn), y.onload = function() {
        d.dirtyStyle();
      };
      var T = y.style;
      T.image = l.image, T.x = i, T.y = a, T.width = o, T.height = s;
    }
    if (u && f) {
      var S = g.style;
      S.lineWidth = u, S.stroke = f, S.strokeOpacity = et(r.strokeOpacity, 1), S.lineDash = r.borderDash, S.lineDashOffset = r.borderDashOffset || 0, g.strokeContainThreshold = 0, g.hasFill() && g.hasStroke() && (S.strokeFirst = !0, S.lineWidth *= 2);
    }
    var C = (g || y).style;
    C.shadowBlur = r.shadowBlur || 0, C.shadowColor = r.shadowColor || "transparent", C.shadowOffsetX = r.shadowOffsetX || 0, C.shadowOffsetY = r.shadowOffsetY || 0, C.opacity = $a(r.opacity, n.opacity, 1);
  }, t.makeFont = function(r) {
    var n = "";
    return nW(r) && (n = [
      r.fontStyle,
      r.fontWeight,
      rW(r.fontSize),
      r.fontFamily || "sans-serif"
    ].join(" ")), n && _o(n) || r.textFont || r.font;
  }, t;
})(hs), _J = { left: !0, right: 1, center: 1 }, xJ = { top: 1, bottom: 1, middle: 1 }, Lk = ["fontStyle", "fontWeight", "fontSize", "fontFamily"];
function rW(e) {
  return typeof e == "string" && (e.indexOf("px") !== -1 || e.indexOf("rem") !== -1 || e.indexOf("em") !== -1) ? e : isNaN(+e) ? nR + "px" : e + "px";
}
function Dk(e, t) {
  for (var r = 0; r < Lk.length; r++) {
    var n = Lk[r], i = t[n];
    i != null && (e[n] = i);
  }
}
function nW(e) {
  return e.fontSize != null || e.fontFamily || e.fontWeight;
}
function SJ(e) {
  return Ek(e), F(e.rich, Ek), e;
}
function Ek(e) {
  if (e) {
    e.font = Rt.makeFont(e);
    var t = e.align;
    t === "middle" && (t = "center"), e.align = t == null || _J[t] ? t : "left";
    var r = e.verticalAlign;
    r === "center" && (r = "middle"), e.verticalAlign = r == null || xJ[r] ? r : "top";
    var n = e.padding;
    n && (e.padding = _x(e.padding));
  }
}
function Pk(e, t) {
  return e == null || t <= 0 || e === "transparent" || e === "none" ? null : e.image || e.colorStops ? "#000" : e;
}
function Ik(e) {
  return e == null || e === "none" ? null : e.image || e.colorStops ? "#000" : e;
}
function Rk(e, t, r) {
  return t === "right" ? e - r[1] : t === "center" ? e + r[3] / 2 - r[1] / 2 : e + r[3];
}
function Ok(e) {
  var t = e.text;
  return t != null && (t += ""), t;
}
function qM(e) {
  return !!(e.backgroundColor || e.lineHeight || e.borderWidth && e.borderColor);
}
var pt = Bt(), nP = function(e, t, r, n) {
  if (n) {
    var i = pt(n);
    i.dataIndex = r, i.dataType = t, i.seriesIndex = e, i.ssrType = "chart", n.type === "group" && n.traverse(function(a) {
      var o = pt(a);
      o.seriesIndex = e, o.dataIndex = r, o.dataType = t, o.ssrType = "chart";
    });
  }
}, Nk = 1, kk = {}, iW = Bt(), TR = Bt(), bR = 0, Cx = 1, CC = 2, Ta = ["emphasis", "blur", "select"], k1 = ["normal", "emphasis", "blur", "select"], $m = 10, wJ = 9, hd = "highlight", y2 = "downplay", Q2 = "select", iP = "unselect", J2 = "toggleSelect", CR = "selectchanged";
function _g(e) {
  return e != null && e !== "none";
}
function AC(e, t, r) {
  e.onHoverStateChange && (e.hoverState || 0) !== r && e.onHoverStateChange(t), e.hoverState = r;
}
function aW(e) {
  AC(e, "emphasis", CC);
}
function oW(e) {
  e.hoverState === CC && AC(e, "normal", bR);
}
function AR(e) {
  AC(e, "blur", Cx);
}
function sW(e) {
  e.hoverState === Cx && AC(e, "normal", bR);
}
function TJ(e) {
  e.selected = !0;
}
function bJ(e) {
  e.selected = !1;
}
function Bk(e, t, r) {
  t(e, r);
}
function bf(e, t, r) {
  Bk(e, t, r), e.isGroup && e.traverse(function(n) {
    Bk(n, t, r);
  });
}
function eb(e, t) {
  switch (t) {
    case "emphasis":
      e.hoverState = CC;
      break;
    case "normal":
      e.hoverState = bR;
      break;
    case "blur":
      e.hoverState = Cx;
      break;
    case "select":
      e.selected = !0;
  }
}
function CJ(e, t, r, n) {
  for (var i = e.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 < e.animators.length; o++) {
    var u = e.animators[o];
    u.__fromStateTransition && u.__fromStateTransition.indexOf(r) < 0 && u.targetName === "style" && u.saveTo(a, t);
  }
  return a;
}
function AJ(e, t, r, n) {
  var i = r && Tt(r, "select") >= 0, a = !1;
  if (e instanceof zt) {
    var o = iW(e), s = i && o.selectFill || o.normalFill, l = i && o.selectStroke || o.normalStroke;
    if (_g(s) || _g(l)) {
      n = n || {};
      var u = n.style || {};
      u.fill === "inherit" ? (a = !0, n = xe({}, n), u = xe({}, u), u.fill = s) : !_g(u.fill) && _g(s) ? (a = !0, n = xe({}, n), u = xe({}, u), u.fill = W2(s)) : !_g(u.stroke) && _g(l) && (a || (n = xe({}, n), u = xe({}, u)), u.stroke = W2(l)), n.style = u;
    }
  }
  if (n && n.z2 == null) {
    a || (n = xe({}, n));
    var f = e.z2EmphasisLift;
    n.z2 = e.z2 + (f ?? $m);
  }
  return n;
}
function MJ(e, t, r) {
  if (r && r.z2 == null) {
    r = xe({}, r);
    var n = e.z2SelectLift;
    r.z2 = e.z2 + (n ?? wJ);
  }
  return r;
}
function LJ(e, t, r) {
  var n = Tt(e.currentStates, t) >= 0, i = e.style.opacity, a = n ? null : CJ(e, ["opacity"], t, {
    opacity: 1
  });
  r = r || {};
  var o = r.style || {};
  return o.opacity == null && (r = xe({}, r), o = xe({
    // Already being applied 'emphasis'. DON'T mul opacity multiple times.
    opacity: n ? i : a.opacity * 0.1
  }, o), r.style = o), r;
}
function jM(e, t) {
  var r = this.states[e];
  if (this.style) {
    if (e === "emphasis")
      return AJ(this, e, t, r);
    if (e === "blur")
      return LJ(this, e, r);
    if (e === "select")
      return MJ(this, e, r);
  }
  return r;
}
function Td(e) {
  e.stateProxy = jM;
  var t = e.getTextContent(), r = e.getTextGuideLine();
  t && (t.stateProxy = jM), r && (r.stateProxy = jM);
}
function zk(e, t) {
  !cW(e, t) && !e.__highByOuter && bf(e, aW);
}
function Fk(e, t) {
  !cW(e, t) && !e.__highByOuter && bf(e, oW);
}
function mf(e, t) {
  e.__highByOuter |= 1 << (t || 0), bf(e, aW);
}
function yf(e, t) {
  !(e.__highByOuter &= ~(1 << (t || 0))) && bf(e, oW);
}
function lW(e) {
  bf(e, AR);
}
function MR(e) {
  bf(e, sW);
}
function uW(e) {
  bf(e, TJ);
}
function fW(e) {
  bf(e, bJ);
}
function cW(e, t) {
  return e.__highDownSilentOnTouch && t.zrByTouch;
}
function hW(e) {
  var t = e.getModel(), r = [], n = [];
  t.eachComponent(function(i, a) {
    var o = TR(a), s = i === "series", l = s ? e.getViewOfSeriesModel(a) : e.getViewOfComponentModel(a);
    !s && n.push(l), o.isBlured && (l.group.traverse(function(u) {
      sW(u);
    }), s && r.push(a)), o.isBlured = !1;
  }), F(n, function(i) {
    i && i.toggleBlurSeries && i.toggleBlurSeries(r, !1, t);
  });
}
function aP(e, t, r, n) {
  var i = n.getModel();
  r = r || "coordinateSystem";
  function a(u, f) {
    for (var c = 0; c < f.length; c++) {
      var h = u.getItemGraphicEl(f[c]);
      h && MR(h);
    }
  }
  if (e != null && !(!t || t === "none")) {
    var o = i.getSeriesByIndex(e), s = o.coordinateSystem;
    s && s.master && (s = s.master);
    var l = [];
    i.eachSeries(function(u) {
      var f = o === u, c = u.coordinateSystem;
      c && c.master && (c = c.master);
      var h = c && s ? c === s : f;
      if (!// Not blur other series if blurScope series
      (r === "series" && !f || r === "coordinateSystem" && !h || t === "series" && f)) {
        var v = n.getViewOfSeriesModel(u);
        if (v.group.traverse(function(y) {
          y.__highByOuter && f && t === "self" || AR(y);
        }), Vi(t))
          a(u.getData(), t);
        else if (ot(t))
          for (var d = Ht(t), g = 0; g < d.length; g++)
            a(u.getData(d[g]), t[d[g]]);
        l.push(u), TR(u).isBlured = !0;
      }
    }), i.eachComponent(function(u, f) {
      if (u !== "series") {
        var c = n.getViewOfComponentModel(f);
        c && c.toggleBlurSeries && c.toggleBlurSeries(l, !0, i);
      }
    });
  }
}
function oP(e, t, r) {
  if (!(e == null || t == null)) {
    var n = r.getModel().getComponent(e, t);
    if (n) {
      TR(n).isBlured = !0;
      var i = r.getViewOfComponentModel(n);
      !i || !i.focusBlurEnabled || i.group.traverse(function(a) {
        AR(a);
      });
    }
  }
}
function DJ(e, t, r) {
  var n = e.seriesIndex, i = e.getData(t.dataType);
  if (i) {
    var a = Sd(i, t);
    a = (Se(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 = pt(o);
      aP(n, u.focus, u.blurScope, r);
    } else {
      var f = e.get(["emphasis", "focus"]), c = e.get(["emphasis", "blurScope"]);
      f != null && aP(n, f, c, r);
    }
  }
}
function LR(e, t, r, n) {
  var i = {
    focusSelf: !1,
    dispatchers: null
  };
  if (e == null || e === "series" || t == null || r == null)
    return i;
  var a = n.getModel().getComponent(e, t);
  if (!a)
    return i;
  var o = n.getViewOfComponentModel(a);
  if (!o || !o.findHighDownDispatchers)
    return i;
  for (var s = o.findHighDownDispatchers(r), l, u = 0; u < s.length; u++)
    if (pt(s[u]).focus === "self") {
      l = !0;
      break;
    }
  return {
    focusSelf: l,
    dispatchers: s
  };
}
function EJ(e, t, r) {
  var n = pt(e), i = LR(n.componentMainType, n.componentIndex, n.componentHighDownName, r), a = i.dispatchers, o = i.focusSelf;
  a ? (o && oP(n.componentMainType, n.componentIndex, r), F(a, function(s) {
    return zk(s, t);
  })) : (aP(n.seriesIndex, n.focus, n.blurScope, r), n.focus === "self" && oP(n.componentMainType, n.componentIndex, r), zk(e, t));
}
function PJ(e, t, r) {
  hW(r);
  var n = pt(e), i = LR(n.componentMainType, n.componentIndex, n.componentHighDownName, r).dispatchers;
  i ? F(i, function(a) {
    return Fk(a, t);
  }) : Fk(e, t);
}
function IJ(e, t, r) {
  if (lP(t)) {
    var n = t.dataType, i = e.getData(n), a = Sd(i, t);
    Se(a) || (a = [a]), e[t.type === J2 ? "toggleSelect" : t.type === Q2 ? "select" : "unselect"](a, n);
  }
}
function Gk(e) {
  var t = e.getAllData();
  F(t, function(r) {
    var n = r.data, i = r.type;
    n.eachItemGraphicEl(function(a, o) {
      e.isSelected(o, i) ? uW(a) : fW(a);
    });
  });
}
function RJ(e) {
  var t = [];
  return e.eachSeries(function(r) {
    var n = r.getAllData();
    F(n, function(i) {
      i.data;
      var a = i.type, o = r.getSelectedDataIndices();
      if (o.length > 0) {
        var s = {
          dataIndex: o,
          seriesIndex: r.seriesIndex
        };
        a != null && (s.dataType = a), t.push(s);
      }
    });
  }), t;
}
function jl(e, t, r) {
  rd(e, !0), bf(e, Td), sP(e, t, r);
}
function OJ(e) {
  rd(e, !1);
}
function Hr(e, t, r, n) {
  n ? OJ(e) : jl(e, t, r);
}
function sP(e, t, r) {
  var n = pt(e);
  t != null ? (n.focus = t, n.blurScope = r) : n.focus && (n.focus = null);
}
var Vk = ["emphasis", "blur", "select"], NJ = {
  itemStyle: "getItemStyle",
  lineStyle: "getLineStyle",
  areaStyle: "getAreaStyle"
};
function Un(e, t, r, n) {
  r = r || "itemStyle";
  for (var i = 0; i < Vk.length; i++) {
    var a = Vk[i], o = t.getModel([a, r]), s = e.ensureState(a);
    s.style = n ? n(o) : o[NJ[r]]();
  }
}
function rd(e, t) {
  var r = t === !1, n = e;
  e.highDownSilentOnTouch && (n.__highDownSilentOnTouch = e.highDownSilentOnTouch), (!r || n.__highDownDispatcher) && (n.__highByOuter = n.__highByOuter || 0, n.__highDownDispatcher = !r);
}
function B1(e) {
  return !!(e && e.__highDownDispatcher);
}
function kJ(e, t, r) {
  var n = pt(e);
  n.componentMainType = t.mainType, n.componentIndex = t.componentIndex, n.componentHighDownName = r;
}
function BJ(e) {
  var t = kk[e];
  return t == null && Nk <= 32 && (t = kk[e] = Nk++), t;
}
function lP(e) {
  var t = e.type;
  return t === Q2 || t === iP || t === J2;
}
function Hk(e) {
  var t = e.type;
  return t === hd || t === y2;
}
function zJ(e) {
  var t = iW(e);
  t.normalFill = e.style.fill, t.normalStroke = e.style.stroke;
  var r = e.states.select || {};
  t.selectFill = r.style && r.style.fill || null, t.selectStroke = r.style && r.style.stroke || null;
}
var xg = ru.CMD, FJ = [[], [], []], Uk = Math.sqrt, GJ = Math.atan2;
function vW(e, t) {
  if (t) {
    var r = e.data, n = e.len(), i, a, o, s, l, u, f = xg.M, c = xg.C, h = xg.L, v = xg.R, d = xg.A, g = xg.Q;
    for (o = 0, s = 0; o < n; ) {
      switch (i = r[o++], s = o, a = 0, i) {
        case f:
          a = 1;
          break;
        case h:
          a = 1;
          break;
        case c:
          a = 3;
          break;
        case g:
          a = 2;
          break;
        case d:
          var y = t[4], x = t[5], S = Uk(t[0] * t[0] + t[1] * t[1]), T = Uk(t[2] * t[2] + t[3] * t[3]), C = GJ(-t[1] / T, t[0] / S);
          r[o] *= S, r[o++] += y, r[o] *= T, r[o++] += x, r[o++] *= S, r[o++] *= T, r[o++] += C, r[o++] += C, o += 2, s = o;
          break;
        case v:
          u[0] = r[o++], u[1] = r[o++], fn(u, u, t), r[s++] = u[0], r[s++] = u[1], u[0] += r[o++], u[1] += r[o++], fn(u, u, t), r[s++] = u[0], r[s++] = u[1];
      }
      for (l = 0; l < a; l++) {
        var A = FJ[l];
        A[0] = r[o++], A[1] = r[o++], fn(A, A, t), r[s++] = A[0], r[s++] = A[1];
      }
    }
    e.increaseVersion();
  }
}
var KM = Math.sqrt, Gw = Math.sin, Vw = Math.cos, e_ = Math.PI;
function Wk(e) {
  return Math.sqrt(e[0] * e[0] + e[1] * e[1]);
}
function uP(e, t) {
  return (e[0] * t[0] + e[1] * t[1]) / (Wk(e) * Wk(t));
}
function Xk(e, t) {
  return (e[0] * t[1] < e[1] * t[0] ? -1 : 1) * Math.acos(uP(e, t));
}
function Yk(e, t, r, n, i, a, o, s, l, u, f) {
  var c = l * (e_ / 180), h = Vw(c) * (e - r) / 2 + Gw(c) * (t - n) / 2, v = -1 * Gw(c) * (e - r) / 2 + Vw(c) * (t - n) / 2, d = h * h / (o * o) + v * v / (s * s);
  d > 1 && (o *= KM(d), s *= KM(d));
  var g = (i === a ? -1 : 1) * KM((o * o * (s * s) - o * o * (v * v) - s * s * (h * h)) / (o * o * (v * v) + s * s * (h * h))) || 0, y = g * o * v / s, x = g * -s * h / o, S = (e + r) / 2 + Vw(c) * y - Gw(c) * x, T = (t + n) / 2 + Gw(c) * y + Vw(c) * x, C = Xk([1, 0], [(h - y) / o, (v - x) / s]), A = [(h - y) / o, (v - x) / s], M = [(-1 * h - y) / o, (-1 * v - x) / s], E = Xk(A, M);
  if (uP(A, M) <= -1 && (E = e_), uP(A, M) >= 1 && (E = 0), E < 0) {
    var P = Math.round(E / e_ * 1e6) / 1e6;
    E = e_ * 2 + P % 2 * e_;
  }
  f.addData(u, S, T, o, s, C, E, c, a);
}
var VJ = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig, HJ = /-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;
function UJ(e) {
  var t = new ru();
  if (!e)
    return t;
  var r = 0, n = 0, i = r, a = n, o, s = ru.CMD, l = e.match(VJ);
  if (!l)
    return t;
  for (var u = 0; u < l.length; u++) {
    for (var f = l[u], c = f.charAt(0), h = void 0, v = f.match(HJ) || [], d = v.length, g = 0; g < d; g++)
      v[g] = parseFloat(v[g]);
    for (var y = 0; y < d; ) {
      var x = void 0, S = void 0, T = void 0, C = void 0, A = void 0, M = void 0, E = void 0, P = r, R = n, O = void 0, N = void 0;
      switch (c) {
        case "l":
          r += v[y++], n += v[y++], h = s.L, t.addData(h, r, n);
          break;
        case "L":
          r = v[y++], n = v[y++], h = s.L, t.addData(h, r, n);
          break;
        case "m":
          r += v[y++], n += v[y++], h = s.M, t.addData(h, r, n), i = r, a = n, c = "l";
          break;
        case "M":
          r = v[y++], n = v[y++], h = s.M, t.addData(h, r, n), i = r, a = n, c = "L";
          break;
        case "h":
          r += v[y++], h = s.L, t.addData(h, r, n);
          break;
        case "H":
          r = v[y++], h = s.L, t.addData(h, r, n);
          break;
        case "v":
          n += v[y++], h = s.L, t.addData(h, r, n);
          break;
        case "V":
          n = v[y++], h = s.L, t.addData(h, r, n);
          break;
        case "C":
          h = s.C, t.addData(h, v[y++], v[y++], v[y++], v[y++], v[y++], v[y++]), r = v[y - 2], n = v[y - 1];
          break;
        case "c":
          h = s.C, t.addData(h, v[y++] + r, v[y++] + n, v[y++] + r, v[y++] + n, v[y++] + r, v[y++] + n), r += v[y - 2], n += v[y - 1];
          break;
        case "S":
          x = r, S = n, O = t.len(), N = t.data, o === s.C && (x += r - N[O - 4], S += n - N[O - 3]), h = s.C, P = v[y++], R = v[y++], r = v[y++], n = v[y++], t.addData(h, x, S, P, R, r, n);
          break;
        case "s":
          x = r, S = n, O = t.len(), N = t.data, o === s.C && (x += r - N[O - 4], S += n - N[O - 3]), h = s.C, P = r + v[y++], R = n + v[y++], r += v[y++], n += v[y++], t.addData(h, x, S, P, R, r, n);
          break;
        case "Q":
          P = v[y++], R = v[y++], r = v[y++], n = v[y++], h = s.Q, t.addData(h, P, R, r, n);
          break;
        case "q":
          P = v[y++] + r, R = v[y++] + n, r += v[y++], n += v[y++], h = s.Q, t.addData(h, P, R, r, n);
          break;
        case "T":
          x = r, S = n, O = t.len(), N = t.data, o === s.Q && (x += r - N[O - 4], S += n - N[O - 3]), r = v[y++], n = v[y++], h = s.Q, t.addData(h, x, S, r, n);
          break;
        case "t":
          x = r, S = n, O = t.len(), N = t.data, o === s.Q && (x += r - N[O - 4], S += n - N[O - 3]), r += v[y++], n += v[y++], h = s.Q, t.addData(h, x, S, r, n);
          break;
        case "A":
          T = v[y++], C = v[y++], A = v[y++], M = v[y++], E = v[y++], P = r, R = n, r = v[y++], n = v[y++], h = s.A, Yk(P, R, r, n, M, E, T, C, A, h, t);
          break;
        case "a":
          T = v[y++], C = v[y++], A = v[y++], M = v[y++], E = v[y++], P = r, R = n, r += v[y++], n += v[y++], h = s.A, Yk(P, R, r, n, M, E, T, C, A, h, t);
          break;
      }
    }
    (c === "z" || c === "Z") && (h = s.Z, t.addData(h), r = i, n = a), o = h;
  }
  return t.toStatic(), t;
}
var dW = (function(e) {
  ae(t, e);
  function t() {
    return e !== null && e.apply(this, arguments) || this;
  }
  return t.prototype.applyTransform = function(r) {
  }, t;
})(zt);
function pW(e) {
  return e.setData != null;
}
function gW(e, t) {
  var r = UJ(e), n = xe({}, t);
  return n.buildPath = function(i) {
    var a = pW(i);
    if (a && i.canSave()) {
      i.appendPath(r);
      var o = i.getContext();
      o && i.rebuildPath(o, 1);
    } else {
      var o = a ? i.getContext() : i;
      o && r.rebuildPath(o, 1);
    }
  }, n.applyTransform = function(i) {
    vW(r, i), this.dirtyShape();
  }, n;
}
function mW(e, t) {
  return new dW(gW(e, t));
}
function WJ(e, t) {
  var r = gW(e, t), n = (function(i) {
    ae(a, i);
    function a(o) {
      var s = i.call(this, o) || this;
      return s.applyTransform = r.applyTransform, s.buildPath = r.buildPath, s;
    }
    return a;
  })(dW);
  return n;
}
function XJ(e, t) {
  for (var r = [], n = e.length, i = 0; i < n; i++) {
    var a = e[i];
    r.push(a.getUpdatedPathProxy(!0));
  }
  var o = new zt(t);
  return o.createPathProxy(), o.buildPath = function(s) {
    if (pW(s)) {
      s.appendPath(r);
      var l = s.getContext();
      l && s.rebuildPath(l, 1);
    }
  }, o;
}
function DR(e, t) {
  t = t || {};
  var r = new zt();
  return e.shape && r.setShape(e.shape), r.setStyle(e.style), t.bakeTransform ? vW(r.path, e.getComputedTransform()) : t.toLocal ? r.setLocalTransform(e.getComputedTransform()) : r.copyTransform(e), r.buildPath = e.buildPath, r.applyTransform = r.applyTransform, r.z = e.z, r.z2 = e.z2, r.zlevel = e.zlevel, r;
}
var YJ = /* @__PURE__ */ (function() {
  function e() {
    this.cx = 0, this.cy = 0, this.r = 0;
  }
  return e;
})(), Qs = (function(e) {
  ae(t, e);
  function t(r) {
    return e.call(this, r) || this;
  }
  return t.prototype.getDefaultShape = function() {
    return new YJ();
  }, t.prototype.buildPath = function(r, n) {
    r.moveTo(n.cx + n.r, n.cy), r.arc(n.cx, n.cy, n.r, 0, Math.PI * 2);
  }, t;
})(zt);
Qs.prototype.type = "circle";
var ZJ = /* @__PURE__ */ (function() {
  function e() {
    this.cx = 0, this.cy = 0, this.rx = 0, this.ry = 0;
  }
  return e;
})(), Ax = (function(e) {
  ae(t, e);
  function t(r) {
    return e.call(this, r) || this;
  }
  return t.prototype.getDefaultShape = function() {
    return new ZJ();
  }, t.prototype.buildPath = function(r, n) {
    var i = 0.5522848, a = n.cx, o = n.cy, s = n.rx, l = n.ry, u = s * i, f = l * i;
    r.moveTo(a - s, o), r.bezierCurveTo(a - s, o - f, a - u, o - l, a, o - l), r.bezierCurveTo(a + u, o - l, a + s, o - f, a + s, o), r.bezierCurveTo(a + s, o + f, a + u, o + l, a, o + l), r.bezierCurveTo(a - u, o + l, a - s, o + f, a - s, o), r.closePath();
  }, t;
})(zt);
Ax.prototype.type = "ellipse";
var yW = Math.PI, QM = yW * 2, bv = Math.sin, Sg = Math.cos, $J = Math.acos, Ji = Math.atan2, Zk = Math.abs, d1 = Math.sqrt, U_ = Math.max, Pl = Math.min, Ns = 1e-4;
function qJ(e, t, r, n, i, a, o, s) {
  var l = r - e, u = n - t, f = o - i, c = s - a, h = c * l - f * u;
  if (!(h * h < Ns))
    return h = (f * (t - a) - c * (e - i)) / h, [e + h * l, t + h * u];
}
function Hw(e, t, r, n, i, a, o) {
  var s = e - r, l = t - n, u = (o ? a : -a) / d1(s * s + l * l), f = u * l, c = -u * s, h = e + f, v = t + c, d = r + f, g = n + c, y = (h + d) / 2, x = (v + g) / 2, S = d - h, T = g - v, C = S * S + T * T, A = i - a, M = h * g - d * v, E = (T < 0 ? -1 : 1) * d1(U_(0, A * A * C - M * M)), P = (M * T - S * E) / C, R = (-M * S - T * E) / C, O = (M * T + S * E) / C, N = (-M * S + T * E) / C, G = P - y, z = R - x, H = O - y, W = N - x;
  return G * G + z * z > H * H + W * W && (P = O, R = N), {
    cx: P,
    cy: R,
    x0: -f,
    y0: -c,
    x1: P * (i / A - 1),
    y1: R * (i / A - 1)
  };
}
function jJ(e) {
  var t;
  if (Se(e)) {
    var r = e.length;
    if (!r)
      return e;
    r === 1 ? t = [e[0], e[0], 0, 0] : r === 2 ? t = [e[0], e[0], e[1], e[1]] : r === 3 ? t = e.concat(e[2]) : t = e;
  } else
    t = [e, e, e, e];
  return t;
}
function KJ(e, t) {
  var r, n = U_(t.r, 0), i = U_(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 f = t.cx, c = t.cy, h = !!t.clockwise, v = Zk(u - l), d = v > QM && v % QM;
      if (d > Ns && (v = d), !(n > Ns))
        e.moveTo(f, c);
      else if (v > QM - Ns)
        e.moveTo(f + n * Sg(l), c + n * bv(l)), e.arc(f, c, n, l, u, !h), i > Ns && (e.moveTo(f + i * Sg(u), c + i * bv(u)), e.arc(f, c, i, u, l, h));
      else {
        var g = void 0, y = void 0, x = void 0, S = void 0, T = void 0, C = void 0, A = void 0, M = void 0, E = void 0, P = void 0, R = void 0, O = void 0, N = void 0, G = void 0, z = void 0, H = void 0, W = n * Sg(l), Z = n * bv(l), ee = i * Sg(u), V = i * bv(u), Q = v > Ns;
        if (Q) {
          var q = t.cornerRadius;
          q && (r = jJ(q), g = r[0], y = r[1], x = r[2], S = r[3]);
          var X = Zk(n - i) / 2;
          if (T = Pl(X, x), C = Pl(X, S), A = Pl(X, g), M = Pl(X, y), R = E = U_(T, C), O = P = U_(A, M), (E > Ns || P > Ns) && (N = n * Sg(u), G = n * bv(u), z = i * Sg(l), H = i * bv(l), v < yW)) {
            var K = qJ(W, Z, z, H, N, G, ee, V);
            if (K) {
              var ue = W - K[0], oe = Z - K[1], te = N - K[0], pe = G - K[1], me = 1 / bv($J((ue * te + oe * pe) / (d1(ue * ue + oe * oe) * d1(te * te + pe * pe))) / 2), de = d1(K[0] * K[0] + K[1] * K[1]);
              R = Pl(E, (n - de) / (me + 1)), O = Pl(P, (i - de) / (me - 1));
            }
          }
        }
        if (!Q)
          e.moveTo(f + W, c + Z);
        else if (R > Ns) {
          var ve = Pl(x, R), Ae = Pl(S, R), be = Hw(z, H, W, Z, n, ve, h), De = Hw(N, G, ee, V, n, Ae, h);
          e.moveTo(f + be.cx + be.x0, c + be.cy + be.y0), R < E && ve === Ae ? e.arc(f + be.cx, c + be.cy, R, Ji(be.y0, be.x0), Ji(De.y0, De.x0), !h) : (ve > 0 && e.arc(f + be.cx, c + be.cy, ve, Ji(be.y0, be.x0), Ji(be.y1, be.x1), !h), e.arc(f, c, n, Ji(be.cy + be.y1, be.cx + be.x1), Ji(De.cy + De.y1, De.cx + De.x1), !h), Ae > 0 && e.arc(f + De.cx, c + De.cy, Ae, Ji(De.y1, De.x1), Ji(De.y0, De.x0), !h));
        } else
          e.moveTo(f + W, c + Z), e.arc(f, c, n, l, u, !h);
        if (!(i > Ns) || !Q)
          e.lineTo(f + ee, c + V);
        else if (O > Ns) {
          var ve = Pl(g, O), Ae = Pl(y, O), be = Hw(ee, V, N, G, i, -Ae, h), De = Hw(W, Z, z, H, i, -ve, h);
          e.lineTo(f + be.cx + be.x0, c + be.cy + be.y0), O < P && ve === Ae ? e.arc(f + be.cx, c + be.cy, O, Ji(be.y0, be.x0), Ji(De.y0, De.x0), !h) : (Ae > 0 && e.arc(f + be.cx, c + be.cy, Ae, Ji(be.y0, be.x0), Ji(be.y1, be.x1), !h), e.arc(f, c, i, Ji(be.cy + be.y1, be.cx + be.x1), Ji(De.cy + De.y1, De.cx + De.x1), h), ve > 0 && e.arc(f + De.cx, c + De.cy, ve, Ji(De.y1, De.x1), Ji(De.y0, De.x0), !h));
        } else
          e.lineTo(f + ee, c + V), e.arc(f, c, i, u, l, h);
      }
      e.closePath();
    }
  }
}
var QJ = /* @__PURE__ */ (function() {
  function e() {
    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 e;
})(), Ui = (function(e) {
  ae(t, e);
  function t(r) {
    return e.call(this, r) || this;
  }
  return t.prototype.getDefaultShape = function() {
    return new QJ();
  }, t.prototype.buildPath = function(r, n) {
    KJ(r, n);
  }, t.prototype.isZeroArea = function() {
    return this.shape.startAngle === this.shape.endAngle || this.shape.r === this.shape.r0;
  }, t;
})(zt);
Ui.prototype.type = "sector";
var JJ = /* @__PURE__ */ (function() {
  function e() {
    this.cx = 0, this.cy = 0, this.r = 0, this.r0 = 0;
  }
  return e;
})(), qm = (function(e) {
  ae(t, e);
  function t(r) {
    return e.call(this, r) || this;
  }
  return t.prototype.getDefaultShape = function() {
    return new JJ();
  }, t.prototype.buildPath = function(r, n) {
    var i = n.cx, a = n.cy, o = Math.PI * 2;
    r.moveTo(i + n.r, a), r.arc(i, a, n.r, 0, o, !1), r.moveTo(i + n.r0, a), r.arc(i, a, n.r0, 0, o, !0);
  }, t;
})(zt);
qm.prototype.type = "ring";
function eee(e, t, r, n) {
  var i = [], a = [], o = [], s = [], l, u, f, c;
  if (n) {
    f = [1 / 0, 1 / 0], c = [-1 / 0, -1 / 0];
    for (var h = 0, v = e.length; h < v; h++)
      nf(f, f, e[h]), af(c, c, e[h]);
    nf(f, f, n[0]), af(c, c, n[1]);
  }
  for (var h = 0, v = e.length; h < v; h++) {
    var d = e[h];
    if (r)
      l = e[h ? h - 1 : v - 1], u = e[(h + 1) % v];
    else if (h === 0 || h === v - 1) {
      i.push(Zl(e[h]));
      continue;
    } else
      l = e[h - 1], u = e[h + 1];
    Ec(a, u, l), s1(a, a, t);
    var g = F2(d, l), y = F2(d, u), x = g + y;
    x !== 0 && (g /= x, y /= x), s1(o, a, -g), s1(s, a, y);
    var S = EE([], d, o), T = EE([], d, s);
    n && (af(S, S, f), nf(S, S, c), af(T, T, f), nf(T, T, c)), i.push(S), i.push(T);
  }
  return r && i.push(i.shift()), i;
}
function _W(e, t, r) {
  var n = t.smooth, i = t.points;
  if (i && i.length >= 2) {
    if (n) {
      var a = eee(i, n, r, t.smoothConstraint);
      e.moveTo(i[0][0], i[0][1]);
      for (var o = i.length, s = 0; s < (r ? o : o - 1); s++) {
        var l = a[s * 2], u = a[s * 2 + 1], f = i[(s + 1) % o];
        e.bezierCurveTo(l[0], l[1], u[0], u[1], f[0], f[1]);
      }
    } else {
      e.moveTo(i[0][0], i[0][1]);
      for (var s = 1, c = i.length; s < c; s++)
        e.lineTo(i[s][0], i[s][1]);
    }
    r && e.closePath();
  }
}
var tee = /* @__PURE__ */ (function() {
  function e() {
    this.points = null, this.smooth = 0, this.smoothConstraint = null;
  }
  return e;
})(), Wi = (function(e) {
  ae(t, e);
  function t(r) {
    return e.call(this, r) || this;
  }
  return t.prototype.getDefaultShape = function() {
    return new tee();
  }, t.prototype.buildPath = function(r, n) {
    _W(r, n, !0);
  }, t;
})(zt);
Wi.prototype.type = "polygon";
var ree = /* @__PURE__ */ (function() {
  function e() {
    this.points = null, this.percent = 1, this.smooth = 0, this.smoothConstraint = null;
  }
  return e;
})(), Ci = (function(e) {
  ae(t, e);
  function t(r) {
    return e.call(this, r) || this;
  }
  return t.prototype.getDefaultStyle = function() {
    return {
      stroke: "#000",
      fill: null
    };
  }, t.prototype.getDefaultShape = function() {
    return new ree();
  }, t.prototype.buildPath = function(r, n) {
    _W(r, n, !1);
  }, t;
})(zt);
Ci.prototype.type = "polyline";
var nee = {}, iee = /* @__PURE__ */ (function() {
  function e() {
    this.x1 = 0, this.y1 = 0, this.x2 = 0, this.y2 = 0, this.percent = 1;
  }
  return e;
})(), wn = (function(e) {
  ae(t, e);
  function t(r) {
    return e.call(this, r) || this;
  }
  return t.prototype.getDefaultStyle = function() {
    return {
      stroke: "#000",
      fill: null
    };
  }, t.prototype.getDefaultShape = function() {
    return new iee();
  }, t.prototype.buildPath = function(r, n) {
    var i, a, o, s;
    if (this.subPixelOptimize) {
      var l = bC(nee, 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 && (r.moveTo(i, a), u < 1 && (o = i * (1 - u) + o * u, s = a * (1 - u) + s * u), r.lineTo(o, s));
  }, t.prototype.pointAt = function(r) {
    var n = this.shape;
    return [
      n.x1 * (1 - r) + n.x2 * r,
      n.y1 * (1 - r) + n.y2 * r
    ];
  }, t;
})(zt);
wn.prototype.type = "line";
var Ha = [], aee = /* @__PURE__ */ (function() {
  function e() {
    this.x1 = 0, this.y1 = 0, this.x2 = 0, this.y2 = 0, this.cpx1 = 0, this.cpy1 = 0, this.percent = 1;
  }
  return e;
})();
function $k(e, t, r) {
  var n = e.cpx2, i = e.cpy2;
  return n != null || i != null ? [
    (r ? Q3 : Jn)(e.x1, e.cpx1, e.cpx2, e.x2, t),
    (r ? Q3 : Jn)(e.y1, e.cpy1, e.cpy2, e.y2, t)
  ] : [
    (r ? BE : Si)(e.x1, e.cpx1, e.x2, t),
    (r ? BE : Si)(e.y1, e.cpy1, e.y2, t)
  ];
}
var jm = (function(e) {
  ae(t, e);
  function t(r) {
    return e.call(this, r) || this;
  }
  return t.prototype.getDefaultStyle = function() {
    return {
      stroke: "#000",
      fill: null
    };
  }, t.prototype.getDefaultShape = function() {
    return new aee();
  }, t.prototype.buildPath = function(r, n) {
    var i = n.x1, a = n.y1, o = n.x2, s = n.y2, l = n.cpx1, u = n.cpy1, f = n.cpx2, c = n.cpy2, h = n.percent;
    h !== 0 && (r.moveTo(i, a), f == null || c == null ? (h < 1 && (E1(i, l, o, h, Ha), l = Ha[1], o = Ha[2], E1(a, u, s, h, Ha), u = Ha[1], s = Ha[2]), r.quadraticCurveTo(l, u, o, s)) : (h < 1 && (Yc(i, l, f, o, h, Ha), l = Ha[1], f = Ha[2], o = Ha[3], Yc(a, u, c, s, h, Ha), u = Ha[1], c = Ha[2], s = Ha[3]), r.bezierCurveTo(l, u, f, c, o, s)));
  }, t.prototype.pointAt = function(r) {
    return $k(this.shape, r, !1);
  }, t.prototype.tangentAt = function(r) {
    var n = $k(this.shape, r, !0);
    return Od(n, n);
  }, t;
})(zt);
jm.prototype.type = "bezier-curve";
var oee = /* @__PURE__ */ (function() {
  function e() {
    this.cx = 0, this.cy = 0, this.r = 0, this.startAngle = 0, this.endAngle = Math.PI * 2, this.clockwise = !0;
  }
  return e;
})(), Mx = (function(e) {
  ae(t, e);
  function t(r) {
    return e.call(this, r) || this;
  }
  return t.prototype.getDefaultStyle = function() {
    return {
      stroke: "#000",
      fill: null
    };
  }, t.prototype.getDefaultShape = function() {
    return new oee();
  }, t.prototype.buildPath = function(r, n) {
    var i = n.cx, a = n.cy, o = Math.max(n.r, 0), s = n.startAngle, l = n.endAngle, u = n.clockwise, f = Math.cos(s), c = Math.sin(s);
    r.moveTo(f * o + i, c * o + a), r.arc(i, a, o, s, l, !u);
  }, t;
})(zt);
Mx.prototype.type = "arc";
var Km = (function(e) {
  ae(t, e);
  function t() {
    var r = e !== null && e.apply(this, arguments) || this;
    return r.type = "compound", r;
  }
  return t.prototype._updatePathDirty = function() {
    for (var r = this.shape.paths, n = this.shapeChanged(), i = 0; i < r.length; i++)
      n = n || r[i].shapeChanged();
    n && this.dirtyShape();
  }, t.prototype.beforeBrush = function() {
    this._updatePathDirty();
    for (var r = this.shape.paths || [], n = this.getGlobalScale(), i = 0; i < r.length; i++)
      r[i].path || r[i].createPathProxy(), r[i].path.setScale(n[0], n[1], r[i].segmentIgnoreThreshold);
  }, t.prototype.buildPath = function(r, n) {
    for (var i = n.paths || [], a = 0; a < i.length; a++)
      i[a].buildPath(r, i[a].shape, !0);
  }, t.prototype.afterBrush = function() {
    for (var r = this.shape.paths || [], n = 0; n < r.length; n++)
      r[n].pathUpdated();
  }, t.prototype.getBoundingRect = function() {
    return this._updatePathDirty.call(this), zt.prototype.getBoundingRect.call(this);
  }, t;
})(zt), xW = (function() {
  function e(t) {
    this.colorStops = t || [];
  }
  return e.prototype.addColorStop = function(t, r) {
    this.colorStops.push({
      offset: t,
      color: r
    });
  }, e;
})(), Nd = (function(e) {
  ae(t, e);
  function t(r, n, i, a, o, s) {
    var l = e.call(this, o) || this;
    return l.x = r ?? 0, l.y = n ?? 0, l.x2 = i ?? 1, l.y2 = a ?? 0, l.type = "linear", l.global = s || !1, l;
  }
  return t;
})(xW), ER = (function(e) {
  ae(t, e);
  function t(r, n, i, a, o) {
    var s = e.call(this, a) || this;
    return s.x = r ?? 0.5, s.y = n ?? 0.5, s.r = i ?? 0.5, s.type = "radial", s.global = o || !1, s;
  }
  return t;
})(xW), JM = Math.min, see = Math.max, Uw = Math.abs, Cv = [0, 0], Av = [0, 0], xi = sU(), Ww = xi.minTv, Xw = xi.maxTv, SW = (function() {
  function e(t, r) {
    this._corners = [], this._axes = [], this._origin = [0, 0];
    for (var n = 0; n < 4; n++)
      this._corners[n] = new ht();
    for (var n = 0; n < 2; n++)
      this._axes[n] = new ht();
    t && this.fromBoundingRect(t, r);
  }
  return e.prototype.fromBoundingRect = function(t, r) {
    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), r)
      for (var u = 0; u < 4; u++)
        n[u].transform(r);
    ht.sub(i[0], n[1], n[0]), ht.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]);
  }, e.prototype.intersect = function(t, r, n) {
    var i = !0, a = !r;
    return r && ht.set(r, 0, 0), xi.reset(n, !a), !this._intersectCheckOneSide(this, t, a, 1) && (i = !1, a) || !this._intersectCheckOneSide(t, this, a, -1) && (i = !1, a) || !a && !xi.negativeSize && ht.copy(r, i ? xi.useDir ? xi.dirMinTv : Ww : Xw), i;
  }, e.prototype._intersectCheckOneSide = function(t, r, n, i) {
    for (var a = !0, o = 0; o < 2; o++) {
      var s = t._axes[o];
      if (t._getProjMinMaxOnAxis(o, t._corners, Cv), t._getProjMinMaxOnAxis(o, r._corners, Av), xi.negativeSize || Cv[1] < Av[0] || Cv[0] > Av[1]) {
        if (a = !1, xi.negativeSize || n)
          return a;
        var l = Uw(Av[0] - Cv[1]), u = Uw(Cv[0] - Av[1]);
        JM(l, u) > Xw.len() && (l < u ? ht.scale(Xw, s, -l * i) : ht.scale(Xw, s, u * i));
      } else if (!n) {
        var l = Uw(Av[0] - Cv[1]), u = Uw(Cv[0] - Av[1]);
        (xi.useDir || JM(l, u) < Ww.len()) && ((l < u || !xi.bidirectional) && (ht.scale(Ww, s, l * i), xi.useDir && xi.calcDirMTV()), (l >= u || !xi.bidirectional) && (ht.scale(Ww, s, -u * i), xi.useDir && xi.calcDirMTV()));
      }
    }
    return a;
  }, e.prototype._getProjMinMaxOnAxis = function(t, r, n) {
    for (var i = this._axes[t], a = this._origin, o = r[0].dot(i) + a[t], s = o, l = o, u = 1; u < r.length; u++) {
      var f = r[u].dot(i) + a[t];
      s = JM(f, s), l = see(f, l);
    }
    n[0] = s + xi.touchThreshold, n[1] = l - xi.touchThreshold, xi.negativeSize = n[1] < n[0];
  }, e;
})(), lee = [], wW = (function(e) {
  ae(t, e);
  function t() {
    var r = e !== null && e.apply(this, arguments) || this;
    return r.notClear = !0, r.incremental = !0, r._displayables = [], r._temporaryDisplayables = [], r._cursor = 0, r;
  }
  return t.prototype.traverse = function(r, n) {
    r.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(r, n) {
    n ? this._temporaryDisplayables.push(r) : this._displayables.push(r), this.markRedraw();
  }, t.prototype.addDisplayables = function(r, n) {
    n = n || !1;
    for (var i = 0; i < r.length; i++)
      this.addDisplayable(r[i], n);
  }, t.prototype.getDisplayables = function() {
    return this._displayables;
  }, t.prototype.getTemporalDisplayables = function() {
    return this._temporaryDisplayables;
  }, t.prototype.eachPendingDisplayable = function(r) {
    for (var n = this._cursor; n < this._displayables.length; n++)
      r && r(this._displayables[n]);
    for (var n = 0; n < this._temporaryDisplayables.length; n++)
      r && r(this._temporaryDisplayables[n]);
  }, t.prototype.update = function() {
    this.updateTransform();
    for (var r = this._cursor; r < this._displayables.length; r++) {
      var n = this._displayables[r];
      n.parent = this, n.update(), n.parent = null;
    }
    for (var r = 0; r < this._temporaryDisplayables.length; r++) {
      var n = this._temporaryDisplayables[r];
      n.parent = this, n.update(), n.parent = null;
    }
  }, t.prototype.getBoundingRect = function() {
    if (!this._rect) {
      for (var r = new st(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(lee)), r.union(a);
      }
      this._rect = r;
    }
    return this._rect;
  }, t.prototype.contain = function(r, n) {
    var i = this.transformCoordToLocal(r, 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(r, n))
          return !0;
      }
    return !1;
  }, t;
})(hs), TW = Bt();
function Qm(e, t, r, n, i) {
  var a;
  if (t && t.ecModel) {
    var o = t.ecModel.getUpdatePayload();
    a = o && o.animation;
  }
  var s = t && t.isAnimationEnabled(), l = e === "update";
  if (s) {
    var u = void 0, f = void 0, c = void 0;
    n ? (u = et(n.duration, 200), f = et(n.easing, "cubicOut"), c = 0) : (u = t.getShallow(l ? "animationDurationUpdate" : "animationDuration"), f = t.getShallow(l ? "animationEasingUpdate" : "animationEasing"), c = t.getShallow(l ? "animationDelayUpdate" : "animationDelay")), a && (a.duration != null && (u = a.duration), a.easing != null && (f = a.easing), a.delay != null && (c = a.delay)), nt(c) && (c = c(r, i)), nt(u) && (u = u(r));
    var h = {
      duration: u || 0,
      delay: c,
      easing: f
    };
    return h;
  } else
    return null;
}
function PR(e, t, r, n, i, a, o) {
  var s = !1, l;
  nt(i) ? (o = a, a = i, i = null) : ot(i) && (a = i.cb, o = i.during, s = i.isFrom, l = i.removeOpt, i = i.dataIndex);
  var u = e === "leave";
  u || t.stopAnimation("leave");
  var f = Qm(e, n, i, u ? l || {} : null, n && n.getAnimationDelayParams ? n.getAnimationDelayParams(t, i) : null);
  if (f && f.duration > 0) {
    var c = f.duration, h = f.delay, v = f.easing, d = {
      duration: c,
      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: e,
      during: o
    };
    s ? t.animateFrom(r, d) : t.animateTo(r, d);
  } else
    t.stopAnimation(), !s && t.attr(r), o && o(1), a && a();
}
function Wt(e, t, r, n, i, a) {
  PR("update", e, t, r, n, i, a);
}
function Ir(e, t, r, n, i, a) {
  PR("enter", e, t, r, n, i, a);
}
function pm(e) {
  if (!e.__zr)
    return !0;
  for (var t = 0; t < e.animators.length; t++) {
    var r = e.animators[t];
    if (r.scope === "leave")
      return !0;
  }
  return !1;
}
function Zc(e, t, r, n, i, a) {
  pm(e) || PR("leave", e, t, r, n, i, a);
}
function qk(e, t, r, n) {
  e.removeTextContent(), e.removeTextGuideLine(), Zc(e, {
    style: {
      opacity: 0
    }
  }, t, r, n);
}
function ff(e, t, r) {
  function n() {
    e.parent && e.parent.remove(e);
  }
  e.isGroup ? e.traverse(function(i) {
    i.isGroup || qk(i, t, r, n);
  }) : qk(e, t, r, n);
}
function vs(e) {
  TW(e).oldStyle = e.style;
}
function uee(e) {
  return TW(e).oldStyle;
}
var fP = {}, _t = ["x", "y"], In = ["width", "height"];
function IR(e) {
  return zt.extend(e);
}
var fee = WJ;
function bW(e, t) {
  return fee(e, t);
}
function ps(e, t) {
  fP[e] = t;
}
function z1(e) {
  if (fP.hasOwnProperty(e))
    return fP[e];
}
function $c(e, t, r, n) {
  var i = mW(e, t);
  return r && (n === "center" && (r = CW(r, i.getBoundingRect())), OR(i, r)), i;
}
function RR(e, t, r) {
  var n = new Xn({
    style: {
      image: e,
      x: t.x,
      y: t.y,
      width: t.width,
      height: t.height
    },
    onload: function(i) {
      if (r === "center") {
        var a = {
          width: i.width,
          height: i.height
        };
        n.setStyle(CW(t, a));
      }
    }
  });
  return n;
}
function CW(e, t) {
  var r = t.width / t.height, n = e.height * r, i;
  n <= e.width ? i = e.height : (n = e.width, i = n / r);
  var a = e.x + e.width / 2, o = e.y + e.height / 2;
  return {
    x: a - n / 2,
    y: o - i / 2,
    width: n,
    height: i
  };
}
var yo = XJ;
function OR(e, t) {
  if (e.applyTransform) {
    var r = e.getBoundingRect(), n = r.calculateTransform(t);
    e.applyTransform(n);
  }
}
function bm(e, t) {
  return bC(e, e, {
    lineWidth: t
  }), e;
}
function cee(e, t) {
  return tW(e, e, t), e;
}
var _2 = wo;
function Hc(e, t) {
  for (var r = Sx([]); e && e !== t; )
    Hs(r, e.getLocalTransform(), r), e = e.parent;
  return r;
}
function Ws(e, t, r) {
  return t && !Vi(t) && (t = of.getLocalTransform(t)), r && (t = cs([], t)), fn([], e, t);
}
function MC(e, t, r) {
  var n = t[4] === 0 || t[5] === 0 || t[0] === 0 ? 1 : Hl(2 * t[4] / t[0]), i = t[4] === 0 || t[5] === 0 || t[2] === 0 ? 1 : Hl(2 * t[4] / t[2]), a = [e === "left" ? -n : e === "right" ? n : 0, e === "top" ? -i : e === "bottom" ? i : 0];
  return a = Ws(a, t, r), Hl(a[0]) > Hl(a[1]) ? a[0] > 0 ? "right" : "left" : a[1] > 0 ? "bottom" : "top";
}
function jk(e) {
  return !e.isGroup;
}
function hee(e) {
  return e.shape != null;
}
function Lx(e, t, r) {
  if (!e || !t)
    return;
  function n(o) {
    var s = {};
    return o.traverse(function(l) {
      jk(l) && l.anid && (s[l.anid] = l);
    }), s;
  }
  function i(o) {
    var s = {
      x: o.x,
      y: o.y,
      rotation: o.rotation
    };
    return hee(o) && (s.shape = it(o.shape)), s;
  }
  var a = n(e);
  t.traverse(function(o) {
    if (jk(o) && o.anid) {
      var s = a[o.anid];
      if (s) {
        var l = i(o);
        o.attr(i(s)), Wt(o, l, r, pt(o).dataIndex);
      }
    }
  });
}
function NR(e, t) {
  return Ce(e, function(r) {
    var n = r[0];
    n = Sn(n, t.x), n = To(n, t.x + t.width);
    var i = r[1];
    return i = Sn(i, t.y), i = To(i, t.y + t.height), [n, i];
  });
}
function AW(e, t) {
  var r = Sn(e.x, t.x), n = To(e.x + e.width, t.x + t.width), i = Sn(e.y, t.y), a = To(e.y + e.height, t.y + t.height);
  if (n >= r && a >= i)
    return {
      x: r,
      y: i,
      width: n - r,
      height: a - i
    };
}
function Jm(e, t, r) {
  var n = xe({
    rectHover: !0
  }, t), i = n.style = {
    strokeNoScale: !0
  };
  if (r = r || {
    x: -1,
    y: -1,
    width: 2,
    height: 2
  }, e)
    return e.indexOf("image://") === 0 ? (i.image = e.slice(8), tt(i, r), new Xn(n)) : $c(e.replace("path://", ""), n, r, "center");
}
function W_(e, t, r, n, i) {
  for (var a = 0, o = i[i.length - 1]; a < i.length; a++) {
    var s = i[a];
    if (MW(e, t, r, n, s[0], s[1], o[0], o[1]))
      return !0;
    o = s;
  }
}
function MW(e, t, r, n, i, a, o, s) {
  var l = r - e, u = n - t, f = o - i, c = s - a, h = eL(f, c, l, u);
  if (vee(h))
    return !1;
  var v = e - i, d = t - a, g = eL(v, d, l, u) / h;
  if (g < 0 || g > 1)
    return !1;
  var y = eL(v, d, f, c) / h;
  return !(y < 0 || y > 1);
}
function eL(e, t, r, n) {
  return e * n - r * t;
}
function vee(e) {
  return e <= 1e-6 && e >= -1e-6;
}
function bd(e, t, r, n, i) {
  return t == null || (Xt(t) ? Zr[0] = Zr[1] = Zr[2] = Zr[3] = t : (Zr[0] = t[0], Zr[1] = t[1], Zr[2] = t[2], Zr[3] = t[3]), n && (Zr[0] = Sn(0, Zr[0]), Zr[1] = Sn(0, Zr[1]), Zr[2] = Sn(0, Zr[2]), Zr[3] = Sn(0, Zr[3])), r && (Zr[0] = -Zr[0], Zr[1] = -Zr[1], Zr[2] = -Zr[2], Zr[3] = -Zr[3]), Kk(e, Zr, "x", "width", 3, 1, i && i[0] || 0), Kk(e, Zr, "y", "height", 0, 2, i && i[1] || 0)), e;
}
var Zr = [0, 0, 0, 0];
function Kk(e, t, r, n, i, a, o) {
  var s = t[a] + t[i], l = e[n];
  e[n] += s, o = Sn(0, To(o, l)), e[n] < o ? (e[n] = o, e[r] += t[i] >= 0 ? -t[i] : t[a] >= 0 ? l + t[a] : Hl(s) > 1e-8 ? (l - o) * t[i] / s : 0) : e[r] -= t[i];
}
function Cf(e) {
  var t = e.itemTooltipOption, r = e.componentModel, n = e.itemName, i = Fe(t) ? {
    formatter: t
  } : t, a = r.mainType, o = r.componentIndex, s = {
    componentType: a,
    name: n,
    $vars: ["name"]
  };
  s[a + "Index"] = o;
  var l = e.formatterParamsExtra;
  l && F(Ht(l), function(f) {
    qe(s, f) || (s[f] = l[f], s.$vars.push(f));
  });
  var u = pt(e.el);
  u.componentMainType = a, u.componentIndex = o, u.tooltipConfig = {
    name: n,
    option: tt({
      content: n,
      encodeHTMLContent: !0,
      formatterParams: s
    }, i)
  };
}
function cP(e, t) {
  var r;
  e.isGroup && (r = t(e)), r || e.traverse(t);
}
function rh(e, t) {
  if (e)
    if (Se(e))
      for (var r = 0; r < e.length; r++)
        cP(e[r], t);
    else
      cP(e, t);
}
function kR(e) {
  return !e || Hl(e[1]) < Yw && Hl(e[2]) < Yw || Hl(e[0]) < Yw && Hl(e[3]) < Yw;
}
var Yw = 1e-5;
function F1(e, t) {
  return e ? st.copy(e, t) : t.clone();
}
function BR(e, t) {
  return t ? Tx(e || ii(), t) : void 0;
}
function Cd(e) {
  return {
    z: e.get("z") || 0,
    zlevel: e.get("zlevel") || 0
  };
}
function LW(e) {
  var t = -1 / 0, r = 1 / 0;
  cP(e, function(a) {
    n(a), n(a.getTextContent()), n(a.getTextGuideLine());
  });
  function n(a) {
    if (!(!a || a.isGroup)) {
      var o = a.currentStates;
      if (o.length)
        for (var s = 0; s < o.length; s++)
          i(a.states[o[s]]);
      i(a);
    }
  }
  function i(a) {
    if (a) {
      var o = a.z2;
      o > t && (t = o), o < r && (r = o);
    }
  }
  return r > t && (r = t = 0), {
    min: r,
    max: t
  };
}
function LC(e, t, r) {
  DW(e, t, r, -1 / 0);
}
function DW(e, t, r, n) {
  if (e.ignoreModelZ)
    return n;
  var i = e.getTextContent(), a = e.getTextGuideLine(), o = e.isGroup;
  if (o)
    for (var s = e.childrenRef(), l = 0; l < s.length; l++)
      n = Sn(DW(s[l], t, r, n), n);
  else
    e.z = t, e.zlevel = r, n = Sn(e.z2 || 0, n);
  if (i && (i.z = t, i.zlevel = r, isFinite(n) && (i.z2 = n + 2)), a) {
    var u = e.textGuideLineConfig;
    a.z = t, a.zlevel = r, isFinite(n) && (a.z2 = n + (u && u.showAbove ? 1 : -1));
  }
  return n;
}
ps("circle", Qs);
ps("ellipse", Ax);
ps("sector", Ui);
ps("ring", qm);
ps("polygon", Wi);
ps("polyline", Ci);
ps("rect", Mt);
ps("line", wn);
ps("bezierCurve", jm);
ps("arc", Mx);
const kd = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  Arc: Mx,
  BezierCurve: jm,
  BoundingRect: st,
  Circle: Qs,
  CompoundPath: Km,
  Ellipse: Ax,
  Group: rt,
  Image: Xn,
  IncrementalDisplayable: wW,
  Line: wn,
  LinearGradient: Nd,
  OrientedBoundingRect: SW,
  Path: zt,
  Point: ht,
  Polygon: Wi,
  Polyline: Ci,
  RadialGradient: ER,
  Rect: Mt,
  Ring: qm,
  Sector: Ui,
  Text: Rt,
  WH: In,
  XY: _t,
  applyTransform: Ws,
  calcZ2Range: LW,
  clipPointsByRect: NR,
  clipRectByRect: AW,
  createIcon: Jm,
  ensureCopyRect: F1,
  ensureCopyTransform: BR,
  expandOrShrinkRect: bd,
  extendPath: bW,
  extendShape: IR,
  getShapeClass: z1,
  getTransform: Hc,
  groupTransition: Lx,
  initProps: Ir,
  isBoundingRectAxisAligned: kR,
  isElementRemoved: pm,
  lineLineIntersect: MW,
  linePolygonIntersect: W_,
  makeImage: RR,
  makePath: $c,
  mergePath: yo,
  registerShape: ps,
  removeElement: Zc,
  removeElementWithFadeOut: ff,
  resizePath: OR,
  retrieveZInfo: Cd,
  setTooltipConfig: Cf,
  subPixelOptimize: _2,
  subPixelOptimizeLine: bm,
  subPixelOptimizeRect: cee,
  transformDirection: MC,
  traverseElements: rh,
  traverseUpdateZ: LC,
  updateProps: Wt
}, Symbol.toStringTag, { value: "Module" }));
var DC = {};
function EW(e, t) {
  for (var r = 0; r < Ta.length; r++) {
    var n = Ta[r], i = t[n], a = e.ensureState(n);
    a.style = a.style || {}, a.style.text = i;
  }
  var o = e.currentStates.slice();
  e.clearStates(!0), e.setStyle({
    text: t.normal
  }), e.useStates(o, !0);
}
function hP(e, t, r) {
  var n = e.labelFetcher, i = e.labelDataIndex, a = e.labelDimIndex, o = t.normal, s;
  n && (s = n.getFormattedLabel(i, "normal", null, a, o && o.get("formatter"), r != null ? {
    interpolatedValue: r
  } : null)), s == null && (s = nt(e.defaultText) ? e.defaultText(i, e, r) : e.defaultText);
  for (var l = {
    normal: s
  }, u = 0; u < Ta.length; u++) {
    var f = Ta[u], c = t[f];
    l[f] = et(n ? n.getFormattedLabel(i, f, null, a, c && c.get("formatter")) : null, s);
  }
  return l;
}
function si(e, t, r, n) {
  r = r || DC;
  for (var i = e instanceof Rt, a = !1, o = 0; o < k1.length; o++) {
    var s = t[k1[o]];
    if (s && s.getShallow("show")) {
      a = !0;
      break;
    }
  }
  var l = i ? e : e.getTextContent();
  if (a) {
    i || (l || (l = new Rt(), e.setTextContent(l)), e.stateProxy && (l.stateProxy = e.stateProxy));
    var u = hP(r, t), f = t.normal, c = !!f.getShallow("show"), h = gr(f, n && n.normal, r, !1, !i);
    h.text = u.normal, i || e.setTextConfig(tb(f, r, !1));
    for (var o = 0; o < Ta.length; o++) {
      var v = Ta[o], s = t[v];
      if (s) {
        var d = l.ensureState(v), g = !!et(s.getShallow("show"), c);
        if (g !== c && (d.ignore = !g), d.style = gr(s, n && n[v], r, !0, !i), d.style.text = u[v], !i) {
          var y = e.ensureState(v);
          y.textConfig = tb(s, r, !0);
        }
      }
    }
    l.silent = !!f.getShallow("silent"), l.style.x != null && (h.x = l.style.x), l.style.y != null && (h.y = l.style.y), l.ignore = !c, l.useStyle(h), l.dirty(), r.enableTextSetter && (ey(l).setLabelText = function(x) {
      var S = hP(r, t, x);
      EW(l, S);
    });
  } else l && (l.ignore = !0);
  e.dirty();
}
function Wn(e, t) {
  t = t || "label";
  for (var r = {
    normal: e.getModel(t)
  }, n = 0; n < Ta.length; n++) {
    var i = Ta[n];
    r[i] = e.getModel([i, t]);
  }
  return r;
}
function gr(e, t, r, n, i) {
  var a = {};
  return dee(a, e, r, n, i), t && xe(a, t), a;
}
function tb(e, t, r) {
  t = t || {};
  var n = {}, i, a = e.getShallow("rotate"), o = et(e.getShallow("distance"), r ? null : 5), s = e.getShallow("offset");
  return i = e.getShallow("position") || (r ? 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 = e.get("color") === "inherit" ? t.inheritColor || null : "auto", t.autoOverflowArea != null && (n.autoOverflowArea = t.autoOverflowArea), t.layoutRect != null && (n.layoutRect = t.layoutRect), n;
}
function dee(e, t, r, n, i) {
  r = r || DC;
  var a = t.ecModel, o = a && a.option.textStyle, s = pee(t), l;
  if (s) {
    l = {};
    var u = "richInheritPlainLabel", f = et(t.get(u), a ? a.get(u) : void 0);
    for (var c in s)
      if (s.hasOwnProperty(c)) {
        var h = t.getModel(["rich", c]);
        tB(l[c] = {}, h, o, t, f, r, n, i, !1, !0);
      }
  }
  l && (e.rich = l);
  var v = t.get("overflow");
  v && (e.overflow = v);
  var d = t.get("lineOverflow");
  d && (e.lineOverflow = d);
  var g = e, y = t.get("minMargin");
  if (y != null)
    y = Xt(y) ? y / 2 : 0, g.margin = [y, y, y, y], g.__marginType = om.minMargin;
  else {
    var x = t.get("textMargin");
    x != null && (g.margin = _x(x), g.__marginType = om.textMargin);
  }
  tB(e, t, o, null, null, r, n, i, !0, !1);
}
function pee(e) {
  for (var t; e && e !== e.ecModel; ) {
    var r = (e.option || DC).rich;
    if (r) {
      t = t || {};
      for (var n = Ht(r), i = 0; i < n.length; i++) {
        var a = n[i];
        t[a] = 1;
      }
    }
    e = e.parentModel;
  }
  return t;
}
var Qk = ["fontStyle", "fontWeight", "fontSize", "fontFamily", "textShadowColor", "textShadowBlur", "textShadowOffsetX", "textShadowOffsetY"], Jk = ["align", "lineHeight", "width", "height", "tag", "verticalAlign", "ellipsis"], eB = ["padding", "borderWidth", "borderRadius", "borderDashOffset", "backgroundColor", "borderColor", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY"];
function tB(e, t, r, n, i, a, o, s, l, u) {
  r = !o && r || DC;
  var f = a && a.inheritColor, c = t.getShallow("color"), h = t.getShallow("textBorderColor"), v = et(t.getShallow("opacity"), r.opacity);
  (c === "inherit" || c === "auto") && (f ? c = f : c = null), (h === "inherit" || h === "auto") && (f ? h = f : h = null), s || (c = c || r.color, h = h || r.textBorderColor), c != null && (e.fill = c), h != null && (e.stroke = h);
  var d = et(t.getShallow("textBorderWidth"), r.textBorderWidth);
  d != null && (e.lineWidth = d);
  var g = et(t.getShallow("textBorderType"), r.textBorderType);
  g != null && (e.lineDash = g);
  var y = et(t.getShallow("textBorderDashOffset"), r.textBorderDashOffset);
  y != null && (e.lineDashOffset = y), !o && v == null && !u && (v = a && a.defaultOpacity), v != null && (e.opacity = v), !o && !s && e.fill == null && a.inheritColor && (e.fill = a.inheritColor);
  for (var x = 0; x < Qk.length; x++) {
    var S = Qk[x], T = i !== !1 && n ? $a(t.getShallow(S), n.getShallow(S), r[S]) : et(t.getShallow(S), r[S]);
    T != null && (e[S] = T);
  }
  for (var x = 0; x < Jk.length; x++) {
    var S = Jk[x], T = t.getShallow(S);
    T != null && (e[S] = T);
  }
  if (e.verticalAlign == null) {
    var C = t.getShallow("baseline");
    C != null && (e.verticalAlign = C);
  }
  if (!l || !a.disableBox) {
    for (var x = 0; x < eB.length; x++) {
      var S = eB[x], T = t.getShallow(S);
      T != null && (e[S] = T);
    }
    var A = t.getShallow("borderType");
    A != null && (e.borderDash = A), (e.backgroundColor === "auto" || e.backgroundColor === "inherit") && f && (e.backgroundColor = f), (e.borderColor === "auto" || e.borderColor === "inherit") && f && (e.borderColor = f);
  }
}
function zR(e, t) {
  var r = t && t.getModel("textStyle");
  return _o([
    // FIXME in node-canvas fontWeight is before fontStyle
    e.fontStyle || r && r.getShallow("fontStyle") || "",
    e.fontWeight || r && r.getShallow("fontWeight") || "",
    (e.fontSize || r && r.getShallow("fontSize") || 12) + "px",
    e.fontFamily || r && r.getShallow("fontFamily") || "sans-serif"
  ].join(" "));
}
var ey = Bt();
function PW(e, t, r, n) {
  if (e) {
    var i = ey(e);
    i.prevValue = i.value, i.value = r;
    var a = t.normal;
    i.valueAnimation = a.get("valueAnimation"), i.valueAnimation && (i.precision = a.get("precision"), i.defaultInterpolatedText = n, i.statesModels = t);
  }
}
function IW(e, t, r, n, i) {
  var a = ey(e);
  if (!a.valueAnimation || a.prevValue === a.value)
    return;
  var o = a.defaultInterpolatedText, s = et(a.interpolatedValue, a.prevValue), l = a.value;
  function u(f) {
    var c = XU(r, a.precision, s, l, f);
    a.interpolatedValue = f === 1 ? null : c;
    var h = hP({
      labelDataIndex: t,
      labelFetcher: i,
      defaultText: o ? o(c) : c + ""
    }, a.statesModels, c);
    EW(e, h);
  }
  e.percent = 0, (a.prevValue == null ? Ir : Wt)(e, {
    // percent is used to prevent animation from being aborted #15916
    percent: 1
  }, n, t, null, u);
}
var om = {
  minMargin: 1,
  textMargin: 2
}, gee = ["textStyle", "color"], tL = ["fontStyle", "fontWeight", "fontSize", "fontFamily", "padding", "lineHeight", "rich", "width", "height", "overflow"], rL = new Rt(), mee = (
  /** @class */
  (function() {
    function e() {
    }
    return e.prototype.getTextColor = function(t) {
      var r = this.ecModel;
      return this.getShallow("color") || (!t && r ? r.get(gee) : null);
    }, e.prototype.getFont = function() {
      return zR({
        fontStyle: this.getShallow("fontStyle"),
        fontWeight: this.getShallow("fontWeight"),
        fontSize: this.getShallow("fontSize"),
        fontFamily: this.getShallow("fontFamily")
      }, this.ecModel);
    }, e.prototype.getTextRect = function(t) {
      for (var r = {
        text: t,
        verticalAlign: this.getShallow("verticalAlign") || this.getShallow("baseline")
      }, n = 0; n < tL.length; n++)
        r[tL[n]] = this.getShallow(tL[n]);
      return rL.useStyle(r), rL.update(), rL.getBoundingRect();
    }, e;
  })()
), RW = [
  ["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.
], yee = wd(RW), _ee = (
  /** @class */
  (function() {
    function e() {
    }
    return e.prototype.getLineStyle = function(t) {
      return yee(this, t);
    }, e;
  })()
), OW = [
  ["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.
], xee = wd(OW), See = (
  /** @class */
  (function() {
    function e() {
    }
    return e.prototype.getItemStyle = function(t, r) {
      return xee(this, t, r);
    }, e;
  })()
), It = (
  /** @class */
  (function() {
    function e(t, r, n) {
      this.parentModel = r, this.ecModel = n, this.option = t;
    }
    return e.prototype.init = function(t, r, n) {
    }, e.prototype.mergeOption = function(t, r) {
      je(this.option, t, !0);
    }, e.prototype.get = function(t, r) {
      return t == null ? this.option : this._doGet(this.parsePath(t), !r && this.parentModel);
    }, e.prototype.getShallow = function(t, r) {
      var n = this.option, i = n == null ? n : n[t];
      if (i == null && !r) {
        var a = this.parentModel;
        a && (i = a.getShallow(t));
      }
      return i;
    }, e.prototype.getModel = function(t, r) {
      var n = t != null, i = n ? this.parsePath(t) : null, a = n ? this._doGet(i) : this.option;
      return r = r || this.parentModel && this.parentModel.getModel(this.resolveParentPath(i)), new e(a, r, this.ecModel);
    }, e.prototype.isEmpty = function() {
      return this.option == null;
    }, e.prototype.restoreData = function() {
    }, e.prototype.clone = function() {
      var t = this.constructor;
      return new t(it(this.option));
    }, e.prototype.parsePath = function(t) {
      return typeof t == "string" ? t.split(".") : t;
    }, e.prototype.resolveParentPath = function(t) {
      return t;
    }, e.prototype.isAnimationEnabled = function() {
      if (!Gt.node && this.option) {
        if (this.option.animation != null)
          return !!this.option.animation;
        if (this.parentModel)
          return this.parentModel.isAnimationEnabled();
      }
    }, e.prototype._doGet = function(t, r) {
      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 && r && (n = r._doGet(this.resolveParentPath(t), r.parentModel)), n;
    }, e;
  })()
);
xR(It);
IQ(It);
cn(It, _ee);
cn(It, See);
cn(It, BQ);
cn(It, mee);
var wee = Math.round(Math.random() * 10);
function ty(e) {
  return [e || "", wee++].join("_");
}
function Tee(e) {
  var t = {};
  e.registerSubTypeDefaulter = function(r, n) {
    var i = Ul(r);
    t[i.main] = n;
  }, e.determineSubType = function(r, n) {
    var i = n.type;
    if (!i) {
      var a = Ul(r).main;
      e.hasSubTypes(r) && t[a] && (i = t[a](n));
    }
    return i;
  };
}
function bee(e, t) {
  e.topologicalTravel = function(a, o, s, l) {
    if (!a.length)
      return;
    var u = r(o), f = u.graph, c = u.noEntryList, h = {};
    for (F(a, function(S) {
      h[S] = !0;
    }); c.length; ) {
      var v = c.pop(), d = f[v], g = !!h[v];
      g && (s.call(l, v, d.originalDeps.slice()), delete h[v]), F(d.successor, g ? x : y);
    }
    F(h, function() {
      var S = "";
      throw new Error(S);
    });
    function y(S) {
      f[S].entryCount--, f[S].entryCount === 0 && c.push(S);
    }
    function x(S) {
      h[S] = !0, y(S);
    }
  };
  function r(a) {
    var o = {}, s = [];
    return F(a, function(l) {
      var u = n(o, l), f = u.originalDeps = t(l), c = i(f, a);
      u.entryCount = c.length, u.entryCount === 0 && s.push(l), F(c, function(h) {
        Tt(u.predecessor, h) < 0 && u.predecessor.push(h);
        var v = n(o, h);
        Tt(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 F(a, function(l) {
      Tt(o, l) >= 0 && s.push(l);
    }), s;
  }
}
function nh(e, t) {
  return je(je({}, e, !0), t, !0);
}
const Cee = {
  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: ". "
      }
    }
  }
}, Aee = {
  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 rb = "ZH", FR = "EN", gm = FR, x2 = {}, GR = {}, NW = Gt.domSupported ? (function() {
  var e = (
    /* eslint-disable-next-line */
    (document.documentElement.lang || navigator.language || navigator.browserLanguage || gm).toUpperCase()
  );
  return e.indexOf(rb) > -1 ? rb : gm;
})() : gm;
function VR(e, t) {
  e = e.toUpperCase(), GR[e] = new It(t), x2[e] = t;
}
function Mee(e) {
  if (Fe(e)) {
    var t = x2[e.toUpperCase()] || {};
    return e === rb || e === FR ? it(t) : je(it(t), it(x2[gm]), !1);
  } else
    return je(it(e), it(x2[gm]), !1);
}
function vP(e) {
  return GR[e];
}
function Lee() {
  return GR[gm];
}
VR(FR, Cee);
VR(rb, Aee);
var dP = null;
function Dee(e) {
  dP || (dP = e);
}
function En() {
  return dP;
}
var HR = 1e3, UR = HR * 60, p1 = UR * 60, as = p1 * 24, rB = as * 365, Eee = {
  year: /({yyyy}|{yy})/,
  month: /({MMMM}|{MMM}|{MM}|{M})/,
  day: /({dd}|{d})/,
  hour: /({HH}|{H}|{hh}|{h})/,
  minute: /({mm}|{m})/,
  second: /({ss}|{s})/,
  millisecond: /({SSS}|{S})/
}, S2 = {
  year: "{yyyy}",
  month: "{MMM}",
  day: "{d}",
  hour: "{HH}:{mm}",
  minute: "{HH}:{mm}",
  second: "{HH}:{mm}:{ss}",
  millisecond: "{HH}:{mm}:{ss} {SSS}"
}, Pee = "{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}", Zw = "{yyyy}-{MM}-{dd}", nB = {
  year: "{yyyy}",
  month: "{yyyy}-{MM}",
  day: Zw,
  hour: Zw + " " + S2.hour,
  minute: Zw + " " + S2.minute,
  second: Zw + " " + S2.second,
  millisecond: Pee
}, po = ["year", "month", "day", "hour", "minute", "second", "millisecond"], Iee = ["year", "half-year", "quarter", "month", "week", "half-week", "day", "half-day", "quarter-day", "hour", "minute", "second", "millisecond"];
function Ree(e) {
  return !Fe(e) && !nt(e) ? Oee(e) : e;
}
function Oee(e) {
  e = e || {};
  var t = {}, r = !0;
  return F(po, function(n) {
    r && (r = e[n] == null);
  }), F(po, function(n, i) {
    var a = e[n];
    t[n] = {};
    for (var o = null, s = i; s >= 0; s--) {
      var l = po[s], u = ot(a) && !Se(a) ? a[l] : a, f = void 0;
      Se(u) ? (f = u.slice(), o = f[0] || "") : Fe(u) ? (o = u, f = [o]) : (o == null ? o = S2[n] : Eee[l].test(o) || (o = t[l][l][0] + " " + o), f = [o], r && (f[1] = "{primary|" + o + "}")), t[n][l] = f;
    }
  }), t;
}
function ma(e, t) {
  return e += "", "0000".substr(0, t - e.length) + e;
}
function g1(e) {
  switch (e) {
    case "half-year":
    case "quarter":
      return "month";
    case "week":
    case "half-week":
      return "day";
    case "half-day":
    case "quarter-day":
      return "hour";
    default:
      return e;
  }
}
function Nee(e) {
  return e === g1(e);
}
function kee(e) {
  switch (e) {
    case "year":
    case "month":
      return "day";
    case "millisecond":
      return "millisecond";
    default:
      return "second";
  }
}
function Dx(e, t, r, n) {
  var i = Ks(e), a = i[kW(r)](), o = i[WR(r)]() + 1, s = Math.floor((o - 1) / 3) + 1, l = i[XR(r)](), u = i["get" + (r ? "UTC" : "") + "Day"](), f = i[YR(r)](), c = (f - 1) % 12 + 1, h = i[ZR(r)](), v = i[$R(r)](), d = i[qR(r)](), g = f >= 12 ? "pm" : "am", y = g.toUpperCase(), x = n instanceof It ? n : vP(n || NW) || Lee(), S = x.getModel("time"), T = S.get("month"), C = S.get("monthAbbr"), A = S.get("dayOfWeek"), M = S.get("dayOfWeekAbbr");
  return (t || "").replace(/{a}/g, g + "").replace(/{A}/g, y + "").replace(/{yyyy}/g, a + "").replace(/{yy}/g, ma(a % 100 + "", 2)).replace(/{Q}/g, s + "").replace(/{MMMM}/g, T[o - 1]).replace(/{MMM}/g, C[o - 1]).replace(/{MM}/g, ma(o, 2)).replace(/{M}/g, o + "").replace(/{dd}/g, ma(l, 2)).replace(/{d}/g, l + "").replace(/{eeee}/g, A[u]).replace(/{ee}/g, M[u]).replace(/{e}/g, u + "").replace(/{HH}/g, ma(f, 2)).replace(/{H}/g, f + "").replace(/{hh}/g, ma(c + "", 2)).replace(/{h}/g, c + "").replace(/{mm}/g, ma(h, 2)).replace(/{m}/g, h + "").replace(/{ss}/g, ma(v, 2)).replace(/{s}/g, v + "").replace(/{SSS}/g, ma(d, 3)).replace(/{S}/g, d + "");
}
function Bee(e, t, r, n, i) {
  var a = null;
  if (Fe(r))
    a = r;
  else if (nt(r)) {
    var o = {
      time: e.time,
      level: e.time.level
    }, s = En();
    s && s.makeAxisLabelFormatterParamBreak(o, e.break), a = r(e.value, t, o);
  } else {
    var l = e.time;
    if (l) {
      var u = r[l.lowerTimeUnit][l.upperTimeUnit];
      a = u[Math.min(l.level, u.length - 1)] || "";
    } else {
      var f = sm(e.value, i);
      a = r[f][f][0];
    }
  }
  return Dx(new Date(e.value), a, i, n);
}
function sm(e, t) {
  var r = Ks(e), n = r[WR(t)]() + 1, i = r[XR(t)](), a = r[YR(t)](), o = r[ZR(t)](), s = r[$R(t)](), l = r[qR(t)](), u = l === 0, f = u && s === 0, c = f && o === 0, h = c && a === 0, v = h && i === 1, d = v && n === 1;
  return d ? "year" : v ? "month" : h ? "day" : c ? "hour" : f ? "minute" : u ? "second" : "millisecond";
}
function nb(e, t, r) {
  switch (t) {
    case "year":
      e[BW(r)](0);
    case "month":
      e[zW(r)](1);
    case "day":
      e[FW(r)](0);
    case "hour":
      e[GW(r)](0);
    case "minute":
      e[VW(r)](0);
    case "second":
      e[HW(r)](0);
  }
  return e;
}
function kW(e) {
  return e ? "getUTCFullYear" : "getFullYear";
}
function WR(e) {
  return e ? "getUTCMonth" : "getMonth";
}
function XR(e) {
  return e ? "getUTCDate" : "getDate";
}
function YR(e) {
  return e ? "getUTCHours" : "getHours";
}
function ZR(e) {
  return e ? "getUTCMinutes" : "getMinutes";
}
function $R(e) {
  return e ? "getUTCSeconds" : "getSeconds";
}
function qR(e) {
  return e ? "getUTCMilliseconds" : "getMilliseconds";
}
function zee(e) {
  return e ? "setUTCFullYear" : "setFullYear";
}
function BW(e) {
  return e ? "setUTCMonth" : "setMonth";
}
function zW(e) {
  return e ? "setUTCDate" : "setDate";
}
function FW(e) {
  return e ? "setUTCHours" : "setHours";
}
function GW(e) {
  return e ? "setUTCMinutes" : "setMinutes";
}
function VW(e) {
  return e ? "setUTCSeconds" : "setSeconds";
}
function HW(e) {
  return e ? "setUTCMilliseconds" : "setMilliseconds";
}
function Fee(e, t, r, n, i, a, o, s) {
  var l = new Rt({
    style: {
      text: e,
      font: t,
      align: r,
      verticalAlign: n,
      padding: i,
      rich: a,
      overflow: o ? "truncate" : null,
      lineHeight: s
    }
  });
  return l.getBoundingRect();
}
function G1(e) {
  if (!mR(e))
    return Fe(e) ? e : "-";
  var t = (e + "").split(".");
  return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, "$1,") + (t.length > 1 ? "." + t[1] : "");
}
function jR(e, t) {
  return e = (e || "").toLowerCase().replace(/-(.)/g, function(r, n) {
    return n.toUpperCase();
  }), t && e && (e = e.charAt(0).toUpperCase() + e.slice(1)), e;
}
var ry = _x;
function pP(e, t, r) {
  var n = "{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";
  function i(f) {
    return f && _o(f) ? f : "-";
  }
  function a(f) {
    return !!(f != null && !isNaN(f) && isFinite(f));
  }
  var o = t === "time", s = e instanceof Date;
  if (o || s) {
    var l = o ? Ks(e) : e;
    if (isNaN(+l)) {
      if (s)
        return "-";
    } else return Dx(l, n, r);
  }
  if (t === "ordinal")
    return B2(e) ? i(e) : Xt(e) && a(e) ? e + "" : "-";
  var u = tu(e);
  return a(u) ? G1(u) : B2(e) ? i(e) : typeof e == "boolean" ? e + "" : "-";
}
var iB = ["a", "b", "c", "d", "e", "f", "g"], nL = function(e, t) {
  return "{" + e + (t ?? "") + "}";
};
function EC(e, t, r) {
  Se(t) || (t = [t]);
  var n = t.length;
  if (!n)
    return "";
  for (var i = t[0].$vars || [], a = 0; a < i.length; a++) {
    var o = iB[a];
    e = e.replace(nL(o), nL(o, 0));
  }
  for (var s = 0; s < n; s++)
    for (var l = 0; l < i.length; l++) {
      var u = t[s][i[l]];
      e = e.replace(nL(iB[l], s), r ? _n(u) : u);
    }
  return e;
}
function Gee(e, t, r) {
  return F(t, function(n, i) {
    e = e.replace("{" + i + "}", n);
  }), e;
}
function KR(e, t) {
  var r = Fe(e) ? {
    color: e,
    extraCssText: t
  } : e || {}, n = r.color, i = r.type;
  t = r.extraCssText;
  var a = r.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:' + _n(n) + ";" + (t || "") + '"></span>' : '<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:' + _n(n) + ";" + (t || "") + '"></span>';
  var o = r.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 UW(e, t, r) {
  (e === "week" || e === "month" || e === "quarter" || e === "half-year" || e === "year") && (e = `MM-dd
yyyy`);
  var n = Ks(t), i = r ? "getUTC" : "get", a = n[i + "FullYear"](), o = n[i + "Month"]() + 1, s = n[i + "Date"](), l = n[i + "Hours"](), u = n[i + "Minutes"](), f = n[i + "Seconds"](), c = n[i + "Milliseconds"]();
  return e = e.replace("MM", ma(o, 2)).replace("M", o).replace("yyyy", a).replace("yy", ma(a % 100 + "", 2)).replace("dd", ma(s, 2)).replace("d", s).replace("hh", ma(l, 2)).replace("h", l).replace("mm", ma(u, 2)).replace("m", u).replace("ss", ma(f, 2)).replace("s", f).replace("SSS", ma(c, 3)), e;
}
function WW(e) {
  return e && e.charAt(0).toUpperCase() + e.substr(1);
}
function Ad(e, t) {
  return t = t || "transparent", Fe(e) ? e : ot(e) && e.colorStops && (e.colorStops[0] || {}).color || t;
}
function ib(e, t) {
  if (t === "_blank" || t === "blank") {
    var r = window.open();
    r.opener = null, r.location.href = e;
  } else
    window.open(e, t);
}
var w2 = {}, iL = {}, ny = (
  /** @class */
  (function() {
    function e() {
      this._normalMasterList = [], this._nonSeriesBoxMasterList = [];
    }
    return e.prototype.create = function(t, r) {
      this._nonSeriesBoxMasterList = n(w2), this._normalMasterList = n(iL);
      function n(i, a) {
        var o = [];
        return F(i, function(s, l) {
          var u = s.create(t, r);
          o = o.concat(u || []);
        }), o;
      }
    }, e.prototype.update = function(t, r) {
      F(this._normalMasterList, function(n) {
        n.update && n.update(t, r);
      });
    }, e.prototype.getCoordinateSystems = function() {
      return this._normalMasterList.concat(this._nonSeriesBoxMasterList);
    }, e.register = function(t, r) {
      if (t === "matrix" || t === "calendar") {
        w2[t] = r;
        return;
      }
      iL[t] = r;
    }, e.get = function(t) {
      return iL[t] || w2[t];
    }, e;
  })()
);
function Vee(e) {
  return !!w2[e];
}
var gP = {
  // By default fetch coord from `model.get('coord')`.
  coord: 1,
  // Some model/series, such as pie, is allowed to also get coord from `model.get('center')`,
  // if cannot get from `model.get('coord')`. But historically pie use `center` option, but
  // geo use `layoutCenter` option to specify layout center; they are not able to be unified.
  // Therefor it is not recommended.
  coord2: 2
};
function Hee(e) {
  XW.set(e.fullType, {
    getCoord2: void 0
  }).getCoord2 = e.getCoord2;
}
var XW = Je();
function Uee(e) {
  var t = e.getShallow("coord", !0), r = gP.coord;
  if (t == null) {
    var n = XW.get(e.type);
    n && n.getCoord2 && (r = gP.coord2, t = n.getCoord2(e));
  }
  return {
    coord: t,
    from: r
  };
}
var Gl = {
  none: 0,
  dataCoordSys: 1,
  boxCoordSys: 2
};
function YW(e, t) {
  var r = e.getShallow("coordinateSystem"), n = e.getShallow("coordinateSystemUsage", !0), i = Gl.none;
  if (r) {
    var a = e.mainType === "series";
    n == null && (n = a ? "data" : "box"), n === "data" ? (i = Gl.dataCoordSys, a || (i = Gl.none)) : n === "box" && (i = Gl.boxCoordSys, !a && !Vee(r) && (i = Gl.none));
  }
  return {
    coordSysType: r,
    kind: i
  };
}
function Ex(e) {
  var t = e.targetModel, r = e.coordSysType, n = e.coordSysProvider, i = e.isDefaultDataCoordSys;
  e.allowNotFound;
  var a = YW(t), o = a.kind, s = a.coordSysType;
  if (i && o !== Gl.dataCoordSys && (o = Gl.dataCoordSys, s = r), o === Gl.none || s !== r)
    return !1;
  var l = n(r, t);
  return l ? (o === Gl.dataCoordSys ? t.coordinateSystem = l : t.boxCoordinateSystem = l, !0) : !1;
}
var ZW = function(e, t) {
  var r = t.getReferringComponents(e, an).models[0];
  return r && r.coordinateSystem;
}, T2 = F, $W = ["left", "right", "top", "bottom", "width", "height"], nd = [["width", "left", "right"], ["height", "top", "bottom"]];
function QR(e, t, r, 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 f = l.getBoundingRect(), c = t.childAt(u + 1), h = c && c.getBoundingRect(), v, d;
    if (e === "horizontal") {
      var g = f.width + (h ? -h.x + f.x : 0);
      v = a + g, v > n || l.newline ? (a = 0, v = g, o += s + r, s = f.height) : s = Math.max(s, f.height);
    } else {
      var y = f.height + (h ? -h.y + f.y : 0);
      d = o + y, d > i || l.newline ? (a += s + r, o = 0, d = y, s = f.width) : s = Math.max(s, f.width);
    }
    l.newline || (l.x = a, l.y = o, l.markRedraw(), e === "horizontal" ? a = v + r : o = d + r);
  });
}
var vd = QR;
St(QR, "vertical");
St(QR, "horizontal");
function qW(e, t) {
  return {
    left: e.getShallow("left", t),
    top: e.getShallow("top", t),
    right: e.getShallow("right", t),
    bottom: e.getShallow("bottom", t),
    width: e.getShallow("width", t),
    height: e.getShallow("height", t)
  };
}
function Wee(e, t) {
  var r = Yn(e, t, {
    enableLayoutOnlyByCenter: !0
  }), n = e.getBoxLayoutParams(), i, a;
  if (r.type === X_.point)
    a = r.refPoint, i = Tr(n, {
      width: t.getWidth(),
      height: t.getHeight()
    });
  else {
    var o = e.get("center"), s = Se(o) ? o : [o, o];
    i = Tr(n, r.refContainer), a = r.boxCoordFrom === gP.coord2 ? r.refPoint : [Be(s[0], i.width) + i.x, Be(s[1], i.height) + i.y];
  }
  return {
    viewRect: i,
    center: a
  };
}
function jW(e, t) {
  var r = Wee(e, t), n = r.viewRect, i = r.center, a = e.get("radius");
  Se(a) || (a = [0, a]);
  var o = Be(n.width, t.getWidth()), s = Be(n.height, t.getHeight()), l = Math.min(o, s), u = Be(a[0], l / 2), f = Be(a[1], l / 2);
  return {
    cx: i[0],
    cy: i[1],
    r0: u,
    r: f,
    viewRect: n
  };
}
function Tr(e, t, r) {
  r = ry(r || 0);
  var n = t.width, i = t.height, a = Be(e.left, n), o = Be(e.top, i), s = Be(e.right, n), l = Be(e.bottom, i), u = Be(e.width, n), f = Be(e.height, i), c = r[2] + r[0], h = r[1] + r[3], v = e.aspect;
  switch (isNaN(u) && (u = n - s - h - a), isNaN(f) && (f = i - l - c - o), v != null && (isNaN(u) && isNaN(f) && (v > n / i ? u = n * 0.8 : f = i * 0.8), isNaN(u) && (u = v * f), isNaN(f) && (f = u / v)), isNaN(a) && (a = n - s - u - h), isNaN(o) && (o = i - l - f - c), e.left || e.right) {
    case "center":
      a = n / 2 - u / 2 - r[3];
      break;
    case "right":
      a = n - u - h;
      break;
  }
  switch (e.top || e.bottom) {
    case "middle":
    case "center":
      o = i / 2 - f / 2 - r[0];
      break;
    case "bottom":
      o = i - f - c;
      break;
  }
  a = a || 0, o = o || 0, isNaN(u) && (u = n - h - a - (s || 0)), isNaN(f) && (f = i - c - o - (l || 0));
  var d = new st((t.x || 0) + a + r[3], (t.y || 0) + o + r[0], u, f);
  return d.margin = r, d;
}
function KW(e, t, r) {
  var n = e.getShallow("preserveAspect", !0);
  if (!n)
    return t;
  var i = t.width / t.height;
  if (Math.abs(Math.atan(r) - Math.atan(i)) < 1e-9)
    return t;
  var a = e.getShallow("preserveAspectAlign", !0), o = e.getShallow("preserveAspectVerticalAlign", !0), s = {
    width: t.width,
    height: t.height
  }, l = n === "cover";
  return i > r && !l || i < r && l ? (s.width = t.height * r, a === "left" ? s.left = 0 : a === "right" ? s.right = 0 : s.left = "center") : (s.height = t.width / r, o === "top" ? s.top = 0 : o === "bottom" ? s.bottom = 0 : s.top = "middle"), Tr(s, t);
}
var X_ = {
  rect: 1,
  point: 2
};
function Yn(e, t, r) {
  var n, i, a, o = e.boxCoordinateSystem, s;
  if (o) {
    var l = Uee(e), u = l.coord, f = l.from;
    if (o.dataToLayout) {
      a = X_.rect, s = f;
      var c = o.dataToLayout(u);
      n = c.contentRect || c.rect;
    } else r && r.enableLayoutOnlyByCenter && o.dataToPoint && (a = X_.point, s = f, i = o.dataToPoint(u));
  }
  return a == null && (a = X_.rect), a === X_.rect && (n || (n = {
    x: 0,
    y: 0,
    width: t.getWidth(),
    height: t.getHeight()
  }), i = [n.x + n.width / 2, n.y + n.height / 2]), {
    type: a,
    refContainer: n,
    refPoint: i,
    boxCoordFrom: s
  };
}
function PC(e, t, r, 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 || e, a.x = e.x, a.y = e.y, !o && !s)
    return !1;
  var u;
  if (l === "raw")
    u = e.type === "group" ? new st(0, 0, +t.width || 0, +t.height || 0) : e.getBoundingRect();
  else if (u = e.getBoundingRect(), e.needLocalTransform()) {
    var f = e.getLocalTransform();
    u = u.clone(), u.applyTransform(f);
  }
  var c = Tr(tt({
    width: u.width,
    height: u.height
  }, t), r, n), h = o ? c.x - u.x : 0, v = s ? c.y - u.y : 0;
  return l === "raw" ? (a.x = h, a.y = v) : (a.x += h, a.y += v), a === e && e.markRedraw(), !0;
}
function Xee(e, t) {
  return e[nd[t][0]] != null || e[nd[t][1]] != null && e[nd[t][2]] != null;
}
function V1(e) {
  var t = e.layoutMode || e.constructor.layoutMode;
  return ot(t) ? t : t ? {
    type: t
  } : null;
}
function nu(e, t, r) {
  var n = r && r.ignoreSize;
  !Se(n) && (n = [n, n]);
  var i = o(nd[0], 0), a = o(nd[1], 1);
  l(nd[0], e, i), l(nd[1], e, a);
  function o(u, f) {
    var c = {}, h = 0, v = {}, d = 0, g = 2;
    if (T2(u, function(S) {
      v[S] = e[S];
    }), T2(u, function(S) {
      qe(t, S) && (c[S] = v[S] = t[S]), s(c, S) && h++, s(v, S) && d++;
    }), n[f])
      return s(t, u[1]) ? v[u[2]] = null : s(t, u[2]) && (v[u[1]] = null), v;
    if (d === g || !h)
      return v;
    if (h >= g)
      return c;
    for (var y = 0; y < u.length; y++) {
      var x = u[y];
      if (!qe(c, x) && qe(e, x)) {
        c[x] = e[x];
        break;
      }
    }
    return c;
  }
  function s(u, f) {
    return u[f] != null && u[f] !== "auto";
  }
  function l(u, f, c) {
    T2(u, function(h) {
      f[h] = c[h];
    });
  }
}
function Bd(e) {
  return QW({}, e);
}
function QW(e, t) {
  return t && e && T2($W, function(r) {
    qe(t, r) && (e[r] = t[r]);
  }), e;
}
var Yee = Bt(), At = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r, n, i) {
      var a = e.call(this, r, n, i) || this;
      return a.uid = ty("ec_cpt_model"), a;
    }
    return t.prototype.init = function(r, n, i) {
      this.mergeDefaultAndTheme(r, i);
    }, t.prototype.mergeDefaultAndTheme = function(r, n) {
      var i = V1(this), a = i ? Bd(r) : {}, o = n.getTheme();
      je(r, o.get(this.mainType)), je(r, this.getDefaultOption()), i && nu(r, a, i);
    }, t.prototype.mergeOption = function(r, n) {
      je(this.option, r, !0);
      var i = V1(this);
      i && nu(this.option, r, i);
    }, t.prototype.optionUpdated = function(r, n) {
    }, t.prototype.getDefaultOption = function() {
      var r = this.constructor;
      if (!DQ(r))
        return r.defaultOption;
      var n = Yee(this);
      if (!n.defaultOption) {
        for (var i = [], a = r; a; ) {
          var o = a.prototype.defaultOption;
          o && i.push(o), a = a.superClass;
        }
        for (var s = {}, l = i.length - 1; l >= 0; l--)
          s = je(s, i[l], !0);
        n.defaultOption = s;
      }
      return n.defaultOption;
    }, t.prototype.getReferringComponents = function(r, n) {
      var i = r + "Index", a = r + "Id";
      return Zm(this.ecModel, r, {
        index: this.get(i, !0),
        id: this.get(a, !0)
      }, n);
    }, t.prototype.getBoxLayoutParams = function() {
      return qW(this, !1);
    }, t.prototype.getZLevelKey = function() {
      return "";
    }, t.prototype.setZLevel = function(r) {
      this.option.zlevel = r;
    }, t.protoInitialize = (function() {
      var r = t.prototype;
      r.type = "component", r.id = "", r.name = "", r.mainType = "", r.subType = "", r.componentIndex = 0;
    })(), t;
  })(It)
);
ZU(At, It);
_C(At);
Tee(At);
bee(At, Zee);
function Zee(e) {
  var t = [];
  return F(At.getClassesByMainType(e), function(r) {
    t = t.concat(r.dependencies || r.prototype.dependencies || []);
  }), t = Ce(t, function(r) {
    return Ul(r).main;
  }), e !== "dataset" && Tt(t, "dataset") <= 0 && t.unshift("dataset"), t;
}
var fe = {
  color: {},
  darkColor: {},
  size: {}
}, mn = fe.color = {
  theme: ["#5070dd", "#b6d634", "#505372", "#ff994d", "#0ca8df", "#ffd10a", "#fb628b", "#785db0", "#3fbe95"],
  neutral00: "#fff",
  neutral05: "#f4f7fd",
  neutral10: "#e8ebf0",
  neutral15: "#dbdee4",
  neutral20: "#cfd2d7",
  neutral25: "#c3c5cb",
  neutral30: "#b7b9be",
  neutral35: "#aaacb2",
  neutral40: "#9ea0a5",
  neutral45: "#929399",
  neutral50: "#86878c",
  neutral55: "#797b7f",
  neutral60: "#6d6e73",
  neutral65: "#616266",
  neutral70: "#54555a",
  neutral75: "#48494d",
  neutral80: "#3c3c41",
  neutral85: "#303034",
  neutral90: "#232328",
  neutral95: "#17171b",
  neutral99: "#000",
  accent05: "#eff1f9",
  accent10: "#e0e4f2",
  accent15: "#d0d6ec",
  accent20: "#c0c9e6",
  accent25: "#b1bbdf",
  accent30: "#a1aed9",
  accent35: "#91a0d3",
  accent40: "#8292cc",
  accent45: "#7285c6",
  accent50: "#6578ba",
  accent55: "#5c6da9",
  accent60: "#536298",
  accent65: "#4a5787",
  accent70: "#404c76",
  accent75: "#374165",
  accent80: "#2e3654",
  accent85: "#252b43",
  accent90: "#1b2032",
  accent95: "#121521",
  transparent: "rgba(0,0,0,0)",
  highlight: "rgba(255,231,130,0.8)"
};
xe(mn, {
  primary: mn.neutral80,
  secondary: mn.neutral70,
  tertiary: mn.neutral60,
  quaternary: mn.neutral50,
  disabled: mn.neutral20,
  border: mn.neutral30,
  borderTint: mn.neutral20,
  borderShade: mn.neutral40,
  background: mn.neutral05,
  backgroundTint: "rgba(234,237,245,0.5)",
  backgroundTransparent: "rgba(255,255,255,0)",
  backgroundShade: mn.neutral10,
  shadow: "rgba(0,0,0,0.2)",
  shadowTint: "rgba(129,130,136,0.2)",
  axisLine: mn.neutral70,
  axisLineTint: mn.neutral40,
  axisTick: mn.neutral70,
  axisTickMinor: mn.neutral60,
  axisLabel: mn.neutral70,
  axisSplitLine: mn.neutral15,
  axisMinorSplitLine: mn.neutral05
});
for (var Mv in mn)
  if (mn.hasOwnProperty(Mv)) {
    var aB = mn[Mv];
    Mv === "theme" ? fe.darkColor.theme = mn.theme.slice() : Mv === "highlight" ? fe.darkColor.highlight = "rgba(255,231,130,0.4)" : Mv.indexOf("accent") === 0 ? fe.darkColor[Mv] = uf(aB, null, function(e) {
      return e * 0.5;
    }, function(e) {
      return Math.min(1, 1.3 - e);
    }) : fe.darkColor[Mv] = uf(aB, null, function(e) {
      return e * 0.9;
    }, function(e) {
      return 1 - Math.pow(e, 1.5);
    });
  }
fe.size = {
  xxs: 2,
  xs: 5,
  s: 10,
  m: 15,
  l: 20,
  xl: 30,
  xxl: 40,
  xxxl: 50
};
var JW = "";
typeof navigator < "u" && (JW = navigator.platform || "");
var wg = "rgba(0, 0, 0, 0.2)", e8 = fe.color.theme[0], $ee = uf(e8, null, null, 0.9);
const qee = {
  darkMode: "auto",
  // backgroundColor: 'rgba(0,0,0,0)',
  colorBy: "series",
  color: fe.color.theme,
  gradientColor: [$ee, e8],
  aria: {
    decal: {
      decals: [{
        color: wg,
        dashArrayX: [1, 0],
        dashArrayY: [2, 5],
        symbolSize: 1,
        rotation: Math.PI / 6
      }, {
        color: wg,
        symbol: "circle",
        dashArrayX: [[8, 8], [0, 8, 8, 0]],
        dashArrayY: [6, 0],
        symbolSize: 0.8
      }, {
        color: wg,
        dashArrayX: [1, 0],
        dashArrayY: [4, 3],
        rotation: -Math.PI / 4
      }, {
        color: wg,
        dashArrayX: [[6, 6], [0, 6, 6, 0]],
        dashArrayY: [6, 0]
      }, {
        color: wg,
        dashArrayX: [[1, 0], [1, 6]],
        dashArrayY: [1, 0, 6, 0],
        rotation: Math.PI / 4
      }, {
        color: wg,
        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: JW.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 t8 = Je(["tooltip", "label", "itemName", "itemId", "itemGroupId", "itemChildGroupId", "seriesName"]), Co = "original", Ai = "arrayRows", Ao = "objectRows", Js = "keyedColumns", Uc = "typedArray", r8 = "unknown", Xs = "column", zd = "row", zi = {
  Must: 1,
  Might: 2,
  Not: 3
  // Other cases
}, n8 = Bt();
function jee(e) {
  n8(e).datasetMap = Je();
}
function i8(e, t, r) {
  var n = {}, i = eO(t);
  if (!i || !e)
    return n;
  var a = [], o = [], s = t.ecModel, l = n8(s).datasetMap, u = i.uid + "_" + r.seriesLayoutBy, f, c;
  e = e.slice(), F(e, function(g, y) {
    var x = ot(g) ? g : e[y] = {
      name: g
    };
    x.type === "ordinal" && f == null && (f = y, c = d(x)), n[x.name] = [];
  });
  var h = l.get(u) || l.set(u, {
    categoryWayDim: c,
    valueWayDim: 0
  });
  F(e, function(g, y) {
    var x = g.name, S = d(g);
    if (f == null) {
      var T = h.valueWayDim;
      v(n[x], T, S), v(o, T, S), h.valueWayDim += S;
    } else if (f === y)
      v(n[x], 0, S), v(a, 0, S);
    else {
      var T = h.categoryWayDim;
      v(n[x], T, S), v(o, T, S), h.categoryWayDim += S;
    }
  });
  function v(g, y, x) {
    for (var S = 0; S < x; S++)
      g.push(y + S);
  }
  function d(g) {
    var y = g.dimsDef;
    return y ? y.length : 1;
  }
  return a.length && (n.itemName = a), o.length && (n.seriesName = o), n;
}
function JR(e, t, r) {
  var n = {}, i = eO(e);
  if (!i)
    return n;
  var a = t.sourceFormat, o = t.dimensionsDefine, s;
  (a === Ao || a === Js) && F(o, function(f, c) {
    (ot(f) ? f.name : f) === "name" && (s = c);
  });
  var l = (function() {
    for (var f = {}, c = {}, h = [], v = 0, d = Math.min(5, r); v < d; v++) {
      var g = o8(t.data, a, t.seriesLayoutBy, o, t.startIndex, v);
      h.push(g);
      var y = g === zi.Not;
      if (y && f.v == null && v !== s && (f.v = v), (f.n == null || f.n === f.v || !y && h[f.n] === zi.Not) && (f.n = v), x(f) && h[f.n] !== zi.Not)
        return f;
      y || (g === zi.Might && c.v == null && v !== s && (c.v = v), (c.n == null || c.n === c.v) && (c.n = v));
    }
    function x(S) {
      return S.v != null && S.n != null;
    }
    return x(f) ? f : x(c) ? c : null;
  })();
  if (l) {
    n.value = [l.v];
    var u = s ?? l.n;
    n.itemName = [u], n.seriesName = [u];
  }
  return n;
}
function eO(e) {
  var t = e.get("data", !0);
  if (!t)
    return Zm(e.ecModel, "dataset", {
      index: e.get("datasetIndex", !0),
      id: e.get("datasetId", !0)
    }, an).models[0];
}
function Kee(e) {
  return !e.get("transform", !0) && !e.get("fromTransformResult", !0) ? [] : Zm(e.ecModel, "dataset", {
    index: e.get("fromDatasetIndex", !0),
    id: e.get("fromDatasetId", !0)
  }, an).models;
}
function a8(e, t) {
  return o8(e.data, e.sourceFormat, e.seriesLayoutBy, e.dimensionsDefine, e.startIndex, t);
}
function o8(e, t, r, n, i, a) {
  var o, s = 5;
  if (wa(e))
    return zi.Not;
  var l, u;
  if (n) {
    var f = n[a];
    ot(f) ? (l = f.name, u = f.type) : Fe(f) && (l = f);
  }
  if (u != null)
    return u === "ordinal" ? zi.Must : zi.Not;
  if (t === Ai) {
    var c = e;
    if (r === zd) {
      for (var h = c[a], v = 0; v < (h || []).length && v < s; v++)
        if ((o = C(h[i + v])) != null)
          return o;
    } else
      for (var v = 0; v < c.length && v < s; v++) {
        var d = c[i + v];
        if (d && (o = C(d[a])) != null)
          return o;
      }
  } else if (t === Ao) {
    var g = e;
    if (!l)
      return zi.Not;
    for (var v = 0; v < g.length && v < s; v++) {
      var y = g[v];
      if (y && (o = C(y[l])) != null)
        return o;
    }
  } else if (t === Js) {
    var x = e;
    if (!l)
      return zi.Not;
    var h = x[l];
    if (!h || wa(h))
      return zi.Not;
    for (var v = 0; v < h.length && v < s; v++)
      if ((o = C(h[v])) != null)
        return o;
  } else if (t === Co)
    for (var S = e, v = 0; v < S.length && v < s; v++) {
      var y = S[v], T = Ym(y);
      if (!Se(T))
        return zi.Not;
      if ((o = C(T[a])) != null)
        return o;
    }
  function C(A) {
    var M = Fe(A);
    if (A != null && Number.isFinite(Number(A)) && A !== "")
      return M ? zi.Might : zi.Not;
    if (M && A !== "-")
      return zi.Must;
  }
  return zi.Not;
}
var mP = Je();
function Qee(e, t) {
  Hi(mP.get(e) == null && t), mP.set(e, t);
}
function Jee(e, t, r) {
  var n = mP.get(t);
  if (!n)
    return r;
  var i = n(e);
  return i ? r.concat(i) : r;
}
var oB = Bt(), ete = Bt(), tO = (
  /** @class */
  (function() {
    function e() {
    }
    return e.prototype.getColorFromPalette = function(t, r, n) {
      var i = Mr(this.get("color", !0)), a = this.get("colorLayer", !0);
      return s8(this, oB, i, a, t, r, n);
    }, e.prototype.clearColorPalette = function() {
      rte(this, oB);
    }, e;
  })()
);
function yP(e, t, r, n) {
  var i = Mr(e.get(["aria", "decal", "decals"]));
  return s8(e, ete, i, null, t, r, n);
}
function tte(e, t) {
  for (var r = e.length, n = 0; n < r; n++)
    if (e[n].length > t)
      return e[n];
  return e[r - 1];
}
function s8(e, t, r, n, i, a, o) {
  a = a || e;
  var s = t(a), l = s.paletteIdx || 0, u = s.paletteNameMap = s.paletteNameMap || {};
  if (u.hasOwnProperty(i))
    return u[i];
  var f = o == null || !n ? r : tte(n, o);
  if (f = f || r, !(!f || !f.length)) {
    var c = f[l];
    return i && (u[i] = c), s.paletteIdx = (l + 1) % f.length, c;
  }
}
function rte(e, t) {
  t(e).paletteIdx = 0, t(e).paletteNameMap = {};
}
var $w, t_, sB, lB = "\0_ec_inner", nte = 1, rO = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      return e !== null && e.apply(this, arguments) || this;
    }
    return t.prototype.init = function(r, n, i, a, o, s) {
      a = a || {}, this.option = null, this._theme = new It(a), this._locale = new It(o), this._optionManager = s;
    }, t.prototype.setOption = function(r, n, i) {
      var a = cB(n);
      this._optionManager.setOption(r, i, a), this._resetOption(null, a);
    }, t.prototype.resetOption = function(r, n) {
      return this._resetOption(r, cB(n));
    }, t.prototype._resetOption = function(r, n) {
      var i = !1, a = this._optionManager;
      if (!r || r === "recreate") {
        var o = a.mountOption(r === "recreate");
        !this.option || r === "recreate" ? sB(this, o) : (this.restoreData(), this._mergeOption(o, n)), i = !0;
      }
      if ((r === "timeline" || r === "media") && this.restoreData(), !r || r === "recreate" || r === "timeline") {
        var s = a.getTimelineOption(this);
        s && (i = !0, this._mergeOption(s, n));
      }
      if (!r || r === "recreate" || r === "media") {
        var l = a.getMediaOption(this);
        l.length && F(l, function(u) {
          i = !0, this._mergeOption(u, n);
        }, this);
      }
      return i;
    }, t.prototype.mergeOption = function(r) {
      this._mergeOption(r, null);
    }, t.prototype._mergeOption = function(r, n) {
      var i = this.option, a = this._componentsMap, o = this._componentsCount, s = [], l = Je(), u = n && n.replaceMergeMainTypeMap;
      jee(this), F(r, function(c, h) {
        c != null && (At.hasClass(h) ? h && (s.push(h), l.set(h, !0)) : i[h] = i[h] == null ? it(c) : je(i[h], c, !0));
      }), u && u.each(function(c, h) {
        At.hasClass(h) && !l.get(h) && (s.push(h), l.set(h, !0));
      }), At.topologicalTravel(s, At.getAllClassMainTypes(), f, this);
      function f(c) {
        var h = Jee(this, c, Mr(r[c])), v = a.get(c), d = (
          // `!oldCmptList` means init. See the comment in `mappingToExists`
          v ? u && u.get(c) ? "replaceMerge" : "normalMerge" : "replaceAll"
        ), g = HU(v, h, d);
        xQ(g, c, At), i[c] = null, a.set(c, null), o.set(c, 0);
        var y = [], x = [], S = 0, T;
        F(g, function(C, A) {
          var M = C.existing, E = C.newOption;
          if (!E)
            M && (M.mergeOption({}, this), M.optionUpdated({}, !1));
          else {
            var P = c === "series", R = At.getClass(
              c,
              C.keyInfo.subType,
              !P
              // Give a more detailed warn later if series don't exists
            );
            if (!R)
              return;
            if (c === "tooltip") {
              if (T)
                return;
              T = !0;
            }
            if (M && M.constructor === R)
              M.name = C.keyInfo.name, M.mergeOption(E, this), M.optionUpdated(E, !1);
            else {
              var O = xe({
                componentIndex: A
              }, C.keyInfo);
              M = new R(E, this, this, O), xe(M, O), C.brandNew && (M.__requireNewView = !0), M.init(E, this, this), M.optionUpdated(null, !0);
            }
          }
          M ? (y.push(M.option), x.push(M), S++) : (y.push(void 0), x.push(void 0));
        }, this), i[c] = y, a.set(c, x), o.set(c, S), c === "series" && $w(this);
      }
      this._seriesIndices || $w(this);
    }, t.prototype.getOption = function() {
      var r = it(this.option);
      return F(r, function(n, i) {
        if (At.hasClass(i)) {
          for (var a = Mr(n), o = a.length, s = !1, l = o - 1; l >= 0; l--)
            a[l] && !N1(a[l]) ? s = !0 : (a[l] = null, !s && o--);
          a.length = o, r[i] = a;
        }
      }), delete r[lB], r;
    }, t.prototype.setTheme = function(r) {
      this._theme = new It(r), this._resetOption("recreate", null);
    }, t.prototype.getTheme = function() {
      return this._theme;
    }, t.prototype.getLocaleModel = function() {
      return this._locale;
    }, t.prototype.setUpdatePayload = function(r) {
      this._payload = r;
    }, t.prototype.getUpdatePayload = function() {
      return this._payload;
    }, t.prototype.getComponent = function(r, n) {
      var i = this._componentsMap.get(r);
      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(r) {
      var n = r.mainType;
      if (!n)
        return [];
      var i = r.index, a = r.id, o = r.name, s = this._componentsMap.get(n);
      if (!s || !s.length)
        return [];
      var l;
      return i != null ? (l = [], F(Mr(i), function(u) {
        s[u] && l.push(s[u]);
      })) : a != null ? l = uB("id", a, s) : o != null ? l = uB("name", o, s) : l = nr(s, function(u) {
        return !!u;
      }), fB(l, r);
    }, t.prototype.findComponents = function(r) {
      var n = r.query, i = r.mainType, a = s(n), o = a ? this.queryComponents(a) : nr(this._componentsMap.get(i), function(u) {
        return !!u;
      });
      return l(fB(o, r));
      function s(u) {
        var f = i + "Index", c = i + "Id", h = i + "Name";
        return u && (u[f] != null || u[c] != null || u[h] != null) ? {
          mainType: i,
          // subType will be filtered finally.
          index: u[f],
          id: u[c],
          name: u[h]
        } : null;
      }
      function l(u) {
        return r.filter ? nr(u, r.filter) : u;
      }
    }, t.prototype.eachComponent = function(r, n, i) {
      var a = this._componentsMap;
      if (nt(r)) {
        var o = n, s = r;
        a.each(function(c, h) {
          for (var v = 0; c && v < c.length; v++) {
            var d = c[v];
            d && s.call(o, h, d, d.componentIndex);
          }
        });
      } else
        for (var l = Fe(r) ? a.get(r) : ot(r) ? this.findComponents(r) : null, u = 0; l && u < l.length; u++) {
          var f = l[u];
          f && n.call(i, f, f.componentIndex);
        }
    }, t.prototype.getSeriesByName = function(r) {
      var n = Gn(r, null);
      return nr(this._componentsMap.get("series"), function(i) {
        return !!i && n != null && i.name === n;
      });
    }, t.prototype.getSeriesByIndex = function(r) {
      return this._componentsMap.get("series")[r];
    }, t.prototype.getSeriesByType = function(r) {
      return nr(this._componentsMap.get("series"), function(n) {
        return !!n && n.subType === r;
      });
    }, t.prototype.getSeries = function() {
      return nr(this._componentsMap.get("series"), function(r) {
        return !!r;
      });
    }, t.prototype.getSeriesCount = function() {
      return this._componentsCount.get("series");
    }, t.prototype.eachSeries = function(r, n) {
      t_(this), F(this._seriesIndices, function(i) {
        var a = this._componentsMap.get("series")[i];
        r.call(n, a, i);
      }, this);
    }, t.prototype.eachRawSeries = function(r, n) {
      F(this._componentsMap.get("series"), function(i) {
        i && r.call(n, i, i.componentIndex);
      });
    }, t.prototype.eachSeriesByType = function(r, n, i) {
      t_(this), F(this._seriesIndices, function(a) {
        var o = this._componentsMap.get("series")[a];
        o.subType === r && n.call(i, o, a);
      }, this);
    }, t.prototype.eachRawSeriesByType = function(r, n, i) {
      return F(this.getSeriesByType(r), n, i);
    }, t.prototype.isSeriesFiltered = function(r) {
      return t_(this), this._seriesIndicesMap.get(r.componentIndex) == null;
    }, t.prototype.getCurrentSeriesIndices = function() {
      return (this._seriesIndices || []).slice();
    }, t.prototype.filterSeries = function(r, n) {
      t_(this);
      var i = [];
      F(this._seriesIndices, function(a) {
        var o = this._componentsMap.get("series")[a];
        r.call(n, o, a) && i.push(a);
      }, this), this._seriesIndices = i, this._seriesIndicesMap = Je(i);
    }, t.prototype.restoreData = function(r) {
      $w(this);
      var n = this._componentsMap, i = [];
      n.each(function(a, o) {
        At.hasClass(o) && i.push(o);
      }), At.topologicalTravel(i, At.getAllClassMainTypes(), function(a) {
        F(n.get(a), function(o) {
          o && (a !== "series" || !ite(o, r)) && o.restoreData();
        });
      });
    }, t.internalField = (function() {
      $w = function(r) {
        var n = r._seriesIndices = [];
        F(r._componentsMap.get("series"), function(i) {
          i && n.push(i.componentIndex);
        }), r._seriesIndicesMap = Je(n);
      }, t_ = function(r) {
      }, sB = function(r, n) {
        r.option = {}, r.option[lB] = nte, r._componentsMap = Je({
          series: []
        }), r._componentsCount = Je();
        var i = n.aria;
        ot(i) && i.enabled == null && (i.enabled = !0), ate(n, r._theme.option), je(n, qee, !1), r._mergeOption(n, null);
      };
    })(), t;
  })(It)
);
function ite(e, t) {
  if (t) {
    var r = t.seriesIndex, n = t.seriesId, i = t.seriesName;
    return r != null && e.componentIndex !== r || n != null && e.id !== n || i != null && e.name !== i;
  }
}
function ate(e, t) {
  var r = e.color && !e.colorLayer;
  F(t, function(n, i) {
    i === "colorLayer" && r || i === "color" && e.color || At.hasClass(i) || (typeof n == "object" ? e[i] = e[i] ? je(e[i], n, !1) : it(n) : e[i] == null && (e[i] = n));
  });
}
function uB(e, t, r) {
  if (Se(t)) {
    var n = Je();
    return F(t, function(a) {
      if (a != null) {
        var o = Gn(a, null);
        o != null && n.set(a, !0);
      }
    }), nr(r, function(a) {
      return a && n.get(a[e]);
    });
  } else {
    var i = Gn(t, null);
    return nr(r, function(a) {
      return a && i != null && a[e] === i;
    });
  }
}
function fB(e, t) {
  return t.hasOwnProperty("subType") ? nr(e, function(r) {
    return r && r.subType === t.subType;
  }) : e;
}
function cB(e) {
  var t = Je();
  return e && F(Mr(e.replaceMerge), function(r) {
    t.set(r, !0);
  }), {
    replaceMergeMainTypeMap: t
  };
}
cn(rO, tO);
var ote = [
  "getDom",
  "getZr",
  "getWidth",
  "getHeight",
  "getDevicePixelRatio",
  "dispatchAction",
  "isSSR",
  "isDisposed",
  "on",
  "off",
  "getDataURL",
  "getConnectedDataURL",
  // 'getModel',
  "getOption",
  // 'getViewOfComponentModel',
  // 'getViewOfSeriesModel',
  "getId",
  "updateLabelLayout"
], l8 = (
  /** @class */
  /* @__PURE__ */ (function() {
    function e(t) {
      F(ote, function(r) {
        this[r] = Ge(t[r], t);
      }, this);
    }
    return e;
  })()
), ste = /^(min|max)?(.+)$/, lte = (
  /** @class */
  (function() {
    function e(t) {
      this._timelineOptions = [], this._mediaList = [], this._currentMediaIndices = [], this._api = t;
    }
    return e.prototype.setOption = function(t, r, n) {
      t && (F(Mr(t.series), function(o) {
        o && o.data && wa(o.data) && L1(o.data);
      }), F(Mr(t.dataset), function(o) {
        o && o.source && wa(o.source) && L1(o.source);
      })), t = it(t);
      var i = this._optionBackup, a = ute(t, r, !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;
    }, e.prototype.mountOption = function(t) {
      var r = this._optionBackup;
      return this._timelineOptions = r.timelineOptions, this._mediaList = r.mediaList, this._mediaDefault = r.mediaDefault, this._currentMediaIndices = [], it(t ? r.baseOption : this._newBaseOption);
    }, e.prototype.getTimelineOption = function(t) {
      var r, n = this._timelineOptions;
      if (n.length) {
        var i = t.getComponent("timeline");
        i && (r = it(
          // FIXME:TS as TimelineModel or quivlant interface
          n[i.getCurrentIndex()]
        ));
      }
      return r;
    }, e.prototype.getMediaOption = function(t) {
      var r = 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++)
        fte(i[l].query, r, n) && o.push(l);
      return !o.length && a && (o = [-1]), o.length && !hte(o, this._currentMediaIndices) && (s = Ce(o, function(f) {
        return it(f === -1 ? a.option : i[f].option);
      })), this._currentMediaIndices = o, s;
    }, e;
  })()
);
function ute(e, t, r) {
  var n = [], i, a, o = e.baseOption, s = e.timeline, l = e.options, u = e.media, f = !!e.media, c = !!(l || s || o && o.timeline);
  o ? (a = o, a.timeline || (a.timeline = s)) : ((c || f) && (e.options = e.media = null), a = e), f && Se(u) && F(u, function(v) {
    v && v.option && (v.query ? n.push(v) : i || (i = v));
  }), h(a), F(l, function(v) {
    return h(v);
  }), F(n, function(v) {
    return h(v.option);
  });
  function h(v) {
    F(t, function(d) {
      d(v, r);
    });
  }
  return {
    baseOption: a,
    timelineOptions: l || [],
    mediaDefault: i,
    mediaList: n
  };
}
function fte(e, t, r) {
  var n = {
    width: t,
    height: r,
    aspectratio: t / r
    // lower case for convenience.
  }, i = !0;
  return F(e, function(a, o) {
    var s = o.match(ste);
    if (!(!s || !s[1] || !s[2])) {
      var l = s[1], u = s[2].toLowerCase();
      cte(n[u], a, l) || (i = !1);
    }
  }), i;
}
function cte(e, t, r) {
  return r === "min" ? e >= t : r === "max" ? e <= t : e === t;
}
function hte(e, t) {
  return e.join(",") === t.join(",");
}
var Rs = F, H1 = ot, hB = ["areaStyle", "lineStyle", "nodeStyle", "linkStyle", "chordStyle", "label", "labelLine"];
function aL(e) {
  var t = e && e.itemStyle;
  if (t)
    for (var r = 0, n = hB.length; r < n; r++) {
      var i = hB[r], a = t.normal, o = t.emphasis;
      a && a[i] && (e[i] = e[i] || {}, e[i].normal ? je(e[i].normal, a[i]) : e[i].normal = a[i], a[i] = null), o && o[i] && (e[i] = e[i] || {}, e[i].emphasis ? je(e[i].emphasis, o[i]) : e[i].emphasis = o[i], o[i] = null);
    }
}
function ta(e, t, r) {
  if (e && e[t] && (e[t].normal || e[t].emphasis)) {
    var n = e[t].normal, i = e[t].emphasis;
    n && (r ? (e[t].normal = e[t].emphasis = null, tt(e[t], n)) : e[t] = n), i && (e.emphasis = e.emphasis || {}, e.emphasis[t] = i, i.focus && (e.emphasis.focus = i.focus), i.blurScope && (e.emphasis.blurScope = i.blurScope));
  }
}
function Y_(e) {
  ta(e, "itemStyle"), ta(e, "lineStyle"), ta(e, "areaStyle"), ta(e, "label"), ta(e, "labelLine"), ta(e, "upperLabel"), ta(e, "edgeLabel");
}
function Dn(e, t) {
  var r = H1(e) && e[t], n = H1(r) && r.textStyle;
  if (n)
    for (var i = 0, a = pk.length; i < a; i++) {
      var o = pk[i];
      n.hasOwnProperty(o) && (r[o] = n[o]);
    }
}
function Qo(e) {
  e && (Y_(e), Dn(e, "label"), e.emphasis && Dn(e.emphasis, "label"));
}
function vte(e) {
  if (H1(e)) {
    aL(e), Y_(e), Dn(e, "label"), Dn(e, "upperLabel"), Dn(e, "edgeLabel"), e.emphasis && (Dn(e.emphasis, "label"), Dn(e.emphasis, "upperLabel"), Dn(e.emphasis, "edgeLabel"));
    var t = e.markPoint;
    t && (aL(t), Qo(t));
    var r = e.markLine;
    r && (aL(r), Qo(r));
    var n = e.markArea;
    n && Qo(n);
    var i = e.data;
    if (e.type === "graph") {
      i = i || e.nodes;
      var a = e.links || e.edges;
      if (a && !wa(a))
        for (var o = 0; o < a.length; o++)
          Qo(a[o]);
      F(e.categories, function(u) {
        Y_(u);
      });
    }
    if (i && !wa(i))
      for (var o = 0; o < i.length; o++)
        Qo(i[o]);
    if (t = e.markPoint, t && t.data)
      for (var s = t.data, o = 0; o < s.length; o++)
        Qo(s[o]);
    if (r = e.markLine, r && r.data)
      for (var l = r.data, o = 0; o < l.length; o++)
        Se(l[o]) ? (Qo(l[o][0]), Qo(l[o][1])) : Qo(l[o]);
    e.type === "gauge" ? (Dn(e, "axisLabel"), Dn(e, "title"), Dn(e, "detail")) : e.type === "treemap" ? (ta(e.breadcrumb, "itemStyle"), F(e.levels, function(u) {
      Y_(u);
    })) : e.type === "tree" && Y_(e.leaves);
  }
}
function Gu(e) {
  return Se(e) ? e : e ? [e] : [];
}
function vB(e) {
  return (Se(e) ? e[0] : e) || {};
}
function dte(e, t) {
  Rs(Gu(e.series), function(n) {
    H1(n) && vte(n);
  });
  var r = ["xAxis", "yAxis", "radiusAxis", "angleAxis", "singleAxis", "parallelAxis", "radar"];
  t && r.push("valueAxis", "categoryAxis", "logAxis", "timeAxis"), Rs(r, function(n) {
    Rs(Gu(e[n]), function(i) {
      i && (Dn(i, "axisLabel"), Dn(i.axisPointer, "label"));
    });
  }), Rs(Gu(e.parallel), function(n) {
    var i = n && n.parallelAxisDefault;
    Dn(i, "axisLabel"), Dn(i && i.axisPointer, "label");
  }), Rs(Gu(e.calendar), function(n) {
    ta(n, "itemStyle"), Dn(n, "dayLabel"), Dn(n, "monthLabel"), Dn(n, "yearLabel");
  }), Rs(Gu(e.radar), function(n) {
    Dn(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);
  }), Rs(Gu(e.geo), function(n) {
    H1(n) && (Qo(n), Rs(Gu(n.regions), function(i) {
      Qo(i);
    }));
  }), Rs(Gu(e.timeline), function(n) {
    Qo(n), ta(n, "label"), ta(n, "itemStyle"), ta(n, "controlStyle", !0);
    var i = n.data;
    Se(i) && F(i, function(a) {
      ot(a) && (ta(a, "label"), ta(a, "itemStyle"));
    });
  }), Rs(Gu(e.toolbox), function(n) {
    ta(n, "iconStyle"), Rs(n.feature, function(i) {
      ta(i, "iconStyle");
    });
  }), Dn(vB(e.axisPointer), "label"), Dn(vB(e.tooltip).axisPointer, "label");
}
function pte(e, t) {
  for (var r = t.split(","), n = e, i = 0; i < r.length && (n = n && n[r[i]], n != null); i++)
    ;
  return n;
}
function gte(e, t, r, n) {
  for (var i = t.split(","), a = e, 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]] = r);
}
function dB(e) {
  e && F(mte, function(t) {
    t[0] in e && !(t[1] in e) && (e[t[1]] = e[t[0]]);
  });
}
var mte = [["x", "left"], ["y", "top"], ["x2", "right"], ["y2", "bottom"]], yte = ["grid", "geo", "parallel", "legend", "toolbox", "title", "visualMap", "dataZoom", "timeline"], oL = [["borderRadius", "barBorderRadius"], ["borderColor", "barBorderColor"], ["borderWidth", "barBorderWidth"]];
function r_(e) {
  var t = e && e.itemStyle;
  if (t)
    for (var r = 0; r < oL.length; r++) {
      var n = oL[r][1], i = oL[r][0];
      t[n] != null && (t[i] = t[n]);
    }
}
function pB(e) {
  e && e.alignTo === "edge" && e.margin != null && e.edgeDistance == null && (e.edgeDistance = e.margin);
}
function gB(e) {
  e && e.downplay && !e.blur && (e.blur = e.downplay);
}
function _te(e) {
  e && e.focusNodeAdjacency != null && (e.emphasis = e.emphasis || {}, e.emphasis.focus == null && (e.emphasis.focus = "adjacency"));
}
function u8(e, t) {
  if (e)
    for (var r = 0; r < e.length; r++)
      t(e[r]), e[r] && u8(e[r].children, t);
}
function f8(e, t) {
  dte(e, t), e.series = Mr(e.series), F(e.series, function(r) {
    if (ot(r)) {
      var n = r.type;
      if (n === "line")
        r.clipOverflow != null && (r.clip = r.clipOverflow);
      else if (n === "pie" || n === "gauge") {
        r.clockWise != null && (r.clockwise = r.clockWise), pB(r.label);
        var i = r.data;
        if (i && !wa(i))
          for (var a = 0; a < i.length; a++)
            pB(i[a]);
        r.hoverOffset != null && (r.emphasis = r.emphasis || {}, (r.emphasis.scaleSize = null) && (r.emphasis.scaleSize = r.hoverOffset));
      } else if (n === "gauge") {
        var o = pte(r, "pointer.color");
        o != null && gte(r, "itemStyle.color", o);
      } else if (n === "bar") {
        r_(r), r_(r.backgroundStyle), r_(r.emphasis);
        var i = r.data;
        if (i && !wa(i))
          for (var a = 0; a < i.length; a++)
            typeof i[a] == "object" && (r_(i[a]), r_(i[a] && i[a].emphasis));
      } else if (n === "sunburst") {
        var s = r.highlightPolicy;
        s && (r.emphasis = r.emphasis || {}, r.emphasis.focus || (r.emphasis.focus = s)), gB(r), u8(r.data, gB);
      } else n === "graph" || n === "sankey" ? _te(r) : n === "map" && (r.mapType && !r.map && (r.map = r.mapType), r.mapLocation && tt(r, r.mapLocation));
      r.hoverAnimation != null && (r.emphasis = r.emphasis || {}, r.emphasis && r.emphasis.scale == null && (r.emphasis.scale = r.hoverAnimation)), dB(r);
    }
  }), e.dataRange && (e.visualMap = e.dataRange), F(yte, function(r) {
    var n = e[r];
    n && (Se(n) || (n = [n]), F(n, function(i) {
      dB(i);
    }));
  });
}
function xte(e) {
  var t = Je();
  e.eachSeries(function(r) {
    var n = r.get("stack");
    if (n) {
      var i = t.get(n) || t.set(n, []), a = r.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: r
      };
      if (!o.stackedDimension || !(o.isStackedByIndex || o.stackedByDimension))
        return;
      i.push(o);
    }
  }), t.each(function(r) {
    if (r.length !== 0) {
      var n = r[0].seriesModel, i = n.get("stackOrder") || "seriesAsc";
      i === "seriesDesc" && r.reverse(), F(r, function(a, o) {
        a.data.setCalculationInfo("stackedOnSeries", o > 0 ? r[o - 1].seriesModel : null);
      }), Ste(r);
    }
  });
}
function Ste(e) {
  F(e, function(t, r) {
    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, f, c) {
      var h = o.get(t.stackedDimension, c);
      if (isNaN(h))
        return i;
      var v, d;
      s ? d = o.getRawIndex(c) : v = o.get(t.stackedByDimension, c);
      for (var g = NaN, y = r - 1; y >= 0; y--) {
        var x = e[y];
        if (s || (d = x.data.rawIndexOf(x.stackedByDimension, v)), d >= 0) {
          var S = x.data.getByRawIndex(x.stackResultDimension, d);
          if (l === "all" || l === "positive" && S > 0 || l === "negative" && S < 0 || l === "samesign" && h >= 0 && S > 0 || l === "samesign" && h <= 0 && S < 0) {
            h = sQ(h, S), g = S;
            break;
          }
        }
      }
      return n[0] = h, n[1] = g, n;
    });
  });
}
var IC = (
  /** @class */
  /* @__PURE__ */ (function() {
    function e(t) {
      this.data = t.data || (t.sourceFormat === Js ? {} : []), this.sourceFormat = t.sourceFormat || r8, this.seriesLayoutBy = t.seriesLayoutBy || Xs, this.startIndex = t.startIndex || 0, this.dimensionsDetectedCount = t.dimensionsDetectedCount, this.metaRawOption = t.metaRawOption;
      var r = this.dimensionsDefine = t.dimensionsDefine;
      if (r)
        for (var n = 0; n < r.length; n++) {
          var i = r[n];
          i.type == null && a8(this, n) === zi.Must && (i.type = "ordinal");
        }
    }
    return e;
  })()
);
function nO(e) {
  return e instanceof IC;
}
function _P(e, t, r) {
  r = r || c8(e);
  var n = t.seriesLayoutBy, i = Tte(e, r, n, t.sourceHeader, t.dimensions), a = new IC({
    data: e,
    sourceFormat: r,
    seriesLayoutBy: n,
    dimensionsDefine: i.dimensionsDefine,
    startIndex: i.startIndex,
    dimensionsDetectedCount: i.dimensionsDetectedCount,
    metaRawOption: it(t)
  });
  return a;
}
function iO(e) {
  return new IC({
    data: e,
    sourceFormat: wa(e) ? Uc : Co
  });
}
function wte(e) {
  return new IC({
    data: e.data,
    sourceFormat: e.sourceFormat,
    seriesLayoutBy: e.seriesLayoutBy,
    dimensionsDefine: it(e.dimensionsDefine),
    startIndex: e.startIndex,
    dimensionsDetectedCount: e.dimensionsDetectedCount
  });
}
function c8(e) {
  var t = r8;
  if (wa(e))
    t = Uc;
  else if (Se(e)) {
    e.length === 0 && (t = Ai);
    for (var r = 0, n = e.length; r < n; r++) {
      var i = e[r];
      if (i != null) {
        if (Se(i) || wa(i)) {
          t = Ai;
          break;
        } else if (ot(i)) {
          t = Ao;
          break;
        }
      }
    }
  } else if (ot(e)) {
    for (var a in e)
      if (qe(e, a) && Vi(e[a])) {
        t = Js;
        break;
      }
  }
  return t;
}
function Tte(e, t, r, n, i) {
  var a, o;
  if (!e)
    return {
      dimensionsDefine: mB(i),
      startIndex: o,
      dimensionsDetectedCount: a
    };
  if (t === Ai) {
    var s = e;
    n === "auto" || n == null ? yB(function(u) {
      u != null && u !== "-" && (Fe(u) ? o == null && (o = 1) : o = 0);
    }, r, s, 10) : o = Xt(n) ? n : n ? 1 : 0, !i && o === 1 && (i = [], yB(function(u, f) {
      i[f] = u != null ? u + "" : "";
    }, r, s, 1 / 0)), a = i ? i.length : r === zd ? s.length : s[0] ? s[0].length : null;
  } else if (t === Ao)
    i || (i = bte(e));
  else if (t === Js)
    i || (i = [], F(e, function(u, f) {
      i.push(f);
    }));
  else if (t === Co) {
    var l = Ym(e[0]);
    a = Se(l) && l.length || 1;
  }
  return {
    startIndex: o,
    dimensionsDefine: mB(i),
    dimensionsDetectedCount: a
  };
}
function bte(e) {
  for (var t = 0, r; t < e.length && !(r = e[t++]); )
    ;
  if (r)
    return Ht(r);
}
function mB(e) {
  if (e) {
    var t = Je();
    return Ce(e, function(r, n) {
      r = ot(r) ? r : {
        name: r
      };
      var i = {
        name: r.name,
        displayName: r.displayName,
        type: r.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 yB(e, t, r, n) {
  if (t === zd)
    for (var i = 0; i < r.length && i < n; i++)
      e(r[i] ? r[i][0] : null, i);
  else
    for (var a = r[0] || [], i = 0; i < a.length && i < n; i++)
      e(a[i], i);
}
function h8(e) {
  var t = e.sourceFormat;
  return t === Ao || t === Js;
}
var Lv, Dv, Ev, Pv, _B, xB, v8 = (
  /** @class */
  (function() {
    function e(t, r) {
      var n = nO(t) ? t : iO(t);
      this._source = n;
      var i = this._data = n.data, a = n.sourceFormat;
      n.seriesLayoutBy, a === Uc && (this._offset = 0, this._dimSize = r, this._data = i), xB(this, i, n);
    }
    return e.prototype.getSource = function() {
      return this._source;
    }, e.prototype.count = function() {
      return 0;
    }, e.prototype.getItem = function(t, r) {
    }, e.prototype.appendData = function(t) {
    }, e.prototype.clean = function() {
    }, e.protoInitialize = (function() {
      var t = e.prototype;
      t.pure = !1, t.persistent = !0;
    })(), e.internalField = (function() {
      var t;
      xB = function(o, s, l) {
        var u = l.sourceFormat, f = l.seriesLayoutBy, c = l.startIndex, h = l.dimensionsDefine, v = _B[aO(u, f)];
        if (xe(o, v), u === Uc)
          o.getItem = r, o.count = i, o.fillStorage = n;
        else {
          var d = d8(u, f);
          o.getItem = Ge(d, null, s, c, h);
          var g = p8(u, f);
          o.count = Ge(g, null, s, c, h);
        }
      };
      var r = function(o, s) {
        o = o - this._offset, s = s || [];
        for (var l = this._data, u = this._dimSize, f = u * o, c = 0; c < u; c++)
          s[c] = l[f + c];
        return s;
      }, n = function(o, s, l, u) {
        for (var f = this._data, c = this._dimSize, h = 0; h < c; h++) {
          for (var v = u[h], d = v[0] == null ? 1 / 0 : v[0], g = v[1] == null ? -1 / 0 : v[1], y = s - o, x = l[h], S = 0; S < y; S++) {
            var T = f[S * c + h];
            x[o + S] = T, T < d && (d = T), T > g && (g = T);
          }
          v[0] = d, v[1] = g;
        }
      }, i = function() {
        return this._data ? this._data.length / this._dimSize : 0;
      };
      _B = (t = {}, t[Ai + "_" + Xs] = {
        pure: !0,
        appendData: a
      }, t[Ai + "_" + zd] = {
        pure: !0,
        appendData: function() {
          throw new Error('Do not support appendData when set seriesLayoutBy: "row".');
        }
      }, t[Ao] = {
        pure: !0,
        appendData: a
      }, t[Js] = {
        pure: !0,
        appendData: function(o) {
          var s = this._data;
          F(o, function(l, u) {
            for (var f = s[u] || (s[u] = []), c = 0; c < (l || []).length; c++)
              f.push(l[c]);
          });
        }
      }, t[Co] = {
        appendData: a
      }, t[Uc] = {
        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]);
      }
    })(), e;
  })()
), qw = function(e) {
  Se(e) || FU("series.data or dataset.source must be an array.");
};
Lv = {}, Lv[Ai + "_" + Xs] = qw, Lv[Ai + "_" + zd] = qw, Lv[Ao] = qw, Lv[Js] = function(e, t) {
  for (var r = 0; r < t.length; r++) {
    var n = t[r].name;
    n == null && FU("dimension name must not be null/undefined.");
  }
}, Lv[Co] = qw;
var SB = function(e, t, r, n) {
  return e[n];
}, Cte = (Dv = {}, Dv[Ai + "_" + Xs] = function(e, t, r, n) {
  return e[n + t];
}, Dv[Ai + "_" + zd] = function(e, t, r, n, i) {
  n += t;
  for (var a = i || [], o = e, s = 0; s < o.length; s++) {
    var l = o[s];
    a[s] = l ? l[n] : null;
  }
  return a;
}, Dv[Ao] = SB, Dv[Js] = function(e, t, r, n, i) {
  for (var a = i || [], o = 0; o < r.length; o++) {
    var s = r[o].name, l = s != null ? e[s] : null;
    a[o] = l ? l[n] : null;
  }
  return a;
}, Dv[Co] = SB, Dv);
function d8(e, t) {
  var r = Cte[aO(e, t)];
  return r;
}
var wB = function(e, t, r) {
  return e.length;
}, Ate = (Ev = {}, Ev[Ai + "_" + Xs] = function(e, t, r) {
  return Math.max(0, e.length - t);
}, Ev[Ai + "_" + zd] = function(e, t, r) {
  var n = e[0];
  return n ? Math.max(0, n.length - t) : 0;
}, Ev[Ao] = wB, Ev[Js] = function(e, t, r) {
  var n = r[0].name, i = n != null ? e[n] : null;
  return i ? i.length : 0;
}, Ev[Co] = wB, Ev);
function p8(e, t) {
  var r = Ate[aO(e, t)];
  return r;
}
var sL = function(e, t, r) {
  return e[t];
}, Mte = (Pv = {}, Pv[Ai] = sL, Pv[Ao] = function(e, t, r) {
  return e[r];
}, Pv[Js] = sL, Pv[Co] = function(e, t, r) {
  var n = Ym(e);
  return n instanceof Array ? n[t] : n;
}, Pv[Uc] = sL, Pv);
function g8(e) {
  var t = Mte[e];
  return t;
}
function aO(e, t) {
  return e === Ai ? e + "_" + t : e;
}
function Cm(e, t, r) {
  if (e) {
    var n = e.getRawDataItem(t);
    if (n != null) {
      var i = e.getStore(), a = i.getSource().sourceFormat;
      if (r != null) {
        var o = e.getDimensionIndex(r), s = i.getDimensionProperty(o);
        return g8(a)(n, o, s);
      } else {
        var l = n;
        return a === Co && (l = Ym(n)), l;
      }
    }
  }
}
var Lte = /\{@(.+?)\}/g, RC = (
  /** @class */
  (function() {
    function e() {
    }
    return e.prototype.getDataParams = function(t, r) {
      var n = this.getData(r), i = this.getRawValue(t, r), 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"], f = l && l.stroke, c = this.mainType, h = c === "series", v = n.userOutput && n.userOutput.get();
      return {
        componentType: c,
        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: r,
        value: i,
        color: u,
        borderColor: f,
        dimensionNames: v ? v.fullDimensions : null,
        encode: v ? v.encode : null,
        // Param name list for mapping `a`, `b`, `c`, `d`, `e`
        $vars: ["seriesName", "name", "value"]
      };
    }, e.prototype.getFormattedLabel = function(t, r, n, i, a, o) {
      r = r || "normal";
      var s = this.getData(n), l = this.getDataParams(t, n);
      if (o && (l.value = o.interpolatedValue), i != null && Se(l.value) && (l.value = l.value[i]), !a) {
        var u = s.getItemModel(t);
        a = u.get(r === "normal" ? ["label", "formatter"] : [r, "label", "formatter"]);
      }
      if (nt(a))
        return l.status = r, l.dimensionIndex = i, a(l);
      if (Fe(a)) {
        var f = EC(a, l);
        return f.replace(Lte, function(c, h) {
          var v = h.length, d = h;
          d.charAt(0) === "[" && d.charAt(v - 1) === "]" && (d = +d.slice(1, v - 1));
          var g = Cm(s, t, d);
          if (o && Se(o.interpolatedValue)) {
            var y = s.getDimensionIndex(d);
            y >= 0 && (g = o.interpolatedValue[y]);
          }
          return g != null ? g + "" : "";
        });
      }
    }, e.prototype.getRawValue = function(t, r) {
      return Cm(this.getData(r), t);
    }, e.prototype.formatTooltip = function(t, r, n) {
    }, e;
  })()
);
function TB(e) {
  var t, r;
  return ot(e) ? e.type && (r = e) : t = e, {
    text: t,
    // markers: markers || markersExisting,
    frag: r
  };
}
function m1(e) {
  return new Dte(e);
}
var Dte = (
  /** @class */
  (function() {
    function e(t) {
      t = t || {}, this._reset = t.reset, this._plan = t.plan, this._count = t.count, this._onDirty = t.onDirty, this._dirty = !0;
    }
    return e.prototype.perform = function(t) {
      var r = this._upstream, n = t && t.skip;
      if (this._dirty && r) {
        var i = this.context;
        i.data = i.outputData = r.context.outputData;
      }
      this.__pipeline && (this.__pipeline.currentTask = this);
      var a;
      this._plan && !n && (a = this._plan(this.context));
      var o = f(this._modBy), s = this._modDataCount || 0, l = f(t && t.modBy), u = t && t.modDataCount || 0;
      (o !== l || s !== u) && (a = "reset");
      function f(S) {
        return !(S >= 1) && (S = 1), S;
      }
      var c;
      (this._dirty || a === "reset") && (this._dirty = !1, c = this._doReset(n)), this._modBy = l, this._modDataCount = u;
      var h = t && t.step;
      if (r ? this._dueEnd = r._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 && (c || v < d)) {
          var g = this._progress;
          if (Se(g))
            for (var y = 0; y < g.length; y++)
              this._doProgress(g[y], v, d, l, u);
          else
            this._doProgress(g, v, d, l, u);
        }
        this._dueIndex = d;
        var x = this._settedOutputEnd != null ? this._settedOutputEnd : d;
        this._outputDueEnd = x;
      } else
        this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : this._dueEnd;
      return this.unfinished();
    }, e.prototype.dirty = function() {
      this._dirty = !0, this._onDirty && this._onDirty(this.context);
    }, e.prototype._doProgress = function(t, r, n, i, a) {
      bB.reset(r, n, i, a), this._callingProgress = t, this._callingProgress({
        start: r,
        end: n,
        count: n - r,
        next: bB.next
      }, this.context);
    }, e.prototype._doReset = function(t) {
      this._dueIndex = this._outputDueEnd = this._dueEnd = 0, this._settedOutputEnd = null;
      var r, n;
      !t && this._reset && (r = this._reset(this.context), r && r.progress && (n = r.forceFirstProgress, r = r.progress), Se(r) && !r.length && (r = null)), this._progress = r, this._modBy = this._modDataCount = null;
      var i = this._downstream;
      return i && i.dirty(), n;
    }, e.prototype.unfinished = function() {
      return this._progress && this._dueIndex < this._dueEnd;
    }, e.prototype.pipe = function(t) {
      (this._downstream !== t || this._dirty) && (this._downstream = t, t._upstream = this, t.dirty());
    }, e.prototype.dispose = function() {
      this._disposed || (this._upstream && (this._upstream._downstream = null), this._downstream && (this._downstream._upstream = null), this._dirty = !1, this._disposed = !0);
    }, e.prototype.getUpstream = function() {
      return this._upstream;
    }, e.prototype.getDownstream = function() {
      return this._downstream;
    }, e.prototype.setOutputEnd = function(t) {
      this._outputDueEnd = this._settedOutputEnd = t;
    }, e;
  })()
), bB = /* @__PURE__ */ (function() {
  var e, t, r, n, i, a = {
    reset: function(l, u, f, c) {
      t = l, e = u, r = f, n = c, i = Math.ceil(n / r), a.next = r > 1 && n > 0 ? s : o;
    }
  };
  return a;
  function o() {
    return t < e ? t++ : null;
  }
  function s() {
    var l = t % i * r + Math.ceil(t / i), u = t >= e ? null : l < n ? l : t;
    return t++, u;
  }
})();
function Wc(e, t) {
  var r = t && t.type;
  return r === "ordinal" ? e : (r === "time" && !Xt(e) && e != null && e !== "-" && (e = +Ks(e)), e == null || e === "" ? NaN : Number(e));
}
var Ete = Je({
  number: function(e) {
    return parseFloat(e);
  },
  time: function(e) {
    return +Ks(e);
  },
  trim: function(e) {
    return Fe(e) ? _o(e) : e;
  }
});
function m8(e) {
  return Ete.get(e);
}
var y8 = {
  lt: function(e, t) {
    return e < t;
  },
  lte: function(e, t) {
    return e <= t;
  },
  gt: function(e, t) {
    return e > t;
  },
  gte: function(e, t) {
    return e >= t;
  }
}, Pte = (
  /** @class */
  (function() {
    function e(t, r) {
      if (!Xt(r)) {
        var n = "";
        or(n);
      }
      this._opFn = y8[t], this._rvalFloat = tu(r);
    }
    return e.prototype.evaluate = function(t) {
      return Xt(t) ? this._opFn(t, this._rvalFloat) : this._opFn(tu(t), this._rvalFloat);
    }, e;
  })()
), _8 = (
  /** @class */
  (function() {
    function e(t, r) {
      var n = t === "desc";
      this._resultLT = n ? 1 : -1, r == null && (r = n ? "min" : "max"), this._incomparable = r === "min" ? -1 / 0 : 1 / 0;
    }
    return e.prototype.evaluate = function(t, r) {
      var n = Xt(t) ? t : tu(t), i = Xt(r) ? r : tu(r), a = isNaN(n), o = isNaN(i);
      if (a && (n = this._incomparable), o && (i = this._incomparable), a && o) {
        var s = Fe(t), l = Fe(r);
        s && (n = l ? t : 0), l && (i = s ? r : 0);
      }
      return n < i ? this._resultLT : n > i ? -this._resultLT : 0;
    }, e;
  })()
), Ite = (
  /** @class */
  (function() {
    function e(t, r) {
      this._rval = r, this._isEQ = t, this._rvalTypeof = typeof r, this._rvalFloat = tu(r);
    }
    return e.prototype.evaluate = function(t) {
      var r = t === this._rval;
      if (!r) {
        var n = typeof t;
        n !== this._rvalTypeof && (n === "number" || this._rvalTypeof === "number") && (r = tu(t) === this._rvalFloat);
      }
      return this._isEQ ? r : !r;
    }, e;
  })()
);
function Rte(e, t) {
  return e === "eq" || e === "ne" ? new Ite(e === "eq", t) : qe(y8, e) ? new Pte(e, t) : null;
}
var Ote = (
  /** @class */
  (function() {
    function e() {
    }
    return e.prototype.getRawData = function() {
      throw new Error("not supported");
    }, e.prototype.getRawDataItem = function(t) {
      throw new Error("not supported");
    }, e.prototype.cloneRawData = function() {
    }, e.prototype.getDimensionInfo = function(t) {
    }, e.prototype.cloneAllDimensionInfo = function() {
    }, e.prototype.count = function() {
    }, e.prototype.retrieveValue = function(t, r) {
    }, e.prototype.retrieveValueFromItem = function(t, r) {
    }, e.prototype.convertValue = function(t, r) {
      return Wc(t, r);
    }, e;
  })()
);
function Nte(e, t) {
  var r = new Ote(), n = e.data, i = r.sourceFormat = e.sourceFormat, a = e.startIndex, o = "";
  e.seriesLayoutBy !== Xs && or(o);
  var s = [], l = {}, u = e.dimensionsDefine;
  if (u)
    F(u, function(g, y) {
      var x = g.name, S = {
        index: y,
        name: x,
        displayName: g.displayName
      };
      if (s.push(S), x != null) {
        var T = "";
        qe(l, x) && or(T), l[x] = S;
      }
    });
  else
    for (var f = 0; f < e.dimensionsDetectedCount; f++)
      s.push({
        index: f
      });
  var c = d8(i, Xs);
  t.__isBuiltIn && (r.getRawDataItem = function(g) {
    return c(n, a, s, g);
  }, r.getRawData = Ge(kte, null, e)), r.cloneRawData = Ge(Bte, null, e);
  var h = p8(i, Xs);
  r.count = Ge(h, null, n, a, s);
  var v = g8(i);
  r.retrieveValue = function(g, y) {
    var x = c(n, a, s, g);
    return d(x, y);
  };
  var d = r.retrieveValueFromItem = function(g, y) {
    if (g != null) {
      var x = s[y];
      if (x)
        return v(g, y, x.name);
    }
  };
  return r.getDimensionInfo = Ge(zte, null, s, l), r.cloneAllDimensionInfo = Ge(Fte, null, s), r;
}
function kte(e) {
  var t = e.sourceFormat;
  if (!oO(t)) {
    var r = "";
    or(r);
  }
  return e.data;
}
function Bte(e) {
  var t = e.sourceFormat, r = e.data;
  if (!oO(t)) {
    var n = "";
    or(n);
  }
  if (t === Ai) {
    for (var i = [], a = 0, o = r.length; a < o; a++)
      i.push(r[a].slice());
    return i;
  } else if (t === Ao) {
    for (var i = [], a = 0, o = r.length; a < o; a++)
      i.push(xe({}, r[a]));
    return i;
  }
}
function zte(e, t, r) {
  if (r != null) {
    if (Xt(r) || !isNaN(r) && !qe(t, r))
      return e[r];
    if (qe(t, r))
      return t[r];
  }
}
function Fte(e) {
  return it(e);
}
var x8 = Je();
function Gte(e) {
  e = it(e);
  var t = e.type, r = "";
  t || or(r);
  var n = t.split(":");
  n.length !== 2 && or(r);
  var i = !1;
  n[0] === "echarts" && (t = n[1], i = !0), e.__isBuiltIn = i, x8.set(t, e);
}
function Vte(e, t, r) {
  var n = Mr(e), i = n.length, a = "";
  i || or(a);
  for (var o = 0, s = i; o < s; o++) {
    var l = n[o];
    t = Hte(l, t), o !== s - 1 && (t.length = Math.max(t.length, 1));
  }
  return t;
}
function Hte(e, t, r, n) {
  var i = "";
  t.length || or(i), ot(e) || or(i);
  var a = e.type, o = x8.get(a);
  o || or(i);
  var s = Ce(t, function(u) {
    return Nte(u, o);
  }), l = Mr(o.transform({
    upstream: s[0],
    upstreamList: s,
    config: it(e.config)
  }));
  return Ce(l, function(u, f) {
    var c = "";
    ot(u) || or(c), u.data || or(c);
    var h = c8(u.data);
    oO(h) || or(c);
    var v, d = t[0];
    if (d && f === 0 && !u.dimensions) {
      var g = d.startIndex;
      g && (u.data = d.data.slice(0, g).concat(u.data)), v = {
        seriesLayoutBy: Xs,
        sourceHeader: g,
        dimensions: d.metaRawOption.dimensions
      };
    } else
      v = {
        seriesLayoutBy: Xs,
        sourceHeader: 0,
        dimensions: u.dimensions
      };
    return _P(u.data, v, null);
  });
}
function oO(e) {
  return e === Ai || e === Ao;
}
var OC = "undefined", Ute = typeof Uint32Array === OC ? Array : Uint32Array, Wte = typeof Uint16Array === OC ? Array : Uint16Array, S8 = typeof Int32Array === OC ? Array : Int32Array, CB = typeof Float64Array === OC ? Array : Float64Array, w8 = {
  float: CB,
  int: S8,
  // Ordinal data type can be string or int
  ordinal: Array,
  number: Array,
  time: CB
}, lL;
function Tg(e) {
  return e > 65535 ? Ute : Wte;
}
function bg() {
  return [1 / 0, -1 / 0];
}
function Xte(e) {
  var t = e.constructor;
  return t === Array ? e.slice() : new t(e);
}
function AB(e, t, r, n, i) {
  var a = w8[r || "float"];
  if (i) {
    var o = e[t], s = o && o.length;
    if (s !== n) {
      for (var l = new a(n), u = 0; u < s; u++)
        l[u] = o[u];
      e[t] = l;
    }
  } else
    e[t] = new a(n);
}
var xP = (
  /** @class */
  (function() {
    function e() {
      this._chunks = [], this._rawExtent = [], this._extent = [], this._count = 0, this._rawCount = 0, this._calcDimNameToIdx = Je();
    }
    return e.prototype.initData = function(t, r, n) {
      this._provider = t, this._chunks = [], this._indices = null, this.getRawIndex = this._getRawIdxIdentity;
      var i = t.getSource(), a = this.defaultDimValueGetter = lL[i.sourceFormat];
      this._dimValueGetter = n || a, this._rawExtent = [], h8(i), this._dimensions = Ce(r, 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());
    }, e.prototype.getProvider = function() {
      return this._provider;
    }, e.prototype.getSource = function() {
      return this._provider.getSource();
    }, e.prototype.ensureCalculationDimension = function(t, r) {
      var n = this._calcDimNameToIdx, i = this._dimensions, a = n.get(t);
      if (a != null) {
        if (i[a].type === r)
          return a;
      } else
        a = i.length;
      return i[a] = {
        type: r
      }, n.set(t, a), this._chunks[a] = new w8[r || "float"](this._rawCount), this._rawExtent[a] = bg(), a;
    }, e.prototype.collectOrdinalMeta = function(t, r) {
      var n = this._chunks[t], i = this._dimensions[t], a = this._rawExtent, o = i.ordinalOffset || 0, s = n.length;
      o === 0 && (a[t] = bg());
      for (var l = a[t], u = o; u < s; u++) {
        var f = n[u] = r.parseAndCollect(n[u]);
        isNaN(f) || (l[0] = Math.min(f, l[0]), l[1] = Math.max(f, l[1]));
      }
      i.ordinalMeta = r, i.ordinalOffset = s, i.type = "ordinal";
    }, e.prototype.getOrdinalMeta = function(t) {
      var r = this._dimensions[t], n = r.ordinalMeta;
      return n;
    }, e.prototype.getDimensionProperty = function(t) {
      var r = this._dimensions[t];
      return r && r.property;
    }, e.prototype.appendData = function(t) {
      var r = this._provider, n = this.count();
      r.appendData(t);
      var i = r.count();
      return r.persistent || (i += n), n < i && this._initDataFromProvider(n, i, !0), [n, i];
    }, e.prototype.appendValues = function(t, r) {
      for (var n = this._chunks, i = this._dimensions, a = i.length, o = this._rawExtent, s = this.count(), l = s + Math.max(t.length, r || 0), u = 0; u < a; u++) {
        var f = i[u];
        AB(n, u, f.type, l, !0);
      }
      for (var c = [], h = s; h < l; h++)
        for (var v = h - s, d = 0; d < a; d++) {
          var f = i[d], g = lL.arrayRows.call(this, t[v] || c, f.property, v, d);
          n[d][h] = g;
          var y = o[d];
          g < y[0] && (y[0] = g), g > y[1] && (y[1] = g);
        }
      return this._rawCount = this._count = l, {
        start: s,
        end: l
      };
    }, e.prototype._initDataFromProvider = function(t, r, n) {
      for (var i = this._provider, a = this._chunks, o = this._dimensions, s = o.length, l = this._rawExtent, u = Ce(o, function(S) {
        return S.property;
      }), f = 0; f < s; f++) {
        var c = o[f];
        l[f] || (l[f] = bg()), AB(a, f, c.type, r, n);
      }
      if (i.fillStorage)
        i.fillStorage(t, r, a, l);
      else
        for (var h = [], v = t; v < r; v++) {
          h = i.getItem(v, h);
          for (var d = 0; d < s; d++) {
            var g = a[d], y = this._dimValueGetter(h, u[d], v, d);
            g[v] = y;
            var x = l[d];
            y < x[0] && (x[0] = y), y > x[1] && (x[1] = y);
          }
        }
      !i.persistent && i.clean && i.clean(), this._rawCount = this._count = r, this._extent = [];
    }, e.prototype.count = function() {
      return this._count;
    }, e.prototype.get = function(t, r) {
      if (!(r >= 0 && r < this._count))
        return NaN;
      var n = this._chunks[t];
      return n ? n[this.getRawIndex(r)] : NaN;
    }, e.prototype.getValues = function(t, r) {
      var n = [], i = [];
      if (r == null) {
        r = 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], r));
      return n;
    }, e.prototype.getByRawIndex = function(t, r) {
      if (!(r >= 0 && r < this._rawCount))
        return NaN;
      var n = this._chunks[t];
      return n ? n[r] : NaN;
    }, e.prototype.getSum = function(t) {
      var r = this._chunks[t], n = 0;
      if (r)
        for (var i = 0, a = this.count(); i < a; i++) {
          var o = this.get(t, i);
          isNaN(o) || (n += o);
        }
      return n;
    }, e.prototype.getMedian = function(t) {
      var r = [];
      this.each([t], function(a) {
        isNaN(a) || r.push(a);
      });
      var n = r.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;
    }, e.prototype.indexOfRawIndex = function(t) {
      if (t >= this._rawCount || t < 0)
        return -1;
      if (!this._indices)
        return t;
      var r = this._indices, n = r[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 (r[o] < t)
          i = o + 1;
        else if (r[o] > t)
          a = o - 1;
        else
          return o;
      }
      return -1;
    }, e.prototype.getIndices = function() {
      var t, r = this._indices;
      if (r) {
        var n = r.constructor, i = this._count;
        if (n === Array) {
          t = new n(i);
          for (var a = 0; a < i; a++)
            t[a] = r[a];
        } else
          t = new n(r.buffer, 0, i);
      } else {
        var n = Tg(this._rawCount);
        t = new n(this.count());
        for (var a = 0; a < t.length; a++)
          t[a] = a;
      }
      return t;
    }, e.prototype.filter = function(t, r) {
      if (!this._count)
        return this;
      for (var n = this.clone(), i = n.count(), a = Tg(n._rawCount), o = new a(i), s = [], l = t.length, u = 0, f = t[0], c = n._chunks, h = 0; h < i; h++) {
        var v = void 0, d = n.getRawIndex(h);
        if (l === 0)
          v = r(h);
        else if (l === 1) {
          var g = c[f][d];
          v = r(g, h);
        } else {
          for (var y = 0; y < l; y++)
            s[y] = c[t[y]][d];
          s[y] = h, v = r.apply(null, s);
        }
        v && (o[u++] = d);
      }
      return u < i && (n._indices = o), n._count = u, n._extent = [], n._updateGetRawIdx(), n;
    }, e.prototype.selectRange = function(t) {
      var r = this.clone(), n = r._count;
      if (!n)
        return this;
      var i = Ht(t), a = i.length;
      if (!a)
        return this;
      var o = r.count(), s = Tg(r._rawCount), l = new s(o), u = 0, f = i[0], c = t[f][0], h = t[f][1], v = r._chunks, d = !1;
      if (!r._indices) {
        var g = 0;
        if (a === 1) {
          for (var y = v[i[0]], x = 0; x < n; x++) {
            var S = y[x];
            (S >= c && S <= h || isNaN(S)) && (l[u++] = g), g++;
          }
          d = !0;
        } else if (a === 2) {
          for (var y = v[i[0]], T = v[i[1]], C = t[i[1]][0], A = t[i[1]][1], x = 0; x < n; x++) {
            var S = y[x], M = T[x];
            (S >= c && S <= h || isNaN(S)) && (M >= C && M <= A || isNaN(M)) && (l[u++] = g), g++;
          }
          d = !0;
        }
      }
      if (!d)
        if (a === 1)
          for (var x = 0; x < o; x++) {
            var E = r.getRawIndex(x), S = v[i[0]][E];
            (S >= c && S <= h || isNaN(S)) && (l[u++] = E);
          }
        else
          for (var x = 0; x < o; x++) {
            for (var P = !0, E = r.getRawIndex(x), R = 0; R < a; R++) {
              var O = i[R], S = v[O][E];
              (S < t[O][0] || S > t[O][1]) && (P = !1);
            }
            P && (l[u++] = r.getRawIndex(x));
          }
      return u < o && (r._indices = l), r._count = u, r._extent = [], r._updateGetRawIdx(), r;
    }, e.prototype.map = function(t, r) {
      var n = this.clone(t);
      return this._updateDims(n, t, r), n;
    }, e.prototype.modify = function(t, r) {
      this._updateDims(this, t, r);
    }, e.prototype._updateDims = function(t, r, n) {
      for (var i = t._chunks, a = [], o = r.length, s = t.count(), l = [], u = t._rawExtent, f = 0; f < r.length; f++)
        u[r[f]] = bg();
      for (var c = 0; c < s; c++) {
        for (var h = t.getRawIndex(c), v = 0; v < o; v++)
          l[v] = i[r[v]][h];
        l[o] = c;
        var d = n && n.apply(null, l);
        if (d != null) {
          typeof d != "object" && (a[0] = d, d = a);
          for (var f = 0; f < d.length; f++) {
            var g = r[f], y = d[f], x = u[g], S = i[g];
            S && (S[h] = y), y < x[0] && (x[0] = y), y > x[1] && (x[1] = y);
          }
        }
      }
    }, e.prototype.lttbDownSample = function(t, r) {
      var n = this.clone([t], !0), i = n._chunks, a = i[t], o = this.count(), s = 0, l = Math.floor(1 / r), u = this.getRawIndex(0), f, c, h, v = new (Tg(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 g = Math.min(d + l, o - 1), y = Math.min(d + l * 2, o), x = (y + g) / 2, S = 0, T = g; T < y; T++) {
          var C = this.getRawIndex(T), A = a[C];
          isNaN(A) || (S += A);
        }
        S /= y - g;
        var M = d, E = Math.min(d + l, o), P = d - 1, R = a[u];
        f = -1, h = M;
        for (var O = -1, N = 0, T = M; T < E; T++) {
          var C = this.getRawIndex(T), A = a[C];
          if (isNaN(A)) {
            N++, O < 0 && (O = C);
            continue;
          }
          c = Math.abs((P - x) * (A - R) - (P - T) * (S - R)), c > f && (f = c, h = C);
        }
        N > 0 && N < E - M && (v[s++] = Math.min(O, h), h = Math.max(O, h)), v[s++] = h, u = h;
      }
      return v[s++] = this.getRawIndex(o - 1), n._count = s, n._indices = v, n.getRawIndex = this._getRawIdx, n;
    }, e.prototype.minmaxDownSample = function(t, r) {
      for (var n = this.clone([t], !0), i = n._chunks, a = Math.floor(1 / r), o = i[t], s = this.count(), l = new (Tg(this._rawCount))(Math.ceil(s / a) * 2), u = 0, f = 0; f < s; f += a) {
        var c = f, h = o[this.getRawIndex(c)], v = f, d = o[this.getRawIndex(v)], g = a;
        f + a > s && (g = s - f);
        for (var y = 0; y < g; y++) {
          var x = this.getRawIndex(f + y), S = o[x];
          S < h && (h = S, c = f + y), S > d && (d = S, v = f + y);
        }
        var T = this.getRawIndex(c), C = this.getRawIndex(v);
        c < v ? (l[u++] = T, l[u++] = C) : (l[u++] = C, l[u++] = T);
      }
      return n._count = u, n._indices = l, n._updateGetRawIdx(), n;
    }, e.prototype.downSample = function(t, r, n, i) {
      for (var a = this.clone([t], !0), o = a._chunks, s = [], l = Math.floor(1 / r), u = o[t], f = this.count(), c = a._rawExtent[t] = bg(), h = new (Tg(this._rawCount))(Math.ceil(f / l)), v = 0, d = 0; d < f; d += l) {
        l > f - d && (l = f - d, s.length = l);
        for (var g = 0; g < l; g++) {
          var y = this.getRawIndex(d + g);
          s[g] = u[y];
        }
        var x = n(s), S = this.getRawIndex(Math.min(d + i(s, x) || 0, f - 1));
        u[S] = x, x < c[0] && (c[0] = x), x > c[1] && (c[1] = x), h[v++] = S;
      }
      return a._count = v, a._indices = h, a._updateGetRawIdx(), a;
    }, e.prototype.each = function(t, r) {
      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:
              r(a);
              break;
            case 1:
              r(i[t[0]][s], a);
              break;
            case 2:
              r(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, r.apply(null, u);
          }
        }
    }, e.prototype.getDataExtent = function(t) {
      var r = this._chunks[t], n = bg();
      if (!r)
        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 f = this.getRawIndex(u), c = r[f];
        c < s && (s = c), c > l && (l = c);
      }
      return o = [s, l], this._extent[t] = o, o;
    }, e.prototype.getRawDataItem = function(t) {
      var r = this.getRawIndex(t);
      if (this._provider.persistent)
        return this._provider.getItem(r);
      for (var n = [], i = this._chunks, a = 0; a < i.length; a++)
        n.push(i[a][r]);
      return n;
    }, e.prototype.clone = function(t, r) {
      var n = new e(), i = this._chunks, a = t && bo(t, function(s, l) {
        return s[l] = !0, s;
      }, {});
      if (a)
        for (var o = 0; o < i.length; o++)
          n._chunks[o] = a[o] ? Xte(i[o]) : i[o];
      else
        n._chunks = i;
      return this._copyCommonProps(n), r || (n._indices = this._cloneIndices()), n._updateGetRawIdx(), n;
    }, e.prototype._copyCommonProps = function(t) {
      t._count = this._count, t._rawCount = this._rawCount, t._provider = this._provider, t._dimensions = this._dimensions, t._extent = it(this._extent), t._rawExtent = it(this._rawExtent);
    }, e.prototype._cloneIndices = function() {
      if (this._indices) {
        var t = this._indices.constructor, r = void 0;
        if (t === Array) {
          var n = this._indices.length;
          r = new t(n);
          for (var i = 0; i < n; i++)
            r[i] = this._indices[i];
        } else
          r = new t(this._indices);
        return r;
      }
      return null;
    }, e.prototype._getRawIdxIdentity = function(t) {
      return t;
    }, e.prototype._getRawIdx = function(t) {
      return t < this._count && t >= 0 ? this._indices[t] : -1;
    }, e.prototype._updateGetRawIdx = function() {
      this.getRawIndex = this._indices ? this._getRawIdx : this._getRawIdxIdentity;
    }, e.internalField = (function() {
      function t(r, n, i, a) {
        return Wc(r[a], this._dimensions[a]);
      }
      lL = {
        arrayRows: t,
        objectRows: function(r, n, i, a) {
          return Wc(r[n], this._dimensions[a]);
        },
        keyedColumns: t,
        original: function(r, n, i, a) {
          var o = r && (r.value == null ? r : r.value);
          return Wc(o instanceof Array ? o[a] : o, this._dimensions[a]);
        },
        typedArray: function(r, n, i, a) {
          return r[a];
        }
      };
    })(), e;
  })()
), T8 = (
  /** @class */
  (function() {
    function e(t) {
      this._sourceList = [], this._storeList = [], this._upstreamSignList = [], this._versionSignBase = 0, this._dirty = !0, this._sourceHost = t;
    }
    return e.prototype.dirty = function() {
      this._setLocalSource([], []), this._storeList = [], this._dirty = !0;
    }, e.prototype._setLocalSource = function(t, r) {
      this._sourceList = t, this._upstreamSignList = r, this._versionSignBase++, this._versionSignBase > 9e10 && (this._versionSignBase = 0);
    }, e.prototype._getVersionSign = function() {
      return this._sourceHost.uid + "_" + this._versionSignBase;
    }, e.prototype.prepareSource = function() {
      this._isDirty() && (this._createSource(), this._dirty = !1);
    }, e.prototype._createSource = function() {
      this._setLocalSource([], []);
      var t = this._sourceHost, r = this._getUpstreamSourceManagers(), n = !!r.length, i, a;
      if (jw(t)) {
        var o = t, s = void 0, l = void 0, u = void 0;
        if (n) {
          var f = r[0];
          f.prepareSource(), u = f.getSource(), s = u.data, l = u.sourceFormat, a = [f._getVersionSign()];
        } else
          s = o.get("data", !0), l = wa(s) ? Uc : Co, a = [];
        var c = this._getSourceMetaRawOption() || {}, h = u && u.metaRawOption || {}, v = et(c.seriesLayoutBy, h.seriesLayoutBy) || null, d = et(c.sourceHeader, h.sourceHeader), g = et(c.dimensions, h.dimensions), y = v !== h.seriesLayoutBy || !!d != !!h.sourceHeader || g;
        i = y ? [_P(s, {
          seriesLayoutBy: v,
          sourceHeader: d,
          dimensions: g
        }, l)] : [];
      } else {
        var x = t;
        if (n) {
          var S = this._applyTransform(r);
          i = S.sourceList, a = S.upstreamSignList;
        } else {
          var T = x.get("source", !0);
          i = [_P(T, this._getSourceMetaRawOption(), null)], a = [];
        }
      }
      this._setLocalSource(i, a);
    }, e.prototype._applyTransform = function(t) {
      var r = this._sourceHost, n = r.get("transform", !0), i = r.get("fromTransformResult", !0);
      if (i != null) {
        var a = "";
        t.length !== 1 && LB(a);
      }
      var o, s = [], l = [];
      return F(t, function(u) {
        u.prepareSource();
        var f = u.getSource(i || 0), c = "";
        i != null && !f && LB(c), s.push(f), l.push(u._getVersionSign());
      }), n ? o = Vte(n, s, {
        datasetIndex: r.componentIndex
      }) : i != null && (o = [wte(s[0])]), {
        sourceList: o,
        upstreamSignList: l
      };
    }, e.prototype._isDirty = function() {
      if (this._dirty)
        return !0;
      for (var t = this._getUpstreamSourceManagers(), r = 0; r < t.length; r++) {
        var n = t[r];
        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[r] !== n._getVersionSign()
        )
          return !0;
      }
    }, e.prototype.getSource = function(t) {
      t = t || 0;
      var r = this._sourceList[t];
      if (!r) {
        var n = this._getUpstreamSourceManagers();
        return n[0] && n[0].getSource(t);
      }
      return r;
    }, e.prototype.getSharedDataStore = function(t) {
      var r = t.makeStoreSchema();
      return this._innerGetDataStore(r.dimensions, t.source, r.hash);
    }, e.prototype._innerGetDataStore = function(t, r, 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];
        jw(this._sourceHost) && l ? s = l._innerGetDataStore(t, r, n) : (s = new xP(), s.initData(new v8(r, t.length), t)), o[n] = s;
      }
      return s;
    }, e.prototype._getUpstreamSourceManagers = function() {
      var t = this._sourceHost;
      if (jw(t)) {
        var r = eO(t);
        return r ? [r.getSourceManager()] : [];
      } else
        return Ce(Kee(t), function(n) {
          return n.getSourceManager();
        });
    }, e.prototype._getSourceMetaRawOption = function() {
      var t = this._sourceHost, r, n, i;
      if (jw(t))
        r = t.get("seriesLayoutBy", !0), n = t.get("sourceHeader", !0), i = t.get("dimensions", !0);
      else if (!this._getUpstreamSourceManagers().length) {
        var a = t;
        r = a.get("seriesLayoutBy", !0), n = a.get("sourceHeader", !0), i = a.get("dimensions", !0);
      }
      return {
        seriesLayoutBy: r,
        sourceHeader: n,
        dimensions: i
      };
    }, e;
  })()
);
function MB(e) {
  var t = e.option.transform;
  t && L1(e.option.transform);
}
function jw(e) {
  return e.mainType === "series";
}
function LB(e) {
  throw new Error(e);
}
var Yte = "line-height:1";
function b8(e) {
  var t = e.lineHeight;
  return t == null ? Yte : "line-height:" + _n(t + "") + "px";
}
function C8(e, t) {
  var r = e.color || fe.color.tertiary, n = e.fontSize || 12, i = e.fontWeight || "400", a = e.color || fe.color.secondary, o = e.fontSize || 14, s = e.fontWeight || "900";
  return t === "html" ? {
    // eslint-disable-next-line max-len
    nameStyle: "font-size:" + _n(n + "") + "px;color:" + _n(r) + ";font-weight:" + _n(i + ""),
    // eslint-disable-next-line max-len
    valueStyle: "font-size:" + _n(o + "") + "px;color:" + _n(a) + ";font-weight:" + _n(s + "")
  } : {
    nameStyle: {
      fontSize: n,
      fill: r,
      fontWeight: i
    },
    valueStyle: {
      fontSize: o,
      fill: a,
      fontWeight: s
    }
  };
}
var Zte = [0, 10, 20, 30], $te = ["", `
`, `

`, `


`];
function Rn(e, t) {
  return t.type = e, t;
}
function SP(e) {
  return e.type === "section";
}
function A8(e) {
  return SP(e) ? qte : jte;
}
function M8(e) {
  if (SP(e)) {
    var t = 0, r = e.blocks.length, n = r > 1 || r > 0 && !e.noHeader;
    return F(e.blocks, function(i) {
      var a = M8(i);
      a >= t && (t = a + +(n && // 0 always can not be readable gap level.
      (!a || SP(i) && !i.noHeader)));
    }), t;
  }
  return 0;
}
function qte(e, t, r, n) {
  var i = t.noHeader, a = Kte(M8(t)), o = [], s = t.blocks || [];
  Hi(!s || Se(s)), s = s || [];
  var l = e.orderMode;
  if (t.sortBlocks && l) {
    s = s.slice();
    var u = {
      valueAsc: "asc",
      valueDesc: "desc"
    };
    if (qe(u, l)) {
      var f = new _8(u[l], null);
      s.sort(function(g, y) {
        return f.evaluate(g.sortParam, y.sortParam);
      });
    } else l === "seriesDesc" && s.reverse();
  }
  F(s, function(g, y) {
    var x = t.valueFormatter, S = A8(g)(
      // Inherit valueFormatter
      x ? xe(xe({}, e), {
        valueFormatter: x
      }) : e,
      g,
      y > 0 ? a.html : 0,
      n
    );
    S != null && o.push(S);
  });
  var c = e.renderMode === "richText" ? o.join(a.richText) : wP(n, o.join(""), i ? r : a.html);
  if (i)
    return c;
  var h = pP(t.header, "ordinal", e.useUTC), v = C8(n, e.renderMode).nameStyle, d = b8(n);
  return e.renderMode === "richText" ? L8(e, h, v) + a.richText + c : wP(n, '<div style="' + v + ";" + d + ';">' + _n(h) + "</div>" + c, r);
}
function jte(e, t, r, n) {
  var i = e.renderMode, a = t.noName, o = t.noValue, s = !t.markerType, l = t.name, u = e.useUTC, f = t.valueFormatter || e.valueFormatter || function(C) {
    return C = Se(C) ? C : [C], Ce(C, function(A, M) {
      return pP(A, Se(v) ? v[M] : v, u);
    });
  };
  if (!(a && o)) {
    var c = s ? "" : e.markupStyleCreator.makeTooltipMarker(t.markerType, t.markerColor || fe.color.secondary, i), h = a ? "" : pP(l, "ordinal", u), v = t.valueType, d = o ? [] : f(t.value, t.dataIndex), g = !s || !a, y = !s && a, x = C8(n, i), S = x.nameStyle, T = x.valueStyle;
    return i === "richText" ? (s ? "" : c) + (a ? "" : L8(e, h, S)) + (o ? "" : ere(e, d, g, y, T)) : wP(n, (s ? "" : c) + (a ? "" : Qte(h, !s, S)) + (o ? "" : Jte(d, g, y, T)), r);
  }
}
function DB(e, t, r, n, i, a) {
  if (e) {
    var o = A8(e), s = {
      useUTC: i,
      renderMode: r,
      orderMode: n,
      markupStyleCreator: t,
      valueFormatter: e.valueFormatter
    };
    return o(s, e, 0, a);
  }
}
function Kte(e) {
  return {
    html: Zte[e],
    richText: $te[e]
  };
}
function wP(e, t, r) {
  var n = '<div style="clear:both"></div>', i = "margin: " + r + "px 0 0", a = b8(e);
  return '<div style="' + i + ";" + a + ';">' + t + n + "</div>";
}
function Qte(e, t, r) {
  var n = t ? "margin-left:2px" : "";
  return '<span style="' + r + ";" + n + '">' + _n(e) + "</span>";
}
function Jte(e, t, r, n) {
  var i = r ? "10px" : "20px", a = t ? "float:right;margin-left:" + i : "";
  return e = Se(e) ? e : [e], '<span style="' + a + ";" + n + '">' + Ce(e, function(o) {
    return _n(o);
  }).join("&nbsp;&nbsp;") + "</span>";
}
function L8(e, t, r) {
  return e.markupStyleCreator.wrapRichTextStyle(t, r);
}
function ere(e, t, r, n, i) {
  var a = [i], o = n ? 10 : 20;
  return r && a.push({
    padding: [0, 0, 0, o],
    align: "right"
  }), e.markupStyleCreator.wrapRichTextStyle(Se(t) ? t.join("  ") : t, a);
}
function D8(e, t) {
  var r = e.getData().getItemVisual(t, "style"), n = r[e.visualDrawType];
  return Ad(n);
}
function E8(e, t) {
  var r = e.get("padding");
  return r ?? (t === "richText" ? [8, 10] : 10);
}
var uL = (
  /** @class */
  (function() {
    function e() {
      this.richTextStyles = {}, this._nextStyleNameId = BU();
    }
    return e.prototype._generateStyleName = function() {
      return "__EC_aUTo_" + this._nextStyleNameId++;
    }, e.prototype.makeTooltipMarker = function(t, r, n) {
      var i = n === "richText" ? this._generateStyleName() : null, a = KR({
        color: r,
        type: t,
        renderMode: n,
        markerId: i
      });
      return Fe(a) ? a : (this.richTextStyles[i] = a.style, a.content);
    }, e.prototype.wrapRichTextStyle = function(t, r) {
      var n = {};
      Se(r) ? F(r, function(a) {
        return xe(n, a);
      }) : xe(n, r);
      var i = this._generateStyleName();
      return this.richTextStyles[i] = n, "{" + i + "|" + t + "}";
    }, e;
  })()
);
function P8(e) {
  var t = e.series, r = e.dataIndex, n = e.multipleSeries, i = t.getData(), a = i.mapDimensionsAll("defaultedTooltip"), o = a.length, s = t.getRawValue(r), l = Se(s), u = D8(t, r), f, c, h, v;
  if (o > 1 || l && !o) {
    var d = tre(s, t, r, a, u);
    f = d.inlineValues, c = d.inlineValueTypes, h = d.blocks, v = d.inlineValues[0];
  } else if (o) {
    var g = i.getDimensionInfo(a[0]);
    v = f = Cm(i, r, a[0]), c = g.type;
  } else
    v = f = l ? s[0] : s;
  var y = yR(t), x = y && t.name || "", S = i.getName(r), T = n ? x : S;
  return Rn("section", {
    header: x,
    // When series name is not specified, do not show a header line with only '-'.
    // This case always happens in tooltip.trigger: 'item'.
    noHeader: n || !y,
    sortParam: v,
    blocks: [Rn("nameValue", {
      markerType: "item",
      markerColor: u,
      // Do not mix display seriesName and itemName in one tooltip,
      // which might confuses users.
      name: T,
      // name dimension might be auto assigned, where the name might
      // be not readable. So we check trim here.
      noName: !_o(T),
      value: f,
      valueType: c,
      dataIndex: r
    })].concat(h || [])
  });
}
function tre(e, t, r, n, i) {
  var a = t.getData(), o = bo(e, function(c, h, v) {
    var d = a.getDimensionInfo(v);
    return c = c || d && d.tooltip !== !1 && d.displayName != null;
  }, !1), s = [], l = [], u = [];
  n.length ? F(n, function(c) {
    f(Cm(a, r, c), c);
  }) : F(e, f);
  function f(c, h) {
    var v = a.getDimensionInfo(h);
    !v || v.otherDims.tooltip === !1 || (o ? u.push(Rn("nameValue", {
      markerType: "subItem",
      markerColor: i,
      name: v.displayName,
      value: c,
      valueType: v.type
    })) : (s.push(c), l.push(v.type)));
  }
  return {
    inlineValues: s,
    inlineValueTypes: l,
    blocks: u
  };
}
var pc = Bt();
function Kw(e, t) {
  return e.getName(t) || e.getId(t);
}
var b2 = "__universalTransitionEnabled", Yt = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r._selectedDataIndicesMap = {}, r;
    }
    return t.prototype.init = function(r, n, i) {
      this.seriesIndex = this.componentIndex, this.dataTask = m1({
        count: nre,
        reset: ire
      }), this.dataTask.context = {
        model: this
      }, this.mergeDefaultAndTheme(r, i);
      var a = pc(this).sourceManager = new T8(this);
      a.prepareSource();
      var o = this.getInitialData(r, i);
      PB(o, this), this.dataTask.context.data = o, pc(this).dataBeforeProcessed = o, EB(this), this._initSelectedMapFromData(o);
    }, t.prototype.mergeDefaultAndTheme = function(r, n) {
      var i = V1(this), a = i ? Bd(r) : {}, o = this.subType;
      At.hasClass(o) && (o += "Series"), je(r, n.getTheme().get(this.subType)), je(r, this.getDefaultOption()), xd(r, "label", ["show"]), this.fillDataTextStyle(r.data), i && nu(r, a, i);
    }, t.prototype.mergeOption = function(r, n) {
      r = je(this.option, r, !0), this.fillDataTextStyle(r.data);
      var i = V1(this);
      i && nu(this.option, r, i);
      var a = pc(this).sourceManager;
      a.dirty(), a.prepareSource();
      var o = this.getInitialData(r, n);
      PB(o, this), this.dataTask.dirty(), this.dataTask.context.data = o, pc(this).dataBeforeProcessed = o, EB(this), this._initSelectedMapFromData(o);
    }, t.prototype.fillDataTextStyle = function(r) {
      if (r && !wa(r))
        for (var n = ["show"], i = 0; i < r.length; i++)
          r[i] && r[i].label && xd(r[i], "label", n);
    }, t.prototype.getInitialData = function(r, n) {
    }, t.prototype.appendData = function(r) {
      var n = this.getRawData();
      n.appendData(r.data);
    }, t.prototype.getData = function(r) {
      var n = TP(this);
      if (n) {
        var i = n.context.data;
        return r == null || !i.getLinkedData ? i : i.getLinkedData(r);
      } else
        return pc(this).data;
    }, t.prototype.getAllData = function() {
      var r = this.getData();
      return r && r.getLinkedDataAll ? r.getLinkedDataAll() : [{
        data: r
      }];
    }, t.prototype.setData = function(r) {
      var n = TP(this);
      if (n) {
        var i = n.context;
        i.outputData = r, n !== this.dataTask && (i.data = r);
      }
      pc(this).data = r;
    }, t.prototype.getEncode = function() {
      var r = this.get("encode", !0);
      if (r)
        return Je(r);
    }, t.prototype.getSourceManager = function() {
      return pc(this).sourceManager;
    }, t.prototype.getSource = function() {
      return this.getSourceManager().getSource();
    }, t.prototype.getRawData = function() {
      return pc(this).dataBeforeProcessed;
    }, t.prototype.getColorBy = function() {
      var r = this.get("colorBy");
      return r || "series";
    }, t.prototype.isColorBySeries = function() {
      return this.getColorBy() === "series";
    }, t.prototype.getBaseAxis = function() {
      var r = this.coordinateSystem;
      return r && r.getBaseAxis && r.getBaseAxis();
    }, t.prototype.indicesOfNearest = function(r, n, i, a) {
      var o = this.getData(), s = this.coordinateSystem, l = s && s.getAxis(r);
      if (!s || !l)
        return [];
      var u = l.dataToCoord(i);
      a == null && (a = 1 / 0);
      var f = [], c = 1 / 0, h = -1, v = 0;
      return o.each(n, function(d, g) {
        var y = l.dataToCoord(d), x = u - y, S = Math.abs(x);
        S <= a && ((S < c || S === c && x >= 0 && h < 0) && (c = S, h = x, v = 0), x === h && (f[v++] = g));
      }), f.length = v, f;
    }, t.prototype.formatTooltip = function(r, n, i) {
      return P8({
        series: this,
        dataIndex: r,
        multipleSeries: n
      });
    }, t.prototype.isAnimationEnabled = function() {
      var r = this.ecModel;
      if (Gt.node && !(r && r.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(r, n, i) {
      var a = this.ecModel, o = tO.prototype.getColorFromPalette.call(this, r, n, i);
      return o || (o = a.getColorFromPalette(r, n, i)), o;
    }, t.prototype.coordDimToDataDim = function(r) {
      return this.getRawData().mapDimensionsAll(r);
    }, t.prototype.getProgressive = function() {
      return this.get("progressive");
    }, t.prototype.getProgressiveThreshold = function() {
      return this.get("progressiveThreshold");
    }, t.prototype.select = function(r, n) {
      this._innerSelect(this.getData(n), r);
    }, t.prototype.unselect = function(r, 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 < r.length; s++) {
          var l = r[s], u = Kw(o, l);
          i[u] = !1, this._selectedDataIndicesMap[u] = -1;
        }
      }
    }, t.prototype.toggleSelect = function(r, n) {
      for (var i = [], a = 0; a < r.length; a++)
        i[0] = r[a], this.isSelected(r[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 r = this._selectedDataIndicesMap, n = Ht(r), i = [], a = 0; a < n.length; a++) {
        var o = r[n[a]];
        o >= 0 && i.push(o);
      }
      return i;
    }, t.prototype.isSelected = function(r, n) {
      var i = this.option.selectedMap;
      if (!i)
        return !1;
      var a = this.getData(n);
      return (i === "all" || i[Kw(a, r)]) && !a.getItemModel(r).get(["select", "disabled"]);
    }, t.prototype.isUniversalTransitionEnabled = function() {
      if (this[b2])
        return !0;
      var r = this.option.universalTransition;
      return r ? r === !0 ? !0 : r && r.enabled : !1;
    }, t.prototype._innerSelect = function(r, 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") {
          ot(o.selectedMap) || (o.selectedMap = {});
          for (var u = o.selectedMap, f = 0; f < l; f++) {
            var c = n[f], h = Kw(r, c);
            u[h] = !0, this._selectedDataIndicesMap[h] = r.getRawIndex(c);
          }
        } else if (s === "single" || s === !0) {
          var v = n[l - 1], h = Kw(r, v);
          o.selectedMap = (i = {}, i[h] = !0, i), this._selectedDataIndicesMap = (a = {}, a[h] = r.getRawIndex(v), a);
        }
      }
    }, t.prototype._initSelectedMapFromData = function(r) {
      if (!this.option.selectedMap) {
        var n = [];
        r.hasItemOption && r.each(function(i) {
          var a = r.getRawDataItem(i);
          a && a.selected && n.push(i);
        }), n.length > 0 && this._innerSelect(r, n);
      }
    }, t.registerClass = function(r) {
      return At.registerClass(r);
    }, t.protoInitialize = (function() {
      var r = t.prototype;
      r.type = "series.__base__", r.seriesIndex = 0, r.ignoreStyleOnData = !1, r.hasSymbolVisual = !1, r.defaultSymbol = "circle", r.visualStyleAccessPath = "itemStyle", r.visualDrawType = "fill";
    })(), t;
  })(At)
);
cn(Yt, RC);
cn(Yt, tO);
ZU(Yt, At);
function EB(e) {
  var t = e.name;
  yR(e) || (e.name = rre(e) || t);
}
function rre(e) {
  var t = e.getRawData(), r = t.mapDimensionsAll("seriesName"), n = [];
  return F(r, function(i) {
    var a = t.getDimensionInfo(i);
    a.displayName && n.push(a.displayName);
  }), n.join(" ");
}
function nre(e) {
  return e.model.getRawData().count();
}
function ire(e) {
  var t = e.model;
  return t.setData(t.getRawData().cloneShallow()), are;
}
function are(e, t) {
  t.outputData && e.end > t.outputData.count() && t.model.getRawData().cloneShallow(t.outputData);
}
function PB(e, t) {
  F(_m(e.CHANGABLE_METHODS, e.DOWNSAMPLE_METHODS), function(r) {
    e.wrapMethod(r, St(ore, t));
  });
}
function ore(e, t) {
  var r = TP(e);
  return r && r.setOutputEnd((t || this).count()), t;
}
function TP(e) {
  var t = (e.ecModel || {}).scheduler, r = t && t.getPipeline(e.uid);
  if (r) {
    var n = r.currentTask;
    if (n) {
      var i = n.agentStubMap;
      i && (n = i.get(e.uid));
    }
    return n;
  }
}
var fr = (
  /** @class */
  (function() {
    function e() {
      this.group = new rt(), this.uid = ty("viewComponent");
    }
    return e.prototype.init = function(t, r) {
    }, e.prototype.render = function(t, r, n, i) {
    }, e.prototype.dispose = function(t, r) {
    }, e.prototype.updateView = function(t, r, n, i) {
    }, e.prototype.updateLayout = function(t, r, n, i) {
    }, e.prototype.updateVisual = function(t, r, n, i) {
    }, e.prototype.toggleBlurSeries = function(t, r, n) {
    }, e.prototype.eachRendered = function(t) {
      var r = this.group;
      r && r.traverse(t);
    }, e;
  })()
);
xR(fr);
_C(fr);
function iy() {
  var e = Bt();
  return function(t) {
    var r = e(t), n = t.pipelineContext, i = !!r.large, a = !!r.progressiveRender, o = r.large = !!(n && n.large), s = r.progressiveRender = !!(n && n.progressiveRender);
    return (i !== o || a !== s) && "reset";
  };
}
var I8 = Bt(), sre = iy(), Ut = (
  /** @class */
  (function() {
    function e() {
      this.group = new rt(), this.uid = ty("viewChart"), this.renderTask = m1({
        plan: lre,
        reset: ure
      }), this.renderTask.context = {
        view: this
      };
    }
    return e.prototype.init = function(t, r) {
    }, e.prototype.render = function(t, r, n, i) {
    }, e.prototype.highlight = function(t, r, n, i) {
      var a = t.getData(i && i.dataType);
      a && RB(a, i, "emphasis");
    }, e.prototype.downplay = function(t, r, n, i) {
      var a = t.getData(i && i.dataType);
      a && RB(a, i, "normal");
    }, e.prototype.remove = function(t, r) {
      this.group.removeAll();
    }, e.prototype.dispose = function(t, r) {
    }, e.prototype.updateView = function(t, r, n, i) {
      this.render(t, r, n, i);
    }, e.prototype.updateLayout = function(t, r, n, i) {
      this.render(t, r, n, i);
    }, e.prototype.updateVisual = function(t, r, n, i) {
      this.render(t, r, n, i);
    }, e.prototype.eachRendered = function(t) {
      rh(this.group, t);
    }, e.markUpdateMethod = function(t, r) {
      I8(t).updateMethod = r;
    }, e.protoInitialize = (function() {
      var t = e.prototype;
      t.type = "chart";
    })(), e;
  })()
);
function IB(e, t, r) {
  e && B1(e) && (t === "emphasis" ? mf : yf)(e, r);
}
function RB(e, t, r) {
  var n = Sd(e, t), i = t && t.highlightKey != null ? BJ(t.highlightKey) : null;
  n != null ? F(Mr(n), function(a) {
    IB(e.getItemGraphicEl(a), r, i);
  }) : e.eachItemGraphicEl(function(a) {
    IB(a, r, i);
  });
}
xR(Ut);
_C(Ut);
function lre(e) {
  return sre(e.model);
}
function ure(e) {
  var t = e.model, r = e.ecModel, n = e.api, i = e.payload, a = t.pipelineContext.progressiveRender, o = e.view, s = i && I8(i).updateMethod, l = a ? "incrementalPrepareRender" : s && o[s] ? s : "render";
  return l !== "render" && o[l](t, r, n, i), fre[l];
}
var fre = {
  incrementalPrepareRender: {
    progress: function(e, t) {
      t.view.incrementalRender(e, 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(e, t) {
      t.view.render(t.model, t.ecModel, t.api, t.payload);
    }
  }
}, ab = "\0__throttleOriginMethod", OB = "\0__throttleRate", NB = "\0__throttleType";
function NC(e, t, r) {
  var n, i = 0, a = 0, o = null, s, l, u, f;
  t = t || 0;
  function c() {
    a = (/* @__PURE__ */ new Date()).getTime(), o = null, e.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 g = f || t, y = f || r;
    f = null, s = n - (y ? i : a) - g, clearTimeout(o), y ? o = setTimeout(c, g) : s >= 0 ? c() : o = setTimeout(c, -s), i = n;
  };
  return h.clear = function() {
    o && (clearTimeout(o), o = null);
  }, h.debounceNextCall = function(v) {
    f = v;
  }, h;
}
function ay(e, t, r, n) {
  var i = e[t];
  if (i) {
    var a = i[ab] || i, o = i[NB], s = i[OB];
    if (s !== r || o !== n) {
      if (r == null || !n)
        return e[t] = a;
      i = e[t] = NC(a, r, n === "debounce"), i[ab] = a, i[NB] = n, i[OB] = r;
    }
    return i;
  }
}
function U1(e, t) {
  var r = e[t];
  r && r[ab] && (r.clear && r.clear(), e[t] = r[ab]);
}
var kB = Bt(), BB = {
  itemStyle: wd(OW, !0),
  lineStyle: wd(RW, !0)
}, cre = {
  lineStyle: "stroke",
  itemStyle: "fill"
};
function R8(e, t) {
  var r = e.visualStyleMapper || BB[t];
  return r || (console.warn("Unknown style type '" + t + "'."), BB.itemStyle);
}
function O8(e, t) {
  var r = e.visualDrawType || cre[t];
  return r || (console.warn("Unknown style type '" + t + "'."), "fill");
}
var hre = {
  createOnAllSeries: !0,
  performRawSeries: !0,
  reset: function(e, t) {
    var r = e.getData(), n = e.visualStyleAccessPath || "itemStyle", i = e.getModel(n), a = R8(e, n), o = a(i), s = i.getShallow("decal");
    s && (r.setVisual("decal", s), s.dirty = !0);
    var l = O8(e, n), u = o[l], f = nt(u) ? u : null, c = o.fill === "auto" || o.stroke === "auto";
    if (!o[l] || f || c) {
      var h = e.getColorFromPalette(
        // TODO series count changed.
        e.name,
        null,
        t.getSeriesCount()
      );
      o[l] || (o[l] = h, r.setVisual("colorFromPalette", !0)), o.fill = o.fill === "auto" || nt(o.fill) ? h : o.fill, o.stroke = o.stroke === "auto" || nt(o.stroke) ? h : o.stroke;
    }
    if (r.setVisual("style", o), r.setVisual("drawType", l), !t.isSeriesFiltered(e) && f)
      return r.setVisual("colorFromPalette", !1), {
        dataEach: function(v, d) {
          var g = e.getDataParams(d), y = xe({}, o);
          y[l] = f(g), v.setItemVisual(d, "style", y);
        }
      };
  }
}, n_ = new It(), vre = {
  createOnAllSeries: !0,
  performRawSeries: !0,
  reset: function(e, t) {
    if (!(e.ignoreStyleOnData || t.isSeriesFiltered(e))) {
      var r = e.getData(), n = e.visualStyleAccessPath || "itemStyle", i = R8(e, n), a = r.getVisual("drawType");
      return {
        dataEach: r.hasItemOption ? function(o, s) {
          var l = o.getRawDataItem(s);
          if (l && l[n]) {
            n_.option = l[n];
            var u = i(n_), f = o.ensureUniqueItemVisual(s, "style");
            xe(f, u), n_.option.decal && (o.setItemVisual(s, "decal", n_.option.decal), n_.option.decal.dirty = !0), a in u && o.setItemVisual(s, "colorFromPalette", !1);
          }
        } : null
      };
    }
  }
}, dre = {
  performRawSeries: !0,
  overallReset: function(e) {
    var t = Je();
    e.eachSeries(function(r) {
      var n = r.getColorBy();
      if (!r.isColorBySeries()) {
        var i = r.type + "-" + n, a = t.get(i);
        a || (a = {}, t.set(i, a)), kB(r).scope = a;
      }
    }), e.eachSeries(function(r) {
      if (!(r.isColorBySeries() || e.isSeriesFiltered(r))) {
        var n = r.getRawData(), i = {}, a = r.getData(), o = kB(r).scope, s = r.visualStyleAccessPath || "itemStyle", l = O8(r, s);
        a.each(function(u) {
          var f = a.getRawIndex(u);
          i[f] = u;
        }), n.each(function(u) {
          var f = i[u], c = a.getItemVisual(f, "colorFromPalette");
          if (c) {
            var h = a.ensureUniqueItemVisual(f, "style"), v = n.getName(u) || u + "", d = n.count();
            h[l] = r.getColorFromPalette(v, o, d);
          }
        });
      }
    });
  }
}, Qw = Math.PI;
function pre(e, t) {
  t = t || {}, tt(t, {
    text: "loading",
    textColor: fe.color.primary,
    fontSize: 12,
    fontWeight: "normal",
    fontStyle: "normal",
    fontFamily: "sans-serif",
    maskColor: "rgba(255,255,255,0.8)",
    showSpinner: !0,
    color: fe.color.theme[0],
    spinnerRadius: 10,
    lineWidth: 5,
    zlevel: 0
  });
  var r = new rt(), n = new Mt({
    style: {
      fill: t.maskColor
    },
    zlevel: t.zlevel,
    z: 1e4
  });
  r.add(n);
  var i = new Rt({
    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 Mt({
    style: {
      fill: "none"
    },
    textContent: i,
    textConfig: {
      position: "right",
      distance: 10
    },
    zlevel: t.zlevel,
    z: 10001
  });
  r.add(a);
  var o;
  return t.showSpinner && (o = new Mx({
    shape: {
      startAngle: -Qw / 2,
      endAngle: -Qw / 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: Qw * 3 / 2
  }).start("circularInOut"), o.animateShape(!0).when(1e3, {
    startAngle: Qw * 3 / 2
  }).delay(300).start("circularInOut"), r.add(o)), r.resize = function() {
    var s = i.getBoundingRect().width, l = t.showSpinner ? t.spinnerRadius : 0, u = (e.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), f = e.getHeight() / 2;
    t.showSpinner && o.setShape({
      cx: u,
      cy: f
    }), a.setShape({
      x: u - l,
      y: f - l,
      width: l * 2,
      height: l * 2
    }), n.setShape({
      x: 0,
      y: 0,
      width: e.getWidth(),
      height: e.getHeight()
    });
  }, r.resize(), r;
}
var N8 = (
  /** @class */
  (function() {
    function e(t, r, n, i) {
      this._stageTaskMap = Je(), this.ecInstance = t, this.api = r, n = this._dataProcessorHandlers = n.slice(), i = this._visualHandlers = i.slice(), this._allHandlers = n.concat(i);
    }
    return e.prototype.restoreData = function(t, r) {
      t.restoreData(r), this._stageTaskMap.each(function(n) {
        var i = n.overallTask;
        i && i.dirty();
      });
    }, e.prototype.getPerformArgs = function(t, r) {
      if (t.__pipeline) {
        var n = this._pipelineMap.get(t.__pipeline.id), i = n.context, a = !r && 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
        };
      }
    }, e.prototype.getPipeline = function(t) {
      return this._pipelineMap.get(t);
    }, e.prototype.updateStreamModes = function(t, r) {
      var n = this._pipelineMap.get(t.uid), i = t.getData(), a = i.count(), o = n.progressiveEnabled && r.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
      };
    }, e.prototype.restorePipelines = function(t) {
      var r = this, n = r._pipelineMap = Je();
      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
        }), r._pipe(i, i.dataTask);
      });
    }, e.prototype.prepareStageTasks = function() {
      var t = this._stageTaskMap, r = this.api.getModel(), n = this.api;
      F(this._allHandlers, function(i) {
        var a = t.get(i.uid) || t.set(i.uid, {}), o = "";
        Hi(!(i.reset && i.overallReset), o), i.reset && this._createSeriesStageTask(i, a, r, n), i.overallReset && this._createOverallStageTask(i, a, r, n);
      }, this);
    }, e.prototype.prepareView = function(t, r, n, i) {
      var a = t.renderTask, o = a.context;
      o.model = r, o.ecModel = n, o.api = i, a.__block = !t.incrementalPrepareRender, this._pipe(r, a);
    }, e.prototype.performDataProcessorTasks = function(t, r) {
      this._performStageTasks(this._dataProcessorHandlers, t, r, {
        block: !0
      });
    }, e.prototype.performVisualTasks = function(t, r, n) {
      this._performStageTasks(this._visualHandlers, t, r, n);
    }, e.prototype._performStageTasks = function(t, r, n, i) {
      i = i || {};
      var a = !1, o = this;
      F(t, function(l, u) {
        if (!(i.visualType && i.visualType !== l.visualType)) {
          var f = o._stageTaskMap.get(l.uid), c = f.seriesTaskMap, h = f.overallTask;
          if (h) {
            var v, d = h.agentStubMap;
            d.each(function(y) {
              s(i, y) && (y.dirty(), v = !0);
            }), v && h.dirty(), o.updatePayload(h, n);
            var g = o.getPerformArgs(h, i.block);
            d.each(function(y) {
              y.perform(g);
            }), h.perform(g) && (a = !0);
          } else c && c.each(function(y, x) {
            s(i, y) && y.dirty();
            var S = o.getPerformArgs(y, i.block);
            S.skip = !l.performRawSeries && r.isSeriesFiltered(y.context.model), o.updatePayload(y, n), y.perform(S) && (a = !0);
          });
        }
      });
      function s(l, u) {
        return l.setDirty && (!l.dirtyMap || l.dirtyMap.get(u.__pipeline.id));
      }
      this.unfinished = a || this.unfinished;
    }, e.prototype.performSeriesTasks = function(t) {
      var r;
      t.eachSeries(function(n) {
        r = n.dataTask.perform() || r;
      }), this.unfinished = r || this.unfinished;
    }, e.prototype.plan = function() {
      this._pipelineMap.each(function(t) {
        var r = t.tail;
        do {
          if (r.__block) {
            t.blockIndex = r.__idxInPipeline;
            break;
          }
          r = r.getUpstream();
        } while (r);
      });
    }, e.prototype.updatePayload = function(t, r) {
      r !== "remain" && (t.context.payload = r);
    }, e.prototype._createSeriesStageTask = function(t, r, n, i) {
      var a = this, o = r.seriesTaskMap, s = r.seriesTaskMap = Je(), l = t.seriesType, u = t.getTargetSeries;
      t.createOnAllSeries ? n.eachRawSeries(f) : l ? n.eachRawSeriesByType(l, f) : u && u(n, i).each(f);
      function f(c) {
        var h = c.uid, v = s.set(h, o && o.get(h) || m1({
          plan: xre,
          reset: Sre,
          count: Tre
        }));
        v.context = {
          model: c,
          ecModel: n,
          api: i,
          // PENDING: `useClearVisual` not used?
          useClearVisual: t.isVisual && !t.isLayout,
          plan: t.plan,
          reset: t.reset,
          scheduler: a
        }, a._pipe(c, v);
      }
    }, e.prototype._createOverallStageTask = function(t, r, n, i) {
      var a = this, o = r.overallTask = r.overallTask || m1({
        reset: gre
      });
      o.context = {
        ecModel: n,
        api: i,
        overallReset: t.overallReset,
        scheduler: a
      };
      var s = o.agentStubMap, l = o.agentStubMap = Je(), u = t.seriesType, f = t.getTargetSeries, c = !0, h = !1, v = "";
      Hi(!t.createOnAllSeries, v), u ? n.eachRawSeriesByType(u, d) : f ? f(n, i).each(d) : (c = !1, F(n.getSeries(), d));
      function d(g) {
        var y = g.uid, x = l.set(y, s && s.get(y) || // When the result of `getTargetSeries` changed, the overallTask
        // should be set as dirty and re-performed.
        (h = !0, m1({
          reset: mre,
          onDirty: _re
        })));
        x.context = {
          model: g,
          overallProgress: c
          // FIXME:TS never used, so comment it
          // modifyOutputEnd: modifyOutputEnd
        }, x.agent = o, x.__block = c, a._pipe(g, x);
      }
      h && o.dirty();
    }, e.prototype._pipe = function(t, r) {
      var n = t.uid, i = this._pipelineMap.get(n);
      !i.head && (i.head = r), i.tail && i.tail.pipe(r), i.tail = r, r.__idxInPipeline = i.count++, r.__pipeline = i;
    }, e.wrapStageHandler = function(t, r) {
      return nt(t) && (t = {
        overallReset: t,
        seriesType: bre(t)
      }), t.uid = ty("stageHandler"), r && (t.visualType = r), t;
    }, e;
  })()
);
function gre(e) {
  e.overallReset(e.ecModel, e.api, e.payload);
}
function mre(e) {
  return e.overallProgress && yre;
}
function yre() {
  this.agent.dirty(), this.getDownstream().dirty();
}
function _re() {
  this.agent && this.agent.dirty();
}
function xre(e) {
  return e.plan ? e.plan(e.model, e.ecModel, e.api, e.payload) : null;
}
function Sre(e) {
  e.useClearVisual && e.data.clearAllVisual();
  var t = e.resetDefines = Mr(e.reset(e.model, e.ecModel, e.api, e.payload));
  return t.length > 1 ? Ce(t, function(r, n) {
    return k8(n);
  }) : wre;
}
var wre = k8(0);
function k8(e) {
  return function(t, r) {
    var n = r.data, i = r.resetDefines[e];
    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 Tre(e) {
  return e.data.count();
}
function bre(e) {
  ob = null;
  try {
    e(W1, B8);
  } catch {
  }
  return ob;
}
var W1 = {}, B8 = {}, ob;
z8(W1, rO);
z8(B8, l8);
W1.eachSeriesByType = W1.eachRawSeriesByType = function(e) {
  ob = e;
};
W1.eachComponent = function(e) {
  e.mainType === "series" && e.subType && (ob = e.subType);
};
function z8(e, t) {
  for (var r in t.prototype)
    e[r] = un;
}
var ct = fe.darkColor, Cre = ct.background, i_ = function() {
  return {
    axisLine: {
      lineStyle: {
        color: ct.axisLine
      }
    },
    splitLine: {
      lineStyle: {
        color: ct.axisSplitLine
      }
    },
    splitArea: {
      areaStyle: {
        color: [ct.backgroundTint, ct.backgroundTransparent]
      }
    },
    minorSplitLine: {
      lineStyle: {
        color: ct.axisMinorSplitLine
      }
    },
    axisLabel: {
      color: ct.axisLabel
    },
    axisName: {}
  };
}, zB = {
  label: {
    color: ct.secondary
  },
  itemStyle: {
    borderColor: ct.borderTint
  },
  dividerLineStyle: {
    color: ct.border
  }
}, F8 = {
  darkMode: !0,
  color: ct.theme,
  backgroundColor: Cre,
  axisPointer: {
    lineStyle: {
      color: ct.border
    },
    crossStyle: {
      color: ct.borderShade
    },
    label: {
      color: ct.tertiary
    }
  },
  legend: {
    textStyle: {
      color: ct.secondary
    },
    pageTextStyle: {
      color: ct.tertiary
    }
  },
  textStyle: {
    color: ct.secondary
  },
  title: {
    textStyle: {
      color: ct.primary
    },
    subtextStyle: {
      color: ct.quaternary
    }
  },
  toolbox: {
    iconStyle: {
      borderColor: ct.accent50
    }
  },
  tooltip: {
    backgroundColor: ct.neutral20,
    defaultBorderColor: ct.border,
    textStyle: {
      color: ct.tertiary
    }
  },
  dataZoom: {
    borderColor: ct.accent10,
    textStyle: {
      color: ct.tertiary
    },
    brushStyle: {
      color: ct.backgroundTint
    },
    handleStyle: {
      color: ct.neutral00,
      borderColor: ct.accent20
    },
    moveHandleStyle: {
      color: ct.accent40
    },
    emphasis: {
      handleStyle: {
        borderColor: ct.accent50
      }
    },
    dataBackground: {
      lineStyle: {
        color: ct.accent30
      },
      areaStyle: {
        color: ct.accent20
      }
    },
    selectedDataBackground: {
      lineStyle: {
        color: ct.accent50
      },
      areaStyle: {
        color: ct.accent30
      }
    }
  },
  visualMap: {
    textStyle: {
      color: ct.secondary
    },
    handleStyle: {
      borderColor: ct.neutral30
    }
  },
  timeline: {
    lineStyle: {
      color: ct.accent10
    },
    label: {
      color: ct.tertiary
    },
    controlStyle: {
      color: ct.accent30,
      borderColor: ct.accent30
    }
  },
  calendar: {
    itemStyle: {
      color: ct.neutral00,
      borderColor: ct.neutral20
    },
    dayLabel: {
      color: ct.tertiary
    },
    monthLabel: {
      color: ct.secondary
    },
    yearLabel: {
      color: ct.secondary
    }
  },
  matrix: {
    x: zB,
    y: zB,
    backgroundColor: {
      borderColor: ct.axisLine
    },
    body: {
      itemStyle: {
        borderColor: ct.borderTint
      }
    }
  },
  timeAxis: i_(),
  logAxis: i_(),
  valueAxis: i_(),
  categoryAxis: i_(),
  line: {
    symbol: "circle"
  },
  graph: {
    color: ct.theme
  },
  gauge: {
    title: {
      color: ct.secondary
    },
    axisLine: {
      lineStyle: {
        color: [[1, ct.neutral05]]
      }
    },
    axisLabel: {
      color: ct.axisLabel
    },
    detail: {
      color: ct.primary
    }
  },
  candlestick: {
    itemStyle: {
      color: "#f64e56",
      color0: "#54ea92",
      borderColor: "#f64e56",
      borderColor0: "#54ea92"
      // borderColor: '#ca2824',
      // borderColor0: '#09a443'
    }
  },
  funnel: {
    itemStyle: {
      borderColor: ct.background
    }
  },
  radar: (function() {
    var e = i_();
    return e.axisName = {
      color: ct.axisLabel
    }, e.axisLine.lineStyle.color = ct.neutral20, e;
  })(),
  treemap: {
    breadcrumb: {
      itemStyle: {
        color: ct.neutral20,
        textStyle: {
          color: ct.secondary
        }
      },
      emphasis: {
        itemStyle: {
          color: ct.neutral30
        }
      }
    }
  },
  sunburst: {
    itemStyle: {
      borderColor: ct.background
    }
  },
  map: {
    itemStyle: {
      borderColor: ct.border,
      areaColor: ct.neutral10
    },
    label: {
      color: ct.tertiary
    },
    emphasis: {
      label: {
        color: ct.primary
      },
      itemStyle: {
        areaColor: ct.highlight
      }
    },
    select: {
      label: {
        color: ct.primary
      },
      itemStyle: {
        areaColor: ct.highlight
      }
    }
  },
  geo: {
    itemStyle: {
      borderColor: ct.border,
      areaColor: ct.neutral10
    },
    emphasis: {
      label: {
        color: ct.primary
      },
      itemStyle: {
        areaColor: ct.highlight
      }
    },
    select: {
      label: {
        color: ct.primary
      },
      itemStyle: {
        color: ct.highlight
      }
    }
  }
};
F8.categoryAxis.splitLine.show = !1;
var Are = (
  /** @class */
  (function() {
    function e() {
    }
    return e.prototype.normalizeQuery = function(t) {
      var r = {}, n = {}, i = {};
      if (Fe(t)) {
        var a = Ul(t);
        r.mainType = a.main || null, r.subType = a.sub || null;
      } else {
        var o = ["Index", "Name", "Id"], s = {
          name: 1,
          dataIndex: 1,
          dataType: 1
        };
        F(t, function(l, u) {
          for (var f = !1, c = 0; c < o.length; c++) {
            var h = o[c], v = u.lastIndexOf(h);
            if (v > 0 && v === u.length - h.length) {
              var d = u.slice(0, v);
              d !== "data" && (r.mainType = d, r[h.toLowerCase()] = l, f = !0);
            }
          }
          s.hasOwnProperty(u) && (n[u] = l, f = !0), f || (i[u] = l);
        });
      }
      return {
        cptQuery: r,
        dataQuery: n,
        otherQuery: i
      };
    }, e.prototype.filter = function(t, r) {
      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 = r.cptQuery, u = r.dataQuery;
      return f(l, o, "mainType") && f(l, o, "subType") && f(l, o, "index", "componentIndex") && f(l, o, "name") && f(l, o, "id") && f(u, a, "name") && f(u, a, "dataIndex") && f(u, a, "dataType") && (!s.filterForExposedEvent || s.filterForExposedEvent(t, r.otherQuery, i, a));
      function f(c, h, v, d) {
        return c[v] == null || h[d || v] === c[v];
      }
    }, e.prototype.afterTrigger = function() {
      this.eventInfo = null;
    }, e;
  })()
), bP = ["symbol", "symbolSize", "symbolRotate", "symbolOffset"], FB = bP.concat(["symbolKeepAspect"]), Mre = {
  createOnAllSeries: !0,
  // For legend.
  performRawSeries: !0,
  reset: function(e, t) {
    var r = e.getData();
    if (e.legendIcon && r.setVisual("legendIcon", e.legendIcon), !e.hasSymbolVisual)
      return;
    for (var n = {}, i = {}, a = !1, o = 0; o < bP.length; o++) {
      var s = bP[o], l = e.get(s);
      nt(l) ? (a = !0, i[s] = l) : n[s] = l;
    }
    if (n.symbol = n.symbol || e.defaultSymbol, r.setVisual(xe({
      legendIcon: e.legendIcon || n.symbol,
      symbolKeepAspect: e.get("symbolKeepAspect")
    }, n)), t.isSeriesFiltered(e))
      return;
    var u = Ht(i);
    function f(c, h) {
      for (var v = e.getRawValue(h), d = e.getDataParams(h), g = 0; g < u.length; g++) {
        var y = u[g];
        c.setItemVisual(h, y, i[y](v, d));
      }
    }
    return {
      dataEach: a ? f : null
    };
  }
}, Lre = {
  createOnAllSeries: !0,
  // For legend.
  performRawSeries: !0,
  reset: function(e, t) {
    if (!e.hasSymbolVisual || t.isSeriesFiltered(e))
      return;
    var r = e.getData();
    function n(i, a) {
      for (var o = i.getItemModel(a), s = 0; s < FB.length; s++) {
        var l = FB[s], u = o.getShallow(l, !0);
        u != null && i.setItemVisual(a, l, u);
      }
    }
    return {
      dataEach: r.hasItemOption ? n : null
    };
  }
};
function sO(e, t, r) {
  switch (r) {
    case "color":
      var n = e.getItemVisual(t, "style");
      return n[e.getVisual("drawType")];
    case "opacity":
      return e.getItemVisual(t, "style").opacity;
    case "symbol":
    case "symbolSize":
    case "liftZ":
      return e.getItemVisual(t, r);
  }
}
function Px(e, t) {
  switch (t) {
    case "color":
      var r = e.getVisual("style");
      return r[e.getVisual("drawType")];
    case "opacity":
      return e.getVisual("style").opacity;
    case "symbol":
    case "symbolSize":
    case "liftZ":
      return e.getVisual(t);
  }
}
function G8(e, t, r, n) {
  switch (r) {
    case "color":
      var i = e.ensureUniqueItemVisual(t, "style");
      i[e.getVisual("drawType")] = n, e.setItemVisual(t, "colorFromPalette", !1);
      break;
    case "opacity":
      e.ensureUniqueItemVisual(t, "style").opacity = n;
      break;
    case "symbol":
    case "symbolSize":
    case "liftZ":
      e.setItemVisual(t, r, n);
      break;
  }
}
function V8(e, t) {
  function r(n, i) {
    var a = [];
    return n.eachComponent({
      mainType: "series",
      subType: e,
      query: i
    }, function(o) {
      a.push(o.seriesIndex);
    }), a;
  }
  F([[e + "ToggleSelect", "toggleSelect"], [e + "Select", "select"], [e + "UnSelect", "unselect"]], function(n) {
    t(n[0], function(i, a, o) {
      i = xe({}, i), o.dispatchAction(xe(i, {
        type: n[1],
        seriesIndex: r(a, i)
      }));
    });
  });
}
function Cg(e, t, r, n, i) {
  var a = e + t;
  r.isSilent(a) || n.eachComponent({
    mainType: "series",
    subType: "pie"
  }, function(o) {
    for (var s = o.seriesIndex, l = o.option.selectedMap, u = i.selected, f = 0; f < u.length; f++)
      if (u[f].seriesIndex === s) {
        var c = o.getData(), h = Sd(c, i.fromActionPayload);
        r.trigger(a, {
          type: a,
          seriesId: o.id,
          name: Se(h) ? c.getName(h[0]) : c.getName(h),
          selected: Fe(l) ? l : xe({}, l)
        });
      }
  });
}
function Dre(e, t, r) {
  e.on("selectchanged", function(n) {
    var i = r.getModel();
    n.isFromClick ? (Cg("map", "selectchanged", t, i, n), Cg("pie", "selectchanged", t, i, n)) : n.fromAction === "select" ? (Cg("map", "selected", t, i, n), Cg("pie", "selected", t, i, n)) : n.fromAction === "unselect" && (Cg("map", "unselected", t, i, n), Cg("pie", "unselected", t, i, n));
  });
}
function id(e, t, r) {
  for (var n; e && !(t(e) && (n = e, r)); )
    e = e.__hostTarget || e.parent;
  return n;
}
var Ere = Math.round(Math.random() * 9), Pre = typeof Object.defineProperty == "function", Ire = (function() {
  function e() {
    this._id = "__ec_inner_" + Ere++;
  }
  return e.prototype.get = function(t) {
    return this._guard(t)[this._id];
  }, e.prototype.set = function(t, r) {
    var n = this._guard(t);
    return Pre ? Object.defineProperty(n, this._id, {
      value: r,
      enumerable: !1,
      configurable: !0
    }) : n[this._id] = r, this;
  }, e.prototype.delete = function(t) {
    return this.has(t) ? (delete this._guard(t)[this._id], !0) : !1;
  }, e.prototype.has = function(t) {
    return !!this._guard(t)[this._id];
  }, e.prototype._guard = function(t) {
    if (t !== Object(t))
      throw TypeError("Value of WeakMap is not a non-null object.");
    return t;
  }, e;
})(), Rre = zt.extend({
  type: "triangle",
  shape: {
    cx: 0,
    cy: 0,
    width: 0,
    height: 0
  },
  buildPath: function(e, t) {
    var r = t.cx, n = t.cy, i = t.width / 2, a = t.height / 2;
    e.moveTo(r, n - a), e.lineTo(r + i, n + a), e.lineTo(r - i, n + a), e.closePath();
  }
}), Ore = zt.extend({
  type: "diamond",
  shape: {
    cx: 0,
    cy: 0,
    width: 0,
    height: 0
  },
  buildPath: function(e, t) {
    var r = t.cx, n = t.cy, i = t.width / 2, a = t.height / 2;
    e.moveTo(r, n - a), e.lineTo(r + i, n), e.lineTo(r, n + a), e.lineTo(r - i, n), e.closePath();
  }
}), Nre = zt.extend({
  type: "pin",
  shape: {
    // x, y on the cusp
    x: 0,
    y: 0,
    width: 0,
    height: 0
  },
  buildPath: function(e, t) {
    var r = 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), f = Math.cos(u) * o, c = Math.sin(u), h = Math.cos(u), v = o * 0.6, d = o * 0.7;
    e.moveTo(r - f, l + s), e.arc(r, l, o, Math.PI - u, Math.PI * 2 + u), e.bezierCurveTo(r + f - c * v, l + s + h * v, r, n - d, r, n), e.bezierCurveTo(r, n - d, r - f + c * v, l + s + h * v, r - f, l + s), e.closePath();
  }
}), kre = zt.extend({
  type: "arrow",
  shape: {
    x: 0,
    y: 0,
    width: 0,
    height: 0
  },
  buildPath: function(e, t) {
    var r = t.height, n = t.width, i = t.x, a = t.y, o = n / 3 * 2;
    e.moveTo(i, a), e.lineTo(i + o, a + r), e.lineTo(i, a + r / 4 * 3), e.lineTo(i - o, a + r), e.lineTo(i, a), e.closePath();
  }
}), Bre = {
  line: wn,
  rect: Mt,
  roundRect: Mt,
  square: Mt,
  circle: Qs,
  diamond: Ore,
  pin: Nre,
  arrow: kre,
  triangle: Rre
}, zre = {
  line: function(e, t, r, n, i) {
    i.x1 = e, i.y1 = t + n / 2, i.x2 = e + r, i.y2 = t + n / 2;
  },
  rect: function(e, t, r, n, i) {
    i.x = e, i.y = t, i.width = r, i.height = n;
  },
  roundRect: function(e, t, r, n, i) {
    i.x = e, i.y = t, i.width = r, i.height = n, i.r = Math.min(r, n) / 4;
  },
  square: function(e, t, r, n, i) {
    var a = Math.min(r, n);
    i.x = e, i.y = t, i.width = a, i.height = a;
  },
  circle: function(e, t, r, n, i) {
    i.cx = e + r / 2, i.cy = t + n / 2, i.r = Math.min(r, n) / 2;
  },
  diamond: function(e, t, r, n, i) {
    i.cx = e + r / 2, i.cy = t + n / 2, i.width = r, i.height = n;
  },
  pin: function(e, t, r, n, i) {
    i.x = e + r / 2, i.y = t + n / 2, i.width = r, i.height = n;
  },
  arrow: function(e, t, r, n, i) {
    i.x = e + r / 2, i.y = t + n / 2, i.width = r, i.height = n;
  },
  triangle: function(e, t, r, n, i) {
    i.cx = e + r / 2, i.cy = t + n / 2, i.width = r, i.height = n;
  }
}, sb = {};
F(Bre, function(e, t) {
  sb[t] = new e();
});
var Fre = zt.extend({
  type: "symbol",
  shape: {
    symbolType: "",
    x: 0,
    y: 0,
    width: 0,
    height: 0
  },
  calculateTextPosition: function(e, t, r) {
    var n = $2(e, t, r), i = this.shape;
    return i && i.symbolType === "pin" && t.position === "inside" && (n.y = r.y + r.height * 0.4), n;
  },
  buildPath: function(e, t, r) {
    var n = t.symbolType;
    if (n !== "none") {
      var i = sb[n];
      i || (n = "rect", i = sb[n]), zre[n](t.x, t.y, t.width, t.height, i.shape), i.buildPath(e, i.shape, r);
    }
  }
});
function Gre(e, t) {
  if (this.type !== "image") {
    var r = this.style;
    this.__isEmptyBrush ? (r.stroke = e, r.fill = t || fe.color.neutral00, r.lineWidth = 2) : this.shape.symbolType === "line" ? r.stroke = e : r.fill = e, this.markRedraw();
  }
}
function en(e, t, r, n, i, a, o) {
  var s = e.indexOf("empty") === 0;
  s && (e = e.substr(5, 1).toLowerCase() + e.substr(6));
  var l;
  return e.indexOf("image://") === 0 ? l = RR(e.slice(8), new st(t, r, n, i), o ? "center" : "cover") : e.indexOf("path://") === 0 ? l = $c(e.slice(7), {}, new st(t, r, n, i), o ? "center" : "cover") : l = new Fre({
    shape: {
      symbolType: e,
      x: t,
      y: r,
      width: n,
      height: i
    }
  }), l.__isEmptyBrush = s, l.setColor = Gre, a && l.setColor(a), l;
}
function oy(e) {
  return Se(e) || (e = [+e, +e]), [e[0] || 0, e[1] || 0];
}
function Fd(e, t) {
  if (e != null)
    return Se(e) || (e = [e, e]), [Be(e[0], t[0]) || 0, Be(et(e[1], e[0]), t[1]) || 0];
}
function ad(e) {
  return isFinite(e);
}
function Vre(e, t, r) {
  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 * r.width + r.x, i = i * r.width + r.x, a = a * r.height + r.y, o = o * r.height + r.y), n = ad(n) ? n : 0, i = ad(i) ? i : 1, a = ad(a) ? a : 0, o = ad(o) ? o : 0;
  var s = e.createLinearGradient(n, a, i, o);
  return s;
}
function Hre(e, t, r) {
  var n = r.width, i = r.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 + r.x, s = s * i + r.y, l = l * a), o = ad(o) ? o : 0.5, s = ad(s) ? s : 0.5, l = l >= 0 && ad(l) ? l : 0.5;
  var u = e.createRadialGradient(o, s, 0, o, s, l);
  return u;
}
function CP(e, t, r) {
  for (var n = t.type === "radial" ? Hre(e, t, r) : Vre(e, t, r), i = t.colorStops, a = 0; a < i.length; a++)
    n.addColorStop(i[a].offset, i[a].color);
  return n;
}
function Ure(e, t) {
  if (e === t || !e && !t)
    return !1;
  if (!e || !t || e.length !== t.length)
    return !0;
  for (var r = 0; r < e.length; r++)
    if (e[r] !== t[r])
      return !0;
  return !1;
}
function Jw(e) {
  return parseInt(e, 10);
}
function lm(e, t, r) {
  var n = ["width", "height"][t], i = ["clientWidth", "clientHeight"][t], a = ["paddingLeft", "paddingTop"][t], o = ["paddingRight", "paddingBottom"][t];
  if (r[n] != null && r[n] !== "auto")
    return parseFloat(r[n]);
  var s = document.defaultView.getComputedStyle(e);
  return (e[i] || Jw(s[n]) || Jw(e.style[n])) - (Jw(s[a]) || 0) - (Jw(s[o]) || 0) | 0;
}
function Wre(e, t) {
  return !e || e === "solid" || !(t > 0) ? null : e === "dashed" ? [4 * t, 2 * t] : e === "dotted" ? [t] : Xt(e) ? [e] : Se(e) ? e : null;
}
function lO(e) {
  var t = e.style, r = t.lineDash && t.lineWidth > 0 && Wre(t.lineDash, t.lineWidth), n = t.lineDashOffset;
  if (r) {
    var i = t.strokeNoScale && e.getLineScale ? e.getLineScale() : 1;
    i && i !== 1 && (r = Ce(r, function(a) {
      return a / i;
    }), n /= i);
  }
  return [r, n];
}
var Xre = new ru(!0);
function lb(e) {
  var t = e.stroke;
  return !(t == null || t === "none" || !(e.lineWidth > 0));
}
function GB(e) {
  return typeof e == "string" && e !== "none";
}
function ub(e) {
  var t = e.fill;
  return t != null && t !== "none";
}
function VB(e, t) {
  if (t.fillOpacity != null && t.fillOpacity !== 1) {
    var r = e.globalAlpha;
    e.globalAlpha = t.fillOpacity * t.opacity, e.fill(), e.globalAlpha = r;
  } else
    e.fill();
}
function HB(e, t) {
  if (t.strokeOpacity != null && t.strokeOpacity !== 1) {
    var r = e.globalAlpha;
    e.globalAlpha = t.strokeOpacity * t.opacity, e.stroke(), e.globalAlpha = r;
  } else
    e.stroke();
}
function AP(e, t, r) {
  var n = SR(t.image, t.__image, r);
  if (xC(n)) {
    var i = e.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) * o1), a.scaleSelf(t.scaleX || 1, t.scaleY || 1), i.setTransform(a);
    }
    return i;
  }
}
function Yre(e, t, r, n) {
  var i, a = lb(r), o = ub(r), s = r.strokePercent, l = s < 1, u = !t.path;
  (!t.silent || l) && u && t.createPathProxy();
  var f = t.path || Xre, c = t.__dirty;
  if (!n) {
    var h = r.fill, v = r.stroke, d = o && !!h.colorStops, g = a && !!v.colorStops, y = o && !!h.image, x = a && !!v.image, S = void 0, T = void 0, C = void 0, A = void 0, M = void 0;
    (d || g) && (M = t.getBoundingRect()), d && (S = c ? CP(e, h, M) : t.__canvasFillGradient, t.__canvasFillGradient = S), g && (T = c ? CP(e, v, M) : t.__canvasStrokeGradient, t.__canvasStrokeGradient = T), y && (C = c || !t.__canvasFillPattern ? AP(e, h, t) : t.__canvasFillPattern, t.__canvasFillPattern = C), x && (A = c || !t.__canvasStrokePattern ? AP(e, v, t) : t.__canvasStrokePattern, t.__canvasStrokePattern = A), d ? e.fillStyle = S : y && (C ? e.fillStyle = C : o = !1), g ? e.strokeStyle = T : x && (A ? e.strokeStyle = A : a = !1);
  }
  var E = t.getGlobalScale();
  f.setScale(E[0], E[1], t.segmentIgnoreThreshold);
  var P, R;
  e.setLineDash && r.lineDash && (i = lO(t), P = i[0], R = i[1]);
  var O = !0;
  (u || c & Jg) && (f.setDPR(e.dpr), l ? f.setContext(null) : (f.setContext(e), O = !1), f.reset(), t.buildPath(f, t.shape, n), f.toStatic(), t.pathUpdated()), O && f.rebuildPath(e, l ? s : 1), P && (e.setLineDash(P), e.lineDashOffset = R), n || (r.strokeFirst ? (a && HB(e, r), o && VB(e, r)) : (o && VB(e, r), a && HB(e, r))), P && e.setLineDash([]);
}
function Zre(e, t, r) {
  var n = t.__image = SR(r.image, t.__image, t, t.onload);
  if (!(!n || !xC(n))) {
    var i = r.x || 0, a = r.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), r.sWidth && r.sHeight) {
      var u = r.sx || 0, f = r.sy || 0;
      e.drawImage(n, u, f, r.sWidth, r.sHeight, i, a, o, s);
    } else if (r.sx && r.sy) {
      var u = r.sx, f = r.sy, c = o - u, h = s - f;
      e.drawImage(n, u, f, c, h, i, a, o, s);
    } else
      e.drawImage(n, i, a, o, s);
  }
}
function $re(e, t, r) {
  var n, i = r.text;
  if (i != null && (i += ""), i) {
    e.font = r.font || pf, e.textAlign = r.textAlign, e.textBaseline = r.textBaseline;
    var a = void 0, o = void 0;
    e.setLineDash && r.lineDash && (n = lO(t), a = n[0], o = n[1]), a && (e.setLineDash(a), e.lineDashOffset = o), r.strokeFirst ? (lb(r) && e.strokeText(i, r.x, r.y), ub(r) && e.fillText(i, r.x, r.y)) : (ub(r) && e.fillText(i, r.x, r.y), lb(r) && e.strokeText(i, r.x, r.y)), a && e.setLineDash([]);
  }
}
var UB = ["shadowBlur", "shadowOffsetX", "shadowOffsetY"], WB = [
  ["lineCap", "butt"],
  ["lineJoin", "miter"],
  ["miterLimit", 10]
];
function H8(e, t, r, n, i) {
  var a = !1;
  if (!n && (r = r || {}, t === r))
    return !1;
  if (n || t.opacity !== r.opacity) {
    Za(e, i), a = !0;
    var o = Math.max(Math.min(t.opacity, 1), 0);
    e.globalAlpha = isNaN(o) ? cd.opacity : o;
  }
  (n || t.blend !== r.blend) && (a || (Za(e, i), a = !0), e.globalCompositeOperation = t.blend || cd.blend);
  for (var s = 0; s < UB.length; s++) {
    var l = UB[s];
    (n || t[l] !== r[l]) && (a || (Za(e, i), a = !0), e[l] = e.dpr * (t[l] || 0));
  }
  return (n || t.shadowColor !== r.shadowColor) && (a || (Za(e, i), a = !0), e.shadowColor = t.shadowColor || cd.shadowColor), a;
}
function XB(e, t, r, n, i) {
  var a = X1(t, i.inHover), o = n ? null : r && X1(r, i.inHover) || {};
  if (a === o)
    return !1;
  var s = H8(e, a, o, n, i);
  if ((n || a.fill !== o.fill) && (s || (Za(e, i), s = !0), GB(a.fill) && (e.fillStyle = a.fill)), (n || a.stroke !== o.stroke) && (s || (Za(e, i), s = !0), GB(a.stroke) && (e.strokeStyle = a.stroke)), (n || a.opacity !== o.opacity) && (s || (Za(e, i), s = !0), e.globalAlpha = a.opacity == null ? 1 : a.opacity), t.hasStroke()) {
    var l = a.lineWidth, u = l / (a.strokeNoScale && t.getLineScale ? t.getLineScale() : 1);
    e.lineWidth !== u && (s || (Za(e, i), s = !0), e.lineWidth = u);
  }
  for (var f = 0; f < WB.length; f++) {
    var c = WB[f], h = c[0];
    (n || a[h] !== o[h]) && (s || (Za(e, i), s = !0), e[h] = a[h] || c[1]);
  }
  return s;
}
function qre(e, t, r, n, i) {
  return H8(e, X1(t, i.inHover), r && X1(r, i.inHover), n, i);
}
function U8(e, t) {
  var r = t.transform, n = e.dpr || 1;
  r ? e.setTransform(n * r[0], n * r[1], n * r[2], n * r[3], n * r[4], n * r[5]) : e.setTransform(n, 0, 0, n, 0, 0);
}
function jre(e, t, r) {
  for (var n = !1, i = 0; i < e.length; i++) {
    var a = e[i];
    n = n || a.isZeroArea(), U8(t, a), t.beginPath(), a.buildPath(t, a.shape), t.clip();
  }
  r.allClipped = n;
}
function Kre(e, t) {
  return e && t ? e[0] !== t[0] || e[1] !== t[1] || e[2] !== t[2] || e[3] !== t[3] || e[4] !== t[4] || e[5] !== t[5] : !(!e && !t);
}
var YB = 1, ZB = 2, $B = 3, qB = 4;
function Qre(e) {
  var t = ub(e), r = lb(e);
  return !(e.lineDash || !(+t ^ +r) || t && typeof e.fill != "string" || r && typeof e.stroke != "string" || e.strokePercent < 1 || e.strokeOpacity < 1 || e.fillOpacity < 1);
}
function Za(e, t) {
  t.batchFill && e.fill(), t.batchStroke && e.stroke(), t.batchFill = "", t.batchStroke = "";
}
function X1(e, t) {
  return t && e.__hoverStyle || e.style;
}
function Ix(e, t) {
  od(e, t, { inHover: !1, viewWidth: 0, viewHeight: 0 }, !0);
}
function od(e, t, r, n) {
  var i = t.transform;
  if (!t.shouldBePainted(r.viewWidth, r.viewHeight, !1, !1)) {
    t.__dirty &= ~mo, t.__isRendered = !1;
    return;
  }
  var a = t.__clipPaths, o = r.prevElClipPaths, s = !1, l = !1;
  if ((!o || Ure(a, o)) && (o && o.length && (Za(e, r), e.restore(), l = s = !0, r.prevElClipPaths = null, r.allClipped = !1, r.prevEl = null), a && a.length && (Za(e, r), e.save(), jre(a, e, r), s = !0), r.prevElClipPaths = a), r.allClipped) {
    t.__isRendered = !1;
    return;
  }
  t.beforeBrush && t.beforeBrush(), t.innerBeforeBrush();
  var u = r.prevEl;
  u || (l = s = !0);
  var f = t instanceof zt && t.autoBatch && Qre(t.style);
  s || Kre(i, u.transform) ? (Za(e, r), U8(e, t)) : f || Za(e, r);
  var c = X1(t, r.inHover);
  t instanceof zt ? (r.lastDrawType !== YB && (l = !0, r.lastDrawType = YB), XB(e, t, u, l, r), (!f || !r.batchFill && !r.batchStroke) && e.beginPath(), Yre(e, t, c, f), f && (r.batchFill = c.fill || "", r.batchStroke = c.stroke || "")) : t instanceof Tm ? (r.lastDrawType !== $B && (l = !0, r.lastDrawType = $B), XB(e, t, u, l, r), $re(e, t, c)) : t instanceof Xn ? (r.lastDrawType !== ZB && (l = !0, r.lastDrawType = ZB), qre(e, t, u, l, r), Zre(e, t, c)) : t.getTemporalDisplayables && (r.lastDrawType !== qB && (l = !0, r.lastDrawType = qB), Jre(e, t, r)), f && n && Za(e, r), t.innerAfterBrush(), t.afterBrush && t.afterBrush(), r.prevEl = t, t.__dirty = 0, t.__isRendered = !0;
}
function Jre(e, t, r) {
  var n = t.getDisplayables(), i = t.getTemporalDisplayables();
  e.save();
  var a = {
    prevElClipPaths: null,
    prevEl: null,
    allClipped: !1,
    viewWidth: r.viewWidth,
    viewHeight: r.viewHeight,
    inHover: r.inHover
  }, o, s;
  for (o = t.getCursor(), s = n.length; o < s; o++) {
    var l = n[o];
    l.beforeBrush && l.beforeBrush(), l.innerBeforeBrush(), od(e, l, a, o === s - 1), l.innerAfterBrush(), l.afterBrush && l.afterBrush(), a.prevEl = l;
  }
  for (var u = 0, f = i.length; u < f; u++) {
    var l = i[u];
    l.beforeBrush && l.beforeBrush(), l.innerBeforeBrush(), od(e, l, a, u === f - 1), l.innerAfterBrush(), l.afterBrush && l.afterBrush(), a.prevEl = l;
  }
  t.clearTemporalDisplayables(), t.notClear = !0, e.restore();
}
var fL = new Ire(), jB = new xm(100), KB = ["symbol", "symbolSize", "symbolKeepAspect", "color", "backgroundColor", "dashArrayX", "dashArrayY", "maxTileWidth", "maxTileHeight"];
function Am(e, t) {
  if (e === "none")
    return null;
  var r = t.getDevicePixelRatio(), n = t.getZr(), i = n.painter.type === "svg";
  e.dirty && fL.delete(e);
  var a = fL.get(e);
  if (a)
    return a;
  var o = tt(e, {
    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 / r, fL.set(e, s), e.dirty = !1, s;
  function l(u) {
    for (var f = [r], c = !0, h = 0; h < KB.length; ++h) {
      var v = o[KB[h]];
      if (v != null && !Se(v) && !Fe(v) && !Xt(v) && typeof v != "boolean") {
        c = !1;
        break;
      }
      f.push(v);
    }
    var d;
    if (c) {
      d = f.join(",") + (i ? "-svg" : "");
      var g = jB.get(d);
      g && (i ? u.svgElement = g : u.image = g);
    }
    var y = X8(o.dashArrayX), x = ene(o.dashArrayY), S = W8(o.symbol), T = tne(y), C = Y8(x), A = !i && ja.createCanvas(), M = i && {
      tag: "g",
      attrs: {},
      key: "dcl",
      children: []
    }, E = R(), P;
    A && (A.width = E.width * r, A.height = E.height * r, P = A.getContext("2d")), O(), c && jB.put(d, A || M), u.image = A, u.svgElement = M, u.svgWidth = E.width, u.svgHeight = E.height;
    function R() {
      for (var N = 1, G = 0, z = T.length; G < z; ++G)
        N = vk(N, T[G]);
      for (var H = 1, G = 0, z = S.length; G < z; ++G)
        H = vk(H, S[G].length);
      N *= H;
      var W = C * T.length * S.length;
      return {
        width: Math.max(1, Math.min(N, o.maxTileWidth)),
        height: Math.max(1, Math.min(W, o.maxTileHeight))
      };
    }
    function O() {
      P && (P.clearRect(0, 0, A.width, A.height), o.backgroundColor && (P.fillStyle = o.backgroundColor, P.fillRect(0, 0, A.width, A.height)));
      for (var N = 0, G = 0; G < x.length; ++G)
        N += x[G];
      if (N <= 0)
        return;
      for (var z = -C, H = 0, W = 0, Z = 0; z < E.height; ) {
        if (H % 2 === 0) {
          for (var ee = W / 2 % S.length, V = 0, Q = 0, q = 0; V < E.width * 2; ) {
            for (var X = 0, G = 0; G < y[Z].length; ++G)
              X += y[Z][G];
            if (X <= 0)
              break;
            if (Q % 2 === 0) {
              var K = (1 - o.symbolSize) * 0.5, ue = V + y[Z][Q] * K, oe = z + x[H] * K, te = y[Z][Q] * o.symbolSize, pe = x[H] * o.symbolSize, me = q / 2 % S[ee].length;
              de(ue, oe, te, pe, S[ee][me]);
            }
            V += y[Z][Q], ++q, ++Q, Q === y[Z].length && (Q = 0);
          }
          ++Z, Z === y.length && (Z = 0);
        }
        z += x[H], ++W, ++H, H === x.length && (H = 0);
      }
      function de(ve, Ae, be, De, Ue) {
        var Xe = i ? 1 : r, $e = en(Ue, ve * Xe, Ae * Xe, be * Xe, De * Xe, o.color, o.symbolKeepAspect);
        if (i) {
          var vt = n.painter.renderOneToVNode($e);
          vt && M.children.push(vt);
        } else
          Ix(P, $e);
      }
    }
  }
}
function W8(e) {
  if (!e || e.length === 0)
    return [["rect"]];
  if (Fe(e))
    return [[e]];
  for (var t = !0, r = 0; r < e.length; ++r)
    if (!Fe(e[r])) {
      t = !1;
      break;
    }
  if (t)
    return W8([e]);
  for (var n = [], r = 0; r < e.length; ++r)
    Fe(e[r]) ? n.push([e[r]]) : n.push(e[r]);
  return n;
}
function X8(e) {
  if (!e || e.length === 0)
    return [[0, 0]];
  if (Xt(e)) {
    var t = Math.ceil(e);
    return [[t, t]];
  }
  for (var r = !0, n = 0; n < e.length; ++n)
    if (!Xt(e[n])) {
      r = !1;
      break;
    }
  if (r)
    return X8([e]);
  for (var i = [], n = 0; n < e.length; ++n)
    if (Xt(e[n])) {
      var t = Math.ceil(e[n]);
      i.push([t, t]);
    } else {
      var t = Ce(e[n], function(s) {
        return Math.ceil(s);
      });
      t.length % 2 === 1 ? i.push(t.concat(t)) : i.push(t);
    }
  return i;
}
function ene(e) {
  if (!e || typeof e == "object" && e.length === 0)
    return [0, 0];
  if (Xt(e)) {
    var t = Math.ceil(e);
    return [t, t];
  }
  var r = Ce(e, function(n) {
    return Math.ceil(n);
  });
  return e.length % 2 ? r.concat(r) : r;
}
function tne(e) {
  return Ce(e, function(t) {
    return Y8(t);
  });
}
function Y8(e) {
  for (var t = 0, r = 0; r < e.length; ++r)
    t += e[r];
  return e.length % 2 === 1 ? t * 2 : t;
}
function rne(e, t) {
  e.eachRawSeries(function(r) {
    if (!e.isSeriesFiltered(r)) {
      var n = r.getData();
      n.hasItemVisual() && n.each(function(o) {
        var s = n.getItemVisual(o, "decal");
        if (s) {
          var l = n.ensureUniqueItemVisual(o, "style");
          l.decal = Am(s, t);
        }
      });
      var i = n.getVisual("decal");
      if (i) {
        var a = n.getVisual("style");
        a.decal = Am(i, t);
      }
    }
  });
}
var zs = new ds(), Z8 = {};
function nne(e, t) {
  Z8[e] = t;
}
function $8(e) {
  return Z8[e];
}
var q8 = {};
function j8(e, t) {
  q8[e] = t;
}
function ine(e) {
  return q8[e];
}
var ane = "6.0.0", one = {
  zrender: "6.0.0"
}, sne = 1, lne = 800, une = 900, fne = 1e3, cne = 2e3, hne = 5e3, K8 = 1e3, vne = 1100, uO = 2e3, Q8 = 3e3, dne = 4e3, kC = 4500, pne = 4600, gne = 5e3, mne = 6e3, J8 = 7e3, e6 = {
  PROCESSOR: {
    FILTER: fne,
    SERIES_FILTER: lne,
    STATISTIC: hne
  },
  VISUAL: {
    LAYOUT: K8,
    PROGRESSIVE_LAYOUT: vne,
    GLOBAL: uO,
    CHART: Q8,
    POST_CHART_LAYOUT: pne,
    COMPONENT: dne,
    BRUSH: gne,
    CHART_ITEM: kC,
    ARIA: mne,
    DECAL: J8
  }
}, Bn = "__flagInMainProcess", eT = "__mainProcessVersion", yi = "__pendingUpdate", cL = "__needsUpdateStatus", QB = /^[a-zA-Z0-9_]+$/, hL = "__connectUpdateStatus", JB = 0, yne = 1, _ne = 2;
function t6(e) {
  return function() {
    for (var t = [], r = 0; r < arguments.length; r++)
      t[r] = arguments[r];
    if (this.isDisposed()) {
      this.id;
      return;
    }
    return n6(this, e, t);
  };
}
function r6(e) {
  return function() {
    for (var t = [], r = 0; r < arguments.length; r++)
      t[r] = arguments[r];
    return n6(this, e, t);
  };
}
function n6(e, t, r) {
  return r[0] = r[0] && r[0].toLowerCase(), ds.prototype[t].apply(e, r);
}
var i6 = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      return e !== null && e.apply(this, arguments) || this;
    }
    return t;
  })(ds)
), a6 = i6.prototype;
a6.on = r6("on");
a6.off = r6("off");
var Iv, vL, tT, Vu, rT, dL, pL, Ag, Mg, e5, t5, gL, r5, nT, n5, o6, Xo, i5, Lg, fb = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r, n, i) {
      var a = e.call(this, new Are()) || this;
      a._chartsViews = [], a._chartsMap = {}, a._componentsViews = [], a._componentsMap = {}, a._pendingActions = [], i = i || {}, a._dom = r;
      var o = "canvas", s = "auto", l = !1;
      a[eT] = 1, i.ssr && RU(function(h) {
        var v = pt(h), d = v.dataIndex;
        if (d != null) {
          var g = Je();
          return g.set("series_index", v.seriesIndex), g.set("data_index", d), v.ssrType && g.set("ssr_type", v.ssrType), g;
        }
      });
      var u = a._zr = q2(r, {
        renderer: i.renderer || o,
        devicePixelRatio: i.devicePixelRatio,
        width: i.width,
        height: i.height,
        ssr: i.ssr,
        useDirtyRect: et(i.useDirtyRect, l),
        useCoarsePointer: et(i.useCoarsePointer, s),
        pointerSize: i.pointerSize
      });
      a._ssr = i.ssr, a._throttledZrFlush = NC(Ge(u.flush, u), 17), a._updateTheme(n), a._locale = Mee(i.locale || NW), a._coordSysMgr = new ny();
      var f = a._api = n5(a);
      function c(h, v) {
        return h.__prio - v.__prio;
      }
      return c2(hb, c), c2(DP, c), a._scheduler = new N8(a, f, DP, hb), a._messageCenter = new i6(), a._initEvents(), a.resize = Ge(a.resize, a), u.animation.on("frame", a._onframe, a), e5(u, a), t5(u, a), L1(a), a;
    }
    return t.prototype._onframe = function() {
      if (!this._disposed) {
        i5(this);
        var r = this._scheduler;
        if (this[yi]) {
          var n = this[yi].silent;
          this[Bn] = !0, Lg(this);
          try {
            Iv(this), Vu.update.call(this, null, this[yi].updateParams);
          } catch (l) {
            throw this[Bn] = !1, this[yi] = null, l;
          }
          this._zr.flush(), this[Bn] = !1, this[yi] = null, Ag.call(this, n), Mg.call(this, n);
        } else if (r.unfinished) {
          var i = sne, a = this._model, o = this._api;
          r.unfinished = !1;
          do {
            var s = +/* @__PURE__ */ new Date();
            r.performSeriesTasks(a), r.performDataProcessorTasks(a), dL(this, a), r.performVisualTasks(a), nT(this, this._model, o, "remain", {}), i -= +/* @__PURE__ */ new Date() - s;
          } while (i > 0 && r.unfinished);
          r.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(r, n, i) {
      if (!this[Bn]) {
        if (this._disposed) {
          this.id;
          return;
        }
        var a, o, s;
        if (ot(n) && (i = n.lazyUpdate, a = n.silent, o = n.replaceMerge, s = n.transition, n = n.notMerge), this[Bn] = !0, Lg(this), !this._model || n) {
          var l = new lte(this._api), u = this._theme, f = this._model = new rO();
          f.scheduler = this._scheduler, f.ssr = this._ssr, f.init(null, null, null, u, this._locale, l);
        }
        this._model.setOption(r, {
          replaceMerge: o
        }, EP);
        var c = {
          seriesTransition: s,
          optionChanged: !0
        };
        if (i)
          this[yi] = {
            silent: a,
            updateParams: c
          }, this[Bn] = !1, this.getZr().wakeUp();
        else {
          try {
            Iv(this), Vu.update.call(this, null, c);
          } catch (h) {
            throw this[yi] = null, this[Bn] = !1, h;
          }
          this._ssr || this._zr.flush(), this[yi] = null, this[Bn] = !1, Ag.call(this, a), Mg.call(this, a);
        }
      }
    }, t.prototype.setTheme = function(r, n) {
      if (!this[Bn]) {
        if (this._disposed) {
          this.id;
          return;
        }
        var i = this._model;
        if (i) {
          var a = n && n.silent, o = null;
          this[yi] && (a == null && (a = this[yi].silent), o = this[yi].updateParams, this[yi] = null), this[Bn] = !0, Lg(this);
          try {
            this._updateTheme(r), i.setTheme(this._theme), Iv(this), Vu.update.call(this, {
              type: "setTheme"
            }, o);
          } catch (s) {
            throw this[Bn] = !1, s;
          }
          this[Bn] = !1, Ag.call(this, a), Mg.call(this, a);
        }
      }
    }, t.prototype._updateTheme = function(r) {
      Fe(r) && (r = s6[r]), r && (r = it(r), r && f8(r, !0), this._theme = r);
    }, 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 || Gt.hasGlobalWindow && window.devicePixelRatio || 1;
    }, t.prototype.getRenderedCanvas = function(r) {
      return this.renderToCanvas(r);
    }, t.prototype.renderToCanvas = function(r) {
      r = r || {};
      var n = this._zr.painter;
      return n.getRenderedCanvas({
        backgroundColor: r.backgroundColor || this._model.get("backgroundColor"),
        pixelRatio: r.pixelRatio || this.getDevicePixelRatio()
      });
    }, t.prototype.renderToSVGString = function(r) {
      r = r || {};
      var n = this._zr.painter;
      return n.renderToString({
        useViewBox: r.useViewBox
      });
    }, t.prototype.getSvgDataURL = function() {
      var r = this._zr, n = r.storage.getDisplayList();
      return F(n, function(i) {
        i.stopAnimation(null, !0);
      }), r.painter.toDataURL();
    }, t.prototype.getDataURL = function(r) {
      if (this._disposed) {
        this.id;
        return;
      }
      r = r || {};
      var n = r.excludeComponents, i = this._model, a = [], o = this;
      F(n, function(l) {
        i.eachComponent({
          mainType: l
        }, function(u) {
          var f = o._componentsMap[u.__viewId];
          f.group.ignore || (a.push(f), f.group.ignore = !0);
        });
      });
      var s = this._zr.painter.getType() === "svg" ? this.getSvgDataURL() : this.renderToCanvas(r).toDataURL("image/" + (r && r.type || "png"));
      return F(a, function(l) {
        l.group.ignore = !1;
      }), s;
    }, t.prototype.getConnectedDataURL = function(r) {
      if (this._disposed) {
        this.id;
        return;
      }
      var n = r.type === "svg", i = this.group, a = Math.min, o = Math.max, s = 1 / 0;
      if (vb[i]) {
        var l = s, u = s, f = -s, c = -s, h = [], v = r && r.pixelRatio || this.getDevicePixelRatio();
        F(dd, function(T, C) {
          if (T.group === i) {
            var A = n ? T.getZr().painter.getSvgDom().innerHTML : T.renderToCanvas(it(r)), M = T.getDom().getBoundingClientRect();
            l = a(M.left, l), u = a(M.top, u), f = o(M.right, f), c = o(M.bottom, c), h.push({
              dom: A,
              left: M.left,
              top: M.top
            });
          }
        }), l *= v, u *= v, f *= v, c *= v;
        var d = f - l, g = c - u, y = ja.createCanvas(), x = q2(y, {
          renderer: n ? "svg" : "canvas"
        });
        if (x.resize({
          width: d,
          height: g
        }), n) {
          var S = "";
          return F(h, function(T) {
            var C = T.left - l, A = T.top - u;
            S += '<g transform="translate(' + C + "," + A + ')">' + T.dom + "</g>";
          }), x.painter.getSvgRoot().innerHTML = S, r.connectedBackgroundColor && x.painter.setBackgroundColor(r.connectedBackgroundColor), x.refreshImmediately(), x.painter.toDataURL();
        } else
          return r.connectedBackgroundColor && x.add(new Mt({
            shape: {
              x: 0,
              y: 0,
              width: d,
              height: g
            },
            style: {
              fill: r.connectedBackgroundColor
            }
          })), F(h, function(T) {
            var C = new Xn({
              style: {
                x: T.left * v - l,
                y: T.top * v - u,
                image: T.dom
              }
            });
            x.add(C);
          }), x.refreshImmediately(), y.toDataURL("image/" + (r && r.type || "png"));
      } else
        return this.getDataURL(r);
    }, t.prototype.convertToPixel = function(r, n, i) {
      return rT(this, "convertToPixel", r, n, i);
    }, t.prototype.convertToLayout = function(r, n, i) {
      return rT(this, "convertToLayout", r, n, i);
    }, t.prototype.convertFromPixel = function(r, n, i) {
      return rT(this, "convertFromPixel", r, n, i);
    }, t.prototype.containPixel = function(r, n) {
      if (this._disposed) {
        this.id;
        return;
      }
      var i = this._model, a, o = dm(i, r);
      return F(o, function(s, l) {
        l.indexOf("Models") >= 0 && F(s, function(u) {
          var f = u.coordinateSystem;
          if (f && f.containPoint)
            a = a || !!f.containPoint(n);
          else if (l === "seriesModels") {
            var c = this._chartsMap[u.__viewId];
            c && c.containPoint && (a = a || c.containPoint(n, u));
          }
        }, this);
      }, this), !!a;
    }, t.prototype.getVisual = function(r, n) {
      var i = this._model, a = dm(i, r, {
        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 ? sO(s, l, n) : Px(s, n);
    }, t.prototype.getViewOfComponentModel = function(r) {
      return this._componentsMap[r.__viewId];
    }, t.prototype.getViewOfSeriesModel = function(r) {
      return this._chartsMap[r.__viewId];
    }, t.prototype._initEvents = function() {
      var r = this;
      F(xne, function(i) {
        var a = function(o) {
          var s = r.getModel(), l = o.target, u, f = i === "globalout";
          if (f ? u = {} : l && id(l, function(g) {
            var y = pt(g);
            if (y && y.dataIndex != null) {
              var x = y.dataModel || s.getSeriesByIndex(y.seriesIndex);
              return u = x && x.getDataParams(y.dataIndex, y.dataType, l) || {}, !0;
            } else if (y.eventData)
              return u = xe({}, y.eventData), !0;
          }, !0), u) {
            var c = u.componentType, h = u.componentIndex;
            (c === "markLine" || c === "markPoint" || c === "markArea") && (c = "series", h = u.seriesIndex);
            var v = c && h != null && s.getComponent(c, h), d = v && r[v.mainType === "series" ? "_chartsMap" : "_componentsMap"][v.__viewId];
            u.event = o, u.type = i, r._$eventProcessor.eventInfo = {
              targetEl: l,
              packedEvent: u,
              model: v,
              view: d
            }, r.trigger(i, u);
          }
        };
        a.zrEventfulCallAtLast = !0, r._zr.on(i, a, r);
      });
      var n = this._messageCenter;
      F(LP, function(i, a) {
        n.on(a, function(o) {
          r.trigger(a, o);
        });
      }), Dre(n, 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 r = this.getDom();
      r && WU(this.getDom(), cO, "");
      var n = this, i = n._api, a = n._model;
      F(n._componentsViews, function(o) {
        o.dispose(a, i);
      }), F(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 dd[n.id];
    }, t.prototype.resize = function(r) {
      if (!this[Bn]) {
        if (this._disposed) {
          this.id;
          return;
        }
        this._zr.resize(r);
        var n = this._model;
        if (this._loadingFX && this._loadingFX.resize(), !!n) {
          var i = n.resetOption("media"), a = r && r.silent;
          this[yi] && (a == null && (a = this[yi].silent), i = !0, this[yi] = null), this[Bn] = !0, Lg(this);
          try {
            i && Iv(this), Vu.update.call(this, {
              type: "resize",
              animation: xe({
                // Disable animation
                duration: 0
              }, r && r.animation)
            });
          } catch (o) {
            throw this[Bn] = !1, o;
          }
          this[Bn] = !1, Ag.call(this, a), Mg.call(this, a);
        }
      }
    }, t.prototype.showLoading = function(r, n) {
      if (this._disposed) {
        this.id;
        return;
      }
      if (ot(r) && (n = r, r = ""), r = r || "default", this.hideLoading(), !!PP[r]) {
        var i = PP[r](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(r) {
      var n = xe({}, r);
      return n.type = MP[r.type], n;
    }, t.prototype.dispatchAction = function(r, n) {
      if (this._disposed) {
        this.id;
        return;
      }
      if (ot(n) || (n = {
        silent: !!n
      }), !!cb[r.type] && this._model) {
        if (this[Bn]) {
          this._pendingActions.push(r);
          return;
        }
        var i = n.silent;
        pL.call(this, r, i);
        var a = n.flush;
        a ? this._zr.flush() : a !== !1 && Gt.browser.weChat && this._throttledZrFlush(), Ag.call(this, i), Mg.call(this, i);
      }
    }, t.prototype.updateLabelLayout = function() {
      zs.trigger("series:layoutlabels", this._model, this._api, {
        // Not adding series labels.
        // TODO
        updatedSeries: []
      });
    }, t.prototype.appendData = function(r) {
      if (this._disposed) {
        this.id;
        return;
      }
      var n = r.seriesIndex, i = this.getModel(), a = i.getSeriesByIndex(n);
      a.appendData(r), this._scheduler.unfinished = !0, this.getZr().wakeUp();
    }, t.internalField = (function() {
      Iv = function(c) {
        var h = c._scheduler;
        h.restorePipelines(c._model), h.prepareStageTasks(), vL(c, !0), vL(c, !1), h.plan();
      }, vL = function(c, h) {
        for (var v = c._model, d = c._scheduler, g = h ? c._componentsViews : c._chartsViews, y = h ? c._componentsMap : c._chartsMap, x = c._zr, S = c._api, T = 0; T < g.length; T++)
          g[T].__alive = !1;
        h ? v.eachComponent(function(M, E) {
          M !== "series" && C(E);
        }) : v.eachSeries(C);
        function C(M) {
          var E = M.__requireNewView;
          M.__requireNewView = !1;
          var P = "_ec_" + M.id + "_" + M.type, R = !E && y[P];
          if (!R) {
            var O = Ul(M.type), N = h ? fr.getClass(O.main, O.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.
              Ut.getClass(O.sub)
            );
            R = new N(), R.init(v, S), y[P] = R, g.push(R), x.add(R.group);
          }
          M.__viewId = R.__id = P, R.__alive = !0, R.__model = M, R.group.__ecComponentInfo = {
            mainType: M.mainType,
            index: M.componentIndex
          }, !h && d.prepareView(R, M, v, S);
        }
        for (var T = 0; T < g.length; ) {
          var A = g[T];
          A.__alive ? T++ : (!h && A.renderTask.dispose(), x.remove(A.group), A.dispose(v, S), g.splice(T, 1), y[A.__id] === A && delete y[A.__id], A.__id = A.group.__ecComponentInfo = null);
        }
      }, tT = function(c, h, v, d, g) {
        var y = c._model;
        if (y.setUpdatePayload(v), !d) {
          F([].concat(c._componentsViews).concat(c._chartsViews), A);
          return;
        }
        var x = {};
        x[d + "Id"] = v[d + "Id"], x[d + "Index"] = v[d + "Index"], x[d + "Name"] = v[d + "Name"];
        var S = {
          mainType: d,
          query: x
        };
        g && (S.subType = g);
        var T = v.excludeSeriesId, C;
        T != null && (C = Je(), F(Mr(T), function(M) {
          var E = Gn(M, null);
          E != null && C.set(E, !0);
        })), y && y.eachComponent(S, function(M) {
          var E = C && C.get(M.id) != null;
          if (!E)
            if (Hk(v))
              if (M instanceof Yt)
                v.type === hd && !v.notBlur && !M.get(["emphasis", "disabled"]) && DJ(M, v, c._api);
              else {
                var P = LR(M.mainType, M.componentIndex, v.name, c._api), R = P.focusSelf, O = P.dispatchers;
                v.type === hd && R && !v.notBlur && oP(M.mainType, M.componentIndex, c._api), O && F(O, function(N) {
                  v.type === hd ? mf(N) : yf(N);
                });
              }
            else lP(v) && M instanceof Yt && (IJ(M, v, c._api), Gk(M), Xo(c));
        }, c), y && y.eachComponent(S, function(M) {
          var E = C && C.get(M.id) != null;
          E || A(c[d === "series" ? "_chartsMap" : "_componentsMap"][M.__viewId]);
        }, c);
        function A(M) {
          M && M.__alive && M[h] && M[h](M.__model, y, c._api, v);
        }
      }, Vu = {
        prepareAndUpdate: function(c) {
          Iv(this), Vu.update.call(this, c, c && {
            // Needs to mark option changed if newOption is given.
            // It's from MagicType.
            // TODO If use a separate flag optionChanged in payload?
            optionChanged: c.newOption != null
          });
        },
        update: function(c, h) {
          var v = this._model, d = this._api, g = this._zr, y = this._coordSysMgr, x = this._scheduler;
          if (v) {
            v.setUpdatePayload(c), x.restoreData(v, c), x.performSeriesTasks(v), y.create(v, d), x.performDataProcessorTasks(v, c), dL(this, v), y.update(v, d), n(v), x.performVisualTasks(v, c);
            var S = v.get("backgroundColor") || "transparent";
            g.setBackgroundColor(S);
            var T = v.get("darkMode");
            T != null && T !== "auto" && g.setDarkMode(T), gL(this, v, d, c, h), zs.trigger("afterupdate", v, d);
          }
        },
        updateTransform: function(c) {
          var h = this, v = this._model, d = this._api;
          if (v) {
            v.setUpdatePayload(c);
            var g = [];
            v.eachComponent(function(x, S) {
              if (x !== "series") {
                var T = h.getViewOfComponentModel(S);
                if (T && T.__alive)
                  if (T.updateTransform) {
                    var C = T.updateTransform(S, v, d, c);
                    C && C.update && g.push(T);
                  } else
                    g.push(T);
              }
            });
            var y = Je();
            v.eachSeries(function(x) {
              var S = h._chartsMap[x.__viewId];
              if (S.updateTransform) {
                var T = S.updateTransform(x, v, d, c);
                T && T.update && y.set(x.uid, 1);
              } else
                y.set(x.uid, 1);
            }), n(v), this._scheduler.performVisualTasks(v, c, {
              setDirty: !0,
              dirtyMap: y
            }), nT(this, v, d, c, {}, y), zs.trigger("afterupdate", v, d);
          }
        },
        updateView: function(c) {
          var h = this._model;
          h && (h.setUpdatePayload(c), Ut.markUpdateMethod(c, "updateView"), n(h), this._scheduler.performVisualTasks(h, c, {
            setDirty: !0
          }), gL(this, h, this._api, c, {}), zs.trigger("afterupdate", h, this._api));
        },
        updateVisual: function(c) {
          var h = this, v = this._model;
          v && (v.setUpdatePayload(c), v.eachSeries(function(d) {
            d.getData().clearAllVisual();
          }), Ut.markUpdateMethod(c, "updateVisual"), n(v), this._scheduler.performVisualTasks(v, c, {
            visualType: "visual",
            setDirty: !0
          }), v.eachComponent(function(d, g) {
            if (d !== "series") {
              var y = h.getViewOfComponentModel(g);
              y && y.__alive && y.updateVisual(g, v, h._api, c);
            }
          }), v.eachSeries(function(d) {
            var g = h._chartsMap[d.__viewId];
            g.updateVisual(d, v, h._api, c);
          }), zs.trigger("afterupdate", v, this._api));
        },
        updateLayout: function(c) {
          Vu.update.call(this, c);
        }
      };
      function r(c, h, v, d, g) {
        if (c._disposed) {
          c.id;
          return;
        }
        for (var y = c._model, x = c._coordSysMgr.getCoordinateSystems(), S, T = dm(y, v), C = 0; C < x.length; C++) {
          var A = x[C];
          if (A[h] && (S = A[h](y, T, d, g)) != null)
            return S;
        }
      }
      rT = r, dL = function(c, h) {
        var v = c._chartsMap, d = c._scheduler;
        h.eachSeries(function(g) {
          d.updateStreamModes(g, v[g.__viewId]);
        });
      }, pL = function(c, h) {
        var v = this, d = this.getModel(), g = c.type, y = c.escapeConnect, x = cb[g], S = (x.update || "update").split(":"), T = S.pop(), C = S[0] != null && Ul(S[0]);
        this[Bn] = !0, Lg(this);
        var A = [c], M = !1;
        c.batch && (M = !0, A = Ce(c.batch, function(Z) {
          return Z = tt(xe({}, Z), c), Z.batch = null, Z;
        }));
        var E = [], P, R = [], O = x.nonRefinedEventType, N = lP(c), G = Hk(c);
        if (G && hW(this._api), F(A, function(Z) {
          var ee = x.action(Z, d, v._api);
          if (x.refineEvent ? R.push(ee) : P = ee, P = P || xe({}, Z), P.type = O, E.push(P), G) {
            var V = _R(c), Q = V.queryOptionMap, q = V.mainTypeSpecified, X = q ? Q.keys()[0] : "series";
            tT(v, T, Z, X), Xo(v);
          } else N ? (tT(v, T, Z, "series"), Xo(v)) : C && tT(v, T, Z, C.main, C.sub);
        }), T !== "none" && !G && !N && !C)
          try {
            this[yi] ? (Iv(this), Vu.update.call(this, c), this[yi] = null) : Vu[T].call(this, c);
          } catch (Z) {
            throw this[Bn] = !1, Z;
          }
        if (M ? P = {
          type: O,
          escapeConnect: y,
          batch: E
        } : P = E[0], this[Bn] = !1, !h) {
          var z = void 0;
          if (x.refineEvent) {
            var H = x.refineEvent(R, c, d, this._api).eventContent;
            Hi(ot(H)), z = tt({
              type: x.refinedEventType
            }, H), z.fromAction = c.type, z.fromActionPayload = c, z.escapeConnect = !0;
          }
          var W = this._messageCenter;
          W.trigger(P.type, P), z && W.trigger(z.type, z);
        }
      }, Ag = function(c) {
        for (var h = this._pendingActions; h.length; ) {
          var v = h.shift();
          pL.call(this, v, c);
        }
      }, Mg = function(c) {
        !c && this.trigger("updated");
      }, e5 = function(c, h) {
        c.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.
          c.animation.isFinished() && !h[yi] && !h._scheduler.unfinished && !h._pendingActions.length && h.trigger("finished");
        });
      }, t5 = function(c, h) {
        c.on("mouseover", function(v) {
          var d = v.target, g = id(d, B1);
          g && (EJ(g, v, h._api), Xo(h));
        }).on("mouseout", function(v) {
          var d = v.target, g = id(d, B1);
          g && (PJ(g, v, h._api), Xo(h));
        }).on("click", function(v) {
          var d = v.target, g = id(d, function(S) {
            return pt(S).dataIndex != null;
          }, !0);
          if (g) {
            var y = g.selected ? "unselect" : "select", x = pt(g);
            h._api.dispatchAction({
              type: y,
              dataType: x.dataType,
              dataIndexInside: x.dataIndex,
              seriesIndex: x.seriesIndex,
              isFromClick: !0
            });
          }
        });
      };
      function n(c) {
        c.clearColorPalette(), c.eachSeries(function(h) {
          h.clearColorPalette();
        });
      }
      function i(c) {
        var h = [], v = [], d = !1;
        if (c.eachComponent(function(S, T) {
          var C = T.get("zlevel") || 0, A = T.get("z") || 0, M = T.getZLevelKey();
          d = d || !!M, (S === "series" ? v : h).push({
            zlevel: C,
            z: A,
            idx: T.componentIndex,
            type: S,
            key: M
          });
        }), d) {
          var g = h.concat(v), y, x;
          c2(g, function(S, T) {
            return S.zlevel === T.zlevel ? S.z - T.z : S.zlevel - T.zlevel;
          }), F(g, function(S) {
            var T = c.getComponent(S.type, S.idx), C = S.zlevel, A = S.key;
            y != null && (C = Math.max(y, C)), A ? (C === y && A !== x && C++, x = A) : x && (C === y && C++, x = ""), y = C, T.setZLevel(C);
          });
        }
      }
      gL = function(c, h, v, d, g) {
        i(h), r5(c, h, v, d, g), F(c._chartsViews, function(y) {
          y.__alive = !1;
        }), nT(c, h, v, d, g), F(c._chartsViews, function(y) {
          y.__alive || y.remove(h, v);
        });
      }, r5 = function(c, h, v, d, g, y) {
        F(y || c._componentsViews, function(x) {
          var S = x.__model;
          u(S, x), x.render(S, h, v, d), l(S, x), f(S, x);
        });
      }, nT = function(c, h, v, d, g, y) {
        var x = c._scheduler;
        g = xe(g || {}, {
          updatedSeries: h.getSeries()
        }), zs.trigger("series:beforeupdate", h, v, g);
        var S = !1;
        h.eachSeries(function(T) {
          var C = c._chartsMap[T.__viewId];
          C.__alive = !0;
          var A = C.renderTask;
          x.updatePayload(A, d), u(T, C), y && y.get(T.uid) && A.dirty(), A.perform(x.getPerformArgs(A)) && (S = !0), C.group.silent = !!T.get("silent"), s(T, C), Gk(T);
        }), x.unfinished = S || x.unfinished, zs.trigger("series:layoutlabels", h, v, g), zs.trigger("series:transition", h, v, g), h.eachSeries(function(T) {
          var C = c._chartsMap[T.__viewId];
          l(T, C), f(T, C);
        }), o(c, h), zs.trigger("series:afterupdate", h, v, g);
      }, Xo = function(c) {
        c[cL] = !0, c.getZr().wakeUp();
      }, Lg = function(c) {
        c[eT] = (c[eT] + 1) % 1e3;
      }, i5 = function(c) {
        c[cL] && (c.getZr().storage.traverse(function(h) {
          pm(h) || a(h);
        }), c[cL] = !1);
      };
      function a(c) {
        for (var h = [], v = c.currentStates, d = 0; d < v.length; d++) {
          var g = v[d];
          g === "emphasis" || g === "blur" || g === "select" || h.push(g);
        }
        c.selected && c.states.select && h.push("select"), c.hoverState === CC && c.states.emphasis ? h.push("emphasis") : c.hoverState === Cx && c.states.blur && h.push("blur"), c.useStates(h);
      }
      function o(c, h) {
        var v = c._zr, d = v.storage, g = 0;
        d.traverse(function(y) {
          y.isGroup || g++;
        }), g > h.get("hoverLayerThreshold") && !Gt.node && !Gt.worker && h.eachSeries(function(y) {
          if (!y.preventUsingHoverLayer) {
            var x = c._chartsMap[y.__viewId];
            x.__alive && x.eachRendered(function(S) {
              S.states.emphasis && (S.states.emphasis.hoverLayer = !0);
            });
          }
        });
      }
      function s(c, h) {
        var v = c.get("blendMode") || null;
        h.eachRendered(function(d) {
          d.isGroup || (d.style.blend = v);
        });
      }
      function l(c, h) {
        if (!c.preventAutoZ) {
          var v = Cd(c);
          h.eachRendered(function(d) {
            return LC(d, v.z, v.zlevel), !0;
          });
        }
      }
      function u(c, h) {
        h.eachRendered(function(v) {
          if (!pm(v)) {
            var d = v.getTextContent(), g = v.getTextGuideLine();
            v.stateTransition && (v.stateTransition = null), d && d.stateTransition && (d.stateTransition = null), g && g.stateTransition && (g.stateTransition = null), v.hasState() ? (v.prevStates = v.currentStates, v.clearStates()) : v.prevStates && (v.prevStates = null);
          }
        });
      }
      function f(c, h) {
        var v = c.getModel("stateAnimation"), d = c.isAnimationEnabled(), g = v.get("duration"), y = g > 0 ? {
          duration: g,
          delay: v.get("delay"),
          easing: v.get("easing")
          // additive: stateAnimationModel.get('additive')
        } : null;
        h.eachRendered(function(x) {
          if (x.states && x.states.emphasis) {
            if (pm(x))
              return;
            if (x instanceof zt && zJ(x), x.__dirty) {
              var S = x.prevStates;
              S && x.useStates(S);
            }
            if (d) {
              x.stateTransition = y;
              var T = x.getTextContent(), C = x.getTextGuideLine();
              T && (T.stateTransition = y), C && (C.stateTransition = y);
            }
            x.__dirty && a(x);
          }
        });
      }
      n5 = function(c) {
        return new /** @class */
        ((function(h) {
          ae(v, h);
          function v() {
            return h !== null && h.apply(this, arguments) || this;
          }
          return v.prototype.getCoordinateSystems = function() {
            return c._coordSysMgr.getCoordinateSystems();
          }, v.prototype.getComponentByElement = function(d) {
            for (; d; ) {
              var g = d.__ecComponentInfo;
              if (g != null)
                return c._model.getComponent(g.mainType, g.index);
              d = d.parent;
            }
          }, v.prototype.enterEmphasis = function(d, g) {
            mf(d, g), Xo(c);
          }, v.prototype.leaveEmphasis = function(d, g) {
            yf(d, g), Xo(c);
          }, v.prototype.enterBlur = function(d) {
            lW(d), Xo(c);
          }, v.prototype.leaveBlur = function(d) {
            MR(d), Xo(c);
          }, v.prototype.enterSelect = function(d) {
            uW(d), Xo(c);
          }, v.prototype.leaveSelect = function(d) {
            fW(d), Xo(c);
          }, v.prototype.getModel = function() {
            return c.getModel();
          }, v.prototype.getViewOfComponentModel = function(d) {
            return c.getViewOfComponentModel(d);
          }, v.prototype.getViewOfSeriesModel = function(d) {
            return c.getViewOfSeriesModel(d);
          }, v.prototype.getMainProcessVersion = function() {
            return c[eT];
          }, v;
        })(l8))(c);
      }, o6 = function(c) {
        function h(v, d) {
          for (var g = 0; g < v.length; g++) {
            var y = v[g];
            y[hL] = d;
          }
        }
        F(MP, function(v, d) {
          c._messageCenter.on(d, function(g) {
            if (vb[c.group] && c[hL] !== JB) {
              if (g && g.escapeConnect)
                return;
              var y = c.makeActionFromEvent(g), x = [];
              F(dd, function(S) {
                S !== c && S.group === c.group && x.push(S);
              }), h(x, JB), F(x, function(S) {
                S[hL] !== yne && S.dispatchAction(y);
              }), h(x, _ne);
            }
          });
        });
      };
    })(), t;
  })(ds)
), fO = fb.prototype;
fO.on = t6("on");
fO.off = t6("off");
fO.one = function(e, t, r) {
  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(e, i);
  }
  this.on.call(this, e, i, r);
};
var xne = ["click", "dblclick", "mouseover", "mouseout", "mousemove", "mousedown", "mouseup", "globalout", "contextmenu"];
var cb = {}, MP = {}, LP = {}, DP = [], EP = [], hb = [], s6 = {}, PP = {}, dd = {}, vb = {}, Sne = +/* @__PURE__ */ new Date() - 0, wne = +/* @__PURE__ */ new Date() - 0, cO = "_echarts_instance_";
function Tne(e, t, r) {
  var n = !(r && r.ssr);
  if (n) {
    var i = hO(e);
    if (i)
      return i;
  }
  var a = new fb(e, t, r);
  return a.id = "ec_" + Sne++, dd[a.id] = a, n && WU(e, cO, a.id), o6(a), zs.trigger("afterinit", a), a;
}
function bne(e) {
  if (Se(e)) {
    var t = e;
    e = null, F(t, function(r) {
      r.group != null && (e = r.group);
    }), e = e || "g_" + wne++, F(t, function(r) {
      r.group = e;
    });
  }
  return vb[e] = !0, e;
}
function l6(e) {
  vb[e] = !1;
}
var Cne = l6;
function Ane(e) {
  Fe(e) ? e = dd[e] : e instanceof fb || (e = hO(e)), e instanceof fb && !e.isDisposed() && e.dispose();
}
function hO(e) {
  return dd[CQ(e, cO)];
}
function Mne(e) {
  return dd[e];
}
function BC(e, t) {
  s6[e] = t;
}
function Rx(e) {
  Tt(EP, e) < 0 && EP.push(e);
}
function vO(e, t) {
  yO(DP, e, t, cne);
}
function dO(e) {
  zC("afterinit", e);
}
function pO(e) {
  zC("afterupdate", e);
}
function zC(e, t) {
  zs.on(e, t);
}
function el(e, t, r) {
  var n, i, a, o, s;
  nt(t) && (r = t, t = ""), ot(e) ? (n = e.type, i = e.event, o = e.update, s = e.publishNonRefinedEvent, r || (r = e.action), a = e.refineEvent) : (n = e, i = t);
  function l(f) {
    return f.toLowerCase();
  }
  i = l(i || n);
  var u = a ? l(n) : i;
  cb[n] || (Hi(QB.test(n) && QB.test(i)), a && Hi(i !== n), cb[n] = {
    actionType: n,
    refinedEventType: i,
    nonRefinedEventType: u,
    update: o,
    action: r,
    refineEvent: a
  }, LP[i] = 1, a && s && (LP[u] = 1), MP[u] = n);
}
function u6(e, t) {
  ny.register(e, t);
}
function gO(e) {
  var t = ny.get(e);
  if (t)
    return t.getDimensionsInfo ? t.getDimensionsInfo() : t.dimensions.slice();
}
function Lne(e, t) {
  j8(e, t);
}
function mO(e, t) {
  yO(hb, e, t, K8, "layout");
}
function ih(e, t) {
  yO(hb, e, t, Q8, "visual");
}
var a5 = [];
function yO(e, t, r, n, i) {
  if ((nt(t) || ot(t)) && (r = t, t = n), !(Tt(a5, r) >= 0)) {
    a5.push(r);
    var a = N8.wrapStageHandler(r, i);
    a.__prio = t, a.__raw = r, e.push(a);
  }
}
function _O(e, t) {
  PP[e] = t;
}
function Dne(e) {
  jH({
    createCanvas: e
  });
}
function xO(e, t, r) {
  var n = $8("registerMap");
  n && n(e, t, r);
}
function db(e) {
  var t = $8("getMap");
  return t && t(e);
}
var f6 = Gte;
ih(uO, hre);
ih(kC, vre);
ih(kC, dre);
ih(uO, Mre);
ih(kC, Lre);
ih(J8, rne);
Rx(f8);
vO(une, xte);
_O("default", pre);
el({
  type: hd,
  event: hd,
  update: hd
}, un);
el({
  type: y2,
  event: y2,
  update: y2
}, un);
el({
  type: Q2,
  event: CR,
  update: Q2,
  action: un,
  refineEvent: SO,
  publishNonRefinedEvent: !0
});
el({
  type: iP,
  event: CR,
  update: iP,
  action: un,
  refineEvent: SO,
  publishNonRefinedEvent: !0
});
el({
  type: J2,
  event: CR,
  update: J2,
  action: un,
  refineEvent: SO,
  publishNonRefinedEvent: !0
});
function SO(e, t, r, n) {
  return {
    eventContent: {
      selected: RJ(r),
      isFromClick: t.isFromClick || !1
    }
  };
}
BC("default", {});
BC("dark", F8);
var Ene = {}, o5 = [], Pne = {
  registerPreprocessor: Rx,
  registerProcessor: vO,
  registerPostInit: dO,
  registerPostUpdate: pO,
  registerUpdateLifecycle: zC,
  registerAction: el,
  registerCoordinateSystem: u6,
  registerLayout: mO,
  registerVisual: ih,
  registerTransform: f6,
  registerLoading: _O,
  registerMap: xO,
  registerImpl: nne,
  PRIORITY: e6,
  ComponentModel: At,
  ComponentView: fr,
  SeriesModel: Yt,
  ChartView: Ut,
  // TODO Use ComponentModel and SeriesModel instead of Constructor
  registerComponentModel: function(e) {
    At.registerClass(e);
  },
  registerComponentView: function(e) {
    fr.registerClass(e);
  },
  registerSeriesModel: function(e) {
    Yt.registerClass(e);
  },
  registerChartView: function(e) {
    Ut.registerClass(e);
  },
  registerCustomSeries: function(e, t) {
    j8(e, t);
  },
  registerSubTypeDefaulter: function(e, t) {
    At.registerSubTypeDefaulter(e, t);
  },
  registerPainter: function(e, t) {
    PU(e, t);
  }
};
function ft(e) {
  if (Se(e)) {
    F(e, function(t) {
      ft(t);
    });
    return;
  }
  Tt(o5, e) >= 0 || (o5.push(e), nt(e) && (e = {
    install: e
  }), e.install(Pne));
}
function a_(e) {
  return e == null ? 0 : e.length || 1;
}
function s5(e) {
  return e;
}
var _f = (
  /** @class */
  (function() {
    function e(t, r, n, i, a, o) {
      this._old = t, this._new = r, this._oldKeyGetter = n || s5, this._newKeyGetter = i || s5, this.context = a, this._diffModeMultiple = o === "multiple";
    }
    return e.prototype.add = function(t) {
      return this._add = t, this;
    }, e.prototype.update = function(t) {
      return this._update = t, this;
    }, e.prototype.updateManyToOne = function(t) {
      return this._updateManyToOne = t, this;
    }, e.prototype.updateOneToMany = function(t) {
      return this._updateOneToMany = t, this;
    }, e.prototype.updateManyToMany = function(t) {
      return this._updateManyToMany = t, this;
    }, e.prototype.remove = function(t) {
      return this._remove = t, this;
    }, e.prototype.execute = function() {
      this[this._diffModeMultiple ? "_executeMultiple" : "_executeOneToOne"]();
    }, e.prototype._executeOneToOne = function() {
      var t = this._old, r = this._new, n = {}, i = new Array(t.length), a = new Array(r.length);
      this._initIndexMap(t, null, i, "_oldKeyGetter"), this._initIndexMap(r, n, a, "_newKeyGetter");
      for (var o = 0; o < t.length; o++) {
        var s = i[o], l = n[s], u = a_(l);
        if (u > 1) {
          var f = l.shift();
          l.length === 1 && (n[s] = l[0]), this._update && this._update(f, o);
        } else u === 1 ? (n[s] = null, this._update && this._update(l, o)) : this._remove && this._remove(o);
      }
      this._performRestAdd(a, n);
    }, e.prototype._executeMultiple = function() {
      var t = this._old, r = this._new, n = {}, i = {}, a = [], o = [];
      this._initIndexMap(t, n, a, "_oldKeyGetter"), this._initIndexMap(r, i, o, "_newKeyGetter");
      for (var s = 0; s < a.length; s++) {
        var l = a[s], u = n[l], f = i[l], c = a_(u), h = a_(f);
        if (c > 1 && h === 1)
          this._updateManyToOne && this._updateManyToOne(f, u), i[l] = null;
        else if (c === 1 && h > 1)
          this._updateOneToMany && this._updateOneToMany(f, u), i[l] = null;
        else if (c === 1 && h === 1)
          this._update && this._update(f, u), i[l] = null;
        else if (c > 1 && h > 1)
          this._updateManyToMany && this._updateManyToMany(f, u), i[l] = null;
        else if (c > 1)
          for (var v = 0; v < c; v++)
            this._remove && this._remove(u[v]);
        else
          this._remove && this._remove(u);
      }
      this._performRestAdd(o, i);
    }, e.prototype._performRestAdd = function(t, r) {
      for (var n = 0; n < t.length; n++) {
        var i = t[n], a = r[i], o = a_(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);
        r[i] = null;
      }
    }, e.prototype._initIndexMap = function(t, r, 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), !!r) {
          var l = r[s], u = a_(l);
          u === 0 ? (r[s] = o, a && n.push(s)) : u === 1 ? r[s] = [l, o] : l.push(o);
        }
      }
    }, e;
  })()
), Ine = (
  /** @class */
  (function() {
    function e(t, r) {
      this._encode = t, this._schema = r;
    }
    return e.prototype.get = function() {
      return {
        // Do not generate full dimension name until fist used.
        fullDimensions: this._getFullDimensionNames(),
        encode: this._encode
      };
    }, e.prototype._getFullDimensionNames = function() {
      return this._cachedDimNames || (this._cachedDimNames = this._schema ? this._schema.makeOutputDimensionNames() : []), this._cachedDimNames;
    }, e;
  })()
);
function Rne(e, t) {
  var r = {}, n = r.encode = {}, i = Je(), a = [], o = [], s = {};
  F(e.dimensions, function(h) {
    var v = e.getDimensionInfo(h), d = v.coordDim;
    if (d) {
      var g = v.coordDimIndex;
      mL(n, d)[g] = h, v.isExtraCoord || (i.set(d, 1), One(v.type) && (a[0] = h), mL(s, d)[g] = e.getDimensionIndex(v.name)), v.defaultTooltip && o.push(h);
    }
    t8.each(function(y, x) {
      var S = mL(n, x), T = v.otherDims[x];
      T != null && T !== !1 && (S[T] = v.name);
    });
  });
  var l = [], u = {};
  i.each(function(h, v) {
    var d = n[v];
    u[v] = d[0], l = l.concat(d);
  }), r.dataDimsOnCoord = l, r.dataDimIndicesOnCoord = Ce(l, function(h) {
    return e.getDimensionInfo(h).storeDimIndex;
  }), r.encodeFirstDimNotExtra = u;
  var f = n.label;
  f && f.length && (a = f.slice());
  var c = n.tooltip;
  return c && c.length ? o = c.slice() : o.length || (o = a.slice()), n.defaultedLabel = a, n.defaultedTooltip = o, r.userOutput = new Ine(s, t), r;
}
function mL(e, t) {
  return e.hasOwnProperty(t) || (e[t] = []), e[t];
}
function pb(e) {
  return e === "category" ? "ordinal" : e === "time" ? "time" : "float";
}
function One(e) {
  return !(e === "ordinal" || e === "time");
}
var C2 = (
  /** @class */
  /* @__PURE__ */ (function() {
    function e(t) {
      this.otherDims = {}, t != null && xe(this, t);
    }
    return e;
  })()
), Nne = Bt(), kne = {
  float: "f",
  int: "i",
  ordinal: "o",
  number: "n",
  time: "t"
}, c6 = (
  /** @class */
  (function() {
    function e(t) {
      this.dimensions = t.dimensions, this._dimOmitted = t.dimensionOmitted, this.source = t.source, this._fullDimCount = t.fullDimensionCount, this._updateDimOmitted(t.dimensionOmitted);
    }
    return e.prototype.isDimensionOmitted = function() {
      return this._dimOmitted;
    }, e.prototype._updateDimOmitted = function(t) {
      this._dimOmitted = t, t && (this._dimNameMap || (this._dimNameMap = d6(this.source)));
    }, e.prototype.getSourceDimensionIndex = function(t) {
      return et(this._dimNameMap.get(t), -1);
    }, e.prototype.getSourceDimension = function(t) {
      var r = this.source.dimensionsDefine;
      if (r)
        return r[t];
    }, e.prototype.makeStoreSchema = function() {
      for (var t = this._fullDimCount, r = h8(this.source), n = !p6(t), i = "", a = [], o = 0, s = 0; o < t; o++) {
        var l = void 0, u = void 0, f = void 0, c = this.dimensions[s];
        if (c && c.storeDimIndex === o)
          l = r ? c.name : null, u = c.type, f = c.ordinalMeta, s++;
        else {
          var h = this.getSourceDimension(o);
          h && (l = r ? h.name : null, u = h.type);
        }
        a.push({
          property: l,
          type: u,
          ordinalMeta: f
        }), r && l != null && (!c || !c.isCalculationCoord) && (i += n ? l.replace(/\`/g, "`1").replace(/\$/g, "`2") : l), i += "$", i += kne[u] || "f", f && (i += f.uid), i += "$";
      }
      var v = this.source, d = [v.seriesLayoutBy, v.startIndex, i].join("$$");
      return {
        dimensions: a,
        hash: d
      };
    }, e.prototype.makeOutputDimensionNames = function() {
      for (var t = [], r = 0, n = 0; r < this._fullDimCount; r++) {
        var i = void 0, a = this.dimensions[n];
        if (a && a.storeDimIndex === r)
          a.isCalculationCoord || (i = a.name), n++;
        else {
          var o = this.getSourceDimension(r);
          o && (i = o.name);
        }
        t.push(i);
      }
      return t;
    }, e.prototype.appendCalculationDimension = function(t) {
      this.dimensions.push(t), t.isCalculationCoord = !0, this._fullDimCount++, this._updateDimOmitted(!0);
    }, e;
  })()
);
function h6(e) {
  return e instanceof c6;
}
function v6(e) {
  for (var t = Je(), r = 0; r < (e || []).length; r++) {
    var n = e[r], i = ot(n) ? n.name : n;
    i != null && t.get(i) == null && t.set(i, r);
  }
  return t;
}
function d6(e) {
  var t = Nne(e);
  return t.dimNameMap || (t.dimNameMap = v6(e.dimensionsDefine));
}
function p6(e) {
  return e > 30;
}
var o_ = ot, gc = Ce, Bne = typeof Int32Array > "u" ? Array : Int32Array, zne = "e\0\0", l5 = -1, Fne = ["hasItemOption", "_nameList", "_idList", "_invertedIndicesMap", "_dimSummary", "userOutput", "_rawData", "_dimValueGetter", "_nameDimIdx", "_idDimIdx", "_nameRepeatCount"], Gne = ["_approximateExtent"], u5, iT, s_, l_, yL, u_, _L, zr = (
  /** @class */
  (function() {
    function e(t, r) {
      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;
      h6(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 = {}, f = 0; f < n.length; f++) {
        var c = n[f], h = Fe(c) ? new C2({
          name: c
        }) : c instanceof C2 ? c : new C2(c), 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] = []);
        var g = f;
        Xt(h.storeDimIndex) && (g = h.storeDimIndex), d.itemName === 0 && (this._nameDimIdx = g), d.itemId === 0 && (this._idDimIdx = g), i && (h.storeDimIndex = f);
      }
      if (this.dimensions = o, this._dimInfos = a, this._initGetDimensionInfo(l), this.hostModel = r, this._invertedIndicesMap = s, this._dimOmitted) {
        var y = this._dimIdxToName = Je();
        F(o, function(x) {
          y.set(a[x].storeDimIndex, x);
        });
      }
    }
    return e.prototype.getDimension = function(t) {
      var r = this._recognizeDimIndex(t);
      if (r == null)
        return t;
      if (r = t, !this._dimOmitted)
        return this.dimensions[r];
      var n = this._dimIdxToName.get(r);
      if (n != null)
        return n;
      var i = this._schema.getSourceDimension(r);
      if (i)
        return i.name;
    }, e.prototype.getDimensionIndex = function(t) {
      var r = this._recognizeDimIndex(t);
      if (r != null)
        return r;
      if (t == null)
        return -1;
      var n = this._getDimInfo(t);
      return n ? n.storeDimIndex : this._dimOmitted ? this._schema.getSourceDimensionIndex(t) : -1;
    }, e.prototype._recognizeDimIndex = function(t) {
      if (Xt(t) || t != null && !isNaN(t) && !this._getDimInfo(t) && (!this._dimOmitted || this._schema.getSourceDimensionIndex(t) < 0))
        return +t;
    }, e.prototype._getStoreDimIndex = function(t) {
      var r = this.getDimensionIndex(t);
      return r;
    }, e.prototype.getDimensionInfo = function(t) {
      return this._getDimInfo(this.getDimension(t));
    }, e.prototype._initGetDimensionInfo = function(t) {
      var r = this._dimInfos;
      this._getDimInfo = t ? function(n) {
        return r.hasOwnProperty(n) ? r[n] : void 0;
      } : function(n) {
        return r[n];
      };
    }, e.prototype.getDimensionsOnCoord = function() {
      return this._dimSummary.dataDimsOnCoord.slice();
    }, e.prototype.mapDimension = function(t, r) {
      var n = this._dimSummary;
      if (r == null)
        return n.encodeFirstDimNotExtra[t];
      var i = n.encode[t];
      return i ? i[r] : null;
    }, e.prototype.mapDimensionsAll = function(t) {
      var r = this._dimSummary, n = r.encode[t];
      return (n || []).slice();
    }, e.prototype.getStore = function() {
      return this._store;
    }, e.prototype.initData = function(t, r, n) {
      var i = this, a;
      if (t instanceof xP && (a = t), !a) {
        var o = this.dimensions, s = nO(t) || Vi(t) ? new v8(t, o.length) : t;
        a = new xP();
        var l = gc(o, function(u) {
          return {
            type: i._dimInfos[u].type,
            property: u
          };
        });
        a.initData(s, l, n);
      }
      this._store = a, this._nameList = (r || []).slice(), this._idList = [], this._nameRepeatCount = {}, this._doInit(0, a.count()), this._dimSummary = Rne(this, this._schema), this.userOutput = this._dimSummary.userOutput;
    }, e.prototype.appendData = function(t) {
      var r = this._store.appendData(t);
      this._doInit(r[0], r[1]);
    }, e.prototype.appendValues = function(t, r) {
      var n = this._store.appendValues(t, r && r.length), i = n.start, a = n.end, o = this._shouldMakeIdFromName();
      if (this._updateOrdinalMeta(), r)
        for (var s = i; s < a; s++) {
          var l = s - i;
          this._nameList[s] = r[l], o && _L(this, s);
        }
    }, e.prototype._updateOrdinalMeta = function() {
      for (var t = this._store, r = this.dimensions, n = 0; n < r.length; n++) {
        var i = this._dimInfos[r[n]];
        i.ordinalMeta && t.collectOrdinalMeta(i.storeDimIndex, i.ordinalMeta);
      }
    }, e.prototype._shouldMakeIdFromName = function() {
      var t = this._store.getProvider();
      return this._idDimIdx == null && t.getSource().sourceFormat !== Uc && !t.fillStorage;
    }, e.prototype._doInit = function(t, r) {
      if (!(t >= r)) {
        var n = this._store, i = n.getProvider();
        this._updateOrdinalMeta();
        var a = this._nameList, o = this._idList, s = i.getSource().sourceFormat, l = s === Co;
        if (l && !i.pure)
          for (var u = [], f = t; f < r; f++) {
            var c = i.getItem(f, u);
            if (!this.hasItemOption && hQ(c) && (this.hasItemOption = !0), c) {
              var h = c.name;
              a[f] == null && h != null && (a[f] = Gn(h, null));
              var v = c.id;
              o[f] == null && v != null && (o[f] = Gn(v, null));
            }
          }
        if (this._shouldMakeIdFromName())
          for (var f = t; f < r; f++)
            _L(this, f);
        u5(this);
      }
    }, e.prototype.getApproximateExtent = function(t) {
      return this._approximateExtent[t] || this._store.getDataExtent(this._getStoreDimIndex(t));
    }, e.prototype.setApproximateExtent = function(t, r) {
      r = this.getDimension(r), this._approximateExtent[r] = t.slice();
    }, e.prototype.getCalculationInfo = function(t) {
      return this._calculationInfo[t];
    }, e.prototype.setCalculationInfo = function(t, r) {
      o_(t) ? xe(this._calculationInfo, t) : this._calculationInfo[t] = r;
    }, e.prototype.getName = function(t) {
      var r = this.getRawIndex(t), n = this._nameList[r];
      return n == null && this._nameDimIdx != null && (n = s_(this, this._nameDimIdx, r)), n == null && (n = ""), n;
    }, e.prototype._getCategory = function(t, r) {
      var n = this._store.get(t, r), i = this._store.getOrdinalMeta(t);
      return i ? i.categories[n] : n;
    }, e.prototype.getId = function(t) {
      return iT(this, this.getRawIndex(t));
    }, e.prototype.count = function() {
      return this._store.count();
    }, e.prototype.get = function(t, r) {
      var n = this._store, i = this._dimInfos[t];
      if (i)
        return n.get(i.storeDimIndex, r);
    }, e.prototype.getByRawIndex = function(t, r) {
      var n = this._store, i = this._dimInfos[t];
      if (i)
        return n.getByRawIndex(i.storeDimIndex, r);
    }, e.prototype.getIndices = function() {
      return this._store.getIndices();
    }, e.prototype.getDataExtent = function(t) {
      return this._store.getDataExtent(this._getStoreDimIndex(t));
    }, e.prototype.getSum = function(t) {
      return this._store.getSum(this._getStoreDimIndex(t));
    }, e.prototype.getMedian = function(t) {
      return this._store.getMedian(this._getStoreDimIndex(t));
    }, e.prototype.getValues = function(t, r) {
      var n = this, i = this._store;
      return Se(t) ? i.getValues(gc(t, function(a) {
        return n._getStoreDimIndex(a);
      }), r) : i.getValues(t);
    }, e.prototype.hasValue = function(t) {
      for (var r = this._dimSummary.dataDimIndicesOnCoord, n = 0, i = r.length; n < i; n++)
        if (isNaN(this._store.get(r[n], t)))
          return !1;
      return !0;
    }, e.prototype.indexOfName = function(t) {
      for (var r = 0, n = this._store.count(); r < n; r++)
        if (this.getName(r) === t)
          return r;
      return -1;
    }, e.prototype.getRawIndex = function(t) {
      return this._store.getRawIndex(t);
    }, e.prototype.indexOfRawIndex = function(t) {
      return this._store.indexOfRawIndex(t);
    }, e.prototype.rawIndexOf = function(t, r) {
      var n = t && this._invertedIndicesMap[t], i = n && n[r];
      return i == null || isNaN(i) ? l5 : i;
    }, e.prototype.each = function(t, r, n) {
      nt(t) && (n = r, r = t, t = []);
      var i = n || this, a = gc(l_(t), this._getStoreDimIndex, this);
      this._store.each(a, i ? Ge(r, i) : r);
    }, e.prototype.filterSelf = function(t, r, n) {
      nt(t) && (n = r, r = t, t = []);
      var i = n || this, a = gc(l_(t), this._getStoreDimIndex, this);
      return this._store = this._store.filter(a, i ? Ge(r, i) : r), this;
    }, e.prototype.selectRange = function(t) {
      var r = this, n = {}, i = Ht(t);
      return F(i, function(a) {
        var o = r._getStoreDimIndex(a);
        n[o] = t[a];
      }), this._store = this._store.selectRange(n), this;
    }, e.prototype.mapArray = function(t, r, n) {
      nt(t) && (n = r, r = t, t = []), n = n || this;
      var i = [];
      return this.each(t, function() {
        i.push(r && r.apply(this, arguments));
      }, n), i;
    }, e.prototype.map = function(t, r, n, i) {
      var a = n || i || this, o = gc(l_(t), this._getStoreDimIndex, this), s = u_(this);
      return s._store = this._store.map(o, a ? Ge(r, a) : r), s;
    }, e.prototype.modify = function(t, r, n, i) {
      var a = n || i || this, o = gc(l_(t), this._getStoreDimIndex, this);
      this._store.modify(o, a ? Ge(r, a) : r);
    }, e.prototype.downSample = function(t, r, n, i) {
      var a = u_(this);
      return a._store = this._store.downSample(this._getStoreDimIndex(t), r, n, i), a;
    }, e.prototype.minmaxDownSample = function(t, r) {
      var n = u_(this);
      return n._store = this._store.minmaxDownSample(this._getStoreDimIndex(t), r), n;
    }, e.prototype.lttbDownSample = function(t, r) {
      var n = u_(this);
      return n._store = this._store.lttbDownSample(this._getStoreDimIndex(t), r), n;
    }, e.prototype.getRawDataItem = function(t) {
      return this._store.getRawDataItem(t);
    }, e.prototype.getItemModel = function(t) {
      var r = this.hostModel, n = this.getRawDataItem(t);
      return new It(n, r, r && r.ecModel);
    }, e.prototype.diff = function(t) {
      var r = this;
      return new _f(t ? t.getStore().getIndices() : [], this.getStore().getIndices(), function(n) {
        return iT(t, n);
      }, function(n) {
        return iT(r, n);
      });
    }, e.prototype.getVisual = function(t) {
      var r = this._visual;
      return r && r[t];
    }, e.prototype.setVisual = function(t, r) {
      this._visual = this._visual || {}, o_(t) ? xe(this._visual, t) : this._visual[t] = r;
    }, e.prototype.getItemVisual = function(t, r) {
      var n = this._itemVisuals[t], i = n && n[r];
      return i ?? this.getVisual(r);
    }, e.prototype.hasItemVisual = function() {
      return this._itemVisuals.length > 0;
    }, e.prototype.ensureUniqueItemVisual = function(t, r) {
      var n = this._itemVisuals, i = n[t];
      i || (i = n[t] = {});
      var a = i[r];
      return a == null && (a = this.getVisual(r), Se(a) ? a = a.slice() : o_(a) && (a = xe({}, a)), i[r] = a), a;
    }, e.prototype.setItemVisual = function(t, r, n) {
      var i = this._itemVisuals[t] || {};
      this._itemVisuals[t] = i, o_(r) ? xe(i, r) : i[r] = n;
    }, e.prototype.clearAllVisual = function() {
      this._visual = {}, this._itemVisuals = [];
    }, e.prototype.setLayout = function(t, r) {
      o_(t) ? xe(this._layout, t) : this._layout[t] = r;
    }, e.prototype.getLayout = function(t) {
      return this._layout[t];
    }, e.prototype.getItemLayout = function(t) {
      return this._itemLayouts[t];
    }, e.prototype.setItemLayout = function(t, r, n) {
      this._itemLayouts[t] = n ? xe(this._itemLayouts[t] || {}, r) : r;
    }, e.prototype.clearItemLayouts = function() {
      this._itemLayouts.length = 0;
    }, e.prototype.setItemGraphicEl = function(t, r) {
      var n = this.hostModel && this.hostModel.seriesIndex;
      nP(n, this.dataType, t, r), this._graphicEls[t] = r;
    }, e.prototype.getItemGraphicEl = function(t) {
      return this._graphicEls[t];
    }, e.prototype.eachItemGraphicEl = function(t, r) {
      F(this._graphicEls, function(n, i) {
        n && t && t.call(r, n, i);
      });
    }, e.prototype.cloneShallow = function(t) {
      return t || (t = new e(this._schema ? this._schema : gc(this.dimensions, this._getDimInfo, this), this.hostModel)), yL(t, this), t._store = this._store, t;
    }, e.prototype.wrapMethod = function(t, r) {
      var n = this[t];
      nt(n) && (this.__wrappedMethods = this.__wrappedMethods || [], this.__wrappedMethods.push(t), this[t] = function() {
        var i = n.apply(this, arguments);
        return r.apply(this, [i].concat(cC(arguments)));
      });
    }, e.internalField = (function() {
      u5 = function(t) {
        var r = t._invertedIndicesMap;
        F(r, function(n, i) {
          var a = t._dimInfos[i], o = a.ordinalMeta, s = t._store;
          if (o) {
            n = r[i] = new Bne(o.categories.length);
            for (var l = 0; l < n.length; l++)
              n[l] = l5;
            for (var l = 0; l < s.count(); l++)
              n[s.get(a.storeDimIndex, l)] = l;
          }
        });
      }, s_ = function(t, r, n) {
        return Gn(t._getCategory(r, n), null);
      }, iT = function(t, r) {
        var n = t._idList[r];
        return n == null && t._idDimIdx != null && (n = s_(t, t._idDimIdx, r)), n == null && (n = zne + r), n;
      }, l_ = function(t) {
        return Se(t) || (t = t != null ? [t] : []), t;
      }, u_ = function(t) {
        var r = new e(t._schema ? t._schema : gc(t.dimensions, t._getDimInfo, t), t.hostModel);
        return yL(r, t), r;
      }, yL = function(t, r) {
        F(Fne.concat(r.__wrappedMethods || []), function(n) {
          r.hasOwnProperty(n) && (t[n] = r[n]);
        }), t.__wrappedMethods = r.__wrappedMethods, F(Gne, function(n) {
          t[n] = it(r[n]);
        }), t._calculationInfo = xe({}, r._calculationInfo);
      }, _L = function(t, r) {
        var n = t._nameList, i = t._idList, a = t._nameDimIdx, o = t._idDimIdx, s = n[r], l = i[r];
        if (s == null && a != null && (n[r] = s = s_(t, a, r)), l == null && o != null && (i[r] = l = s_(t, o, r)), l == null && s != null) {
          var u = t._nameRepeatCount, f = u[s] = (u[s] || 0) + 1;
          l = s, f > 1 && (l += "__ec__" + f), i[r] = l;
        }
      };
    })(), e;
  })()
);
function ah(e, t) {
  return sy(e, t).dimensions;
}
function sy(e, t) {
  nO(e) || (e = iO(e)), t = t || {};
  var r = t.coordDimensions || [], n = t.dimensionsDefine || e.dimensionsDefine || [], i = Je(), a = [], o = Hne(e, r, n, t.dimensionsCount), s = t.canOmitUnusedDimensions && p6(o), l = n === e.dimensionsDefine, u = l ? d6(e) : v6(n), f = t.encodeDefine;
  !f && t.encodeDefaulter && (f = t.encodeDefaulter(e, o));
  for (var c = Je(f), h = new S8(o), v = 0; v < h.length; v++)
    h[v] = -1;
  function d(R) {
    var O = h[R];
    if (O < 0) {
      var N = n[R], G = ot(N) ? N : {
        name: N
      }, z = new C2(), H = G.name;
      H != null && u.get(H) != null && (z.name = z.displayName = H), G.type != null && (z.type = G.type), G.displayName != null && (z.displayName = G.displayName);
      var W = a.length;
      return h[R] = W, z.storeDimIndex = R, a.push(z), z;
    }
    return a[O];
  }
  if (!s)
    for (var v = 0; v < o; v++)
      d(v);
  c.each(function(R, O) {
    var N = Mr(R).slice();
    if (N.length === 1 && !Fe(N[0]) && N[0] < 0) {
      c.set(O, !1);
      return;
    }
    var G = c.set(O, []);
    F(N, function(z, H) {
      var W = Fe(z) ? u.get(z) : z;
      W != null && W < o && (G[H] = W, y(d(W), O, H));
    });
  });
  var g = 0;
  F(r, function(R) {
    var O, N, G, z;
    if (Fe(R))
      O = R, z = {};
    else {
      z = R, O = z.name;
      var H = z.ordinalMeta;
      z.ordinalMeta = null, z = xe({}, z), z.ordinalMeta = H, N = z.dimsDef, G = z.otherDims, z.name = z.coordDim = z.coordDimIndex = z.dimsDef = z.otherDims = null;
    }
    var W = c.get(O);
    if (W !== !1) {
      if (W = Mr(W), !W.length)
        for (var Z = 0; Z < (N && N.length || 1); Z++) {
          for (; g < o && d(g).coordDim != null; )
            g++;
          g < o && W.push(g++);
        }
      F(W, function(ee, V) {
        var Q = d(ee);
        if (l && z.type != null && (Q.type = z.type), y(tt(Q, z), O, V), Q.name == null && N) {
          var q = N[V];
          !ot(q) && (q = {
            name: q
          }), Q.name = Q.displayName = q.name, Q.defaultTooltip = q.defaultTooltip;
        }
        G && tt(Q.otherDims, G);
      });
    }
  });
  function y(R, O, N) {
    t8.get(O) != null ? R.otherDims[O] = N : (R.coordDim = O, R.coordDimIndex = N, i.set(O, !0));
  }
  var x = t.generateCoord, S = t.generateCoordCount, T = S != null;
  S = x ? S || 1 : 0;
  var C = x || "value";
  function A(R) {
    R.name == null && (R.name = R.coordDim);
  }
  if (s)
    F(a, function(R) {
      A(R);
    }), a.sort(function(R, O) {
      return R.storeDimIndex - O.storeDimIndex;
    });
  else
    for (var M = 0; M < o; M++) {
      var E = d(M), P = E.coordDim;
      P == null && (E.coordDim = Une(C, i, T), E.coordDimIndex = 0, (!x || S <= 0) && (E.isExtraCoord = !0), S--), A(E), E.type == null && (a8(e, M) === zi.Must || E.isExtraCoord && (E.otherDims.itemName != null || E.otherDims.seriesName != null)) && (E.type = "ordinal");
    }
  return Vne(a), new c6({
    source: e,
    dimensions: a,
    fullDimensionCount: o,
    dimensionOmitted: s
  });
}
function Vne(e) {
  for (var t = Je(), r = 0; r < e.length; r++) {
    var n = e[r], i = n.name, a = t.get(i) || 0;
    a > 0 && (n.name = i + (a - 1)), a++, t.set(i, a);
  }
}
function Hne(e, t, r, n) {
  var i = Math.max(e.dimensionsDetectedCount || 1, t.length, r.length, n || 0);
  return F(t, function(a) {
    var o;
    ot(a) && (o = a.dimsDef) && (i = Math.max(i, o.length));
  }), i;
}
function Une(e, t, r) {
  if (r || t.hasKey(e)) {
    for (var n = 0; t.hasKey(e + n); )
      n++;
    e += n;
  }
  return t.set(e, !0), e;
}
var Wne = (
  /** @class */
  /* @__PURE__ */ (function() {
    function e(t) {
      this.coordSysDims = [], this.axisMap = Je(), this.categoryAxisMap = Je(), this.coordSysName = t;
    }
    return e;
  })()
);
function Xne(e) {
  var t = e.get("coordinateSystem"), r = new Wne(t), n = Yne[t];
  if (n)
    return n(e, r, r.axisMap, r.categoryAxisMap), r;
}
var Yne = {
  cartesian2d: function(e, t, r, n) {
    var i = e.getReferringComponents("xAxis", an).models[0], a = e.getReferringComponents("yAxis", an).models[0];
    t.coordSysDims = ["x", "y"], r.set("x", i), r.set("y", a), Dg(i) && (n.set("x", i), t.firstCategoryDimIndex = 0), Dg(a) && (n.set("y", a), t.firstCategoryDimIndex == null && (t.firstCategoryDimIndex = 1));
  },
  singleAxis: function(e, t, r, n) {
    var i = e.getReferringComponents("singleAxis", an).models[0];
    t.coordSysDims = ["single"], r.set("single", i), Dg(i) && (n.set("single", i), t.firstCategoryDimIndex = 0);
  },
  polar: function(e, t, r, n) {
    var i = e.getReferringComponents("polar", an).models[0], a = i.findAxisModel("radiusAxis"), o = i.findAxisModel("angleAxis");
    t.coordSysDims = ["radius", "angle"], r.set("radius", a), r.set("angle", o), Dg(a) && (n.set("radius", a), t.firstCategoryDimIndex = 0), Dg(o) && (n.set("angle", o), t.firstCategoryDimIndex == null && (t.firstCategoryDimIndex = 1));
  },
  geo: function(e, t, r, n) {
    t.coordSysDims = ["lng", "lat"];
  },
  parallel: function(e, t, r, n) {
    var i = e.ecModel, a = i.getComponent("parallel", e.get("parallelIndex")), o = t.coordSysDims = a.dimensions.slice();
    F(a.parallelAxisIndex, function(s, l) {
      var u = i.getComponent("parallelAxis", s), f = o[l];
      r.set(f, u), Dg(u) && (n.set(f, u), t.firstCategoryDimIndex == null && (t.firstCategoryDimIndex = l));
    });
  },
  matrix: function(e, t, r, n) {
    var i = e.getReferringComponents("matrix", an).models[0];
    t.coordSysDims = ["x", "y"];
    var a = i.getDimensionModel("x"), o = i.getDimensionModel("y");
    r.set("x", a), r.set("y", o), n.set("x", a), n.set("y", o);
  }
};
function Dg(e) {
  return e.get("type") === "category";
}
function g6(e, t, r) {
  r = r || {};
  var n = r.byIndex, i = r.stackedCoordDimension, a, o, s;
  Zne(t) ? a = t : (o = t.schema, a = o.dimensions, s = t.store);
  var l = !!(e && e.get("stack")), u, f, c, h;
  if (F(a, function(S, T) {
    Fe(S) && (a[T] = S = {
      name: S
    }), l && !S.isExtraCoord && (!n && !u && S.ordinalMeta && (u = S), !f && S.type !== "ordinal" && S.type !== "time" && (!i || i === S.coordDim) && (f = S));
  }), f && !n && !u && (n = !0), f) {
    c = "__\0ecstackresult_" + e.id, h = "__\0ecstackedover_" + e.id, u && (u.createInvertedIndices = !0);
    var v = f.coordDim, d = f.type, g = 0;
    F(a, function(S) {
      S.coordDim === v && g++;
    });
    var y = {
      name: c,
      coordDim: v,
      coordDimIndex: g,
      type: d,
      isExtraCoord: !0,
      isCalculationCoord: !0,
      storeDimIndex: a.length
    }, x = {
      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: g + 1,
      type: d,
      isExtraCoord: !0,
      isCalculationCoord: !0,
      storeDimIndex: a.length + 1
    };
    o ? (s && (y.storeDimIndex = s.ensureCalculationDimension(h, d), x.storeDimIndex = s.ensureCalculationDimension(c, d)), o.appendCalculationDimension(y), o.appendCalculationDimension(x)) : (a.push(y), a.push(x));
  }
  return {
    stackedDimension: f && f.name,
    stackedByDimension: u && u.name,
    isStackedByIndex: n,
    stackedOverDimension: h,
    stackResultDimension: c
  };
}
function Zne(e) {
  return !h6(e.schema);
}
function xf(e, t) {
  return !!t && t === e.getCalculationInfo("stackedDimension");
}
function wO(e, t) {
  return xf(e, t) ? e.getCalculationInfo("stackResultDimension") : t;
}
function $ne(e, t) {
  var r = e.get("coordinateSystem"), n = ny.get(r), i;
  return t && t.coordSysDims && (i = Ce(t.coordSysDims, function(a) {
    var o = {
      name: a
    }, s = t.axisMap.get(a);
    if (s) {
      var l = s.get("type");
      o.type = pb(l);
    }
    return o;
  })), i || (i = n && (n.getDimensionsInfo ? n.getDimensionsInfo() : n.dimensions.slice()) || ["x", "y"]), i;
}
function qne(e, t, r) {
  var n, i;
  return r && F(e, function(a, o) {
    var s = a.coordDim, l = r.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 && (e[n].otherDims.itemName = 0), n;
}
function ou(e, t, r) {
  r = r || {};
  var n = t.getSourceManager(), i, a = !1;
  e ? (a = !0, i = iO(e)) : (i = n.getSource(), a = i.sourceFormat === Co);
  var o = Xne(t), s = $ne(t, o), l = r.useEncodeDefaulter, u = nt(l) ? l : l ? St(i8, s, t) : null, f = {
    coordDimensions: s,
    generateCoord: r.generateCoord,
    encodeDefine: t.getEncode(),
    encodeDefaulter: u,
    canOmitUnusedDimensions: !a
  }, c = sy(i, f), h = qne(c.dimensions, r.createInvertedIndices, o), v = a ? null : n.getSharedDataStore(c), d = g6(t, {
    schema: c,
    store: v
  }), g = new zr(c, t);
  g.setCalculationInfo(d);
  var y = h != null && jne(i) ? function(x, S, T, C) {
    return C === h ? T : this.defaultDimValueGetter(x, S, T, C);
  } : null;
  return g.hasItemOption = !1, g.initData(
    // Try to reuse the data store in sourceManager if using dataset.
    a ? i : v,
    null,
    y
  ), g;
}
function jne(e) {
  if (e.sourceFormat === Co) {
    var t = Kne(e.data || []);
    return !Se(Ym(t));
  }
}
function Kne(e) {
  for (var t = 0; t < e.length && e[t] == null; )
    t++;
  return e[t];
}
function IP(e) {
  return e.type === "interval" || e.type === "log";
}
function Qne(e, t, r, n, i) {
  var a = {}, o = a.interval = gR(t / r, !0);
  n != null && o < n && (o = a.interval = n), i != null && o > i && (o = a.interval = i);
  var s = a.intervalPrecision = Y1(o), l = a.niceTickExtent = [jr(Math.ceil(e[0] / o) * o, s), jr(Math.floor(e[1] / o) * o, s)];
  return Jne(l, e), a;
}
function xL(e) {
  var t = Math.pow(10, yC(e)), r = e / t;
  return r ? r === 2 ? r = 3 : r === 3 ? r = 5 : r *= 2 : r = 1, jr(r * t);
}
function Y1(e) {
  return Gs(e) + 2;
}
function f5(e, t, r) {
  e[t] = Math.max(Math.min(e[t], r[1]), r[0]);
}
function Jne(e, t) {
  !isFinite(e[0]) && (e[0] = t[0]), !isFinite(e[1]) && (e[1] = t[1]), f5(e, 0, t), f5(e, 1, t), e[0] > e[1] && (e[0] = e[1]);
}
function TO(e, t) {
  return e >= t[0] && e <= t[1];
}
var eie = (
  /** @class */
  (function() {
    function e() {
      this.normalize = c5, this.scale = h5;
    }
    return e.prototype.updateMethods = function(t) {
      t.hasBreaks() ? (this.normalize = Ge(t.normalize, t), this.scale = Ge(t.scale, t)) : (this.normalize = c5, this.scale = h5);
    }, e;
  })()
);
function c5(e, t) {
  return t[1] === t[0] ? 0.5 : (e - t[0]) / (t[1] - t[0]);
}
function h5(e, t) {
  return e * (t[1] - t[0]) + t[0];
}
function RP(e, t, r) {
  var n = Math.log(e);
  return [
    // log(negative) is NaN, so safe guard here.
    // PENDING: But even getting a -Infinity still does not make sense in extent.
    //  Just keep it as is, getting a NaN to make some previous cases works by coincidence.
    Math.log(r ? t[0] : Math.max(0, t[0])) / n,
    Math.log(r ? t[1] : Math.max(0, t[1])) / n
  ];
}
var oh = (
  /** @class */
  (function() {
    function e(t) {
      this._calculator = new eie(), this._setting = t || {}, this._extent = [1 / 0, -1 / 0];
      var r = En();
      r && (this._brkCtx = r.createScaleBreakContext(), this._brkCtx.update(this._extent));
    }
    return e.prototype.getSetting = function(t) {
      return this._setting[t];
    }, e.prototype._innerUnionExtent = function(t) {
      var r = this._extent;
      this._innerSetExtent(t[0] < r[0] ? t[0] : r[0], t[1] > r[1] ? t[1] : r[1]);
    }, e.prototype.unionExtentFromData = function(t, r) {
      this._innerUnionExtent(t.getApproximateExtent(r));
    }, e.prototype.getExtent = function() {
      return this._extent.slice();
    }, e.prototype.setExtent = function(t, r) {
      this._innerSetExtent(t, r);
    }, e.prototype._innerSetExtent = function(t, r) {
      var n = this._extent;
      isNaN(t) || (n[0] = t), isNaN(r) || (n[1] = r), this._brkCtx && this._brkCtx.update(n);
    }, e.prototype.setBreaksFromOption = function(t) {
      var r = En();
      r && this._innerSetBreak(r.parseAxisBreakOption(t, Ge(this.parse, this)));
    }, e.prototype._innerSetBreak = function(t) {
      this._brkCtx && (this._brkCtx.setBreaks(t), this._calculator.updateMethods(this._brkCtx), this._brkCtx.update(this._extent));
    }, e.prototype._innerGetBreaks = function() {
      return this._brkCtx ? this._brkCtx.breaks : [];
    }, e.prototype.hasBreaks = function() {
      return this._brkCtx ? this._brkCtx.hasBreaks() : !1;
    }, e.prototype._getExtentSpanWithBreaks = function() {
      return this._brkCtx && this._brkCtx.hasBreaks() ? this._brkCtx.getExtentSpan() : this._extent[1] - this._extent[0];
    }, e.prototype.isInExtentRange = function(t) {
      return this._extent[0] <= t && this._extent[1] >= t;
    }, e.prototype.isBlank = function() {
      return this._isBlank;
    }, e.prototype.setBlank = function(t) {
      this._isBlank = t;
    }, e;
  })()
);
_C(oh);
var tie = 0, Mm = (
  /** @class */
  (function() {
    function e(t) {
      this.categories = t.categories || [], this._needCollect = t.needCollect, this._deduplication = t.deduplication, this.uid = ++tie, this._onCollect = t.onCollect;
    }
    return e.createByAxisModel = function(t) {
      var r = t.option, n = r.data, i = n && Ce(n, rie);
      return new e({
        categories: i,
        needCollect: !i,
        // deduplication is default in axis.
        deduplication: r.dedplication !== !1
      });
    }, e.prototype.getOrdinal = function(t) {
      return this._getOrCreateMap().get(t);
    }, e.prototype.parseAndCollect = function(t) {
      var r, n = this._needCollect;
      if (!Fe(t) && !n)
        return t;
      if (n && !this._deduplication)
        return r = this.categories.length, this.categories[r] = t, this._onCollect && this._onCollect(t, r), r;
      var i = this._getOrCreateMap();
      return r = i.get(t), r == null && (n ? (r = this.categories.length, this.categories[r] = t, i.set(t, r), this._onCollect && this._onCollect(t, r)) : r = NaN), r;
    }, e.prototype._getOrCreateMap = function() {
      return this._map || (this._map = Je(this.categories));
    }, e;
  })()
);
function rie(e) {
  return ot(e) && e.value != null ? e.value : e + "";
}
var Lm = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r) {
      var n = e.call(this, r) || this;
      n.type = "ordinal";
      var i = n.getSetting("ordinalMeta");
      return i || (i = new Mm({})), Se(i) && (i = new Mm({
        categories: Ce(i, function(a) {
          return ot(a) ? a.value : a;
        })
      })), n._ordinalMeta = i, n._extent = n.getSetting("extent") || [0, i.categories.length - 1], n;
    }
    return t.prototype.parse = function(r) {
      return r == null ? NaN : Fe(r) ? this._ordinalMeta.getOrdinal(r) : Math.round(r);
    }, t.prototype.contain = function(r) {
      return TO(r, this._extent) && r >= 0 && r < this._ordinalMeta.categories.length;
    }, t.prototype.normalize = function(r) {
      return r = this._getTickNumber(r), this._calculator.normalize(r, this._extent);
    }, t.prototype.scale = function(r) {
      return r = Math.round(this._calculator.scale(r, this._extent)), this.getRawOrdinalNumber(r);
    }, t.prototype.getTicks = function() {
      for (var r = [], n = this._extent, i = n[0]; i <= n[1]; )
        r.push({
          value: i
        }), i++;
      return r;
    }, t.prototype.getMinorTicks = function(r) {
    }, t.prototype.setSortInfo = function(r) {
      if (r == null) {
        this._ordinalNumbersByTick = this._ticksByOrdinalNumber = null;
        return;
      }
      for (var n = r.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 f = 0; o < s; ++o) {
        for (; a[f] != null; )
          f++;
        i.push(f), a[f] = o;
      }
    }, t.prototype._getTickNumber = function(r) {
      var n = this._ticksByOrdinalNumber;
      return n && r >= 0 && r < n.length ? n[r] : r;
    }, t.prototype.getRawOrdinalNumber = function(r) {
      var n = this._ordinalNumbersByTick;
      return n && r >= 0 && r < n.length ? n[r] : r;
    }, t.prototype.getLabel = function(r) {
      if (!this.isBlank()) {
        var n = this.getRawOrdinalNumber(r.value), i = this._ordinalMeta.categories[n];
        return i == null ? "" : i + "";
      }
    }, t.prototype.count = function() {
      return this._extent[1] - this._extent[0] + 1;
    }, t.prototype.isInExtentRange = function(r) {
      return r = this._getTickNumber(r), this._extent[0] <= r && this._extent[1] >= r;
    }, t.prototype.getOrdinalMeta = function() {
      return this._ordinalMeta;
    }, t.prototype.calcNiceTicks = function() {
    }, t.prototype.calcNiceExtent = function() {
    }, t.type = "ordinal", t;
  })(oh)
);
oh.registerClass(Lm);
var mc = jr, Sf = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = "interval", r._interval = 0, r._intervalPrecision = 2, r;
    }
    return t.prototype.parse = function(r) {
      return r == null || r === "" ? NaN : Number(r);
    }, t.prototype.contain = function(r) {
      return TO(r, this._extent);
    }, t.prototype.normalize = function(r) {
      return this._calculator.normalize(r, this._extent);
    }, t.prototype.scale = function(r) {
      return this._calculator.scale(r, this._extent);
    }, t.prototype.getInterval = function() {
      return this._interval;
    }, t.prototype.setInterval = function(r) {
      this._interval = r, this._niceExtent = this._extent.slice(), this._intervalPrecision = Y1(r);
    }, t.prototype.getTicks = function(r) {
      r = r || {};
      var n = this._interval, i = this._extent, a = this._niceExtent, o = this._intervalPrecision, s = En(), l = [];
      if (!n)
        return l;
      if (r.breakTicks === "only_break" && s)
        return s.addBreaksToTicks(l, this._brkCtx.breaks, this._extent), l;
      var u = 1e4;
      i[0] < a[0] && (r.expandToNicedExtent ? l.push({
        value: mc(a[0] - n, o)
      }) : l.push({
        value: i[0]
      }));
      for (var f = function(d, g) {
        return Math.round((g - d) / n);
      }, c = a[0]; c <= a[1]; ) {
        if (l.push({
          value: c
        }), c = mc(c + n, o), this._brkCtx) {
          var h = this._brkCtx.calcNiceTickMultiple(c, f);
          h >= 0 && (c = mc(c + h * n, o));
        }
        if (l.length > 0 && c === l[l.length - 1].value)
          break;
        if (l.length > u)
          return [];
      }
      var v = l.length ? l[l.length - 1].value : a[1];
      return i[1] > v && (r.expandToNicedExtent ? l.push({
        value: mc(v + n, o)
      }) : l.push({
        value: i[1]
      })), s && s.pruneTicksByBreak(r.pruneByBreak, l, this._brkCtx.breaks, function(d) {
        return d.value;
      }, this._interval, this._extent), r.breakTicks !== "none" && s && s.addBreaksToTicks(l, this._brkCtx.breaks, this._extent), l;
    }, t.prototype.getMinorTicks = function(r) {
      for (var n = this.getTicks({
        expandToNicedExtent: !0
      }), i = [], a = this.getExtent(), o = 1; o < n.length; o++) {
        var s = n[o], l = n[o - 1];
        if (!(l.break || s.break)) {
          for (var u = 0, f = [], c = s.value - l.value, h = c / r, v = Y1(h); u < r - 1; ) {
            var d = mc(l.value + (u + 1) * h, v);
            d > a[0] && d < a[1] && f.push(d), u++;
          }
          var g = En();
          g && g.pruneTicksByBreak("auto", f, this._getNonTransBreaks(), function(y) {
            return y;
          }, this._interval, a), i.push(f);
        }
      }
      return i;
    }, t.prototype._getNonTransBreaks = function() {
      return this._brkCtx ? this._brkCtx.breaks : [];
    }, t.prototype.getLabel = function(r, n) {
      if (r == null)
        return "";
      var i = n && n.precision;
      i == null ? i = Gs(r.value) || 0 : i === "auto" && (i = this._intervalPrecision);
      var a = mc(r.value, i, !0);
      return G1(a);
    }, t.prototype.calcNiceTicks = function(r, n, i) {
      r = r || 5;
      var a = this._extent.slice(), o = this._getExtentSpanWithBreaks();
      if (isFinite(o)) {
        o < 0 && (o = -o, a.reverse(), this._innerSetExtent(a[0], a[1]), a = this._extent.slice());
        var s = Qne(a, o, r, n, i);
        this._intervalPrecision = s.intervalPrecision, this._interval = s.interval, this._niceExtent = s.niceTickExtent;
      }
    }, t.prototype.calcNiceExtent = function(r) {
      var n = this._extent.slice();
      if (n[0] === n[1])
        if (n[0] !== 0) {
          var i = Math.abs(n[0]);
          r.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._innerSetExtent(n[0], n[1]), n = this._extent.slice(), this.calcNiceTicks(r.splitNumber, r.minInterval, r.maxInterval);
      var o = this._interval, s = this._intervalPrecision;
      r.fixMin || (n[0] = mc(Math.floor(n[0] / o) * o, s)), r.fixMax || (n[1] = mc(Math.ceil(n[1] / o) * o, s)), this._innerSetExtent(n[0], n[1]);
    }, t.prototype.setNiceExtent = function(r, n) {
      this._niceExtent = [r, n];
    }, t.type = "interval", t;
  })(oh)
);
oh.registerClass(Sf);
var m6 = typeof Float32Array < "u", nie = m6 ? Float32Array : Array;
function Wl(e) {
  return Se(e) ? m6 ? new Float32Array(e) : e : new nie(e);
}
var OP = "__ec_stack_";
function y6(e) {
  return e.get("stack") || OP + e.seriesIndex;
}
function bO(e) {
  return e.dim + e.index;
}
function iie(e) {
  var t = [], r = e.axis, n = "axis0";
  if (r.type === "category") {
    for (var i = r.getBandWidth(), a = 0; a < e.count; a++)
      t.push(tt({
        bandWidth: i,
        axisKey: n,
        stackId: OP + a
      }, e));
    for (var o = S6(t), s = [], a = 0; a < e.count; a++) {
      var l = o[n][OP + a];
      l.offsetCenter = l.offset + l.width / 2, s.push(l);
    }
    return s;
  }
}
function _6(e, t) {
  var r = [];
  return t.eachSeriesByType(e, function(n) {
    b6(n) && r.push(n);
  }), r;
}
function aie(e) {
  var t = {};
  F(e, function(l) {
    var u = l.coordinateSystem, f = u.getBaseAxis();
    if (!(f.type !== "time" && f.type !== "value"))
      for (var c = l.getData(), h = f.dim + "_" + f.index, v = c.getDimensionIndex(c.mapDimension(f.dim)), d = c.getStore(), g = 0, y = d.count(); g < y; ++g) {
        var x = d.get(v, g);
        t[h] ? t[h].push(x) : t[h] = [x];
      }
  });
  var r = {};
  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));
        }
        r[n] = a;
      }
    }
  return r;
}
function x6(e) {
  var t = aie(e), r = [];
  return F(e, 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], f = Math.abs(o[1] - o[0]), c = a.scale.getExtent(), h = Math.abs(c[1] - c[0]);
      s = u ? f / h * u : f;
    } else {
      var v = n.getData();
      s = Math.abs(o[1] - o[0]) / v.count();
    }
    var d = Be(n.get("barWidth"), s), g = Be(n.get("barMaxWidth"), s), y = Be(
      // 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") || (C6(n) ? 0.5 : 1),
      s
    ), x = n.get("barGap"), S = n.get("barCategoryGap"), T = n.get("defaultBarGap");
    r.push({
      bandWidth: s,
      barWidth: d,
      barMaxWidth: g,
      barMinWidth: y,
      barGap: x,
      barCategoryGap: S,
      defaultBarGap: T,
      axisKey: bO(a),
      stackId: y6(n)
    });
  }), S6(r);
}
function S6(e) {
  var t = {};
  F(e, function(n, i) {
    var a = n.axisKey, o = n.bandWidth, s = t[a] || {
      bandWidth: o,
      remainedWidth: o,
      autoWidthCount: 0,
      categoryGap: null,
      gap: n.defaultBarGap || 0,
      stacks: {}
    }, l = s.stacks;
    t[a] = s;
    var u = n.stackId;
    l[u] || s.autoWidthCount++, l[u] = l[u] || {
      width: 0,
      maxWidth: 0
    };
    var f = n.barWidth;
    f && !l[u].width && (l[u].width = f, f = Math.min(s.remainedWidth, f), s.remainedWidth -= f);
    var c = n.barMaxWidth;
    c && (l[u].maxWidth = c);
    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 r = {};
  return F(t, function(n, i) {
    r[i] = {};
    var a = n.stacks, o = n.bandWidth, s = n.categoryGap;
    if (s == null) {
      var l = Ht(a).length;
      s = Math.max(35 - l * 4, 15) + "%";
    }
    var u = Be(s, o), f = Be(n.gap, 1), c = n.remainedWidth, h = n.autoWidthCount, v = (c - u) / (h + (h - 1) * f);
    v = Math.max(v, 0), F(a, function(x) {
      var S = x.maxWidth, T = x.minWidth;
      if (x.width) {
        var C = x.width;
        S && (C = Math.min(C, S)), T && (C = Math.max(C, T)), x.width = C, c -= C + f * C, h--;
      } else {
        var C = v;
        S && S < C && (C = Math.min(S, c)), T && T > C && (C = T), C !== v && (x.width = C, c -= C + f * C, h--);
      }
    }), v = (c - u) / (h + (h - 1) * f), v = Math.max(v, 0);
    var d = 0, g;
    F(a, function(x, S) {
      x.width || (x.width = v), g = x, d += x.width * (1 + f);
    }), g && (d -= g.width * f);
    var y = -d / 2;
    F(a, function(x, S) {
      r[i][S] = r[i][S] || {
        bandWidth: o,
        offset: y,
        width: x.width
      }, y += x.width * (1 + f);
    });
  }), r;
}
function oie(e, t, r) {
  if (e && t) {
    var n = e[bO(t)];
    return n;
  }
}
function w6(e, t) {
  var r = _6(e, t), n = x6(r);
  F(r, function(i) {
    var a = i.getData(), o = i.coordinateSystem, s = o.getBaseAxis(), l = y6(i), u = n[bO(s)][l], f = u.offset, c = u.width;
    a.setLayout({
      bandWidth: u.bandWidth,
      offset: f,
      size: c
    });
  });
}
function T6(e) {
  return {
    seriesType: e,
    plan: iy(),
    reset: function(t) {
      if (b6(t)) {
        var r = t.getData(), n = t.coordinateSystem, i = n.getBaseAxis(), a = n.getOtherAxis(i), o = r.getDimensionIndex(r.mapDimension(a.dim)), s = r.getDimensionIndex(r.mapDimension(i.dim)), l = t.get("showBackground", !0), u = r.mapDimension(a.dim), f = r.getCalculationInfo("stackResultDimension"), c = xf(r, u) && !!r.getCalculationInfo("stackedOnSeries"), h = a.isHorizontal(), v = sie(i, a), d = C6(t), g = t.get("barMinHeight") || 0, y = f && r.getDimensionIndex(f), x = r.getLayout("size"), S = r.getLayout("offset");
        return {
          progress: function(T, C) {
            for (var A = T.count, M = d && Wl(A * 3), E = d && l && Wl(A * 3), P = d && Wl(A), R = n.master.getRect(), O = h ? R.width : R.height, N, G = C.getStore(), z = 0; (N = T.next()) != null; ) {
              var H = G.get(c ? y : o, N), W = G.get(s, N), Z = v, ee = void 0;
              c && (ee = +H - G.get(o, N));
              var V = void 0, Q = void 0, q = void 0, X = void 0;
              if (h) {
                var K = n.dataToPoint([H, W]);
                if (c) {
                  var ue = n.dataToPoint([ee, W]);
                  Z = ue[0];
                }
                V = Z, Q = K[1] + S, q = K[0] - Z, X = x, Math.abs(q) < g && (q = (q < 0 ? -1 : 1) * g);
              } else {
                var K = n.dataToPoint([W, H]);
                if (c) {
                  var ue = n.dataToPoint([W, ee]);
                  Z = ue[1];
                }
                V = K[0] + S, Q = Z, q = x, X = K[1] - Z, Math.abs(X) < g && (X = (X <= 0 ? -1 : 1) * g);
              }
              d ? (M[z] = V, M[z + 1] = Q, M[z + 2] = h ? q : X, E && (E[z] = h ? R.x : V, E[z + 1] = h ? Q : R.y, E[z + 2] = O), P[N] = N) : C.setItemLayout(N, {
                x: V,
                y: Q,
                width: q,
                height: X
              }), z += 3;
            }
            d && C.setLayout({
              largePoints: M,
              largeDataIndices: P,
              largeBackgroundPoints: E,
              valueAxisHorizontal: h
            });
          }
        };
      }
    }
  };
}
function b6(e) {
  return e.coordinateSystem && e.coordinateSystem.type === "cartesian2d";
}
function C6(e) {
  return e.pipelineContext && e.pipelineContext.large;
}
function sie(e, t) {
  var r = t.model.get("startValue");
  return r || (r = 0), t.toGlobalCoord(t.dataToCoord(t.type === "log" ? r > 0 ? r : 1 : r));
}
var lie = function(e, t, r, n) {
  for (; r < n; ) {
    var i = r + n >>> 1;
    e[i][1] < t ? r = i + 1 : n = i;
  }
  return r;
}, CO = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r) {
      var n = e.call(this, r) || this;
      return n.type = "time", n;
    }
    return t.prototype.getLabel = function(r) {
      var n = this.getSetting("useUTC");
      return Dx(r.value, nB[kee(g1(this._minLevelUnit))] || nB.second, n, this.getSetting("locale"));
    }, t.prototype.getFormattedLabel = function(r, n, i) {
      var a = this.getSetting("useUTC"), o = this.getSetting("locale");
      return Bee(r, n, i, o, a);
    }, t.prototype.getTicks = function(r) {
      r = r || {};
      var n = this._interval, i = this._extent, a = En(), o = [];
      if (!n)
        return o;
      var s = this.getSetting("useUTC");
      if (a && r.breakTicks === "only_break")
        return En().addBreaksToTicks(o, this._brkCtx.breaks, this._extent), o;
      var l = sm(i[1], s);
      o.push({
        value: i[0],
        time: {
          level: 0,
          upperTimeUnit: l,
          lowerTimeUnit: l
        }
      });
      var u = pie(this._minLevelUnit, this._approxInterval, s, i, this._getExtentSpanWithBreaks(), this._brkCtx);
      o = o.concat(u);
      var f = sm(i[1], s);
      o.push({
        value: i[1],
        time: {
          level: 0,
          upperTimeUnit: f,
          lowerTimeUnit: f
        }
      });
      var c = this.getSetting("useUTC"), h = po.length - 1, v = 0;
      return F(o, function(d) {
        h = Math.min(h, Tt(po, d.time.upperTimeUnit)), v = Math.max(v, d.time.level);
      }), a && En().pruneTicksByBreak(r.pruneByBreak, o, this._brkCtx.breaks, function(d) {
        return d.value;
      }, this._approxInterval, this._extent), a && r.breakTicks !== "none" && En().addBreaksToTicks(o, this._brkCtx.breaks, this._extent, function(d) {
        for (var g = Math.max(Tt(po, sm(d.vmin, c)), Tt(po, sm(d.vmax, c))), y = 0, x = 0; x < po.length; x++)
          if (!A6(po[x], d.vmin, d.vmax, c)) {
            y = x;
            break;
          }
        var S = Math.min(y, h), T = Math.max(S, g);
        return {
          level: v,
          lowerTimeUnit: po[T],
          upperTimeUnit: po[S]
        };
      }), o;
    }, t.prototype.calcNiceExtent = function(r) {
      var n = this.getExtent();
      if (n[0] === n[1] && (n[0] -= as, n[1] += as), 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] - as;
      }
      this._innerSetExtent(n[0], n[1]), this.calcNiceTicks(r.splitNumber, r.minInterval, r.maxInterval);
    }, t.prototype.calcNiceTicks = function(r, n, i) {
      r = r || 10;
      var a = this._getExtentSpanWithBreaks();
      this._approxInterval = a / r, n != null && this._approxInterval < n && (this._approxInterval = n), i != null && this._approxInterval > i && (this._approxInterval = i);
      var o = aT.length, s = Math.min(lie(aT, this._approxInterval, 0, o), o - 1);
      this._interval = aT[s][1], this._intervalPrecision = Y1(this._interval), this._minLevelUnit = aT[Math.max(s - 1, 0)][0];
    }, t.prototype.parse = function(r) {
      return Xt(r) ? r : +Ks(r);
    }, t.prototype.contain = function(r) {
      return TO(r, this._extent);
    }, t.prototype.normalize = function(r) {
      return this._calculator.normalize(r, this._extent);
    }, t.prototype.scale = function(r) {
      return this._calculator.scale(r, this._extent);
    }, t.type = "time", t;
  })(Sf)
), aT = [
  // Format                           interval
  ["second", HR],
  ["minute", UR],
  ["hour", p1],
  ["quarter-day", p1 * 6],
  ["half-day", p1 * 12],
  ["day", as * 1.2],
  ["half-week", as * 3.5],
  ["week", as * 7],
  ["month", as * 31],
  ["quarter", as * 95],
  ["half-year", rB / 2],
  ["year", rB]
  // 1Y
];
function A6(e, t, r, n) {
  return nb(new Date(t), e, n).getTime() === nb(new Date(r), e, n).getTime();
}
function uie(e, t) {
  return e /= as, e > 16 ? 16 : e > 7.5 ? 7 : e > 3.5 ? 4 : e > 1.5 ? 2 : 1;
}
function fie(e) {
  var t = 30 * as;
  return e /= t, e > 6 ? 6 : e > 3 ? 3 : e > 2 ? 2 : 1;
}
function cie(e) {
  return e /= p1, e > 12 ? 12 : e > 6 ? 6 : e > 3.5 ? 4 : e > 2 ? 2 : 1;
}
function v5(e, t) {
  return e /= t ? UR : HR, e > 30 ? 30 : e > 20 ? 20 : e > 15 ? 15 : e > 10 ? 10 : e > 5 ? 5 : e > 2 ? 2 : 1;
}
function hie(e) {
  return gR(e, !0);
}
function vie(e, t, r) {
  var n = Math.max(0, Tt(po, t) - 1);
  return nb(new Date(e), po[n], r).getTime();
}
function die(e, t) {
  var r = /* @__PURE__ */ new Date(0);
  r[e](1);
  var n = r.getTime();
  r[e](1 + t);
  var i = r.getTime() - n;
  return function(a, o) {
    return Math.max(0, Math.round((o - a) / i));
  };
}
function pie(e, t, r, n, i, a) {
  var o = 1e4, s = Iee, l = 0;
  function u(z, H, W, Z, ee, V, Q) {
    for (var q = die(ee, z), X = H, K = new Date(X); X < W && X <= n[1] && (Q.push({
      value: X
    }), !(l++ > o)); )
      if (K[ee](K[Z]() + z), X = K.getTime(), a) {
        var ue = a.calcNiceTickMultiple(X, q);
        ue > 0 && (K[ee](K[Z]() + ue * z), X = K.getTime());
      }
    Q.push({
      value: X,
      notAdd: !0
    });
  }
  function f(z, H, W) {
    var Z = [], ee = !H.length;
    if (!A6(g1(z), n[0], n[1], r)) {
      ee && (H = [{
        value: vie(n[0], z, r)
      }, {
        value: n[1]
      }]);
      for (var V = 0; V < H.length - 1; V++) {
        var Q = H[V].value, q = H[V + 1].value;
        if (Q !== q) {
          var X = void 0, K = void 0, ue = void 0, oe = !1;
          switch (z) {
            case "year":
              X = Math.max(1, Math.round(t / as / 365)), K = kW(r), ue = zee(r);
              break;
            case "half-year":
            case "quarter":
            case "month":
              X = fie(t), K = WR(r), ue = BW(r);
              break;
            case "week":
            // PENDING If week is added. Ignore day.
            case "half-week":
            case "day":
              X = uie(t), K = XR(r), ue = zW(r), oe = !0;
              break;
            case "half-day":
            case "quarter-day":
            case "hour":
              X = cie(t), K = YR(r), ue = FW(r);
              break;
            case "minute":
              X = v5(t, !0), K = ZR(r), ue = GW(r);
              break;
            case "second":
              X = v5(t, !1), K = $R(r), ue = VW(r);
              break;
            case "millisecond":
              X = hie(t), K = qR(r), ue = HW(r);
              break;
          }
          q >= n[0] && Q <= n[1] && u(X, Q, q, K, ue, oe, Z), z === "year" && W.length > 1 && V === 0 && W.unshift({
            value: W[0].value - X
          });
        }
      }
      for (var V = 0; V < Z.length; V++)
        W.push(Z[V]);
    }
  }
  for (var c = [], h = [], v = 0, d = 0, g = 0; g < s.length; ++g) {
    var y = g1(s[g]);
    if (Nee(s[g])) {
      f(s[g], c[c.length - 1] || [], h);
      var x = s[g + 1] ? g1(s[g + 1]) : null;
      if (y !== x) {
        if (h.length) {
          d = v, h.sort(function(z, H) {
            return z.value - H.value;
          });
          for (var S = [], T = 0; T < h.length; ++T) {
            var C = h[T].value;
            (T === 0 || h[T - 1].value !== C) && (S.push(h[T]), C >= n[0] && C <= n[1] && v++);
          }
          var A = i / t;
          if (v > A * 1.5 && d > A / 1.5 || (c.push(S), v > A || e === s[g]))
            break;
        }
        h = [];
      }
    }
  }
  for (var M = nr(Ce(c, function(z) {
    return nr(z, function(H) {
      return H.value >= n[0] && H.value <= n[1] && !H.notAdd;
    });
  }), function(z) {
    return z.length > 0;
  }), E = [], P = M.length - 1, g = 0; g < M.length; ++g)
    for (var R = M[g], O = 0; O < R.length; ++O) {
      var N = sm(R[O].value, r);
      E.push({
        value: R[O].value,
        time: {
          level: P - g,
          upperTimeUnit: N,
          lowerTimeUnit: N
        }
      });
    }
  E.sort(function(z, H) {
    return z.value - H.value;
  });
  for (var G = [], g = 0; g < E.length; ++g)
    (g === 0 || E[g].value !== E[g - 1].value) && G.push(E[g]);
  return G;
}
oh.registerClass(CO);
var NP = jr, gie = Math.floor, mie = Math.ceil, oT = Math.pow, sT = Math.log, M6 = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = "log", r.base = 10, r._originalScale = new Sf(), r;
    }
    return t.prototype.getTicks = function(r) {
      r = r || {};
      var n = this._extent.slice(), i = this._originalScale.getExtent(), a = e.prototype.getTicks.call(this, r), o = this.base, s = this._originalScale._innerGetBreaks(), l = En();
      return Ce(a, function(u) {
        var f = u.value, c = null, h = oT(o, f);
        f === n[0] && this._fixMin ? c = i[0] : f === n[1] && this._fixMax && (c = i[1]);
        var v;
        if (l) {
          var d = l.getTicksLogTransformBreak(u, o, s, lT);
          v = d.vBreak, c == null && (c = d.brkRoundingCriterion);
        }
        return c != null && (h = lT(h, c)), {
          value: h,
          break: v
        };
      }, this);
    }, t.prototype._getNonTransBreaks = function() {
      return this._originalScale._innerGetBreaks();
    }, t.prototype.setExtent = function(r, n) {
      this._originalScale.setExtent(r, n);
      var i = RP(this.base, [r, n]);
      e.prototype.setExtent.call(this, i[0], i[1]);
    }, t.prototype.getExtent = function() {
      var r = this.base, n = e.prototype.getExtent.call(this);
      n[0] = oT(r, n[0]), n[1] = oT(r, n[1]);
      var i = this._originalScale.getExtent();
      return this._fixMin && (n[0] = lT(n[0], i[0])), this._fixMax && (n[1] = lT(n[1], i[1])), n;
    }, t.prototype.unionExtentFromData = function(r, n) {
      this._originalScale.unionExtentFromData(r, n);
      var i = RP(this.base, r.getApproximateExtent(n), !0);
      this._innerUnionExtent(i);
    }, t.prototype.calcNiceTicks = function(r) {
      r = r || 10;
      var n = this._extent.slice(), i = this._getExtentSpanWithBreaks();
      if (!(!isFinite(i) || i <= 0)) {
        var a = kU(i), o = r / i * a;
        for (o <= 0.5 && (a *= 10); !isNaN(a) && Math.abs(a) < 1 && Math.abs(a) > 0; )
          a *= 10;
        var s = [NP(mie(n[0] / a) * a), NP(gie(n[1] / a) * a)];
        this._interval = a, this._intervalPrecision = Y1(a), this._niceExtent = s;
      }
    }, t.prototype.calcNiceExtent = function(r) {
      e.prototype.calcNiceExtent.call(this, r), this._fixMin = r.fixMin, this._fixMax = r.fixMax;
    }, t.prototype.contain = function(r) {
      return r = sT(r) / sT(this.base), e.prototype.contain.call(this, r);
    }, t.prototype.normalize = function(r) {
      return r = sT(r) / sT(this.base), e.prototype.normalize.call(this, r);
    }, t.prototype.scale = function(r) {
      return r = e.prototype.scale.call(this, r), oT(this.base, r);
    }, t.prototype.setBreaksFromOption = function(r) {
      var n = En();
      if (n) {
        var i = n.logarithmicParseBreaksFromOption(r, this.base, Ge(this.parse, this)), a = i.parsedOriginal, o = i.parsedLogged;
        this._originalScale._innerSetBreak(a), this._innerSetBreak(o);
      }
    }, t.type = "log", t;
  })(Sf)
);
function lT(e, t) {
  return NP(e, Gs(t));
}
oh.registerClass(M6);
var yie = (
  /** @class */
  (function() {
    function e(t, r, n) {
      this._prepareParams(t, r, n);
    }
    return e.prototype._prepareParams = function(t, r, 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" && r.getNeedCrossZero && r.getNeedCrossZero();
      var a = r.get("min", !0);
      a == null && (a = r.get("startValue", !0));
      var o = this._modelMinRaw = a;
      nt(o) ? this._modelMinNum = uT(t, o({
        min: n[0],
        max: n[1]
      })) : o !== "dataMin" && (this._modelMinNum = uT(t, o));
      var s = this._modelMaxRaw = r.get("max", !0);
      if (nt(s) ? this._modelMaxNum = uT(t, s({
        min: n[0],
        max: n[1]
      })) : s !== "dataMax" && (this._modelMaxNum = uT(t, s)), i)
        this._axisDataLen = r.getCategories().length;
      else {
        var l = r.get("boundaryGap"), u = Se(l) ? l : [l || 0, l || 0];
        typeof u[0] == "boolean" || typeof u[1] == "boolean" ? this._boundaryGapInner = [0, 0] : this._boundaryGapInner = [$s(u[0], 1), $s(u[1], 1)];
      }
    }, e.prototype.calculate = function() {
      var t = this._isOrdinal, r = this._dataMin, n = this._dataMax, i = this._axisDataLen, a = this._boundaryGapInner, o = t ? null : n - r || Math.abs(r), s = this._modelMinRaw === "dataMin" ? r : this._modelMinNum, l = this._modelMaxRaw === "dataMax" ? n : this._modelMaxNum, u = s != null, f = l != null;
      s == null && (s = t ? i ? 0 : NaN : r - 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 c = Gi(s) || Gi(l) || t && !i;
      this._needCrossZero && (s > 0 && l > 0 && !u && (s = 0), s < 0 && l < 0 && !f && (l = 0));
      var h = this._determinedMin, v = this._determinedMax;
      return h != null && (s = h, u = !0), v != null && (l = v, f = !0), {
        min: s,
        max: l,
        minFixed: u,
        maxFixed: f,
        isBlank: c
      };
    }, e.prototype.modifyDataMinMax = function(t, r) {
      this[xie[t]] = r;
    }, e.prototype.setDeterminedMinMax = function(t, r) {
      var n = _ie[t];
      this[n] = r;
    }, e.prototype.freeze = function() {
      this.frozen = !0;
    }, e;
  })()
), _ie = {
  min: "_determinedMin",
  max: "_determinedMax"
}, xie = {
  min: "_dataMin",
  max: "_dataMax"
};
function L6(e, t, r) {
  var n = e.rawExtentInfo;
  return n || (n = new yie(e, t, r), e.rawExtentInfo = n, n);
}
function uT(e, t) {
  return t == null ? null : Gi(t) ? NaN : e.parse(t);
}
function D6(e, t) {
  var r = e.type, n = L6(e, t, e.getExtent()).calculate();
  e.setBlank(n.isBlank);
  var i = n.min, a = n.max, o = t.ecModel;
  if (o && r === "time") {
    var s = _6("bar", o), l = !1;
    if (F(s, function(c) {
      l = l || c.getBaseAxis() === t.axis;
    }), l) {
      var u = x6(s), f = Sie(i, a, t, u);
      i = f.min, a = f.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 Sie(e, t, r, n) {
  var i = r.axis.getExtent(), a = Math.abs(i[1] - i[0]), o = oie(n, r.axis);
  if (o === void 0)
    return {
      min: e,
      max: t
    };
  var s = 1 / 0;
  F(o, function(v) {
    s = Math.min(v.offset, s);
  });
  var l = -1 / 0;
  F(o, function(v) {
    l = Math.max(v.offset + v.width, l);
  }), s = Math.abs(s), l = Math.abs(l);
  var u = s + l, f = t - e, c = 1 - (s + l) / a, h = f / c - f;
  return t += h * (l / u), e -= h * (s / u), {
    min: e,
    max: t
  };
}
function Md(e, t) {
  var r = t, n = D6(e, r), i = n.extent, a = r.get("splitNumber");
  e instanceof M6 && (e.base = r.get("logBase"));
  var o = e.type, s = r.get("interval"), l = o === "interval" || o === "time";
  e.setBreaksFromOption(P6(r)), e.setExtent(i[0], i[1]), e.calcNiceExtent({
    splitNumber: a,
    fixMin: n.fixMin,
    fixMax: n.fixMax,
    minInterval: l ? r.get("minInterval") : null,
    maxInterval: l ? r.get("maxInterval") : null
  }), s != null && e.setInterval && e.setInterval(s);
}
function Ox(e, t) {
  if (t = t || e.get("type"), t)
    switch (t) {
      // Buildin scale
      case "category":
        return new Lm({
          ordinalMeta: e.getOrdinalMeta ? e.getOrdinalMeta() : e.getCategories(),
          extent: [1 / 0, -1 / 0]
        });
      case "time":
        return new CO({
          locale: e.ecModel.getLocaleModel(),
          useUTC: e.ecModel.get("useUTC")
        });
      default:
        return new (oh.getClass(t) || Sf)();
    }
}
function wie(e) {
  var t = e.scale.getExtent(), r = t[0], n = t[1];
  return !(r > 0 && n > 0 || r < 0 && n < 0);
}
function ly(e) {
  var t = e.getLabelModel().get("formatter");
  if (e.type === "time") {
    var r = Ree(t);
    return function(i, a) {
      return e.scale.getFormattedLabel(i, a, r);
    };
  } else {
    if (Fe(t))
      return function(i) {
        var a = e.scale.getLabel(i), o = t.replace("{value}", a ?? "");
        return o;
      };
    if (nt(t)) {
      if (e.type === "category")
        return function(i, a) {
          return t(
            gb(e, i),
            i.value - e.scale.getExtent()[0],
            null
            // Using `null` just for backward compat.
          );
        };
      var n = En();
      return function(i, a) {
        var o = null;
        return n && (o = n.makeAxisLabelFormatterParamBreak(o, i.break)), t(gb(e, i), a, o);
      };
    } else
      return function(i) {
        return e.scale.getLabel(i);
      };
  }
}
function gb(e, t) {
  return e.type === "category" ? e.scale.getLabel(t) : t.value;
}
function AO(e) {
  var t = e.get("interval");
  return t ?? "auto";
}
function E6(e) {
  return e.type === "category" && AO(e.getLabelModel()) === 0;
}
function mb(e, t) {
  var r = {};
  return F(e.mapDimensionsAll(t), function(n) {
    r[wO(e, n)] = !0;
  }), Ht(r);
}
function Tie(e, t, r) {
  t && F(mb(t, r), function(n) {
    var i = t.getApproximateExtent(n);
    i[0] < e[0] && (e[0] = i[0]), i[1] > e[1] && (e[1] = i[1]);
  });
}
function Dm(e) {
  return e === "middle" || e === "center";
}
function Z1(e) {
  return e.getShallow("show");
}
function P6(e) {
  var t = e.get("breaks", !0);
  if (t != null)
    return !En() || !bie(e.axis) ? void 0 : t;
}
function bie(e) {
  return (e.dim === "x" || e.dim === "y" || e.dim === "z" || e.dim === "single") && e.type !== "category";
}
var uy = (
  /** @class */
  (function() {
    function e() {
    }
    return e.prototype.getNeedCrossZero = function() {
      var t = this.option;
      return !t.scale;
    }, e.prototype.getCoordSysModel = function() {
    }, e;
  })()
);
function I6(e) {
  return ou(null, e);
}
var FC = {
  isDimensionStacked: xf,
  enableDataStack: g6,
  getStackedDimension: wO
};
function GC(e, t) {
  var r = t;
  t instanceof It || (r = new It(t));
  var n = Ox(r);
  return n.setExtent(e[0], e[1]), Md(n, r), n;
}
function R6(e) {
  cn(e, uy);
}
function y1(e, t) {
  return t = t || {}, gr(e, null, null, t.state !== "normal");
}
const Cie = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  createDimensions: ah,
  createList: I6,
  createScale: GC,
  createSymbol: en,
  createTextStyle: y1,
  dataStack: FC,
  enableHoverEmphasis: jl,
  getECData: pt,
  getLayoutRect: Tr,
  mixinAxisModelCommonMethods: R6
}, Symbol.toStringTag, { value: "Module" }));
var Aie = 1e-8;
function d5(e, t) {
  return Math.abs(e - t) < Aie;
}
function jv(e, t, r) {
  var n = 0, i = e[0];
  if (!i)
    return !1;
  for (var a = 1; a < e.length; a++) {
    var o = e[a];
    n += Ku(i[0], i[1], o[0], o[1], t, r), i = o;
  }
  var s = e[0];
  return (!d5(i[0], s[0]) || !d5(i[1], s[1])) && (n += Ku(i[0], i[1], s[0], s[1], t, r)), n !== 0;
}
var Mie = [];
function SL(e, t) {
  for (var r = 0; r < e.length; r++)
    fn(e[r], e[r], t);
}
function p5(e, t, r, n) {
  for (var i = 0; i < e.length; i++) {
    var a = e[i];
    n && (a = n.project(a)), a && isFinite(a[0]) && isFinite(a[1]) && (nf(t, t, a), af(r, r, a));
  }
}
function Lie(e) {
  for (var t = 0, r = 0, n = 0, i = e.length, a = e[i - 1][0], o = e[i - 1][1], s = 0; s < i; s++) {
    var l = e[s][0], u = e[s][1], f = a * u - l * o;
    t += f, r += (a + l) * f, n += (o + u) * f, a = l, o = u;
  }
  return t ? [r / t / 3, n / t / 3, t] : [e[0][0] || 0, e[0][1] || 0];
}
var O6 = (
  /** @class */
  (function() {
    function e(t) {
      this.name = t;
    }
    return e.prototype.setCenter = function(t) {
      this._center = t;
    }, e.prototype.getCenter = function() {
      var t = this._center;
      return t || (t = this._center = this.calcCenter()), t;
    }, e;
  })()
), g5 = (
  /** @class */
  /* @__PURE__ */ (function() {
    function e(t, r) {
      this.type = "polygon", this.exterior = t, this.interiors = r;
    }
    return e;
  })()
), m5 = (
  /** @class */
  /* @__PURE__ */ (function() {
    function e(t) {
      this.type = "linestring", this.points = t;
    }
    return e;
  })()
), N6 = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r, n, i) {
      var a = e.call(this, r) || this;
      return a.type = "geoJSON", a.geometries = n, a._center = i && [i[0], i[1]], a;
    }
    return t.prototype.calcCenter = function() {
      for (var r = this.geometries, n, i = 0, a = 0; a < r.length; a++) {
        var o = r[a], s = o.exterior, l = s && s.length;
        l > i && (n = o, i = l);
      }
      if (n)
        return Lie(n.exterior);
      var u = this.getBoundingRect();
      return [u.x + u.width / 2, u.y + u.height / 2];
    }, t.prototype.getBoundingRect = function(r) {
      var n = this._rect;
      if (n && !r)
        return n;
      var i = [1 / 0, 1 / 0], a = [-1 / 0, -1 / 0], o = this.geometries;
      return F(o, function(s) {
        s.type === "polygon" ? p5(s.exterior, i, a, r) : F(s.points, function(l) {
          p5(l, i, a, r);
        });
      }), isFinite(i[0]) && isFinite(i[1]) && isFinite(a[0]) && isFinite(a[1]) || (i[0] = i[1] = a[0] = a[1] = 0), n = new st(i[0], i[1], a[0] - i[0], a[1] - i[1]), r || (this._rect = n), n;
    }, t.prototype.contain = function(r) {
      var n = this.getBoundingRect(), i = this.geometries;
      if (!n.contain(r[0], r[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 (jv(l, r[0], r[1])) {
            for (var f = 0; f < (u ? u.length : 0); f++)
              if (jv(u[f], r[0], r[1]))
                continue e;
            return !0;
          }
        }
      }
      return !1;
    }, t.prototype.transformTo = function(r, n, i, a) {
      var o = this.getBoundingRect(), s = o.width / o.height;
      i ? a || (a = i / s) : i = s * a;
      for (var l = new st(r, n, i, a), u = o.calculateTransform(l), f = this.geometries, c = 0; c < f.length; c++) {
        var h = f[c];
        h.type === "polygon" ? (SL(h.exterior, u), F(h.interiors, function(v) {
          SL(v, u);
        })) : F(h.points, function(v) {
          SL(v, u);
        });
      }
      o = this._rect, o.copy(l), this._center = [o.x + o.width / 2, o.y + o.height / 2];
    }, t.prototype.cloneShallow = function(r) {
      r == null && (r = this.name);
      var n = new t(r, this.geometries, this._center);
      return n._rect = this._rect, n.transformTo = null, n;
    }, t;
  })(O6)
), Die = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r, n) {
      var i = e.call(this, r) || this;
      return i.type = "geoSVG", i._elOnlyForCalculate = n, i;
    }
    return t.prototype.calcCenter = function() {
      for (var r = this._elOnlyForCalculate, n = r.getBoundingRect(), i = [n.x + n.width / 2, n.y + n.height / 2], a = Sx(Mie), o = r; o && !o.isGeoSVGGraphicRoot; )
        Hs(a, o.getLocalTransform(), a), o = o.parent;
      return cs(a, a), fn(i, i, a), i;
    }, t;
  })(O6)
);
function Eie(e) {
  if (!e.UTF8Encoding)
    return e;
  var t = e, r = t.UTF8Scale;
  r == null && (r = 1024);
  var n = t.features;
  return F(n, function(i) {
    var a = i.geometry, o = a.encodeOffsets, s = a.coordinates;
    if (o)
      switch (a.type) {
        case "LineString":
          a.coordinates = k6(s, o, r);
          break;
        case "Polygon":
          wL(s, o, r);
          break;
        case "MultiLineString":
          wL(s, o, r);
          break;
        case "MultiPolygon":
          F(s, function(l, u) {
            return wL(l, o[u], r);
          });
      }
  }), t.UTF8Encoding = !1, t;
}
function wL(e, t, r) {
  for (var n = 0; n < e.length; n++)
    e[n] = k6(e[n], t[n], r);
}
function k6(e, t, r) {
  for (var n = [], i = t[0], a = t[1], o = 0; o < e.length; o += 2) {
    var s = e.charCodeAt(o) - 64, l = e.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 / r, l / r]);
  }
  return n;
}
function $1(e, t) {
  return e = Eie(e), Ce(nr(e.features, function(r) {
    return r.geometry && r.properties && r.geometry.coordinates.length > 0;
  }), function(r) {
    var n = r.properties, i = r.geometry, a = [];
    switch (i.type) {
      case "Polygon":
        var o = i.coordinates;
        a.push(new g5(o[0], o.slice(1)));
        break;
      case "MultiPolygon":
        F(i.coordinates, function(l) {
          l[0] && a.push(new g5(l[0], l.slice(1)));
        });
        break;
      case "LineString":
        a.push(new m5([i.coordinates]));
        break;
      case "MultiLineString":
        a.push(new m5(i.coordinates));
    }
    var s = new N6(n[t || "name"], a, n.cp);
    return s.properties = n, s;
  });
}
const Pie = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  MAX_SAFE_INTEGER: jE,
  asc: xo,
  getPercentWithPrecision: oQ,
  getPixelPrecision: dR,
  getPrecision: Gs,
  getPrecisionSafe: mC,
  isNumeric: mR,
  isRadianAroundZero: wm,
  linearMap: er,
  nice: gR,
  numericToNumber: tu,
  parseDate: Ks,
  parsePercent: Be,
  quantile: m2,
  quantity: kU,
  quantityExponent: yC,
  reformIntervals: KE,
  remRadian: pR,
  round: jr
}, Symbol.toStringTag, { value: "Module" })), Iie = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  format: Dx,
  parse: Ks,
  roundTime: nb
}, Symbol.toStringTag, { value: "Module" })), Rie = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  Arc: Mx,
  BezierCurve: jm,
  BoundingRect: st,
  Circle: Qs,
  CompoundPath: Km,
  Ellipse: Ax,
  Group: rt,
  Image: Xn,
  IncrementalDisplayable: wW,
  Line: wn,
  LinearGradient: Nd,
  Polygon: Wi,
  Polyline: Ci,
  RadialGradient: ER,
  Rect: Mt,
  Ring: qm,
  Sector: Ui,
  Text: Rt,
  clipPointsByRect: NR,
  clipRectByRect: AW,
  createIcon: Jm,
  extendPath: bW,
  extendShape: IR,
  getShapeClass: z1,
  getTransform: Hc,
  initProps: Ir,
  makeImage: RR,
  makePath: $c,
  mergePath: yo,
  registerShape: ps,
  resizePath: OR,
  updateProps: Wt
}, Symbol.toStringTag, { value: "Module" })), Oie = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  addCommas: G1,
  capitalFirst: WW,
  encodeHTML: _n,
  formatTime: UW,
  formatTpl: EC,
  getTextRect: Fee,
  getTooltipMarker: KR,
  normalizeCssArray: ry,
  toCamelCase: jR,
  truncateText: FQ
}, Symbol.toStringTag, { value: "Module" })), Nie = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  bind: Ge,
  clone: it,
  curry: St,
  defaults: tt,
  each: F,
  extend: xe,
  filter: nr,
  indexOf: Tt,
  inherits: mx,
  isArray: Se,
  isFunction: nt,
  isObject: ot,
  isString: Fe,
  map: Ce,
  merge: je,
  reduce: bo
}, Symbol.toStringTag, { value: "Module" }));
var kie = Bt(), _1 = Bt(), qs = {
  estimate: 1,
  determine: 2
};
function yb(e) {
  return {
    out: {
      noPxChangeTryDetermine: []
    },
    kind: e
  };
}
function B6(e, t) {
  var r = Ce(t, function(n) {
    return e.scale.parse(n);
  });
  return e.type === "time" && r.length > 0 && (r.sort(), r.unshift(r[0]), r.push(r[r.length - 1])), r;
}
function Bie(e, t) {
  var r = e.getLabelModel().get("customValues");
  if (r) {
    var n = ly(e), i = e.scale.getExtent(), a = B6(e, r), o = nr(a, function(s) {
      return s >= i[0] && s <= i[1];
    });
    return {
      labels: Ce(o, function(s) {
        var l = {
          value: s
        };
        return {
          formattedLabel: n(l),
          rawLabel: e.scale.getLabel(l),
          tickValue: s,
          time: void 0,
          break: void 0
        };
      })
    };
  }
  return e.type === "category" ? Fie(e, t) : Vie(e);
}
function zie(e, t, r) {
  var n = e.getTickModel().get("customValues");
  if (n) {
    var i = e.scale.getExtent(), a = B6(e, n);
    return {
      ticks: nr(a, function(o) {
        return o >= i[0] && o <= i[1];
      })
    };
  }
  return e.type === "category" ? Gie(e, t) : {
    ticks: Ce(e.scale.getTicks(r), function(o) {
      return o.value;
    })
  };
}
function Fie(e, t) {
  var r = e.getLabelModel(), n = z6(e, r, t);
  return !r.get("show") || e.scale.isBlank() ? {
    labels: []
  } : n;
}
function z6(e, t, r) {
  var n = Uie(e), i = AO(t), a = r.kind === qs.estimate;
  if (!a) {
    var o = G6(n, i);
    if (o)
      return o;
  }
  var s, l;
  nt(i) ? s = U6(e, i) : (l = i === "auto" ? Wie(e, r) : i, s = H6(e, l));
  var u = {
    labels: s,
    labelCategoryInterval: l
  };
  return a ? r.out.noPxChangeTryDetermine.push(function() {
    return kP(n, i, u), !0;
  }) : kP(n, i, u), u;
}
function Gie(e, t) {
  var r = Hie(e), n = AO(t), i = G6(r, n);
  if (i)
    return i;
  var a, o;
  if ((!t.get("show") || e.scale.isBlank()) && (a = []), nt(n))
    a = U6(e, n, !0);
  else if (n === "auto") {
    var s = z6(e, e.getLabelModel(), yb(qs.determine));
    o = s.labelCategoryInterval, a = Ce(s.labels, function(l) {
      return l.tickValue;
    });
  } else
    o = n, a = H6(e, o, !0);
  return kP(r, n, {
    ticks: a,
    tickCategoryInterval: o
  });
}
function Vie(e) {
  var t = e.scale.getTicks(), r = ly(e);
  return {
    labels: Ce(t, function(n, i) {
      return {
        formattedLabel: r(n, i),
        rawLabel: e.scale.getLabel(n),
        tickValue: n.value,
        time: n.time,
        break: n.break
      };
    })
  };
}
var Hie = F6("axisTick"), Uie = F6("axisLabel");
function F6(e) {
  return function(r) {
    return _1(r)[e] || (_1(r)[e] = {
      list: []
    });
  };
}
function G6(e, t) {
  for (var r = 0; r < e.list.length; r++)
    if (e.list[r].key === t)
      return e.list[r].value;
}
function kP(e, t, r) {
  return e.list.push({
    key: t,
    value: r
  }), r;
}
function Wie(e, t) {
  if (t.kind === qs.estimate) {
    var r = e.calculateCategoryInterval(t);
    return t.out.noPxChangeTryDetermine.push(function() {
      return _1(e).autoInterval = r, !0;
    }), r;
  }
  var n = _1(e).autoInterval;
  return n ?? (_1(e).autoInterval = e.calculateCategoryInterval(t));
}
function Xie(e, t) {
  var r = t.kind, n = Zie(e), i = ly(e), a = (n.axisRotate - n.labelRotate) / 180 * Math.PI, o = e.scale, s = o.getExtent(), l = o.count();
  if (s[1] - s[0] < 1)
    return 0;
  var u = 1, f = 40;
  l > f && (u = Math.max(1, Math.floor(l / f)));
  for (var c = s[0], h = e.dataToCoord(c + 1) - e.dataToCoord(c), v = Math.abs(h * Math.cos(a)), d = Math.abs(h * Math.sin(a)), g = 0, y = 0; c <= s[1]; c += u) {
    var x = 0, S = 0, T = pC(i({
      value: c
    }), n.font, "center", "top");
    x = T.width * 1.3, S = T.height * 1.3, g = Math.max(g, x, 7), y = Math.max(y, S, 7);
  }
  var C = g / v, A = y / d;
  isNaN(C) && (C = 1 / 0), isNaN(A) && (A = 1 / 0);
  var M = Math.max(0, Math.floor(Math.min(C, A)));
  if (r === qs.estimate)
    return t.out.noPxChangeTryDetermine.push(Ge(Yie, null, e, M, l)), M;
  var E = V6(e, M, l);
  return E ?? M;
}
function Yie(e, t, r) {
  return V6(e, t, r) == null;
}
function V6(e, t, r) {
  var n = kie(e.model), i = e.getExtent(), a = n.lastAutoInterval, o = n.lastTickCount;
  if (a != null && o != null && Math.abs(a - t) <= 1 && Math.abs(o - r) <= 1 && a > t && n.axisExtent0 === i[0] && n.axisExtent1 === i[1])
    return a;
  n.lastTickCount = r, n.lastAutoInterval = t, n.axisExtent0 = i[0], n.axisExtent1 = i[1];
}
function Zie(e) {
  var t = e.getLabelModel();
  return {
    axisRotate: e.getRotate ? e.getRotate() : e.isHorizontal && !e.isHorizontal() ? 90 : 0,
    labelRotate: t.get("rotate") || 0,
    font: t.getFont()
  };
}
function H6(e, t, r) {
  var n = ly(e), i = e.scale, a = i.getExtent(), o = e.getLabelModel(), s = [], l = Math.max((t || 0) + 1, 1), u = a[0], f = i.count();
  u !== 0 && l > 1 && f / l > 2 && (u = Math.round(Math.ceil(u / l) * l));
  var c = E6(e), h = o.get("showMinLabel") || c, v = o.get("showMaxLabel") || c;
  h && u !== a[0] && g(a[0]);
  for (var d = u; d <= a[1]; d += l)
    g(d);
  v && d - l !== a[1] && g(a[1]);
  function g(y) {
    var x = {
      value: y
    };
    s.push(r ? y : {
      formattedLabel: n(x),
      rawLabel: i.getLabel(x),
      tickValue: y,
      time: void 0,
      break: void 0
    });
  }
  return s;
}
function U6(e, t, r) {
  var n = e.scale, i = ly(e), a = [];
  return F(n.getTicks(), function(o) {
    var s = n.getLabel(o), l = o.value;
    t(o.value, s) && a.push(r ? l : {
      formattedLabel: i(o),
      rawLabel: s,
      tickValue: l,
      time: void 0,
      break: void 0
    });
  }), a;
}
var y5 = [0, 1], ra = (
  /** @class */
  (function() {
    function e(t, r, n) {
      this.onBand = !1, this.inverse = !1, this.dim = t, this.scale = r, this._extent = n || [0, 0];
    }
    return e.prototype.contain = function(t) {
      var r = this._extent, n = Math.min(r[0], r[1]), i = Math.max(r[0], r[1]);
      return t >= n && t <= i;
    }, e.prototype.containData = function(t) {
      return this.scale.contain(this.scale.parse(t));
    }, e.prototype.getExtent = function() {
      return this._extent.slice();
    }, e.prototype.getPixelPrecision = function(t) {
      return dR(t || this.scale.getExtent(), this._extent);
    }, e.prototype.setExtent = function(t, r) {
      var n = this._extent;
      n[0] = t, n[1] = r;
    }, e.prototype.dataToCoord = function(t, r) {
      var n = this._extent, i = this.scale;
      return t = i.normalize(i.parse(t)), this.onBand && i.type === "ordinal" && (n = n.slice(), _5(n, i.count())), er(t, y5, n, r);
    }, e.prototype.coordToData = function(t, r) {
      var n = this._extent, i = this.scale;
      this.onBand && i.type === "ordinal" && (n = n.slice(), _5(n, i.count()));
      var a = er(t, n, y5, r);
      return this.scale.scale(a);
    }, e.prototype.pointToData = function(t, r) {
    }, e.prototype.getTicksCoords = function(t) {
      t = t || {};
      var r = t.tickModel || this.getTickModel(), n = zie(this, r, {
        breakTicks: t.breakTicks,
        pruneByBreak: t.pruneByBreak
      }), i = n.ticks, a = Ce(i, function(s) {
        return {
          coord: this.dataToCoord(this.scale.type === "ordinal" ? this.scale.getRawOrdinalNumber(s) : s),
          tickValue: s
        };
      }, this), o = r.get("alignWithLabel");
      return $ie(this, a, o, t.clamp), a;
    }, e.prototype.getMinorTicksCoords = function() {
      if (this.scale.type === "ordinal")
        return [];
      var t = this.model.getModel("minorTick"), r = t.get("splitNumber");
      r > 0 && r < 100 || (r = 5);
      var n = this.scale.getMinorTicks(r), i = Ce(n, function(a) {
        return Ce(a, function(o) {
          return {
            coord: this.dataToCoord(o),
            tickValue: o
          };
        }, this);
      }, this);
      return i;
    }, e.prototype.getViewLabels = function(t) {
      return t = t || yb(qs.determine), Bie(this, t).labels;
    }, e.prototype.getLabelModel = function() {
      return this.model.getModel("axisLabel");
    }, e.prototype.getTickModel = function() {
      return this.model.getModel("axisTick");
    }, e.prototype.getBandWidth = function() {
      var t = this._extent, r = this.scale.getExtent(), n = r[1] - r[0] + (this.onBand ? 1 : 0);
      n === 0 && (n = 1);
      var i = Math.abs(t[1] - t[0]);
      return Math.abs(i) / n;
    }, e.prototype.calculateCategoryInterval = function(t) {
      return t = t || yb(qs.determine), Xie(this, t);
    }, e;
  })()
);
function _5(e, t) {
  var r = e[1] - e[0], n = t, i = r / n / 2;
  e[0] += i, e[1] -= i;
}
function $ie(e, t, r, n) {
  var i = t.length;
  if (!e.onBand || r || !i)
    return;
  var a = e.getExtent(), o, s;
  if (i === 1)
    t[0].coord = a[0], t[0].onBand = !0, o = t[1] = {
      coord: a[1],
      tickValue: t[0].tickValue,
      onBand: !0
    };
  else {
    var l = t[i - 1].tickValue - t[0].tickValue, u = (t[i - 1].coord - t[0].coord) / l;
    F(t, function(v) {
      v.coord -= u / 2, v.onBand = !0;
    });
    var f = e.scale.getExtent();
    s = 1 + f[1] - t[i - 1].tickValue, o = {
      coord: t[i - 1].coord + u * s,
      tickValue: f[1] + 1,
      onBand: !0
    }, t.push(o);
  }
  var c = 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],
    onBand: !0
  }), h(a[1], o.coord) && (n ? o.coord = a[1] : t.pop()), n && h(o.coord, a[1]) && t.push({
    coord: a[1],
    onBand: !0
  });
  function h(v, d) {
    return v = jr(v), d = jr(d), c ? v > d : v < d;
  }
}
function qie(e) {
  var t = At.extend(e);
  return At.registerClass(t), t;
}
function jie(e) {
  var t = fr.extend(e);
  return fr.registerClass(t), t;
}
function MO(e) {
  var t = Yt.extend(e);
  return Yt.registerClass(t), t;
}
function LO(e) {
  var t = Ut.extend(e);
  return Ut.registerClass(t), t;
}
var f_ = Math.PI * 2, Rv = ru.CMD, Kie = ["top", "right", "bottom", "left"];
function Qie(e, t, r, n, i) {
  var a = r.width, o = r.height;
  switch (e) {
    case "top":
      n.set(r.x + a / 2, r.y - t), i.set(0, -1);
      break;
    case "bottom":
      n.set(r.x + a / 2, r.y + o + t), i.set(0, 1);
      break;
    case "left":
      n.set(r.x - t, r.y + o / 2), i.set(-1, 0);
      break;
    case "right":
      n.set(r.x + a + t, r.y + o / 2), i.set(1, 0);
      break;
  }
}
function Jie(e, t, r, n, i, a, o, s, l) {
  o -= e, s -= t;
  var u = Math.sqrt(o * o + s * s);
  o /= u, s /= u;
  var f = o * r + e, c = s * r + t;
  if (Math.abs(n - i) % f_ < 1e-4)
    return l[0] = f, l[1] = c, u - r;
  if (a) {
    var h = n;
    n = So(i), i = So(h);
  } else
    n = So(n), i = So(i);
  n > i && (i += f_);
  var v = Math.atan2(s, o);
  if (v < 0 && (v += f_), v >= n && v <= i || v + f_ >= n && v + f_ <= i)
    return l[0] = f, l[1] = c, u - r;
  var d = r * Math.cos(n) + e, g = r * Math.sin(n) + t, y = r * Math.cos(i) + e, x = r * Math.sin(i) + t, S = (d - o) * (d - o) + (g - s) * (g - s), T = (y - o) * (y - o) + (x - s) * (x - s);
  return S < T ? (l[0] = d, l[1] = g, Math.sqrt(S)) : (l[0] = y, l[1] = x, Math.sqrt(T));
}
function _b(e, t, r, n, i, a, o, s) {
  var l = i - e, u = a - t, f = r - e, c = n - t, h = Math.sqrt(f * f + c * c);
  f /= h, c /= h;
  var v = l * f + u * c, d = v / h;
  s && (d = Math.min(Math.max(d, 0), 1)), d *= h;
  var g = o[0] = e + d * f, y = o[1] = t + d * c;
  return Math.sqrt((g - i) * (g - i) + (y - a) * (y - a));
}
function W6(e, t, r, n, i, a, o) {
  r < 0 && (e = e + r, r = -r), n < 0 && (t = t + n, n = -n);
  var s = e + r, l = t + n, u = o[0] = Math.min(Math.max(i, e), s), f = o[1] = Math.min(Math.max(a, t), l);
  return Math.sqrt((u - i) * (u - i) + (f - a) * (f - a));
}
var Fs = [];
function eae(e, t, r) {
  var n = W6(t.x, t.y, t.width, t.height, e.x, e.y, Fs);
  return r.set(Fs[0], Fs[1]), n;
}
function tae(e, t, r) {
  for (var n = 0, i = 0, a = 0, o = 0, s, l, u = 1 / 0, f = t.data, c = e.x, h = e.y, v = 0; v < f.length; ) {
    var d = f[v++];
    v === 1 && (n = f[v], i = f[v + 1], a = n, o = i);
    var g = u;
    switch (d) {
      case Rv.M:
        a = f[v++], o = f[v++], n = a, i = o;
        break;
      case Rv.L:
        g = _b(n, i, f[v], f[v + 1], c, h, Fs, !0), n = f[v++], i = f[v++];
        break;
      case Rv.C:
        g = pU(n, i, f[v++], f[v++], f[v++], f[v++], f[v], f[v + 1], c, h, Fs), n = f[v++], i = f[v++];
        break;
      case Rv.Q:
        g = mU(n, i, f[v++], f[v++], f[v], f[v + 1], c, h, Fs), n = f[v++], i = f[v++];
        break;
      case Rv.A:
        var y = f[v++], x = f[v++], S = f[v++], T = f[v++], C = f[v++], A = f[v++];
        v += 1;
        var M = !!(1 - f[v++]);
        s = Math.cos(C) * S + y, l = Math.sin(C) * T + x, v <= 1 && (a = s, o = l);
        var E = (c - y) * T / S + y;
        g = Jie(y, x, T, C, C + A, M, E, h, Fs), n = Math.cos(C + A) * S + y, i = Math.sin(C + A) * T + x;
        break;
      case Rv.R:
        a = n = f[v++], o = i = f[v++];
        var P = f[v++], R = f[v++];
        g = W6(a, o, P, R, c, h, Fs);
        break;
      case Rv.Z:
        g = _b(n, i, a, o, c, h, Fs, !0), n = a, i = o;
        break;
    }
    g < u && (u = g, r.set(Fs[0], Fs[1]));
  }
  return u;
}
var Vs = new ht(), Or = new ht(), yn = new ht(), Xl = new ht(), Vl = new ht();
function x5(e, t) {
  if (e) {
    var r = e.getTextGuideLine(), n = e.getTextContent();
    if (n && r) {
      var i = e.textGuideLineConfig || {}, a = [[0, 0], [0, 0], [0, 0]], o = i.candidates || Kie, s = n.getBoundingRect().clone();
      s.applyTransform(n.getComputedTransform());
      var l = 1 / 0, u = i.anchor, f = e.getComputedTransform(), c = f && cs([], f), h = t.get("length2") || 0;
      u && yn.copy(u);
      for (var v = 0; v < o.length; v++) {
        var d = o[v];
        Qie(d, 0, s, Vs, Xl), ht.scaleAndAdd(Or, Vs, Xl, h), Or.transform(c);
        var g = e.getBoundingRect(), y = u ? u.distance(Or) : e instanceof zt ? tae(Or, e.path, yn) : eae(Or, g, yn);
        y < l && (l = y, Or.transform(f), yn.transform(f), yn.toArray(a[0]), Or.toArray(a[1]), Vs.toArray(a[2]));
      }
      X6(a, t.get("minTurnAngle")), r.setShape({
        points: a
      });
    }
  }
}
var xb = [], ya = new ht();
function X6(e, t) {
  if (t <= 180 && t > 0) {
    t = t / 180 * Math.PI, Vs.fromArray(e[0]), Or.fromArray(e[1]), yn.fromArray(e[2]), ht.sub(Xl, Vs, Or), ht.sub(Vl, yn, Or);
    var r = Xl.len(), n = Vl.len();
    if (!(r < 1e-3 || n < 1e-3)) {
      Xl.scale(1 / r), Vl.scale(1 / n);
      var i = Xl.dot(Vl), a = Math.cos(t);
      if (a < i) {
        var o = _b(Or.x, Or.y, yn.x, yn.y, Vs.x, Vs.y, xb, !1);
        ya.fromArray(xb), ya.scaleAndAdd(Vl, o / Math.tan(Math.PI - t));
        var s = yn.x !== Or.x ? (ya.x - Or.x) / (yn.x - Or.x) : (ya.y - Or.y) / (yn.y - Or.y);
        if (isNaN(s))
          return;
        s < 0 ? ht.copy(ya, Or) : s > 1 && ht.copy(ya, yn), ya.toArray(e[1]);
      }
    }
  }
}
function rae(e, t, r) {
  if (r <= 180 && r > 0) {
    r = r / 180 * Math.PI, Vs.fromArray(e[0]), Or.fromArray(e[1]), yn.fromArray(e[2]), ht.sub(Xl, Or, Vs), ht.sub(Vl, yn, Or);
    var n = Xl.len(), i = Vl.len();
    if (!(n < 1e-3 || i < 1e-3)) {
      Xl.scale(1 / n), Vl.scale(1 / i);
      var a = Xl.dot(t), o = Math.cos(r);
      if (a < o) {
        var s = _b(Or.x, Or.y, yn.x, yn.y, Vs.x, Vs.y, xb, !1);
        ya.fromArray(xb);
        var l = Math.PI / 2, u = Math.acos(Vl.dot(t)), f = l + u - r;
        if (f >= l)
          ht.copy(ya, yn);
        else {
          ya.scaleAndAdd(Vl, s / Math.tan(Math.PI / 2 - f));
          var c = yn.x !== Or.x ? (ya.x - Or.x) / (yn.x - Or.x) : (ya.y - Or.y) / (yn.y - Or.y);
          if (isNaN(c))
            return;
          c < 0 ? ht.copy(ya, Or) : c > 1 && ht.copy(ya, yn);
        }
        ya.toArray(e[1]);
      }
    }
  }
}
function TL(e, t, r, n) {
  var i = r === "normal", a = i ? e : e.ensureState(r);
  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 ? e.useStyle(s) : a.style = s;
}
function nae(e, t) {
  var r = t.smooth, n = t.points;
  if (n)
    if (e.moveTo(n[0][0], n[0][1]), r > 0 && n.length >= 3) {
      var i = rf(n[0], n[1]), a = rf(n[1], n[2]);
      if (!i || !a) {
        e.lineTo(n[1][0], n[1][1]), e.lineTo(n[2][0], n[2][1]);
        return;
      }
      var o = Math.min(i, a) * r, s = l1([], n[1], n[0], o / i), l = l1([], n[1], n[2], o / a), u = l1([], s, l, 0.5);
      e.bezierCurveTo(s[0], s[1], s[0], s[1], u[0], u[1]), e.bezierCurveTo(l[0], l[1], l[0], l[1], n[2][0], n[2][1]);
    } else
      for (var f = 1; f < n.length; f++)
        e.lineTo(n[f][0], n[f][1]);
}
function DO(e, t, r) {
  var n = e.getTextGuideLine(), i = e.getTextContent();
  if (!i) {
    n && e.removeTextGuideLine();
    return;
  }
  for (var a = t.normal, o = a.get("show"), s = i.ignore, l = 0; l < k1.length; l++) {
    var u = k1[l], f = t[u], c = u === "normal";
    if (f) {
      var h = f.get("show"), v = c ? s : et(i.states[u] && i.states[u].ignore, s);
      if (v || !et(h, o)) {
        var d = c ? n : n && n.states[u];
        d && (d.ignore = !0), n && TL(n, !0, u, f);
        continue;
      }
      n || (n = new Ci(), e.setTextGuideLine(n), !c && (s || !o) && TL(n, !0, "normal", t.normal), e.stateProxy && (n.stateProxy = e.stateProxy)), TL(n, !1, u, f);
    }
  }
  if (n) {
    tt(n.style, r), n.style.fill = null;
    var g = a.get("showAbove"), y = e.textGuideLineConfig = e.textGuideLineConfig || {};
    y.showAbove = g || !1, n.buildPath = nae;
  }
}
function EO(e, t) {
  t = t || "labelLine";
  for (var r = {
    normal: e.getModel(t)
  }, n = 0; n < Ta.length; n++) {
    var i = Ta[n];
    r[i] = e.getModel([i, t]);
  }
  return r;
}
var S5 = ["label", "labelLine", "layoutOption", "priority", "defaultAttr", "marginForce", "minMarginForce", "marginDefault", "suggestIgnore"], iae = 1, Sb = 2, Y6 = iae | Sb;
function wb(e, t, r) {
  r = r || Y6, t ? e.dirty |= r : e.dirty &= ~r;
}
function Z6(e, t) {
  return t = t || Y6, e.dirty == null || !!(e.dirty & t);
}
function iu(e) {
  if (e)
    return Z6(e) && $6(e, e.label, e), e;
}
function $6(e, t, r) {
  var n = t.getComputedTransform();
  e.transform = BR(e.transform, n);
  var i = e.localRect = F1(e.localRect, t.getBoundingRect()), a = t.style, o = a.margin, s = r && r.marginForce, l = r && r.minMarginForce, u = r && r.marginDefault, f = a.__marginType;
  f == null && u && (o = u, f = om.textMargin);
  for (var c = 0; c < 4; c++)
    bL[c] = f === om.minMargin && l && l[c] != null ? l[c] : s && s[c] != null ? s[c] : o ? o[c] : 0;
  f === om.textMargin && bd(i, bL, !1, !1);
  var h = e.rect = F1(e.rect, i);
  return n && h.applyTransform(n), f === om.minMargin && bd(h, bL, !1, !1), e.axisAligned = kR(n), (e.label = e.label || {}).ignore = t.ignore, wb(e, !1), wb(e, !0, Sb), e;
}
var bL = [0, 0, 0, 0];
function aae(e, t, r) {
  return e.transform = BR(e.transform, r), e.localRect = F1(e.localRect, t), e.rect = F1(e.rect, t), r && e.rect.applyTransform(r), e.axisAligned = kR(r), e.obb = void 0, (e.label = e.label || {}).ignore = !1, e;
}
function BP(e, t) {
  if (e) {
    e.label.x += t.x, e.label.y += t.y, e.label.markRedraw();
    var r = e.transform;
    r && (r[4] += t.x, r[5] += t.y);
    var n = e.rect;
    n && (n.x += t.x, n.y += t.y);
    var i = e.obb;
    i && i.fromBoundingRect(e.localRect, r);
  }
}
function zP(e, t) {
  for (var r = 0; r < S5.length; r++) {
    var n = S5[r];
    e[n] == null && (e[n] = t[n]);
  }
  return iu(e);
}
function w5(e) {
  var t = e.obb;
  return (!t || Z6(e, Sb)) && (e.obb = t = t || new SW(), t.fromBoundingRect(e.localRect, e.transform), wb(e, !1, Sb)), t;
}
function FP(e, t, r, n, i) {
  var a = e.length, o = _t[t], s = In[t];
  if (a < 2)
    return !1;
  e.sort(function(E, P) {
    return E.rect[o] - P.rect[o];
  });
  for (var l = 0, u, f = !1, c = 0; c < a; c++) {
    var h = e[c], v = h.rect;
    u = v[o] - l, u < 0 && (v[o] -= u, h.label[o] -= u, f = !0), l = v[o] + v[s];
  }
  var d = e[0], g = e[a - 1], y, x;
  S(), y < 0 && A(-y, 0.8), x < 0 && A(x, 0.8), S(), T(y, x, 1), T(x, y, -1), S(), y < 0 && M(-y), x < 0 && M(x);
  function S() {
    y = d.rect[o] - r, x = n - g.rect[o] - g.rect[s];
  }
  function T(E, P, R) {
    if (E < 0) {
      var O = Math.min(P, -E);
      if (O > 0) {
        C(O * R, 0, a);
        var N = O + E;
        N < 0 && A(-N * R, 1);
      } else
        A(-E * R, 1);
    }
  }
  function C(E, P, R) {
    E !== 0 && (f = !0);
    for (var O = P; O < R; O++) {
      var N = e[O], G = N.rect;
      G[o] += E, N.label[o] += E;
    }
  }
  function A(E, P) {
    for (var R = [], O = 0, N = 1; N < a; N++) {
      var G = e[N - 1].rect, z = Math.max(e[N].rect[o] - G[o] - G[s], 0);
      R.push(z), O += z;
    }
    if (O) {
      var H = Math.min(Math.abs(E) / O, P);
      if (E > 0)
        for (var N = 0; N < a - 1; N++) {
          var W = R[N] * H;
          C(W, 0, N + 1);
        }
      else
        for (var N = a - 1; N > 0; N--) {
          var W = R[N - 1] * H;
          C(-W, N, a);
        }
    }
  }
  function M(E) {
    var P = E < 0 ? -1 : 1;
    E = Math.abs(E);
    for (var R = Math.ceil(E / (a - 1)), O = 0; O < a - 1; O++)
      if (P > 0 ? C(R, 0, O + 1) : C(-R, a - O - 1, a), E -= R, E <= 0)
        return;
  }
  return f;
}
function oae(e) {
  for (var t = 0; t < e.length; t++) {
    var r = e[t], n = r.defaultAttr, i = r.labelLine;
    r.label.attr("ignore", n.ignore), i && i.attr("ignore", n.labelGuideIgnore);
  }
}
function q6(e) {
  var t = [];
  e.sort(function(u, f) {
    return (f.suggestIgnore ? 1 : 0) - (u.suggestIgnore ? 1 : 0) || f.priority - u.priority;
  });
  function r(u) {
    if (!u.ignore) {
      var f = u.ensureState("emphasis");
      f.ignore == null && (f.ignore = !1);
    }
    u.ignore = !0;
  }
  for (var n = 0; n < e.length; n++) {
    var i = iu(e[n]);
    if (!i.label.ignore) {
      for (var a = i.label, o = i.labelLine, s = !1, l = 0; l < t.length; l++)
        if (VC(i, t[l], null, {
          touchThreshold: 0.05
        })) {
          s = !0;
          break;
        }
      s ? (r(a), o && r(o)) : t.push(i);
    }
  }
}
function VC(e, t, r, n) {
  return !e || !t || e.label && e.label.ignore || t.label && t.label.ignore || !e.rect.intersect(t.rect, r, n) ? !1 : e.axisAligned && t.axisAligned ? !0 : w5(e).intersect(w5(t), r, n);
}
function sae(e) {
  if (e) {
    for (var t = [], r = 0; r < e.length; r++)
      t.push(e[r].slice());
    return t;
  }
}
function lae(e, t) {
  var r = e.label, n = t && t.getTextGuideLine();
  return {
    dataIndex: e.dataIndex,
    dataType: e.dataType,
    seriesIndex: e.seriesModel.seriesIndex,
    text: e.label.style.text,
    rect: e.hostRect,
    labelRect: e.rect,
    // x: labelAttr.x,
    // y: labelAttr.y,
    align: r.style.align,
    verticalAlign: r.style.verticalAlign,
    labelLinePoints: sae(n && n.shape.points)
  };
}
var T5 = ["align", "verticalAlign", "width", "height", "fontSize"], da = new of(), CL = Bt(), uae = Bt();
function fT(e, t, r) {
  for (var n = 0; n < r.length; n++) {
    var i = r[n];
    t[i] != null && (e[i] = t[i]);
  }
}
var cT = ["x", "y", "rotation"], fae = (
  /** @class */
  (function() {
    function e() {
      this._labelList = [], this._chartViewList = [];
    }
    return e.prototype.clearLabels = function() {
      this._labelList = [], this._chartViewList = [];
    }, e.prototype._addLabel = function(t, r, n, i, a) {
      var o = i.style, s = i.__hostTarget, l = s.textConfig || {}, u = i.getComputedTransform(), f = i.getBoundingRect().plain();
      st.applyTransform(f, f, u), u ? da.setLocalTransform(u) : (da.x = da.y = da.rotation = da.originX = da.originY = 0, da.scaleX = da.scaleY = 1), da.rotation = So(da.rotation);
      var c = i.__hostTarget, h;
      if (c) {
        h = c.getBoundingRect().plain();
        var v = c.getComputedTransform();
        st.applyTransform(h, h, v);
      }
      var d = h && c.getTextGuideLine();
      this._labelList.push({
        label: i,
        labelLine: d,
        seriesModel: n,
        dataIndex: t,
        dataType: r,
        layoutOptionOrCb: a,
        layoutOption: null,
        rect: f,
        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: da.x,
          y: da.y,
          scaleX: da.scaleX,
          scaleY: da.scaleY,
          rotation: da.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
        }
      });
    }, e.prototype.addLabelsOfSeries = function(t) {
      var r = this;
      this._chartViewList.push(t);
      var n = t.__model, i = n.get("labelLayout");
      (nt(i) || Ht(i).length) && t.group.traverse(function(a) {
        if (a.ignore)
          return !0;
        var o = a.getTextContent(), s = pt(a);
        o && !o.disableLabelLayout && r._addLabel(s.dataIndex, s.dataType, n, o, i);
      });
    }, e.prototype.updateLayoutConfig = function(t) {
      var r = t.getWidth(), n = t.getHeight();
      function i(T, C) {
        return function() {
          x5(T, C);
        };
      }
      for (var a = 0; a < this._labelList.length; a++) {
        var o = this._labelList[a], s = o.label, l = s.__hostTarget, u = o.defaultAttr, f = void 0;
        nt(o.layoutOptionOrCb) ? f = o.layoutOptionOrCb(lae(o, l)) : f = o.layoutOptionOrCb, f = f || {}, o.layoutOption = f;
        var c = 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: f.x != null || f.y != null ? null : u.attachedPos,
          // Ignore rotation config on the host el if rotation is changed.
          rotation: f.rotate != null ? f.rotate * c : u.attachedRot,
          offset: [f.dx || 0, f.dy || 0]
        });
        var h = !1;
        if (f.x != null ? (s.x = Be(f.x, r), s.setStyle("x", 0), h = !0) : (s.x = u.x, s.setStyle("x", u.style.x)), f.y != null ? (s.y = Be(f.y, n), s.setStyle("y", 0), h = !0) : (s.y = u.y, s.setStyle("y", u.style.y)), f.labelLinePoints) {
          var v = l.getTextGuideLine();
          v && (v.setShape({
            points: f.labelLinePoints
          }), h = !1);
        }
        var d = CL(s);
        d.needsUpdateLabelLine = h, s.rotation = f.rotate != null ? f.rotate * c : u.rotation, s.scaleX = u.scaleX, s.scaleY = u.scaleY;
        for (var g = 0; g < T5.length; g++) {
          var y = T5[g];
          s.setStyle(y, f[y] != null ? f[y] : u.style[y]);
        }
        if (f.draggable) {
          if (s.draggable = !0, s.cursor = "move", l) {
            var x = o.seriesModel;
            if (o.dataIndex != null) {
              var S = o.seriesModel.getData(o.dataType);
              x = S.getItemModel(o.dataIndex);
            }
            s.on("drag", i(l, x.getModel("labelLine")));
          }
        } else
          s.off("drag"), s.cursor = u.cursor;
      }
    }, e.prototype.layout = function(t) {
      var r = t.getWidth(), n = t.getHeight(), i = [];
      F(this._labelList, function(l) {
        l.defaultAttr.ignore || i.push(zP({}, l));
      });
      var a = nr(i, function(l) {
        return l.layoutOption.moveOverlap === "shiftX";
      }), o = nr(i, function(l) {
        return l.layoutOption.moveOverlap === "shiftY";
      });
      FP(a, 0, 0, r), FP(o, 1, 0, n);
      var s = nr(i, function(l) {
        return l.layoutOption.hideOverlap;
      });
      oae(s), q6(s);
    }, e.prototype.processLabelsOverall = function() {
      var t = this;
      F(this._chartViewList, function(r) {
        var n = r.__model, i = r.ignoreLabelLineUpdate, a = n.isAnimationEnabled();
        r.group.traverse(function(o) {
          if (o.ignore && !o.forceLabelAnimation)
            return !0;
          var s = !i, l = o.getTextContent();
          !s && l && (s = CL(l).needsUpdateLabelLine), s && t._updateLabelLine(o, n), a && t._animateLabels(o, n);
        });
      });
    }, e.prototype._updateLabelLine = function(t, r) {
      var n = t.getTextContent(), i = pt(t), a = i.dataIndex;
      if (n && a != null) {
        var o = r.getData(i.dataType), s = o.getItemModel(a), l = {}, u = o.getItemVisual(a, "style");
        if (u) {
          var f = o.getVisual("drawType");
          l.stroke = u[f];
        }
        var c = s.getModel("labelLine");
        DO(t, EO(s), l), x5(t, c);
      }
    }, e.prototype._animateLabels = function(t, r) {
      var n = t.getTextContent(), i = t.getTextGuideLine();
      if (n && (t.forceLabelAnimation || !n.ignore && !n.invisible && !t.disableLabelAnimation && !pm(t))) {
        var a = CL(n), o = a.oldLayout, s = pt(t), l = s.dataIndex, u = {
          x: n.x,
          y: n.y,
          rotation: n.rotation
        }, f = r.getData(s.dataType);
        if (o) {
          n.attr(o);
          var h = t.prevStates;
          h && (Tt(h, "select") >= 0 && n.attr(a.oldLayoutSelect), Tt(h, "emphasis") >= 0 && n.attr(a.oldLayoutEmphasis)), Wt(n, u, r, l);
        } else if (n.attr(u), !ey(n).valueAnimation) {
          var c = et(n.style.opacity, 1);
          n.style.opacity = 0, Ir(n, {
            style: {
              opacity: c
            }
          }, r, l);
        }
        if (a.oldLayout = u, n.states.select) {
          var v = a.oldLayoutSelect = {};
          fT(v, u, cT), fT(v, n.states.select, cT);
        }
        if (n.states.emphasis) {
          var d = a.oldLayoutEmphasis = {};
          fT(d, u, cT), fT(d, n.states.emphasis, cT);
        }
        IW(n, l, f, r, r);
      }
      if (i && !i.ignore && !i.invisible) {
        var a = uae(i), o = a.oldLayout, g = {
          points: i.shape.points
        };
        o ? (i.attr({
          shape: o
        }), Wt(i, {
          shape: g
        }, r)) : (i.setShape(g), i.style.strokePercent = 0, Ir(i, {
          style: {
            strokePercent: 1
          }
        }, r)), a.oldLayout = g;
      }
    }, e;
  })()
), AL = Bt();
function j6(e) {
  e.registerUpdateLifecycle("series:beforeupdate", function(t, r, n) {
    var i = AL(r).labelManager;
    i || (i = AL(r).labelManager = new fae()), i.clearLabels();
  }), e.registerUpdateLifecycle("series:layoutlabels", function(t, r, n) {
    var i = AL(r).labelManager;
    n.updatedSeries.forEach(function(a) {
      i.addLabelsOfSeries(r.getViewOfSeriesModel(a));
    }), i.updateLayoutConfig(r), i.layout(r), i.processLabelsOverall();
  });
}
var ML = Math.sin, LL = Math.cos, K6 = Math.PI, Ov = Math.PI * 2, cae = 180 / K6, Q6 = (function() {
  function e() {
  }
  return e.prototype.reset = function(t) {
    this._start = !0, this._d = [], this._str = "", this._p = Math.pow(10, t || 4);
  }, e.prototype.moveTo = function(t, r) {
    this._add("M", t, r);
  }, e.prototype.lineTo = function(t, r) {
    this._add("L", t, r);
  }, e.prototype.bezierCurveTo = function(t, r, n, i, a, o) {
    this._add("C", t, r, n, i, a, o);
  }, e.prototype.quadraticCurveTo = function(t, r, n, i) {
    this._add("Q", t, r, n, i);
  }, e.prototype.arc = function(t, r, n, i, a, o) {
    this.ellipse(t, r, n, n, 0, i, a, o);
  }, e.prototype.ellipse = function(t, r, n, i, a, o, s, l) {
    var u = s - o, f = !l, c = Math.abs(u), h = Rc(c - Ov) || (f ? u >= Ov : -u >= Ov), v = u > 0 ? u % Ov : u % Ov + Ov, d = !1;
    h ? d = !0 : Rc(c) ? d = !1 : d = v >= K6 == !!f;
    var g = t + n * LL(o), y = r + i * ML(o);
    this._start && this._add("M", g, y);
    var x = Math.round(a * cae);
    if (h) {
      var S = 1 / this._p, T = (f ? 1 : -1) * (Ov - S);
      this._add("A", n, i, x, 1, +f, t + n * LL(o + T), r + i * ML(o + T)), S > 0.01 && this._add("A", n, i, x, 0, +f, g, y);
    } else {
      var C = t + n * LL(s), A = r + i * ML(s);
      this._add("A", n, i, x, +d, +f, C, A);
    }
  }, e.prototype.rect = function(t, r, n, i) {
    this._add("M", t, r), this._add("l", n, 0), this._add("l", 0, i), this._add("l", -n, 0), this._add("Z");
  }, e.prototype.closePath = function() {
    this._d.length > 0 && this._add("Z");
  }, e.prototype._add = function(t, r, n, i, a, o, s, l, u) {
    for (var f = [], c = this._p, h = 1; h < arguments.length; h++) {
      var v = arguments[h];
      if (isNaN(v)) {
        this._invalid = !0;
        return;
      }
      f.push(Math.round(v * c) / c);
    }
    this._d.push(t + f.join(" ")), this._start = t === "Z";
  }, e.prototype.generateStr = function() {
    this._str = this._invalid ? "" : this._d.join(""), this._d = [];
  }, e.prototype.getStr = function() {
    return this._str;
  }, e;
})(), PO = "none", hae = Math.round;
function vae(e) {
  var t = e.fill;
  return t != null && t !== PO;
}
function dae(e) {
  var t = e.stroke;
  return t != null && t !== PO;
}
var GP = ["lineCap", "miterLimit", "lineJoin"], pae = Ce(GP, function(e) {
  return "stroke-" + e.toLowerCase();
});
function gae(e, t, r, n) {
  var i = t.opacity == null ? 1 : t.opacity;
  if (r instanceof Xn) {
    e("opacity", i);
    return;
  }
  if (vae(t)) {
    var a = O1(t.fill);
    e("fill", a.color);
    var o = t.fillOpacity != null ? t.fillOpacity * a.opacity * i : a.opacity * i;
    o < 1 && e("fill-opacity", o);
  } else
    e("fill", PO);
  if (dae(t)) {
    var s = O1(t.stroke);
    e("stroke", s.color);
    var l = t.strokeNoScale ? r.getLineScale() : 1, u = l ? (t.lineWidth || 0) / l : 0, f = t.strokeOpacity != null ? t.strokeOpacity * s.opacity * i : s.opacity * i, c = t.strokeFirst;
    if (u !== 1 && e("stroke-width", u), c && e("paint-order", c ? "stroke" : "fill"), f < 1 && e("stroke-opacity", f), t.lineDash) {
      var h = lO(r), v = h[0], d = h[1];
      v && (d = hae(d || 0), e("stroke-dasharray", v.join(",")), (d || n) && e("stroke-dashoffset", d));
    }
    for (var g = 0; g < GP.length; g++) {
      var y = GP[g];
      if (t[y] !== K2[y]) {
        var x = t[y] || K2[y];
        x && e(pae[g], x);
      }
    }
  }
}
var J6 = "http://www.w3.org/2000/svg", e9 = "http://www.w3.org/1999/xlink", mae = "http://www.w3.org/2000/xmlns/", yae = "http://www.w3.org/XML/1998/namespace", b5 = "ecmeta_";
function t9(e) {
  return document.createElementNS(J6, e);
}
function ti(e, t, r, n, i) {
  return {
    tag: e,
    attrs: r || {},
    children: n,
    text: i,
    key: t
  };
}
function _ae(e, t) {
  var r = [];
  if (t)
    for (var n in t) {
      var i = t[n], a = n;
      i !== !1 && (i !== !0 && i != null && (a += '="' + i + '"'), r.push(a));
    }
  return "<" + e + " " + r.join(" ") + ">";
}
function xae(e) {
  return "</" + e + ">";
}
function IO(e, t) {
  t = t || {};
  var r = t.newline ? `
` : "";
  function n(i) {
    var a = i.children, o = i.tag, s = i.attrs, l = i.text;
    return _ae(o, s) + (o !== "style" ? _n(l) : l || "") + (a ? "" + r + Ce(a, function(u) {
      return n(u);
    }).join(r) + r : "") + xae(o);
  }
  return n(e);
}
function Sae(e, t, r) {
  r = r || {};
  var n = r.newline ? `
` : "", i = " {" + n, a = n + "}", o = Ce(Ht(e), function(l) {
    return l + i + Ce(Ht(e[l]), function(u) {
      return u + ":" + e[l][u] + ";";
    }).join(n) + a;
  }).join(n), s = Ce(Ht(t), function(l) {
    return "@keyframes " + l + i + Ce(Ht(t[l]), function(u) {
      return u + i + Ce(Ht(t[l][u]), function(f) {
        var c = t[l][u][f];
        return f === "d" && (c = 'path("' + c + '")'), f + ":" + c + ";";
      }).join(n) + a;
    }).join(n) + a;
  }).join(n);
  return !o && !s ? "" : ["<![CDATA[", o, s, "]]>"].join(n);
}
function VP(e) {
  return {
    zrId: e,
    shadowCache: {},
    patternCache: {},
    gradientCache: {},
    clipPathCache: {},
    defs: {},
    cssNodes: {},
    cssAnims: {},
    cssStyleCache: {},
    cssAnimIdx: 0,
    shadowIdx: 0,
    gradientIdx: 0,
    patternIdx: 0,
    clipPathIdx: 0
  };
}
function C5(e, t, r, n) {
  return ti("svg", "root", {
    width: e,
    height: t,
    xmlns: J6,
    "xmlns:xlink": e9,
    version: "1.1",
    baseProfile: "full",
    viewBox: n ? "0 0 " + e + " " + t : !1
  }, r);
}
var wae = 0;
function r9() {
  return wae++;
}
var A5 = {
  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"
}, Wv = "transform-origin";
function Tae(e, t, r) {
  var n = xe({}, e.shape);
  xe(n, t), e.buildPath(r, n);
  var i = new Q6();
  return i.reset(bU(e)), r.rebuildPath(i, 1), i.generateStr(), i.getStr();
}
function bae(e, t) {
  var r = t.originX, n = t.originY;
  (r || n) && (e[Wv] = r + "px " + n + "px");
}
var Cae = {
  fill: "fill",
  opacity: "opacity",
  lineWidth: "stroke-width",
  lineDashOffset: "stroke-dashoffset"
};
function n9(e, t) {
  var r = t.zrId + "-ani-" + t.cssAnimIdx++;
  return t.cssAnims[r] = e, r;
}
function Aae(e, t, r) {
  var n = e.shape.paths, i = {}, a, o;
  if (F(n, function(l) {
    var u = VP(r.zrId);
    u.animation = !0, HC(l, {}, u, !0);
    var f = u.cssAnims, c = u.cssNodes, h = Ht(f), v = h.length;
    if (v) {
      o = h[v - 1];
      var d = f[o];
      for (var g in d) {
        var y = d[g];
        i[g] = i[g] || { d: "" }, i[g].d += y.d || "";
      }
      for (var x in c) {
        var S = c[x].animation;
        S.indexOf(o) >= 0 && (a = S);
      }
    }
  }), !!a) {
    t.d = !1;
    var s = n9(i, r);
    return a.replace(o, s);
  }
}
function M5(e) {
  return Fe(e) ? A5[e] ? "cubic-bezier(" + A5[e] + ")" : fR(e) ? e : "" : "";
}
function HC(e, t, r, n) {
  var i = e.animators, a = i.length, o = [];
  if (e instanceof Km) {
    var s = Aae(e, t, r);
    if (s)
      o.push(s);
    else if (!a)
      return;
  } else if (!a)
    return;
  for (var l = {}, u = 0; u < a; u++) {
    var f = i[u], c = [f.getMaxTime() / 1e3 + "s"], h = M5(f.getClip().easing), v = f.getDelay();
    h ? c.push(h) : c.push("linear"), v && c.push(v / 1e3 + "s"), f.getLoop() && c.push("infinite");
    var d = c.join(" ");
    l[d] = l[d] || [d, []], l[d][1].push(f);
  }
  function g(S) {
    var T = S[1], C = T.length, A = {}, M = {}, E = {}, P = "animation-timing-function";
    function R(de, ve, Ae) {
      for (var be = de.getTracks(), De = de.getMaxTime(), Ue = 0; Ue < be.length; Ue++) {
        var Xe = be[Ue];
        if (Xe.needsAnimate()) {
          var $e = Xe.keyframes, vt = Xe.propName;
          if (Ae && (vt = Ae(vt)), vt)
            for (var Lt = 0; Lt < $e.length; Lt++) {
              var cr = $e[Lt], mr = Math.round(cr.time / De * 100) + "%", Kt = M5(cr.easing), wt = cr.rawValue;
              (Fe(wt) || Xt(wt)) && (ve[mr] = ve[mr] || {}, ve[mr][vt] = cr.rawValue, Kt && (ve[mr][P] = Kt));
            }
        }
      }
    }
    for (var O = 0; O < C; O++) {
      var N = T[O], G = N.targetName;
      G ? G === "shape" && R(N, M) : !n && R(N, A);
    }
    for (var z in A) {
      var H = {};
      Z2(H, e), xe(H, A[z]);
      var W = CU(H), Z = A[z][P];
      E[z] = W ? {
        transform: W
      } : {}, bae(E[z], H), Z && (E[z][P] = Z);
    }
    var ee, V = !0;
    for (var z in M) {
      E[z] = E[z] || {};
      var Q = !ee, Z = M[z][P];
      Q && (ee = new ru());
      var q = ee.len();
      ee.reset(), E[z].d = Tae(e, M[z], ee);
      var X = ee.len();
      if (!Q && q !== X) {
        V = !1;
        break;
      }
      Z && (E[z][P] = Z);
    }
    if (!V)
      for (var z in E)
        delete E[z].d;
    if (!n)
      for (var O = 0; O < C; O++) {
        var N = T[O], G = N.targetName;
        G === "style" && R(N, E, function(be) {
          return Cae[be];
        });
      }
    for (var K = Ht(E), ue = !0, oe, O = 1; O < K.length; O++) {
      var te = K[O - 1], pe = K[O];
      if (E[te][Wv] !== E[pe][Wv]) {
        ue = !1;
        break;
      }
      oe = E[te][Wv];
    }
    if (ue && oe) {
      for (var z in E)
        E[z][Wv] && delete E[z][Wv];
      t[Wv] = oe;
    }
    if (nr(K, function(de) {
      return Ht(E[de]).length > 0;
    }).length) {
      var me = n9(E, r);
      return me + " " + S[0] + " both";
    }
  }
  for (var y in l) {
    var s = g(l[y]);
    s && o.push(s);
  }
  if (o.length) {
    var x = r.zrId + "-cls-" + r9();
    r.cssNodes["." + x] = {
      animation: o.join(",")
    }, t.class = x;
  }
}
function Mae(e, t, r) {
  if (!e.ignore)
    if (e.isSilent()) {
      var n = {
        "pointer-events": "none"
      };
      L5(n, t, r);
    } else {
      var i = e.states.emphasis && e.states.emphasis.style ? e.states.emphasis.style : {}, a = i.fill;
      if (!a) {
        var o = e.style && e.style.fill, s = e.states.select && e.states.select.style && e.states.select.style.fill, l = e.currentStates.indexOf("select") >= 0 && s || o;
        l && (a = W2(l));
      }
      var u = i.lineWidth;
      if (u) {
        var f = !i.strokeNoScale && e.transform ? e.transform[0] : 1;
        u = u / f;
      }
      var n = {
        cursor: "pointer"
      };
      a && (n.fill = a), i.stroke && (n.stroke = i.stroke), u && (n["stroke-width"] = u), L5(n, t, r);
    }
}
function L5(e, t, r, n) {
  var i = JSON.stringify(e), a = r.cssStyleCache[i];
  a || (a = r.zrId + "-cls-" + r9(), r.cssStyleCache[i] = a, r.cssNodes["." + a + ":hover"] = e), t.class = t.class ? t.class + " " + a : a;
}
var q1 = Math.round;
function i9(e) {
  return e && Fe(e.src);
}
function a9(e) {
  return e && nt(e.toDataURL);
}
function RO(e, t, r, n) {
  gae(function(i, a) {
    var o = i === "fill" || i === "stroke";
    o && TU(a) ? s9(t, e, i, n) : o && hR(a) ? l9(r, e, i, n) : e[i] = a, o && n.ssr && a === "none" && (e["pointer-events"] = "visible");
  }, t, r, !1), Oae(r, e, n);
}
function OO(e, t) {
  var r = IU(t);
  r && (r.each(function(n, i) {
    n != null && (e[(b5 + i).toLowerCase()] = n + "");
  }), t.isSilent() && (e[b5 + "silent"] = "true"));
}
function D5(e) {
  return Rc(e[0] - 1) && Rc(e[1]) && Rc(e[2]) && Rc(e[3] - 1);
}
function Lae(e) {
  return Rc(e[4]) && Rc(e[5]);
}
function NO(e, t, r) {
  if (t && !(Lae(t) && D5(t))) {
    var n = 1e4;
    e.transform = D5(t) ? "translate(" + q1(t[4] * n) / n + " " + q1(t[5] * n) / n + ")" : wK(t);
  }
}
function E5(e, t, r) {
  for (var n = e.points, i = [], a = 0; a < n.length; a++)
    i.push(q1(n[a][0] * r) / r), i.push(q1(n[a][1] * r) / r);
  t.points = i.join(" ");
}
function P5(e) {
  return !e.smooth;
}
function Dae(e) {
  var t = Ce(e, function(r) {
    return typeof r == "string" ? [r, r] : r;
  });
  return function(r, n, i) {
    for (var a = 0; a < t.length; a++) {
      var o = t[a], s = r[o[0]];
      s != null && (n[o[1]] = q1(s * i) / i);
    }
  };
}
var Eae = {
  circle: [Dae(["cx", "cy", "r"])],
  polyline: [E5, P5],
  polygon: [E5, P5]
};
function Pae(e) {
  for (var t = e.animators, r = 0; r < t.length; r++)
    if (t[r].targetName === "shape")
      return !0;
  return !1;
}
function o9(e, t) {
  var r = e.style, n = e.shape, i = Eae[e.type], a = {}, o = t.animation, s = "path", l = e.style.strokePercent, u = t.compress && bU(e) || 4;
  if (i && !t.willUpdate && !(i[1] && !i[1](n)) && !(o && Pae(e)) && !(l < 1)) {
    s = e.type;
    var f = Math.pow(10, u);
    i[0](n, a, f);
  } else {
    var c = !e.path || e.shapeChanged();
    e.path || e.createPathProxy();
    var h = e.path;
    c && (h.beginPath(), e.buildPath(h, e.shape), e.pathUpdated());
    var v = h.getVersion(), d = e, g = d.__svgPathBuilder;
    (d.__svgPathVersion !== v || !g || l !== d.__svgPathStrokePercent) && (g || (g = d.__svgPathBuilder = new Q6()), g.reset(u), h.rebuildPath(g, l), g.generateStr(), d.__svgPathVersion = v, d.__svgPathStrokePercent = l), a.d = g.getStr();
  }
  return NO(a, e.transform), RO(a, r, e, t), OO(a, e), t.animation && HC(e, a, t), t.emphasis && Mae(e, a, t), ti(s, e.id + "", a);
}
function Iae(e, t) {
  var r = e.style, n = r.image;
  if (n && !Fe(n) && (i9(n) ? n = n.src : a9(n) && (n = n.toDataURL())), !!n) {
    var i = r.x || 0, a = r.y || 0, o = r.width, s = r.height, l = {
      href: n,
      width: o,
      height: s
    };
    return i && (l.x = i), a && (l.y = a), NO(l, e.transform), RO(l, r, e, t), OO(l, e), t.animation && HC(e, l, t), ti("image", e.id + "", l);
  }
}
function Rae(e, t) {
  var r = e.style, n = r.text;
  if (n != null && (n += ""), !(!n || isNaN(r.x) || isNaN(r.y))) {
    var i = r.font || pf, a = r.x || 0, o = bK(r.y || 0, bx(i), r.textBaseline), s = TK[r.textAlign] || r.textAlign, l = {
      "dominant-baseline": "central",
      "text-anchor": s
    };
    if (nW(r)) {
      var u = "", f = r.fontStyle, c = rW(r.fontSize);
      if (!parseFloat(c))
        return;
      var h = r.fontFamily || qH, v = r.fontWeight;
      u += "font-size:" + c + ";font-family:" + h + ";", f && f !== "normal" && (u += "font-style:" + f + ";"), 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), NO(l, e.transform), RO(l, r, e, t), OO(l, e), t.animation && HC(e, l, t), ti("text", e.id + "", l, void 0, n);
  }
}
function I5(e, t) {
  if (e instanceof zt)
    return o9(e, t);
  if (e instanceof Xn)
    return Iae(e, t);
  if (e instanceof Tm)
    return Rae(e, t);
}
function Oae(e, t, r) {
  var n = e.style;
  if (CK(n)) {
    var i = AK(e), a = r.shadowCache, o = a[i];
    if (!o) {
      var s = e.getGlobalScale(), l = s[0], u = s[1];
      if (!l || !u)
        return;
      var f = n.shadowOffsetX || 0, c = n.shadowOffsetY || 0, h = n.shadowBlur, v = O1(n.shadowColor), d = v.opacity, g = v.color, y = h / 2 / l, x = h / 2 / u, S = y + " " + x;
      o = r.zrId + "-s" + r.shadowIdx++, r.defs[o] = ti("filter", o, {
        id: o,
        x: "-100%",
        y: "-100%",
        width: "300%",
        height: "300%"
      }, [
        ti("feDropShadow", "", {
          dx: f / l,
          dy: c / u,
          stdDeviation: S,
          "flood-color": g,
          "flood-opacity": d
        })
      ]), a[i] = o;
    }
    t.filter = dC(o);
  }
}
function s9(e, t, r, n) {
  var i = e[r], a, o = {
    gradientUnits: i.global ? "userSpaceOnUse" : "objectBoundingBox"
  };
  if (SU(i))
    a = "linearGradient", o.x1 = i.x, o.y1 = i.y, o.x2 = i.x2, o.y2 = i.y2;
  else if (wU(i))
    a = "radialGradient", o.cx = et(i.x, 0.5), o.cy = et(i.y, 0.5), o.r = et(i.r, 0.5);
  else
    return;
  for (var s = i.colorStops, l = [], u = 0, f = s.length; u < f; ++u) {
    var c = GE(s[u].offset) * 100 + "%", h = s[u].color, v = O1(h), d = v.color, g = v.opacity, y = {
      offset: c
    };
    y["stop-color"] = d, g < 1 && (y["stop-opacity"] = g), l.push(ti("stop", u + "", y));
  }
  var x = ti(a, "", o, l), S = IO(x), T = n.gradientCache, C = T[S];
  C || (C = n.zrId + "-g" + n.gradientIdx++, T[S] = C, o.id = C, n.defs[C] = ti(a, C, o, l)), t[r] = dC(C);
}
function l9(e, t, r, n) {
  var i = e.style[r], a = e.getBoundingRect(), o = {}, s = i.repeat, l = s === "no-repeat", u = s === "repeat-x", f = s === "repeat-y", c;
  if (xU(i)) {
    var h = i.imageWidth, v = i.imageHeight, d = void 0, g = i.image;
    if (Fe(g) ? d = g : i9(g) ? d = g.src : a9(g) && (d = g.toDataURL()), typeof Image > "u") {
      var y = "Image width/height must been given explictly in svg-ssr renderer.";
      Hi(h, y), Hi(v, y);
    } else if (h == null || v == null) {
      var x = function(O, N) {
        if (O) {
          var G = O.elm, z = h || N.width, H = v || N.height;
          O.tag === "pattern" && (u ? (H = 1, z /= a.width) : f && (z = 1, H /= a.height)), O.attrs.width = z, O.attrs.height = H, G && (G.setAttribute("width", z), G.setAttribute("height", H));
        }
      }, S = SR(d, null, e, function(O) {
        l || x(M, O), x(c, O);
      });
      S && S.width && S.height && (h = h || S.width, v = v || S.height);
    }
    c = ti("image", "img", {
      href: d,
      width: h,
      height: v
    }), o.width = h, o.height = v;
  } else i.svgElement && (c = it(i.svgElement), o.width = i.svgWidth, o.height = i.svgHeight);
  if (c) {
    var T, C;
    l ? T = C = 1 : u ? (C = 1, T = o.width / a.width) : f ? (T = 1, C = o.height / a.height) : o.patternUnits = "userSpaceOnUse", T != null && !isNaN(T) && (o.width = T), C != null && !isNaN(C) && (o.height = C);
    var A = CU(i);
    A && (o.patternTransform = A);
    var M = ti("pattern", "", o, [c]), E = IO(M), P = n.patternCache, R = P[E];
    R || (R = n.zrId + "-p" + n.patternIdx++, P[E] = R, o.id = R, M = n.defs[R] = ti("pattern", R, o, [c])), t[r] = dC(R);
  }
}
function Nae(e, t, r) {
  var n = r.clipPathCache, i = r.defs, a = n[e.id];
  if (!a) {
    a = r.zrId + "-c" + r.clipPathIdx++;
    var o = {
      id: a
    };
    n[e.id] = a, i[a] = ti("clipPath", a, o, [o9(e, r)]);
  }
  t["clip-path"] = dC(a);
}
function R5(e) {
  return document.createTextNode(e);
}
function Kv(e, t, r) {
  e.insertBefore(t, r);
}
function O5(e, t) {
  e.removeChild(t);
}
function N5(e, t) {
  e.appendChild(t);
}
function u9(e) {
  return e.parentNode;
}
function f9(e) {
  return e.nextSibling;
}
function DL(e, t) {
  e.textContent = t;
}
var k5 = 58, kae = 120, Bae = ti("", "");
function HP(e) {
  return e === void 0;
}
function Bl(e) {
  return e !== void 0;
}
function zae(e, t, r) {
  for (var n = {}, i = t; i <= r; ++i) {
    var a = e[i].key;
    a !== void 0 && (n[a] = i);
  }
  return n;
}
function Z_(e, t) {
  var r = e.key === t.key, n = e.tag === t.tag;
  return n && r;
}
function j1(e) {
  var t, r = e.children, n = e.tag;
  if (Bl(n)) {
    var i = e.elm = t9(n);
    if (kO(Bae, e), Se(r))
      for (t = 0; t < r.length; ++t) {
        var a = r[t];
        a != null && N5(i, j1(a));
      }
    else Bl(e.text) && !ot(e.text) && N5(i, R5(e.text));
  } else
    e.elm = R5(e.text);
  return e.elm;
}
function c9(e, t, r, n, i) {
  for (; n <= i; ++n) {
    var a = r[n];
    a != null && Kv(e, j1(a), t);
  }
}
function Tb(e, t, r, n) {
  for (; r <= n; ++r) {
    var i = t[r];
    if (i != null)
      if (Bl(i.tag)) {
        var a = u9(i.elm);
        O5(a, i.elm);
      } else
        O5(e, i.elm);
  }
}
function kO(e, t) {
  var r, n = t.elm, i = e && e.attrs || {}, a = t.attrs || {};
  if (i !== a) {
    for (r in a) {
      var o = a[r], s = i[r];
      s !== o && (o === !0 ? n.setAttribute(r, "") : o === !1 ? n.removeAttribute(r) : r === "style" ? n.style.cssText = o : r.charCodeAt(0) !== kae ? n.setAttribute(r, o) : r === "xmlns:xlink" || r === "xmlns" ? n.setAttributeNS(mae, r, o) : r.charCodeAt(3) === k5 ? n.setAttributeNS(yae, r, o) : r.charCodeAt(5) === k5 ? n.setAttributeNS(e9, r, o) : n.setAttribute(r, o));
    }
    for (r in i)
      r in a || n.removeAttribute(r);
  }
}
function Fae(e, t, r) {
  for (var n = 0, i = 0, a = t.length - 1, o = t[0], s = t[a], l = r.length - 1, u = r[0], f = r[l], c, h, v, d; n <= a && i <= l; )
    o == null ? o = t[++n] : s == null ? s = t[--a] : u == null ? u = r[++i] : f == null ? f = r[--l] : Z_(o, u) ? (em(o, u), o = t[++n], u = r[++i]) : Z_(s, f) ? (em(s, f), s = t[--a], f = r[--l]) : Z_(o, f) ? (em(o, f), Kv(e, o.elm, f9(s.elm)), o = t[++n], f = r[--l]) : Z_(s, u) ? (em(s, u), Kv(e, s.elm, o.elm), s = t[--a], u = r[++i]) : (HP(c) && (c = zae(t, n, a)), h = c[u.key], HP(h) ? Kv(e, j1(u), o.elm) : (v = t[h], v.tag !== u.tag ? Kv(e, j1(u), o.elm) : (em(v, u), t[h] = void 0, Kv(e, v.elm, o.elm))), u = r[++i]);
  (n <= a || i <= l) && (n > a ? (d = r[l + 1] == null ? null : r[l + 1].elm, c9(e, d, r, i, l)) : Tb(e, t, n, a));
}
function em(e, t) {
  var r = t.elm = e.elm, n = e.children, i = t.children;
  e !== t && (kO(e, t), HP(t.text) ? Bl(n) && Bl(i) ? n !== i && Fae(r, n, i) : Bl(i) ? (Bl(e.text) && DL(r, ""), c9(r, null, i, 0, i.length - 1)) : Bl(n) ? Tb(r, n, 0, n.length - 1) : Bl(e.text) && DL(r, "") : e.text !== t.text && (Bl(n) && Tb(r, n, 0, n.length - 1), DL(r, t.text)));
}
function Gae(e, t) {
  if (Z_(e, t))
    em(e, t);
  else {
    var r = e.elm, n = u9(r);
    j1(t), n !== null && (Kv(n, t.elm, f9(r)), Tb(n, [e], 0, 0));
  }
  return t;
}
var Vae = 0, Hae = (function() {
  function e(t, r, n) {
    if (this.type = "svg", this.refreshHover = B5(), this.configLayer = B5(), this.storage = r, this._opts = n = xe({}, n), this.root = t, this._id = "zr" + Vae++, this._oldVNode = C5(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 = t9("svg");
      kO(null, this._oldVNode), i.appendChild(a), t.appendChild(i);
    }
    this.resize(n.width, n.height);
  }
  return e.prototype.getType = function() {
    return this.type;
  }, e.prototype.getViewportRoot = function() {
    return this._viewport;
  }, e.prototype.getViewportRootOffset = function() {
    var t = this.getViewportRoot();
    if (t)
      return {
        offsetLeft: t.offsetLeft || 0,
        offsetTop: t.offsetTop || 0
      };
  }, e.prototype.getSvgDom = function() {
    return this._svgDom;
  }, e.prototype.refresh = function() {
    if (this.root) {
      var t = this.renderToVNode({
        willUpdate: !0
      });
      t.attrs.style = "position:absolute;left:0;top:0;user-select:none", Gae(this._oldVNode, t), this._oldVNode = t;
    }
  }, e.prototype.renderOneToVNode = function(t) {
    return I5(t, VP(this._id));
  }, e.prototype.renderToVNode = function(t) {
    t = t || {};
    var r = this.storage.getDisplayList(!0), n = this._width, i = this._height, a = VP(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 = Uae(n, i, this._backgroundColor, a);
    s && o.push(s);
    var l = t.compress ? null : this._mainVNode = ti("g", "main", {}, []);
    this._paintList(r, a, l ? l.children : o), l && o.push(l);
    var u = Ce(Ht(a.defs), function(h) {
      return a.defs[h];
    });
    if (u.length && o.push(ti("defs", "defs", {}, u)), t.animation) {
      var f = Sae(a.cssNodes, a.cssAnims, { newline: !0 });
      if (f) {
        var c = ti("style", "stl", {}, [], f);
        o.push(c);
      }
    }
    return C5(n, i, o, t.useViewBox);
  }, e.prototype.renderToString = function(t) {
    return t = t || {}, IO(this.renderToVNode({
      animation: et(t.cssAnimation, !0),
      emphasis: et(t.cssEmphasis, !0),
      willUpdate: !1,
      compress: !0,
      useViewBox: et(t.useViewBox, !0)
    }), { newline: !0 });
  }, e.prototype.setBackgroundColor = function(t) {
    this._backgroundColor = t;
  }, e.prototype.getSvgRoot = function() {
    return this._mainVNode && this._mainVNode.elm;
  }, e.prototype._paintList = function(t, r, n) {
    for (var i = t.length, a = [], o = 0, s, l, u = 0, f = 0; f < i; f++) {
      var c = t[f];
      if (!c.invisible) {
        var h = c.__clipPaths, v = h && h.length || 0, d = l && l.length || 0, g = void 0;
        for (g = Math.max(v - 1, d - 1); g >= 0 && !(h && l && h[g] === l[g]); g--)
          ;
        for (var y = d - 1; y > g; y--)
          o--, s = a[o - 1];
        for (var x = g + 1; x < v; x++) {
          var S = {};
          Nae(h[x], S, r);
          var T = ti("g", "clip-g-" + u++, S, []);
          (s ? s.children : n).push(T), a[o++] = T, s = T;
        }
        l = h;
        var C = I5(c, r);
        C && (s ? s.children : n).push(C);
      }
    }
  }, e.prototype.resize = function(t, r) {
    var n = this._opts, i = this.root, a = this._viewport;
    if (t != null && (n.width = t), r != null && (n.height = r), i && a && (a.style.display = "none", t = lm(i, 0, n), r = lm(i, 1, n), a.style.display = ""), this._width !== t || this._height !== r) {
      if (this._width = t, this._height = r, a) {
        var o = a.style;
        o.width = t + "px", o.height = r + "px";
      }
      if (hR(this._backgroundColor))
        this.refresh();
      else {
        var s = this._svgDom;
        s && (s.setAttribute("width", t), s.setAttribute("height", r));
        var l = this._bgVNode && this._bgVNode.elm;
        l && (l.setAttribute("width", t), l.setAttribute("height", r));
      }
    }
  }, e.prototype.getWidth = function() {
    return this._width;
  }, e.prototype.getHeight = function() {
    return this._height;
  }, e.prototype.dispose = function() {
    this.root && (this.root.innerHTML = ""), this._svgDom = this._viewport = this.storage = this._oldVNode = this._bgVNode = this._mainVNode = null;
  }, e.prototype.clear = function() {
    this._svgDom && (this._svgDom.innerHTML = null), this._oldVNode = null;
  }, e.prototype.toDataURL = function(t) {
    var r = this.renderToString(), n = "data:image/svg+xml;";
    return t ? (r = LK(r), r && n + "base64," + r) : n + "charset=UTF-8," + encodeURIComponent(r);
  }, e;
})();
function B5(e) {
  return function() {
  };
}
function Uae(e, t, r, n) {
  var i;
  if (r && r !== "none")
    if (i = ti("rect", "bg", {
      width: e,
      height: t,
      x: "0",
      y: "0"
    }), TU(r))
      s9({ fill: r }, i.attrs, "fill", n);
    else if (hR(r))
      l9({
        style: {
          fill: r
        },
        dirty: un,
        getBoundingRect: function() {
          return { width: e, height: t };
        }
      }, i.attrs, "fill", n);
    else {
      var a = O1(r), o = a.color, s = a.opacity;
      i.attrs.fill = o, s < 1 && (i.attrs["fill-opacity"] = s);
    }
  return i;
}
function Wae(e) {
  e.registerPainter("svg", Hae);
}
function z5(e, t, r) {
  var n = ja.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", e)), n.width = i * r, n.height = a * r, n;
}
var EL = (function(e) {
  ae(t, e);
  function t(r, n, i) {
    var a = e.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 || Y2, typeof r == "string" ? o = z5(r, n, i) : ot(r) && (o = r, r = o.id), a.id = r, a.dom = o;
    var s = o.style;
    return s && (sR(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 r = this.dpr;
    this.domBack = z5("back-" + this.id, this.painter, r), this.ctxBack = this.domBack.getContext("2d"), r !== 1 && this.ctxBack.scale(r, r);
  }, t.prototype.createRepaintRects = function(r, n, i, a) {
    if (this.__firstTimePaint)
      return this.__firstTimePaint = !1, null;
    var o = [], s = this.maxRepaintRectCount, l = !1, u = new st(0, 0, 0, 0);
    function f(S) {
      if (!(!S.isFinite() || S.isZero()))
        if (o.length === 0) {
          var T = new st(0, 0, 0, 0);
          T.copy(S), o.push(T);
        } else {
          for (var C = !1, A = 1 / 0, M = 0, E = 0; E < o.length; ++E) {
            var P = o[E];
            if (P.intersect(S)) {
              var R = new st(0, 0, 0, 0);
              R.copy(P), R.union(S), o[E] = R, C = !0;
              break;
            } else if (l) {
              u.copy(S), u.union(P);
              var O = S.width * S.height, N = P.width * P.height, G = u.width * u.height, z = G - O - N;
              z < A && (A = z, M = E);
            }
          }
          if (l && (o[M].union(S), C = !0), !C) {
            var T = new st(0, 0, 0, 0);
            T.copy(S), o.push(T);
          }
          l || (l = o.length >= s);
        }
    }
    for (var c = this.__startIndex; c < this.__endIndex; ++c) {
      var h = r[c];
      if (h) {
        var v = h.shouldBePainted(i, a, !0, !0), d = h.__isRendered && (h.__dirty & mo || !v) ? h.getPrevPaintRect() : null;
        d && f(d);
        var g = v && (h.__dirty & mo || !h.__isRendered) ? h.getPaintRect() : null;
        g && f(g);
      }
    }
    for (var c = this.__prevStartIndex; c < this.__prevEndIndex; ++c) {
      var h = n[c], v = h && h.shouldBePainted(i, a, !0, !0);
      if (h && (!v || !h.__zr) && h.__isRendered) {
        var d = h.getPrevPaintRect();
        d && f(d);
      }
    }
    var y;
    do {
      y = !1;
      for (var c = 0; c < o.length; ) {
        if (o[c].isZero()) {
          o.splice(c, 1);
          continue;
        }
        for (var x = c + 1; x < o.length; )
          o[c].intersect(o[x]) ? (y = !0, o[c].union(o[x]), o.splice(x, 1)) : x++;
        c++;
      }
    } while (y);
    return this._paintRects = o, o;
  }, t.prototype.debugGetPaintRects = function() {
    return (this._paintRects || []).slice();
  }, t.prototype.resize = function(r, n) {
    var i = this.dpr, a = this.dom, o = a.style, s = this.domBack;
    o && (o.width = r + "px", o.height = n + "px"), a.width = r * i, a.height = n * i, s && (s.width = r * i, s.height = n * i, i !== 1 && this.ctxBack.scale(i, i));
  }, t.prototype.clear = function(r, n, i) {
    var a = this.dom, o = this.ctx, s = a.width, l = a.height;
    n = n || this.clearColor;
    var u = this.motionBlur && !r, f = this.lastFrameAlpha, c = this.dpr, h = this;
    u && (this.domBack || this.createBackBuffer(), this.ctxBack.globalCompositeOperation = "copy", this.ctxBack.drawImage(a, 0, 0, s / c, l / c));
    var v = this.domBack;
    function d(g, y, x, S) {
      if (o.clearRect(g, y, x, S), n && n !== "transparent") {
        var T = void 0;
        if (yx(n)) {
          var C = n.global || n.__width === x && n.__height === S;
          T = C && n.__canvasGradient || CP(o, n, {
            x: 0,
            y: 0,
            width: x,
            height: S
          }), n.__canvasGradient = T, n.__width = x, n.__height = S;
        } else JH(n) && (n.scaleX = n.scaleX || c, n.scaleY = n.scaleY || c, T = AP(o, n, {
          dirty: function() {
            h.setUnpainted(), h.painter.refresh();
          }
        }));
        o.save(), o.fillStyle = T || n, o.fillRect(g, y, x, S), o.restore();
      }
      u && (o.save(), o.globalAlpha = f, o.drawImage(v, g, y, x, S), o.restore());
    }
    !i || u ? d(0, 0, s, l) : i.length && F(i, function(g) {
      d(g.x * c, g.y * c, g.width * c, g.height * c);
    });
  }, t;
})(ds), F5 = 1e5, Nv = 314159, hT = 0.01, Xae = 1e-3;
function Yae(e) {
  return e ? e.__builtin__ ? !0 : !(typeof e.resize != "function" || typeof e.refresh != "function") : !1;
}
function Zae(e, t) {
  var r = document.createElement("div");
  return r.style.cssText = [
    "position:relative",
    "width:" + e + "px",
    "height:" + t + "px",
    "padding:0",
    "margin:0",
    "border-width:0"
  ].join(";") + ";", r;
}
var $ae = (function() {
  function e(t, r, 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 = xe({}, n || {}), this.dpr = n.devicePixelRatio || Y2, this._singleCanvas = a, this.root = t;
    var o = t.style;
    o && (sR(t), t.innerHTML = ""), this.storage = r;
    var s = this._zlevelList;
    this._prevDisplayList = [];
    var l = this._layers;
    if (a) {
      var f = t, c = f.width, h = f.height;
      n.width != null && (c = n.width), n.height != null && (h = n.height), this.dpr = n.devicePixelRatio || 1, f.width = c * this.dpr, f.height = h * this.dpr, this._width = c, this._height = h;
      var v = new EL(f, this, this.dpr);
      v.__builtin__ = !0, v.initContext(), l[Nv] = v, v.zlevel = Nv, s.push(Nv), this._domRoot = t;
    } else {
      this._width = lm(t, 0, n), this._height = lm(t, 1, n);
      var u = this._domRoot = Zae(this._width, this._height);
      t.appendChild(u);
    }
  }
  return e.prototype.getType = function() {
    return "canvas";
  }, e.prototype.isSingleCanvas = function() {
    return this._singleCanvas;
  }, e.prototype.getViewportRoot = function() {
    return this._domRoot;
  }, e.prototype.getViewportRootOffset = function() {
    var t = this.getViewportRoot();
    if (t)
      return {
        offsetLeft: t.offsetLeft || 0,
        offsetTop: t.offsetTop || 0
      };
  }, e.prototype.refresh = function(t) {
    var r = this.storage.getDisplayList(!0), n = this._prevDisplayList, i = this._zlevelList;
    this._redrawId = Math.random(), this._paintList(r, 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 = r.slice()), this;
  }, e.prototype.refreshHover = function() {
    this._paintHoverList(this.storage.getDisplayList(!1));
  }, e.prototype._paintHoverList = function(t) {
    var r = t.length, n = this._hoverlayer;
    if (n && n.clear(), !!r) {
      for (var i = {
        inHover: !0,
        viewWidth: this._width,
        viewHeight: this._height
      }, a, o = 0; o < r; o++) {
        var s = t[o];
        s.__inHover && (n || (n = this._hoverlayer = this.getLayer(F5)), a || (a = n.ctx, a.save()), od(a, s, i, o === r - 1));
      }
      a && a.restore();
    }
  }, e.prototype.getHoverLayer = function() {
    return this.getLayer(F5);
  }, e.prototype.paintOne = function(t, r) {
    Ix(t, r);
  }, e.prototype._paintList = function(t, r, n, i) {
    if (this._redrawId === i) {
      n = n || !1, this._updateLayerStatus(t);
      var a = this._doPaintList(t, r, 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;
        V2(function() {
          l._paintList(t, r, n, i);
        });
      }
    }
  }, e.prototype._compositeManually = function() {
    var t = this.getLayer(Nv).ctx, r = this._domRoot.width, n = this._domRoot.height;
    t.clearRect(0, 0, r, n), this.eachBuiltinLayer(function(i) {
      i.virtual && t.drawImage(i.dom, 0, 0, r, n);
    });
  }, e.prototype._doPaintList = function(t, r, 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 f = !0, c = !1, h = function(g) {
      var y = a[g], x = y.ctx, S = o && y.createRepaintRects(t, r, v._width, v._height), T = n ? y.__startIndex : y.__drawIndex, C = !n && y.incremental && Date.now, A = C && Date.now(), M = y.zlevel === v._zlevelList[0] ? v._backgroundColor : null;
      if (y.__startIndex === y.__endIndex)
        y.clear(!1, M, S);
      else if (T === y.__startIndex) {
        var E = t[T];
        (!E.incremental || !E.notClear || n) && y.clear(!1, M, S);
      }
      T === -1 && (console.error("For some unknown reason. drawIndex is -1"), T = y.__startIndex);
      var P, R = function(z) {
        var H = {
          inHover: !1,
          allClipped: !1,
          prevEl: null,
          viewWidth: i._width,
          viewHeight: i._height
        };
        for (P = T; P < y.__endIndex; P++) {
          var W = t[P];
          if (W.__inHover && (c = !0), i._doPaintEl(W, y, o, z, H, P === y.__endIndex - 1), C) {
            var Z = Date.now() - A;
            if (Z > 15)
              break;
          }
        }
        H.prevElClipPaths && x.restore();
      };
      if (S)
        if (S.length === 0)
          P = y.__endIndex;
        else
          for (var O = v.dpr, N = 0; N < S.length; ++N) {
            var G = S[N];
            x.save(), x.beginPath(), x.rect(G.x * O, G.y * O, G.width * O, G.height * O), x.clip(), R(G), x.restore();
          }
      else
        x.save(), R(), x.restore();
      y.__drawIndex = P, y.__drawIndex < y.__endIndex && (f = !1);
    }, v = this, d = 0; d < a.length; d++)
      h(d);
    return Gt.wxa && F(this._layers, function(g) {
      g && g.ctx && g.ctx.draw && g.ctx.draw();
    }), {
      finished: f,
      needsRefreshHover: c
    };
  }, e.prototype._doPaintEl = function(t, r, n, i, a, o) {
    var s = r.ctx;
    if (n) {
      var l = t.getPaintRect();
      (!i || l && l.intersect(i)) && (od(s, t, a, o), t.setPrevPaintRect(l));
    } else
      od(s, t, a, o);
  }, e.prototype.getLayer = function(t, r) {
    this._singleCanvas && !this._needsManuallyCompositing && (t = Nv);
    var n = this._layers[t];
    return n || (n = new EL("zr_" + t, this, this.dpr), n.zlevel = t, n.__builtin__ = !0, this._layerConfig[t] ? je(n, this._layerConfig[t], !0) : this._layerConfig[t - hT] && je(n, this._layerConfig[t - hT], !0), r && (n.virtual = r), this.insertLayer(t, n), n.initContext()), n;
  }, e.prototype.insertLayer = function(t, r) {
    var n = this._layers, i = this._zlevelList, a = i.length, o = this._domRoot, s = null, l = -1;
    if (!n[t] && Yae(r)) {
      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] = r, !r.virtual)
        if (s) {
          var u = s.dom;
          u.nextSibling ? o.insertBefore(r.dom, u.nextSibling) : o.appendChild(r.dom);
        } else
          o.firstChild ? o.insertBefore(r.dom, o.firstChild) : o.appendChild(r.dom);
      r.painter || (r.painter = this);
    }
  }, e.prototype.eachLayer = function(t, r) {
    for (var n = this._zlevelList, i = 0; i < n.length; i++) {
      var a = n[i];
      t.call(r, this._layers[a], a);
    }
  }, e.prototype.eachBuiltinLayer = function(t, r) {
    for (var n = this._zlevelList, i = 0; i < n.length; i++) {
      var a = n[i], o = this._layers[a];
      o.__builtin__ && t.call(r, o, a);
    }
  }, e.prototype.eachOtherLayer = function(t, r) {
    for (var n = this._zlevelList, i = 0; i < n.length; i++) {
      var a = n[i], o = this._layers[a];
      o.__builtin__ || t.call(r, o, a);
    }
  }, e.prototype.getLayers = function() {
    return this._layers;
  }, e.prototype._updateLayerStatus = function(t) {
    this.eachBuiltinLayer(function(c, h) {
      c.__dirty = c.__used = !1;
    });
    function r(c) {
      a && (a.__endIndex !== c && (a.__dirty = !0), a.__endIndex = c);
    }
    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, f = void 0;
      s !== u && (s = u, o = 0), i.incremental ? (f = this.getLayer(u + Xae, this._needsManuallyCompositing), f.incremental = !0, o = 1) : f = this.getLayer(u + (o > 0 ? hT : 0), this._needsManuallyCompositing), f.__builtin__ || uC("ZLevel " + u + " has been used by unkown layer " + f.id), f !== a && (f.__used = !0, f.__startIndex !== l && (f.__dirty = !0), f.__startIndex = l, f.incremental ? f.__drawIndex = -1 : f.__drawIndex = l, r(l), a = f), i.__dirty & mo && !i.__inHover && (f.__dirty = !0, f.incremental && f.__drawIndex < 0 && (f.__drawIndex = l));
    }
    r(l), this.eachBuiltinLayer(function(c, h) {
      !c.__used && c.getElementCount() > 0 && (c.__dirty = !0, c.__startIndex = c.__endIndex = c.__drawIndex = 0), c.__dirty && c.__drawIndex < 0 && (c.__drawIndex = c.__startIndex);
    });
  }, e.prototype.clear = function() {
    return this.eachBuiltinLayer(this._clearLayer), this;
  }, e.prototype._clearLayer = function(t) {
    t.clear();
  }, e.prototype.setBackgroundColor = function(t) {
    this._backgroundColor = t, F(this._layers, function(r) {
      r.setUnpainted();
    });
  }, e.prototype.configLayer = function(t, r) {
    if (r) {
      var n = this._layerConfig;
      n[t] ? je(n[t], r, !0) : n[t] = r;
      for (var i = 0; i < this._zlevelList.length; i++) {
        var a = this._zlevelList[i];
        if (a === t || a === t + hT) {
          var o = this._layers[a];
          je(o, n[t], !0);
        }
      }
    }
  }, e.prototype.delLayer = function(t) {
    var r = this._layers, n = this._zlevelList, i = r[t];
    i && (i.dom.parentNode.removeChild(i.dom), delete r[t], n.splice(Tt(n, t), 1));
  }, e.prototype.resize = function(t, r) {
    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), r != null && (i.height = r), t = lm(a, 0, i), r = lm(a, 1, i), n.style.display = "", this._width !== t || r !== this._height) {
        n.style.width = t + "px", n.style.height = r + "px";
        for (var o in this._layers)
          this._layers.hasOwnProperty(o) && this._layers[o].resize(t, r);
        this.refresh(!0);
      }
      this._width = t, this._height = r;
    } else {
      if (t == null || r == null)
        return;
      this._width = t, this._height = r, this.getLayer(Nv).resize(t, r);
    }
    return this;
  }, e.prototype.clearLayer = function(t) {
    var r = this._layers[t];
    r && r.clear();
  }, e.prototype.dispose = function() {
    this.root.innerHTML = "", this.root = this.storage = this._domRoot = this._layers = null;
  }, e.prototype.getRenderedCanvas = function(t) {
    if (t = t || {}, this._singleCanvas && !this._compositeManually)
      return this._layers[Nv].dom;
    var r = new EL("image", this, t.pixelRatio || this.dpr);
    r.initContext(), r.clear(!1, t.backgroundColor || this._backgroundColor);
    var n = r.ctx;
    if (t.pixelRatio <= this.dpr) {
      this.refresh();
      var i = r.dom.width, a = r.dom.height;
      this.eachLayer(function(c) {
        c.__builtin__ ? n.drawImage(c.dom, 0, 0, i, a) : c.renderToCanvas && (n.save(), c.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 f = s[l];
        od(n, f, o, l === u - 1);
      }
    return r.dom;
  }, e.prototype.getWidth = function() {
    return this._width;
  }, e.prototype.getHeight = function() {
    return this._height;
  }, e;
})();
function h9(e) {
  e.registerPainter("canvas", $ae);
}
var qae = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.hasSymbolVisual = !0, r;
    }
    return t.prototype.getInitialData = function(r) {
      return ou(null, this, {
        useEncodeDefaulter: !0
      });
    }, t.prototype.getLegendIcon = function(r) {
      var n = new rt(), i = en("line", 0, r.itemHeight / 2, r.itemWidth, 0, r.lineStyle.stroke, !1);
      n.add(i), i.setStyle(r.lineStyle);
      var a = this.getData().getVisual("symbol"), o = this.getData().getVisual("symbolRotate"), s = a === "none" ? "circle" : a, l = r.itemHeight * 0.8, u = en(s, (r.itemWidth - l) / 2, (r.itemHeight - l) / 2, l, l, r.itemStyle.fill);
      n.add(u), u.setStyle(r.itemStyle);
      var f = r.iconRotate === "inherit" ? o : r.iconRotate || 0;
      return u.rotation = f * Math.PI / 180, u.setOrigin([r.itemWidth / 2, r.itemHeight / 2]), s.indexOf("empty") > -1 && (u.style.stroke = u.style.fill, u.style.fill = fe.color.neutral00, 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: 6,
      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;
  })(Yt)
);
function Em(e, t) {
  var r = e.mapDimensionsAll("defaultedLabel"), n = r.length;
  if (n === 1) {
    var i = Cm(e, t, r[0]);
    return i != null ? i + "" : null;
  } else if (n) {
    for (var a = [], o = 0; o < r.length; o++)
      a.push(Cm(e, t, r[o]));
    return a.join(" ");
  }
}
function v9(e, t) {
  var r = e.mapDimensionsAll("defaultedLabel");
  if (!Se(t))
    return t + "";
  for (var n = [], i = 0; i < r.length; i++) {
    var a = e.getDimensionIndex(r[i]);
    a >= 0 && n.push(t[a]);
  }
  return n.join(" ");
}
var Nx = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r, n, i, a) {
      var o = e.call(this) || this;
      return o.updateData(r, n, i, a), o;
    }
    return t.prototype._createSymbol = function(r, n, i, a, o, s) {
      this.removeAll();
      var l = en(r, -1, -1, 2, 2, null, s);
      l.attr({
        z2: et(o, 100),
        culling: !0,
        scaleX: a[0] / 2,
        scaleY: a[1] / 2
      }), l.drift = jae, this._symbolType = r, this.add(l);
    }, t.prototype.stopSymbolAnimation = function(r) {
      this.childAt(0).stopAnimation(null, r);
    }, t.prototype.getSymbolType = function() {
      return this._symbolType;
    }, t.prototype.getSymbolPath = function() {
      return this.childAt(0);
    }, t.prototype.highlight = function() {
      mf(this.childAt(0));
    }, t.prototype.downplay = function() {
      yf(this.childAt(0));
    }, t.prototype.setZ = function(r, n) {
      var i = this.childAt(0);
      i.zlevel = r, i.z = n;
    }, t.prototype.setDraggable = function(r, n) {
      var i = this.childAt(0);
      i.draggable = r, i.cursor = !n && r ? "move" : i.cursor;
    }, t.prototype.updateData = function(r, n, i, a) {
      this.silent = !1;
      var o = r.getItemVisual(n, "symbol") || "circle", s = r.hostModel, l = t.getSymbolSize(r, n), u = t.getSymbolZ2(r, n), f = o !== this._symbolType, c = a && a.disableAnimation;
      if (f) {
        var h = r.getItemVisual(n, "symbolKeepAspect");
        this._createSymbol(o, r, n, l, u, h);
      } else {
        var v = this.childAt(0);
        v.silent = !1;
        var d = {
          scaleX: l[0] / 2,
          scaleY: l[1] / 2
        };
        c ? v.attr(d) : Wt(v, d, s, n), vs(v);
      }
      if (this._updateCommon(r, n, l, i, a), f) {
        var v = this.childAt(0);
        if (!c) {
          var d = {
            scaleX: this._sizeX,
            scaleY: this._sizeY,
            style: {
              // Always fadeIn. Because it has fadeOut animation when symbol is removed..
              opacity: v.style.opacity
            }
          };
          v.scaleX = v.scaleY = 0, v.style.opacity = 0, Ir(v, d, s, n);
        }
      }
      c && this.childAt(0).stopAnimation("leave");
    }, t.prototype._updateCommon = function(r, n, i, a, o) {
      var s = this.childAt(0), l = r.hostModel, u, f, c, h, v, d, g, y, x;
      if (a && (u = a.emphasisItemStyle, f = a.blurItemStyle, c = a.selectItemStyle, h = a.focus, v = a.blurScope, g = a.labelStatesModels, y = a.hoverScale, x = a.cursorStyle, d = a.emphasisDisabled), !a || r.hasItemOption) {
        var S = a && a.itemModel ? a.itemModel : r.getItemModel(n), T = S.getModel("emphasis");
        u = T.getModel("itemStyle").getItemStyle(), c = S.getModel(["select", "itemStyle"]).getItemStyle(), f = S.getModel(["blur", "itemStyle"]).getItemStyle(), h = T.get("focus"), v = T.get("blurScope"), d = T.get("disabled"), g = Wn(S), y = T.getShallow("scale"), x = S.getShallow("cursor");
      }
      var C = r.getItemVisual(n, "symbolRotate");
      s.attr("rotation", (C || 0) * Math.PI / 180 || 0);
      var A = Fd(r.getItemVisual(n, "symbolOffset"), i);
      A && (s.x = A[0], s.y = A[1]), x && s.attr("cursor", x);
      var M = r.getItemVisual(n, "style"), E = M.fill;
      if (s instanceof Xn) {
        var P = s.style;
        s.useStyle(xe({
          // TODO other properties like x, y ?
          image: P.image,
          x: P.x,
          y: P.y,
          width: P.width,
          height: P.height
        }, M));
      } else
        s.__isEmptyBrush ? s.useStyle(xe({}, M)) : s.useStyle(M), s.style.decal = null, s.setColor(E, o && o.symbolInnerColor), s.style.strokeNoScale = !0;
      var R = r.getItemVisual(n, "liftZ"), O = this._z2;
      R != null ? O == null && (this._z2 = s.z2, s.z2 += R) : O != null && (s.z2 = O, this._z2 = null);
      var N = o && o.useNameLabel;
      si(s, g, {
        labelFetcher: l,
        labelDataIndex: n,
        defaultText: G,
        inheritColor: E,
        defaultOpacity: M.opacity
      });
      function G(W) {
        return N ? r.getName(W) : Em(r, W);
      }
      this._sizeX = i[0] / 2, this._sizeY = i[1] / 2;
      var z = s.ensureState("emphasis");
      z.style = u, s.ensureState("select").style = c, s.ensureState("blur").style = f;
      var H = y == null || y === !0 ? Math.max(1.1, 3 / this._sizeY) : isFinite(y) && y > 0 ? +y : 1;
      z.scaleX = this._sizeX * H, z.scaleY = this._sizeY * H, this.setSymbolScale(1), Hr(this, h, v, d);
    }, t.prototype.setSymbolScale = function(r) {
      this.scaleX = this.scaleY = r;
    }, t.prototype.fadeOut = function(r, n, i) {
      var a = this.childAt(0), o = pt(this).dataIndex, s = i && i.animation;
      if (this.silent = a.silent = !0, i && i.fadeLabel) {
        var l = a.getTextContent();
        l && Zc(l, {
          style: {
            opacity: 0
          }
        }, n, {
          dataIndex: o,
          removeOpt: s,
          cb: function() {
            a.removeTextContent();
          }
        });
      } else
        a.removeTextContent();
      Zc(a, {
        style: {
          opacity: 0
        },
        scaleX: 0,
        scaleY: 0
      }, n, {
        dataIndex: o,
        cb: r,
        removeOpt: s
      });
    }, t.getSymbolSize = function(r, n) {
      return oy(r.getItemVisual(n, "symbolSize"));
    }, t.getSymbolZ2 = function(r, n) {
      return r.getItemVisual(n, "z2");
    }, t;
  })(rt)
);
function jae(e, t) {
  this.parent.drift(e, t);
}
function PL(e, t, r, n) {
  return t && !isNaN(t[0]) && !isNaN(t[1]) && !(n.isIgnore && n.isIgnore(r)) && !(n.clipShape && !n.clipShape.contain(t[0], t[1])) && e.getItemVisual(r, "symbol") !== "none";
}
function G5(e) {
  return e != null && !ot(e) && (e = {
    isIgnore: e
  }), e || {};
}
function V5(e) {
  var t = e.hostModel, r = t.getModel("emphasis");
  return {
    emphasisItemStyle: r.getModel("itemStyle").getItemStyle(),
    blurItemStyle: t.getModel(["blur", "itemStyle"]).getItemStyle(),
    selectItemStyle: t.getModel(["select", "itemStyle"]).getItemStyle(),
    focus: r.get("focus"),
    blurScope: r.get("blurScope"),
    emphasisDisabled: r.get("disabled"),
    hoverScale: r.get("scale"),
    labelStatesModels: Wn(t),
    cursorStyle: t.get("cursor")
  };
}
var kx = (
  /** @class */
  (function() {
    function e(t) {
      this.group = new rt(), this._SymbolCtor = t || Nx;
    }
    return e.prototype.updateData = function(t, r) {
      this._progressiveEls = null, r = G5(r);
      var n = this.group, i = t.hostModel, a = this._data, o = this._SymbolCtor, s = r.disableAnimation, l = V5(t), u = {
        disableAnimation: s
      }, f = r.getSymbolPoint || function(c) {
        return t.getItemLayout(c);
      };
      a || n.removeAll(), t.diff(a).add(function(c) {
        var h = f(c);
        if (PL(t, h, c, r)) {
          var v = new o(t, c, l, u);
          v.setPosition(h), t.setItemGraphicEl(c, v), n.add(v);
        }
      }).update(function(c, h) {
        var v = a.getItemGraphicEl(h), d = f(c);
        if (!PL(t, d, c, r)) {
          n.remove(v);
          return;
        }
        var g = t.getItemVisual(c, "symbol") || "circle", y = v && v.getSymbolType && v.getSymbolType();
        if (!v || y && y !== g)
          n.remove(v), v = new o(t, c, l, u), v.setPosition(d);
        else {
          v.updateData(t, c, l, u);
          var x = {
            x: d[0],
            y: d[1]
          };
          s ? v.attr(x) : Wt(v, x, i);
        }
        n.add(v), t.setItemGraphicEl(c, v);
      }).remove(function(c) {
        var h = a.getItemGraphicEl(c);
        h && h.fadeOut(function() {
          n.remove(h);
        }, i);
      }).execute(), this._getSymbolPoint = f, this._data = t;
    }, e.prototype.updateLayout = function() {
      var t = this, r = this._data;
      r && r.eachItemGraphicEl(function(n, i) {
        var a = t._getSymbolPoint(i);
        n.setPosition(a), n.markRedraw();
      });
    }, e.prototype.incrementalPrepareUpdate = function(t) {
      this._seriesScope = V5(t), this._data = null, this.group.removeAll();
    }, e.prototype.incrementalUpdate = function(t, r, n) {
      this._progressiveEls = [], n = G5(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 = r.getItemLayout(a);
        if (PL(r, o, a, n)) {
          var s = new this._SymbolCtor(r, a, this._seriesScope);
          s.traverse(i), s.setPosition(o), this.group.add(s), r.setItemGraphicEl(a, s), this._progressiveEls.push(s);
        }
      }
    }, e.prototype.eachRendered = function(t) {
      rh(this._progressiveEls || this.group, t);
    }, e.prototype.remove = function(t) {
      var r = this.group, n = this._data;
      n && t ? n.eachItemGraphicEl(function(i) {
        i.fadeOut(function() {
          r.remove(i);
        }, n.hostModel);
      }) : r.removeAll();
    }, e;
  })()
);
function d9(e, t, r) {
  var n = e.getBaseAxis(), i = e.getOtherAxis(n), a = Kae(i, r), o = n.dim, s = i.dim, l = t.mapDimension(s), u = t.mapDimension(o), f = s === "x" || s === "radius" ? 1 : 0, c = Ce(e.dimensions, function(d) {
    return t.mapDimension(d);
  }), h = !1, v = t.getCalculationInfo("stackResultDimension");
  return xf(
    t,
    c[0]
    /* , dims[1] */
  ) && (h = !0, c[0] = v), xf(
    t,
    c[1]
    /* , dims[0] */
  ) && (h = !0, c[1] = v), {
    dataDimsForPoint: c,
    valueStart: a,
    valueAxisDim: s,
    baseAxisDim: o,
    stacked: !!h,
    valueDim: l,
    baseDim: u,
    baseDataOffset: f,
    stackedOverDimension: t.getCalculationInfo("stackedOverDimension")
  };
}
function Kae(e, t) {
  var r = 0, n = e.scale.getExtent();
  return t === "start" ? r = n[0] : t === "end" ? r = n[1] : Xt(t) && !isNaN(t) ? r = t : n[0] > 0 ? r = n[0] : n[1] < 0 && (r = n[1]), r;
}
function p9(e, t, r, n) {
  var i = NaN;
  e.stacked && (i = r.get(r.getCalculationInfo("stackedOverDimension"), n)), isNaN(i) && (i = e.valueStart);
  var a = e.baseDataOffset, o = [];
  return o[a] = r.get(e.baseDim, n), o[1 - a] = i, t.dataToPoint(o);
}
function Qae(e, t) {
  var r = [];
  return t.diff(e).add(function(n) {
    r.push({
      cmd: "+",
      idx: n
    });
  }).update(function(n, i) {
    r.push({
      cmd: "=",
      idx: i,
      idx1: n
    });
  }).remove(function(n) {
    r.push({
      cmd: "-",
      idx: n
    });
  }).execute(), r;
}
function Jae(e, t, r, n, i, a, o, s) {
  for (var l = Qae(e, t), u = [], f = [], c = [], h = [], v = [], d = [], g = [], y = d9(i, t, o), x = e.getLayout("points") || [], S = t.getLayout("points") || [], T = 0; T < l.length; T++) {
    var C = l[T], A = !0, M = void 0, E = void 0;
    switch (C.cmd) {
      case "=":
        M = C.idx * 2, E = C.idx1 * 2;
        var P = x[M], R = x[M + 1], O = S[E], N = S[E + 1];
        (isNaN(P) || isNaN(R)) && (P = O, R = N), u.push(P, R), f.push(O, N), c.push(r[M], r[M + 1]), h.push(n[E], n[E + 1]), g.push(t.getRawIndex(C.idx1));
        break;
      case "+":
        var G = C.idx, z = y.dataDimsForPoint, H = i.dataToPoint([t.get(z[0], G), t.get(z[1], G)]);
        E = G * 2, u.push(H[0], H[1]), f.push(S[E], S[E + 1]);
        var W = p9(y, i, t, G);
        c.push(W[0], W[1]), h.push(n[E], n[E + 1]), g.push(t.getRawIndex(G));
        break;
      case "-":
        A = !1;
    }
    A && (v.push(C), d.push(d.length));
  }
  d.sort(function(te, pe) {
    return g[te] - g[pe];
  });
  for (var Z = u.length, ee = Wl(Z), V = Wl(Z), Q = Wl(Z), q = Wl(Z), X = [], T = 0; T < d.length; T++) {
    var K = d[T], ue = T * 2, oe = K * 2;
    ee[ue] = u[oe], ee[ue + 1] = u[oe + 1], V[ue] = f[oe], V[ue + 1] = f[oe + 1], Q[ue] = c[oe], Q[ue + 1] = c[oe + 1], q[ue] = h[oe], q[ue + 1] = h[oe + 1], X[T] = v[K];
  }
  return {
    current: ee,
    next: V,
    stackedOnCurrent: Q,
    stackedOnNext: q,
    status: X
  };
}
var yc = Math.min, _c = Math.max;
function pd(e, t) {
  return isNaN(e) || isNaN(t);
}
function UP(e, t, r, n, i, a, o, s, l) {
  for (var u, f, c, h, v, d, g = r, y = 0; y < n; y++) {
    var x = t[g * 2], S = t[g * 2 + 1];
    if (g >= i || g < 0)
      break;
    if (pd(x, S)) {
      if (l) {
        g += a;
        continue;
      }
      break;
    }
    if (g === r)
      e[a > 0 ? "moveTo" : "lineTo"](x, S), c = x, h = S;
    else {
      var T = x - u, C = S - f;
      if (T * T + C * C < 0.5) {
        g += a;
        continue;
      }
      if (o > 0) {
        for (var A = g + a, M = t[A * 2], E = t[A * 2 + 1]; M === x && E === S && y < n; )
          y++, A += a, g += a, M = t[A * 2], E = t[A * 2 + 1], x = t[g * 2], S = t[g * 2 + 1], T = x - u, C = S - f;
        var P = y + 1;
        if (l)
          for (; pd(M, E) && P < n; )
            P++, A += a, M = t[A * 2], E = t[A * 2 + 1];
        var R = 0.5, O = 0, N = 0, G = void 0, z = void 0;
        if (P >= n || pd(M, E))
          v = x, d = S;
        else {
          O = M - u, N = E - f;
          var H = x - u, W = M - x, Z = S - f, ee = E - S, V = void 0, Q = void 0;
          if (s === "x") {
            V = Math.abs(H), Q = Math.abs(W);
            var q = O > 0 ? 1 : -1;
            v = x - q * V * o, d = S, G = x + q * Q * o, z = S;
          } else if (s === "y") {
            V = Math.abs(Z), Q = Math.abs(ee);
            var X = N > 0 ? 1 : -1;
            v = x, d = S - X * V * o, G = x, z = S + X * Q * o;
          } else
            V = Math.sqrt(H * H + Z * Z), Q = Math.sqrt(W * W + ee * ee), R = Q / (Q + V), v = x - O * o * (1 - R), d = S - N * o * (1 - R), G = x + O * o * R, z = S + N * o * R, G = yc(G, _c(M, x)), z = yc(z, _c(E, S)), G = _c(G, yc(M, x)), z = _c(z, yc(E, S)), O = G - x, N = z - S, v = x - O * V / Q, d = S - N * V / Q, v = yc(v, _c(u, x)), d = yc(d, _c(f, S)), v = _c(v, yc(u, x)), d = _c(d, yc(f, S)), O = x - v, N = S - d, G = x + O * Q / V, z = S + N * Q / V;
        }
        e.bezierCurveTo(c, h, v, d, x, S), c = G, h = z;
      } else
        e.lineTo(x, S);
    }
    u = x, f = S, g += a;
  }
  return y;
}
var g9 = (
  /** @class */
  /* @__PURE__ */ (function() {
    function e() {
      this.smooth = 0, this.smoothConstraint = !0;
    }
    return e;
  })()
), eoe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r) {
      var n = e.call(this, r) || this;
      return n.type = "ec-polyline", n;
    }
    return t.prototype.getDefaultStyle = function() {
      return {
        stroke: fe.color.neutral99,
        fill: null
      };
    }, t.prototype.getDefaultShape = function() {
      return new g9();
    }, t.prototype.buildPath = function(r, n) {
      var i = n.points, a = 0, o = i.length / 2;
      if (n.connectNulls) {
        for (; o > 0 && pd(i[o * 2 - 2], i[o * 2 - 1]); o--)
          ;
        for (; a < o && pd(i[a * 2], i[a * 2 + 1]); a++)
          ;
      }
      for (; a < o; )
        a += UP(r, i, a, o, o, 1, n.smooth, n.smoothMonotone, n.connectNulls) + 1;
    }, t.prototype.getPointOn = function(r, n) {
      this.path || (this.createPathProxy(), this.buildPath(this.path, this.shape));
      for (var i = this.path, a = i.data, o = ru.CMD, s, l, u = n === "x", f = [], c = 0; c < a.length; ) {
        var h = a[c++], v = void 0, d = void 0, g = void 0, y = void 0, x = void 0, S = void 0, T = void 0;
        switch (h) {
          case o.M:
            s = a[c++], l = a[c++];
            break;
          case o.L:
            if (v = a[c++], d = a[c++], T = u ? (r - s) / (v - s) : (r - l) / (d - l), T <= 1 && T >= 0) {
              var C = u ? (d - l) * T + l : (v - s) * T + s;
              return u ? [r, C] : [C, r];
            }
            s = v, l = d;
            break;
          case o.C:
            v = a[c++], d = a[c++], g = a[c++], y = a[c++], x = a[c++], S = a[c++];
            var A = u ? U2(s, v, g, x, r, f) : U2(l, d, y, S, r, f);
            if (A > 0)
              for (var M = 0; M < A; M++) {
                var E = f[M];
                if (E <= 1 && E >= 0) {
                  var C = u ? Jn(l, d, y, S, E) : Jn(s, v, g, x, E);
                  return u ? [r, C] : [C, r];
                }
              }
            s = x, l = S;
            break;
        }
      }
    }, t;
  })(zt)
), toe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      return e !== null && e.apply(this, arguments) || this;
    }
    return t;
  })(g9)
), m9 = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r) {
      var n = e.call(this, r) || this;
      return n.type = "ec-polygon", n;
    }
    return t.prototype.getDefaultShape = function() {
      return new toe();
    }, t.prototype.buildPath = function(r, n) {
      var i = n.points, a = n.stackedOnPoints, o = 0, s = i.length / 2, l = n.smoothMonotone;
      if (n.connectNulls) {
        for (; s > 0 && pd(i[s * 2 - 2], i[s * 2 - 1]); s--)
          ;
        for (; o < s && pd(i[o * 2], i[o * 2 + 1]); o++)
          ;
      }
      for (; o < s; ) {
        var u = UP(r, i, o, s, s, 1, n.smooth, l, n.connectNulls);
        UP(r, a, o + u - 1, u, s, -1, n.stackedOnSmooth, l, n.connectNulls), o += u + 1, r.closePath();
      }
    }, t;
  })(zt)
);
function y9(e, t, r, n, i) {
  var a = e.getArea(), o = a.x, s = a.y, l = a.width, u = a.height, f = r.get(["lineStyle", "width"]) || 0;
  o -= f / 2, s -= f / 2, l += f, u += f, l = Math.ceil(l), o !== Math.floor(o) && (o = Math.floor(o), l++);
  var c = new Mt({
    shape: {
      x: o,
      y: s,
      width: l,
      height: u
    }
  });
  if (t) {
    var h = e.getBaseAxis(), v = h.isHorizontal(), d = h.inverse;
    v ? (d && (c.shape.x += l), c.shape.width = 0) : (d || (c.shape.y += u), c.shape.height = 0);
    var g = nt(i) ? function(y) {
      i(y, c);
    } : null;
    Ir(c, {
      shape: {
        width: l,
        height: u,
        x: o,
        y: s
      }
    }, r, null, n, g);
  }
  return c;
}
function _9(e, t, r) {
  var n = e.getArea(), i = jr(n.r0, 1), a = jr(n.r, 1), o = new Ui({
    shape: {
      cx: jr(e.cx, 1),
      cy: jr(e.cy, 1),
      r0: i,
      r: a,
      startAngle: n.startAngle,
      endAngle: n.endAngle,
      clockwise: n.clockwise
    }
  });
  if (t) {
    var s = e.getBaseAxis().dim === "angle";
    s ? o.shape.endAngle = n.startAngle : o.shape.r = i, Ir(o, {
      shape: {
        endAngle: n.endAngle,
        r: a
      }
    }, r);
  }
  return o;
}
function Bx(e, t, r, n, i) {
  if (e) {
    if (e.type === "polar")
      return _9(e, t, r);
    if (e.type === "cartesian2d")
      return y9(e, t, r, n, i);
  } else return null;
  return null;
}
function qc(e, t) {
  return e.type === t;
}
function H5(e, t) {
  if (e.length === t.length) {
    for (var r = 0; r < e.length; r++)
      if (e[r] !== t[r])
        return;
    return !0;
  }
}
function U5(e) {
  for (var t = 1 / 0, r = 1 / 0, n = -1 / 0, i = -1 / 0, a = 0; a < e.length; ) {
    var o = e[a++], s = e[a++];
    isNaN(o) || (t = Math.min(o, t), n = Math.max(o, n)), isNaN(s) || (r = Math.min(s, r), i = Math.max(s, i));
  }
  return [[t, r], [n, i]];
}
function W5(e, t) {
  var r = U5(e), n = r[0], i = r[1], a = U5(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 X5(e) {
  return Xt(e) ? e : e ? 0.5 : 0;
}
function roe(e, t, r) {
  if (!r.valueDim)
    return [];
  for (var n = t.count(), i = Wl(n * 2), a = 0; a < n; a++) {
    var o = p9(r, e, t, a);
    i[a * 2] = o[0], i[a * 2 + 1] = o[1];
  }
  return i;
}
function xc(e, t, r, n, i) {
  var a = r.getBaseAxis(), o = a.dim === "x" || a.dim === "radius" ? 0 : 1, s = [], l = 0, u = [], f = [], c = [], h = [];
  if (i) {
    for (l = 0; l < e.length; l += 2) {
      var v = t || e;
      !isNaN(v[l]) && !isNaN(v[l + 1]) && h.push(e[l], e[l + 1]);
    }
    e = h;
  }
  for (l = 0; l < e.length - 2; l += 2)
    switch (c[0] = e[l + 2], c[1] = e[l + 3], f[0] = e[l], f[1] = e[l + 1], s.push(f[0], f[1]), n) {
      case "end":
        u[o] = c[o], u[1 - o] = f[1 - o], s.push(u[0], u[1]);
        break;
      case "middle":
        var d = (f[o] + c[o]) / 2, g = [];
        u[o] = g[o] = d, u[1 - o] = f[1 - o], g[1 - o] = c[1 - o], s.push(u[0], u[1]), s.push(g[0], g[1]);
        break;
      default:
        u[o] = f[o], u[1 - o] = c[1 - o], s.push(u[0], u[1]);
    }
  return s.push(e[l++], e[l++]), s;
}
function noe(e, t) {
  var r = [], n = e.length, i, a;
  function o(f, c, h) {
    var v = f.coord, d = (h - v) / (c.coord - v), g = cR(d, [f.color, c.color]);
    return {
      coord: h,
      color: g
    };
  }
  for (var s = 0; s < n; s++) {
    var l = e[s], u = l.coord;
    if (u < 0)
      i = l;
    else if (u > t) {
      a ? r.push(o(a, l, t)) : i && r.push(o(i, l, 0), o(i, l, t));
      break;
    } else
      i && (r.push(o(i, l, 0)), i = null), r.push(l), a = l;
  }
  return r;
}
function ioe(e, t, r) {
  var n = e.getVisual("visualMeta");
  if (!(!n || !n.length || !e.count()) && t.type === "cartesian2d") {
    for (var i, a, o = n.length - 1; o >= 0; o--) {
      var s = e.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 = Ce(a.stops, function(T) {
        return {
          coord: l.toGlobalCoord(l.dataToCoord(T.value)),
          color: T.color
        };
      }), f = u.length, c = a.outerColors.slice();
      f && u[0].coord > u[f - 1].coord && (u.reverse(), c.reverse());
      var h = noe(u, i === "x" ? r.getWidth() : r.getHeight()), v = h.length;
      if (!v && f)
        return u[0].coord < 0 ? c[1] ? c[1] : u[f - 1].color : c[0] ? c[0] : u[0].color;
      var d = 10, g = h[0].coord - d, y = h[v - 1].coord + d, x = y - g;
      if (x < 1e-3)
        return "transparent";
      F(h, function(T) {
        T.offset = (T.coord - g) / x;
      }), h.push({
        // NOTE: inRangeStopLen may still be 0 if stoplen is zero.
        offset: v ? h[v - 1].offset : 0.5,
        color: c[1] || "transparent"
      }), h.unshift({
        offset: v ? h[0].offset : 0.5,
        color: c[0] || "transparent"
      });
      var S = new Nd(0, 0, 0, 0, h, !0);
      return S[i] = g, S[i + "2"] = y, S;
    }
  }
}
function aoe(e, t, r) {
  var n = e.get("showAllSymbol"), i = n === "auto";
  if (!(n && !i)) {
    var a = r.getAxesByScale("ordinal")[0];
    if (a && !(i && ooe(a, t))) {
      var o = t.mapDimension(a.dim), s = {};
      return F(a.getViewLabels(), function(l) {
        var u = a.scale.getRawOrdinalNumber(l.tickValue);
        s[u] = 1;
      }), function(l) {
        return !s.hasOwnProperty(t.get(o, l));
      };
    }
  }
}
function ooe(e, t) {
  var r = e.getExtent(), n = Math.abs(r[1] - r[0]) / e.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 (Nx.getSymbolSize(
      t,
      o
      // Only for cartesian, where `isHorizontal` exists.
    )[e.isHorizontal() ? 1 : 0] * 1.5 > n)
      return !1;
  return !0;
}
function soe(e, t) {
  return isNaN(e) || isNaN(t);
}
function loe(e) {
  for (var t = e.length / 2; t > 0 && soe(e[t * 2 - 2], e[t * 2 - 1]); t--)
    ;
  return t - 1;
}
function Y5(e, t) {
  return [e[t * 2], e[t * 2 + 1]];
}
function uoe(e, t, r) {
  for (var n = e.length / 2, i = r === "x" ? 0 : 1, a, o, s = 0, l = -1, u = 0; u < n; u++)
    if (o = e[u * 2 + i], !(isNaN(o) || isNaN(e[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 x9(e) {
  if (e.get(["endLabel", "show"]))
    return !0;
  for (var t = 0; t < Ta.length; t++)
    if (e.get([Ta[t], "endLabel", "show"]))
      return !0;
  return !1;
}
function IL(e, t, r, n) {
  if (qc(t, "cartesian2d")) {
    var i = n.getModel("endLabel"), a = i.get("valueAnimation"), o = n.getData(), s = {
      lastFrameIndex: 0
    }, l = x9(n) ? function(v, d) {
      e._endLabelOnDuring(v, d, o, s, a, i, t);
    } : null, u = t.getBaseAxis().isHorizontal(), f = y9(t, r, n, function() {
      var v = e._endLabel;
      v && r && s.originalX != null && v.attr({
        x: s.originalX,
        y: s.originalY
      });
    }, l);
    if (!n.get("clip", !0)) {
      var c = f.shape, h = Math.max(c.width, c.height);
      u ? (c.y -= h, c.height += h * 2) : (c.x -= h, c.width += h * 2);
    }
    return l && l(1, f), f;
  } else
    return _9(t, r, n);
}
function foe(e, t) {
  var r = t.getBaseAxis(), n = r.isHorizontal(), i = r.inverse, a = n ? i ? "right" : "left" : "center", o = n ? "middle" : i ? "top" : "bottom";
  return {
    normal: {
      align: e.get("align") || a,
      verticalAlign: e.get("verticalAlign") || o
    }
  };
}
var coe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      return e !== null && e.apply(this, arguments) || this;
    }
    return t.prototype.init = function() {
      var r = new rt(), n = new kx();
      this.group.add(n.group), this._symbolDraw = n, this._lineGroup = r, this._changePolyState = Ge(this._changePolyState, this);
    }, t.prototype.render = function(r, n, i) {
      var a = r.coordinateSystem, o = this.group, s = r.getData(), l = r.getModel("lineStyle"), u = r.getModel("areaStyle"), f = s.getLayout("points") || [], c = a.type === "polar", h = this._coordSys, v = this._symbolDraw, d = this._polyline, g = this._polygon, y = this._lineGroup, x = !n.ssr && r.get("animation"), S = !u.isEmpty(), T = u.get("origin"), C = d9(a, s, T), A = S && roe(a, s, C), M = r.get("showSymbol"), E = r.get("connectNulls"), P = M && !c && aoe(r, s, a), R = this._data;
      R && R.eachItemGraphicEl(function(te, pe) {
        te.__temp && (o.remove(te), R.setItemGraphicEl(pe, null));
      }), M || v.remove(), o.add(y);
      var O = c ? !1 : r.get("step"), N;
      a && a.getArea && r.get("clip", !0) && (N = a.getArea(), N.width != null ? (N.x -= 0.1, N.y -= 0.1, N.width += 0.2, N.height += 0.2) : N.r0 && (N.r0 -= 0.5, N.r += 0.5)), this._clipShapeForSymbol = N;
      var G = ioe(s, a, i) || s.getVisual("style")[s.getVisual("drawType")];
      if (!(d && h.type === a.type && O === this._step))
        M && v.updateData(s, {
          isIgnore: P,
          clipShape: N,
          disableAnimation: !0,
          getSymbolPoint: function(te) {
            return [f[te * 2], f[te * 2 + 1]];
          }
        }), x && this._initSymbolLabelAnimation(s, a, N), O && (A && (A = xc(A, f, a, O, E)), f = xc(f, null, a, O, E)), d = this._newPolyline(f), S ? g = this._newPolygon(f, A) : g && (y.remove(g), g = this._polygon = null), c || this._initOrUpdateEndLabel(r, a, Ad(G)), y.setClipPath(IL(this, a, !0, r));
      else {
        S && !g ? g = this._newPolygon(f, A) : g && !S && (y.remove(g), g = this._polygon = null), c || this._initOrUpdateEndLabel(r, a, Ad(G));
        var z = y.getClipPath();
        if (z) {
          var H = IL(this, a, !1, r);
          Ir(z, {
            shape: H.shape
          }, r);
        } else
          y.setClipPath(IL(this, a, !0, r));
        M && v.updateData(s, {
          isIgnore: P,
          clipShape: N,
          disableAnimation: !0,
          getSymbolPoint: function(te) {
            return [f[te * 2], f[te * 2 + 1]];
          }
        }), (!H5(this._stackedOnPoints, A) || !H5(this._points, f)) && (x ? this._doUpdateAnimation(s, A, a, i, O, T, E) : (O && (A && (A = xc(A, f, a, O, E)), f = xc(f, null, a, O, E)), d.setShape({
          points: f
        }), g && g.setShape({
          points: f,
          stackedOnPoints: A
        })));
      }
      var W = r.getModel("emphasis"), Z = W.get("focus"), ee = W.get("blurScope"), V = W.get("disabled");
      if (d.useStyle(tt(
        // Use color in lineStyle first
        l.getLineStyle(),
        {
          fill: "none",
          stroke: G,
          lineJoin: "bevel"
        }
      )), Un(d, r, "lineStyle"), d.style.lineWidth > 0 && r.get(["emphasis", "lineStyle", "width"]) === "bolder") {
        var Q = d.getState("emphasis").style;
        Q.lineWidth = +d.style.lineWidth + 1;
      }
      pt(d).seriesIndex = r.seriesIndex, Hr(d, Z, ee, V);
      var q = X5(r.get("smooth")), X = r.get("smoothMonotone");
      if (d.setShape({
        smooth: q,
        smoothMonotone: X,
        connectNulls: E
      }), g) {
        var K = s.getCalculationInfo("stackedOnSeries"), ue = 0;
        g.useStyle(tt(u.getAreaStyle(), {
          fill: G,
          opacity: 0.7,
          lineJoin: "bevel",
          decal: s.getVisual("style").decal
        })), K && (ue = X5(K.get("smooth"))), g.setShape({
          smooth: q,
          stackedOnSmooth: ue,
          smoothMonotone: X,
          connectNulls: E
        }), Un(g, r, "areaStyle"), pt(g).seriesIndex = r.seriesIndex, Hr(g, Z, ee, V);
      }
      var oe = this._changePolyState;
      s.eachItemGraphicEl(function(te) {
        te && (te.onHoverStateChange = oe);
      }), this._polyline.onHoverStateChange = oe, this._data = s, this._coordSys = a, this._stackedOnPoints = A, this._points = f, this._step = O, this._valueOrigin = T, r.get("triggerLineEvent") && (this.packEventData(r, d), g && this.packEventData(r, g));
    }, t.prototype.packEventData = function(r, n) {
      pt(n).eventData = {
        componentType: "series",
        componentSubType: "line",
        componentIndex: r.componentIndex,
        seriesIndex: r.seriesIndex,
        seriesName: r.name,
        seriesType: "line"
      };
    }, t.prototype.highlight = function(r, n, i, a) {
      var o = r.getData(), s = Sd(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 f = l[s * 2], c = l[s * 2 + 1];
          if (isNaN(f) || isNaN(c) || this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(f, c))
            return;
          var h = r.get("zlevel") || 0, v = r.get("z") || 0;
          u = new Nx(o, s), u.x = f, u.y = c, 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
        Ut.prototype.highlight.call(this, r, n, i, a);
    }, t.prototype.downplay = function(r, n, i, a) {
      var o = r.getData(), s = Sd(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
        Ut.prototype.downplay.call(this, r, n, i, a);
    }, t.prototype._changePolyState = function(r) {
      var n = this._polygon;
      eb(this._polyline, r), n && eb(n, r);
    }, t.prototype._newPolyline = function(r) {
      var n = this._polyline;
      return n && this._lineGroup.remove(n), n = new eoe({
        shape: {
          points: r
        },
        segmentIgnoreThreshold: 2,
        z2: 10
      }), this._lineGroup.add(n), this._polyline = n, n;
    }, t.prototype._newPolygon = function(r, n) {
      var i = this._polygon;
      return i && this._lineGroup.remove(i), i = new m9({
        shape: {
          points: r,
          stackedOnPoints: n
        },
        segmentIgnoreThreshold: 2
      }), this._lineGroup.add(i), this._polygon = i, i;
    }, t.prototype._initSymbolLabelAnimation = function(r, 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 = r.hostModel, f = u.get("animationDuration");
      nt(f) && (f = f(null));
      var c = u.get("animationDelay") || 0, h = nt(c) ? c(null) : c;
      r.eachItemGraphicEl(function(v, d) {
        var g = v;
        if (g) {
          var y = [v.x, v.y], x = void 0, S = void 0, T = void 0;
          if (i)
            if (o) {
              var C = i, A = n.pointToCoord(y);
              a ? (x = C.startAngle, S = C.endAngle, T = -A[1] / 180 * Math.PI) : (x = C.r0, S = C.r, T = A[0]);
            } else {
              var M = i;
              a ? (x = M.x, S = M.x + M.width, T = v.x) : (x = M.y + M.height, S = M.y, T = v.y);
            }
          var E = S === x ? 0 : (T - x) / (S - x);
          l && (E = 1 - E);
          var P = nt(c) ? c(d) : f * E + h, R = g.getSymbolPath(), O = R.getTextContent();
          g.attr({
            scaleX: 0,
            scaleY: 0
          }), g.animateTo({
            scaleX: 1,
            scaleY: 1
          }, {
            duration: 200,
            setToFinal: !0,
            delay: P
          }), O && O.animateFrom({
            style: {
              opacity: 0
            }
          }, {
            duration: 300,
            delay: P
          }), R.disableLabelAnimation = !0;
        }
      });
    }, t.prototype._initOrUpdateEndLabel = function(r, n, i) {
      var a = r.getModel("endLabel");
      if (x9(r)) {
        var o = r.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 Rt({
          z2: 200
          // should be higher than item symbol
        }), u.ignoreClip = !0, s.setTextContent(this._endLabel), s.disableLabelAnimation = !0);
        var f = loe(l);
        f >= 0 && (si(s, Wn(r, "endLabel"), {
          inheritColor: i,
          labelFetcher: r,
          labelDataIndex: f,
          defaultText: function(c, h, v) {
            return v != null ? v9(o, v) : Em(o, c);
          },
          enableTextSetter: !0
        }, foe(a, n)), s.textConfig.position = null);
      } else this._endLabel && (this._polyline.removeTextContent(), this._endLabel = null);
    }, t.prototype._endLabelOnDuring = function(r, n, i, a, o, s, l) {
      var u = this._endLabel, f = this._polyline;
      if (u) {
        r < 1 && a.originalX == null && (a.originalX = u.x, a.originalY = u.y);
        var c = i.getLayout("points"), h = i.hostModel, v = h.get("connectNulls"), d = s.get("precision"), g = s.get("distance") || 0, y = l.getBaseAxis(), x = y.isHorizontal(), S = y.inverse, T = n.shape, C = S ? x ? T.x : T.y + T.height : x ? T.x + T.width : T.y, A = (x ? g : 0) * (S ? -1 : 1), M = (x ? 0 : -g) * (S ? -1 : 1), E = x ? "x" : "y", P = uoe(c, C, E), R = P.range, O = R[1] - R[0], N = void 0;
        if (O >= 1) {
          if (O > 1 && !v) {
            var G = Y5(c, R[0]);
            u.attr({
              x: G[0] + A,
              y: G[1] + M
            }), o && (N = h.getRawValue(R[0]));
          } else {
            var G = f.getPointOn(C, E);
            G && u.attr({
              x: G[0] + A,
              y: G[1] + M
            });
            var z = h.getRawValue(R[0]), H = h.getRawValue(R[1]);
            o && (N = XU(i, d, z, H, P.t));
          }
          a.lastFrameIndex = R[0];
        } else {
          var W = r === 1 || a.lastFrameIndex > 0 ? R[0] : 0, G = Y5(c, W);
          o && (N = h.getRawValue(W)), u.attr({
            x: G[0] + A,
            y: G[1] + M
          });
        }
        if (o) {
          var Z = ey(u);
          typeof Z.setLabelText == "function" && Z.setLabelText(N);
        }
      }
    }, t.prototype._doUpdateAnimation = function(r, n, i, a, o, s, l) {
      var u = this._polyline, f = this._polygon, c = r.hostModel, h = Jae(this._data, r, this._stackedOnPoints, n, this._coordSys, i, this._valueOrigin), v = h.current, d = h.stackedOnCurrent, g = h.next, y = h.stackedOnNext;
      if (o && (d = xc(h.stackedOnCurrent, h.current, i, o, l), v = xc(h.current, null, i, o, l), y = xc(h.stackedOnNext, h.next, i, o, l), g = xc(h.next, null, i, o, l)), W5(v, g) > 3e3 || f && W5(d, y) > 3e3) {
        u.stopAnimation(), u.setShape({
          points: g
        }), f && (f.stopAnimation(), f.setShape({
          points: g,
          stackedOnPoints: y
        }));
        return;
      }
      u.shape.__points = h.current, u.shape.points = v;
      var x = {
        shape: {
          points: g
        }
      };
      h.current !== v && (x.shape.__points = h.next), u.stopAnimation(), Wt(u, x, c), f && (f.setShape({
        // Reuse the points with polyline.
        points: v,
        stackedOnPoints: d
      }), f.stopAnimation(), Wt(f, {
        shape: {
          stackedOnPoints: y
        }
      }, c), u.shape.points !== f.shape.points && (f.shape.points = u.shape.points));
      for (var S = [], T = h.status, C = 0; C < T.length; C++) {
        var A = T[C].cmd;
        if (A === "=") {
          var M = r.getItemGraphicEl(T[C].idx1);
          M && S.push({
            el: M,
            ptIdx: C
            // Index of points
          });
        }
      }
      u.animators && u.animators.length && u.animators[0].during(function() {
        f && f.dirtyShape();
        for (var E = u.shape.__points, P = 0; P < S.length; P++) {
          var R = S[P].el, O = S[P].ptIdx * 2;
          R.x = E[O], R.y = E[O + 1], R.markRedraw();
        }
      });
    }, t.prototype.remove = function(r) {
      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;
  })(Ut)
);
function zx(e, t) {
  return {
    seriesType: e,
    plan: iy(),
    reset: function(r) {
      var n = r.getData(), i = r.coordinateSystem, a = r.pipelineContext, o = t || a.large;
      if (i) {
        var s = Ce(i.dimensions, function(v) {
          return n.mapDimension(v);
        }).slice(0, 2), l = s.length, u = n.getCalculationInfo("stackResultDimension");
        xf(n, s[0]) && (s[0] = u), xf(n, s[1]) && (s[1] = u);
        var f = n.getStore(), c = n.getDimensionIndex(s[0]), h = n.getDimensionIndex(s[1]);
        return l && {
          progress: function(v, d) {
            for (var g = v.end - v.start, y = o && Wl(g * l), x = [], S = [], T = v.start, C = 0; T < v.end; T++) {
              var A = void 0;
              if (l === 1) {
                var M = f.get(c, T);
                A = i.dataToPoint(M, null, S);
              } else
                x[0] = f.get(c, T), x[1] = f.get(h, T), A = i.dataToPoint(x, null, S);
              o ? (y[C++] = A[0], y[C++] = A[1]) : d.setItemLayout(T, A.slice());
            }
            o && d.setLayout("points", y);
          }
        };
      }
    }
  };
}
var hoe = {
  average: function(e) {
    for (var t = 0, r = 0, n = 0; n < e.length; n++)
      isNaN(e[n]) || (t += e[n], r++);
    return r === 0 ? NaN : t / r;
  },
  sum: function(e) {
    for (var t = 0, r = 0; r < e.length; r++)
      t += e[r] || 0;
    return t;
  },
  max: function(e) {
    for (var t = -1 / 0, r = 0; r < e.length; r++)
      e[r] > t && (t = e[r]);
    return isFinite(t) ? t : NaN;
  },
  min: function(e) {
    for (var t = 1 / 0, r = 0; r < e.length; r++)
      e[r] < t && (t = e[r]);
    return isFinite(t) ? t : NaN;
  },
  // TODO
  // Median
  nearest: function(e) {
    return e[0];
  }
}, voe = function(e) {
  return Math.round(e.length / 2);
};
function S9(e) {
  return {
    seriesType: e,
    // FIXME:TS never used, so comment it
    // modifyOutputEnd: true,
    reset: function(t, r, 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), f = l.getExtent(), c = n.getDevicePixelRatio(), h = Math.abs(f[1] - f[0]) * (c || 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;
          Fe(a) ? d = hoe[a] : nt(a) && (d = a), d && t.setData(i.downSample(i.mapDimension(u.dim), 1 / v, d, voe));
        }
      }
    }
  };
}
function doe(e) {
  e.registerChartView(coe), e.registerSeriesModel(qae), e.registerLayout(zx("line", !0)), e.registerVisual({
    seriesType: "line",
    reset: function(t) {
      var r = t.getData(), n = t.getModel("lineStyle").getLineStyle();
      n && !n.stroke && (n.stroke = r.getVisual("style").fill), r.setVisual("legendLineStyle", n);
    }
  }), e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC, S9("line"));
}
var K1 = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.getInitialData = function(r, n) {
      return ou(null, this, {
        useEncodeDefaulter: !0
      });
    }, t.prototype.getMarkerPosition = function(r, n, i) {
      var a = this.coordinateSystem;
      if (a && a.clampData) {
        var o = a.clampData(r), s = a.dataToPoint(o);
        if (i)
          F(a.getAxes(), function(h, v) {
            if (h.type === "category" && n != null) {
              var d = h.getTicksCoords(), g = h.getTickModel().get("alignWithLabel"), y = o[v], x = n[v] === "x1" || n[v] === "y1";
              if (x && !g && (y += 1), d.length < 2)
                return;
              if (d.length === 2) {
                s[v] = h.toGlobalCoord(h.getExtent()[x ? 1 : 0]);
                return;
              }
              for (var S = void 0, T = void 0, C = 1, A = 0; A < d.length; A++) {
                var M = d[A].coord, E = A === d.length - 1 ? d[A - 1].tickValue + C : d[A].tickValue;
                if (E === y) {
                  T = M;
                  break;
                } else if (E < y)
                  S = M;
                else if (S != null && E > y) {
                  T = (M + S) / 2;
                  break;
                }
                A === 1 && (C = E - d[0].tickValue);
              }
              T == null && (S ? S && (T = d[d.length - 1].coord) : T = d[0].coord), s[v] = h.toGlobalCoord(T);
            }
          });
        else {
          var l = this.getData(), u = l.getLayout("offset"), f = l.getLayout("size"), c = a.getBaseAxis().isHorizontal() ? 0 : 1;
          s[c] += u + f / 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",
      defaultBarGap: "10%"
    }, t;
  })(Yt)
);
Yt.registerClass(K1);
var poe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.getInitialData = function() {
      return ou(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 r = this.get("progressiveThreshold"), n = this.get("largeThreshold");
      return n > r && (r = n), r;
    }, t.prototype.brushSelector = function(r, n, i) {
      return i.rect(n.getItemLayout(r));
    }, t.type = "series.bar", t.dependencies = ["grid", "polar"], t.defaultOption = nh(K1.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: fe.color.primary,
          borderWidth: 2
        }
      },
      realtimeSort: !1
    }), t;
  })(K1)
), goe = (
  /** @class */
  /* @__PURE__ */ (function() {
    function e() {
      this.cx = 0, this.cy = 0, this.r0 = 0, this.r = 0, this.startAngle = 0, this.endAngle = Math.PI * 2, this.clockwise = !0;
    }
    return e;
  })()
), bb = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r) {
      var n = e.call(this, r) || this;
      return n.type = "sausage", n;
    }
    return t.prototype.getDefaultShape = function() {
      return new goe();
    }, t.prototype.buildPath = function(r, 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, f = n.startAngle, c = n.endAngle, h = n.clockwise, v = Math.PI * 2, d = h ? c - f < v : f - c < v;
      d || (f = c - (h ? v : -v));
      var g = Math.cos(f), y = Math.sin(f), x = Math.cos(c), S = Math.sin(c);
      d ? (r.moveTo(g * o + i, y * o + a), r.arc(g * u + i, y * u + a, l, -Math.PI + f, f, !h)) : r.moveTo(g * s + i, y * s + a), r.arc(i, a, s, f, c, !h), r.arc(x * u + i, S * u + a, l, c - Math.PI * 2, c - Math.PI, !h), o !== 0 && r.arc(i, a, o, c, f, h);
    }, t;
  })(zt)
);
function moe(e, t) {
  t = t || {};
  var r = t.isRoundCap;
  return function(n, i, a) {
    var o = i.position;
    if (!o || o instanceof Array)
      return $2(n, i, a);
    var s = e(o), l = i.distance != null ? i.distance : 5, u = this.shape, f = u.cx, c = u.cy, h = u.r, v = u.r0, d = (h + v) / 2, g = u.startAngle, y = u.endAngle, x = (g + y) / 2, S = r ? Math.abs(h - v) / 2 : 0, T = Math.cos, C = Math.sin, A = f + h * T(g), M = c + h * C(g), E = "left", P = "top";
    switch (s) {
      case "startArc":
        A = f + (v - l) * T(x), M = c + (v - l) * C(x), E = "center", P = "top";
        break;
      case "insideStartArc":
        A = f + (v + l) * T(x), M = c + (v + l) * C(x), E = "center", P = "bottom";
        break;
      case "startAngle":
        A = f + d * T(g) + vT(g, l + S, !1), M = c + d * C(g) + dT(g, l + S, !1), E = "right", P = "middle";
        break;
      case "insideStartAngle":
        A = f + d * T(g) + vT(g, -l + S, !1), M = c + d * C(g) + dT(g, -l + S, !1), E = "left", P = "middle";
        break;
      case "middle":
        A = f + d * T(x), M = c + d * C(x), E = "center", P = "middle";
        break;
      case "endArc":
        A = f + (h + l) * T(x), M = c + (h + l) * C(x), E = "center", P = "bottom";
        break;
      case "insideEndArc":
        A = f + (h - l) * T(x), M = c + (h - l) * C(x), E = "center", P = "top";
        break;
      case "endAngle":
        A = f + d * T(y) + vT(y, l + S, !0), M = c + d * C(y) + dT(y, l + S, !0), E = "left", P = "middle";
        break;
      case "insideEndAngle":
        A = f + d * T(y) + vT(y, -l + S, !0), M = c + d * C(y) + dT(y, -l + S, !0), E = "right", P = "middle";
        break;
      default:
        return $2(n, i, a);
    }
    return n = n || {}, n.x = A, n.y = M, n.align = E, n.verticalAlign = P, n;
  };
}
function yoe(e, t, r, n) {
  if (Xt(n)) {
    e.setTextConfig({
      rotation: n
    });
    return;
  } else if (Se(t)) {
    e.setTextConfig({
      rotation: 0
    });
    return;
  }
  var i = e.shape, a = i.clockwise ? i.startAngle : i.endAngle, o = i.clockwise ? i.endAngle : i.startAngle, s = (a + o) / 2, l, u = r(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:
      e.setTextConfig({
        rotation: 0
      });
      return;
  }
  var f = Math.PI * 1.5 - l;
  u === "middle" && f > Math.PI / 2 && f < Math.PI * 1.5 && (f -= Math.PI), e.setTextConfig({
    rotation: f
  });
}
function vT(e, t, r) {
  return t * Math.sin(e) * (r ? -1 : 1);
}
function dT(e, t, r) {
  return t * Math.cos(e) * (r ? 1 : -1);
}
function Yl(e, t, r) {
  var n = e.get("borderRadius");
  if (n == null)
    return r ? {
      cornerRadius: 0
    } : null;
  Se(n) || (n = [n, n, n, n]);
  var i = Math.abs(t.r || 0 - t.r0 || 0);
  return {
    cornerRadius: Ce(n, function(a) {
      return $s(a, i);
    })
  };
}
var RL = Math.max, OL = Math.min;
function _oe(e, t) {
  var r = e.getArea && e.getArea();
  if (qc(e, "cartesian2d")) {
    var n = e.getBaseAxis();
    if (n.type !== "category" || !n.onBand) {
      var i = t.getLayout("bandWidth");
      n.isHorizontal() ? (r.x -= i, r.width += i * 2) : (r.y -= i, r.height += i * 2);
    }
  }
  return r;
}
var xoe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e.call(this) || this;
      return r.type = t.type, r._isFirstFrame = !0, r;
    }
    return t.prototype.render = function(r, n, i, a) {
      this._model = r, this._removeOnRenderedListener(i), this._updateDrawMode(r);
      var o = r.get("coordinateSystem");
      (o === "cartesian2d" || o === "polar") && (this._progressiveEls = null, this._isLargeDraw ? this._renderLarge(r, n, i) : this._renderNormal(r, n, i, a));
    }, t.prototype.incrementalPrepareRender = function(r) {
      this._clear(), this._updateDrawMode(r), this._updateLargeClip(r);
    }, t.prototype.incrementalRender = function(r, n) {
      this._progressiveEls = [], this._incrementalRenderLarge(r, n);
    }, t.prototype.eachRendered = function(r) {
      rh(this._progressiveEls || this.group, r);
    }, t.prototype._updateDrawMode = function(r) {
      var n = r.pipelineContext.large;
      (this._isLargeDraw == null || n !== this._isLargeDraw) && (this._isLargeDraw = n, this._clear());
    }, t.prototype._renderNormal = function(r, n, i, a) {
      var o = this.group, s = r.getData(), l = this._data, u = r.coordinateSystem, f = u.getBaseAxis(), c;
      u.type === "cartesian2d" ? c = f.isHorizontal() : u.type === "polar" && (c = f.dim === "angle");
      var h = r.isAnimationEnabled() ? r : null, v = Soe(r, u);
      v && this._enableRealtimeSort(v, s, i);
      var d = r.get("clip", !0) || v, g = _oe(u, s);
      o.removeClipPath();
      var y = r.get("roundCap", !0), x = r.get("showBackground", !0), S = r.getModel("backgroundStyle"), T = S.get("borderRadius") || 0, C = [], A = this._backgroundEls, M = a && a.isInitSort, E = a && a.type === "changeAxisOrder";
      function P(N) {
        var G = pT[u.type](s, N);
        if (!G)
          return null;
        var z = Loe(u, c, G);
        return z.useStyle(S.getItemStyle()), u.type === "cartesian2d" ? z.setShape("r", T) : z.setShape("cornerRadius", T), C[N] = z, z;
      }
      s.diff(l).add(function(N) {
        var G = s.getItemModel(N), z = pT[u.type](s, N, G);
        if (z && (x && P(N), !(!s.hasValue(N) || !K5[u.type](z)))) {
          var H = !1;
          d && (H = Z5[u.type](g, z));
          var W = $5[u.type](r, s, N, z, c, h, f.model, !1, y);
          v && (W.forceLabelAnimation = !0), Q5(W, s, N, G, z, r, c, u.type === "polar"), M ? W.attr({
            shape: z
          }) : v ? q5(v, h, W, z, N, c, !1, !1) : Ir(W, {
            shape: z
          }, r, N), s.setItemGraphicEl(N, W), o.add(W), W.ignore = H;
        }
      }).update(function(N, G) {
        var z = s.getItemModel(N), H = pT[u.type](s, N, z);
        if (H) {
          if (x) {
            var W = void 0;
            A.length === 0 ? W = P(G) : (W = A[G], W.useStyle(S.getItemStyle()), u.type === "cartesian2d" ? W.setShape("r", T) : W.setShape("cornerRadius", T), C[N] = W);
            var Z = pT[u.type](s, N), ee = T9(c, Z, u);
            Wt(W, {
              shape: ee
            }, h, N);
          }
          var V = l.getItemGraphicEl(G);
          if (!s.hasValue(N) || !K5[u.type](H)) {
            o.remove(V);
            return;
          }
          var Q = !1;
          d && (Q = Z5[u.type](g, H), Q && o.remove(V));
          var q = V && (V.type === "sector" && y || V.type === "sausage" && !y);
          if (q && (V && ff(V, r, G), V = null), V ? vs(V) : V = $5[u.type](r, s, N, H, c, h, f.model, !0, y), v && (V.forceLabelAnimation = !0), E) {
            var X = V.getTextContent();
            if (X) {
              var K = ey(X);
              K.prevValue != null && (K.prevValue = K.value);
            }
          } else
            Q5(V, s, N, z, H, r, c, u.type === "polar");
          M ? V.attr({
            shape: H
          }) : v ? q5(v, h, V, H, N, c, !0, E) : Wt(V, {
            shape: H
          }, r, N, null), s.setItemGraphicEl(N, V), V.ignore = Q, o.add(V);
        }
      }).remove(function(N) {
        var G = l.getItemGraphicEl(N);
        G && ff(G, r, N);
      }).execute();
      var R = this._backgroundGroup || (this._backgroundGroup = new rt());
      R.removeAll();
      for (var O = 0; O < C.length; ++O)
        R.add(C[O]);
      o.add(R), this._backgroundEls = C, this._data = s;
    }, t.prototype._renderLarge = function(r, n, i) {
      this._clear(), ez(r, this.group), this._updateLargeClip(r);
    }, t.prototype._incrementalRenderLarge = function(r, n) {
      this._removeBackground(), ez(n, this.group, this._progressiveEls, !0);
    }, t.prototype._updateLargeClip = function(r) {
      var n = r.get("clip", !0) && Bx(r.coordinateSystem, !1, r), i = this.group;
      n ? i.setClipPath(n) : i.removeClipPath();
    }, t.prototype._enableRealtimeSort = function(r, n, i) {
      var a = this;
      if (n.count()) {
        var o = r.baseAxis;
        if (this._isFirstFrame)
          this._dispatchInitSort(n, r, i), this._isFirstFrame = !1;
        else {
          var s = function(l) {
            var u = n.getItemGraphicEl(l), f = u && u.shape;
            return f && // 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() ? f.height : f.width) || 0;
          };
          this._onRendered = function() {
            a._updateSortWithinSameData(n, s, o, i);
          }, i.getZr().on("rendered", this._onRendered);
        }
      }
    }, t.prototype._dataSort = function(r, n, i) {
      var a = [];
      return r.each(r.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: Ce(a, function(o) {
          return o.ordinalNumber;
        })
      };
    }, t.prototype._isOrderChangedWithinSameData = function(r, n, i) {
      for (var a = i.scale, o = r.mapDimension(i.dim), s = Number.MAX_VALUE, l = 0, u = a.getOrdinalMeta().categories.length; l < u; ++l) {
        var f = r.rawIndexOf(o, a.getRawOrdinalNumber(l)), c = f < 0 ? Number.MIN_VALUE : n(r.indexOfRawIndex(f));
        if (c > s)
          return !0;
        s = c;
      }
      return !1;
    }, t.prototype._isOrderDifferentInView = function(r, 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 (r.ordinalNumbers[o] !== i.getRawOrdinalNumber(o))
          return !0;
    }, t.prototype._updateSortWithinSameData = function(r, n, i, a) {
      if (this._isOrderChangedWithinSameData(r, n, i)) {
        var o = this._dataSort(r, 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(r, n, i) {
      var a = n.baseAxis, o = this._dataSort(r, a, function(s) {
        return r.get(r.mapDimension(n.otherAxis.dim), s);
      });
      i.dispatchAction({
        type: "changeAxisOrder",
        componentType: a.dim + "Axis",
        isInitSort: !0,
        axisId: a.index,
        sortInfo: o
      });
    }, t.prototype.remove = function(r, n) {
      this._clear(this._model), this._removeOnRenderedListener(n);
    }, t.prototype.dispose = function(r, n) {
      this._removeOnRenderedListener(n);
    }, t.prototype._removeOnRenderedListener = function(r) {
      this._onRendered && (r.getZr().off("rendered", this._onRendered), this._onRendered = null);
    }, t.prototype._clear = function(r) {
      var n = this.group, i = this._data;
      r && r.isAnimationEnabled() && i && !this._isLargeDraw ? (this._removeBackground(), this._backgroundEls = [], i.eachItemGraphicEl(function(a) {
        ff(a, r, pt(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;
  })(Ut)
), Z5 = {
  cartesian2d: function(e, t) {
    var r = t.width < 0 ? -1 : 1, n = t.height < 0 ? -1 : 1;
    r < 0 && (t.x += t.width, t.width = -t.width), n < 0 && (t.y += t.height, t.height = -t.height);
    var i = e.x + e.width, a = e.y + e.height, o = RL(t.x, e.x), s = OL(t.x + t.width, i), l = RL(t.y, e.y), u = OL(t.y + t.height, a), f = s < o, c = u < l;
    return t.x = f && o > i ? s : o, t.y = c && l > a ? u : l, t.width = f ? 0 : s - o, t.height = c ? 0 : u - l, r < 0 && (t.x += t.width, t.width = -t.width), n < 0 && (t.y += t.height, t.height = -t.height), f || c;
  },
  polar: function(e, t) {
    var r = t.r0 <= t.r ? 1 : -1;
    if (r < 0) {
      var n = t.r;
      t.r = t.r0, t.r0 = n;
    }
    var i = OL(t.r, e.r), a = RL(t.r0, e.r0);
    t.r = i, t.r0 = a;
    var o = i - a < 0;
    if (r < 0) {
      var n = t.r;
      t.r = t.r0, t.r0 = n;
    }
    return o;
  }
}, $5 = {
  cartesian2d: function(e, t, r, n, i, a, o, s, l) {
    var u = new Mt({
      shape: xe({}, n),
      z2: 1
    });
    if (u.__dataIndex = r, u.name = "item", a) {
      var f = u.shape, c = i ? "height" : "width";
      f[c] = 0;
    }
    return u;
  },
  polar: function(e, t, r, n, i, a, o, s, l) {
    var u = !i && l ? bb : Ui, f = new u({
      shape: n,
      z2: 1
    });
    f.name = "item";
    var c = w9(i);
    if (f.calculateTextPosition = moe(c, {
      isRoundCap: u === bb
    }), a) {
      var h = f.shape, v = i ? "r" : "endAngle", d = {};
      h[v] = i ? n.r0 : n.startAngle, d[v] = n[v], (s ? Wt : Ir)(f, {
        shape: d
        // __value: typeof dataValue === 'string' ? parseInt(dataValue, 10) : dataValue
      }, a);
    }
    return f;
  }
};
function Soe(e, t) {
  var r = e.get("realtimeSort", !0), n = t.getBaseAxis();
  if (r && n.type === "category" && t.type === "cartesian2d")
    return {
      baseAxis: n,
      otherAxis: t.getOtherAxis(n)
    };
}
function q5(e, t, r, 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 ? Wt : Ir)(r, {
    shape: l
  }, t, i, null);
  var f = t ? e.baseAxis.model : null;
  (o ? Wt : Ir)(r, {
    shape: u
  }, f, i);
}
function j5(e, t) {
  for (var r = 0; r < t.length; r++)
    if (!isFinite(e[t[r]]))
      return !0;
  return !1;
}
var woe = ["x", "y", "width", "height"], Toe = ["cx", "cy", "r", "startAngle", "endAngle"], K5 = {
  cartesian2d: function(e) {
    return !j5(e, woe);
  },
  polar: function(e) {
    return !j5(e, Toe);
  }
}, pT = {
  // itemModel is only used to get borderWidth, which is not needed
  // when calculating bar background layout.
  cartesian2d: function(e, t, r) {
    var n = e.getItemLayout(t);
    if (!n)
      return null;
    var i = r ? Coe(r, 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(e, t, r) {
    var n = e.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 boe(e) {
  return e.startAngle != null && e.endAngle != null && e.startAngle === e.endAngle;
}
function w9(e) {
  return /* @__PURE__ */ (function(t) {
    var r = t ? "Arc" : "Angle";
    return function(n) {
      switch (n) {
        case "start":
        case "insideStart":
        case "end":
        case "insideEnd":
          return n + r;
        default:
          return n;
      }
    };
  })(e);
}
function Q5(e, t, r, n, i, a, o, s) {
  var l = t.getItemVisual(r, "style");
  if (s) {
    if (!a.get("roundCap")) {
      var f = e.shape, c = Yl(n.getModel("itemStyle"), f, !0);
      xe(f, c), e.setShape(f);
    }
  } else {
    var u = n.get(["itemStyle", "borderRadius"]) || 0;
    e.setShape("r", u);
  }
  e.useStyle(l);
  var h = n.getShallow("cursor");
  h && e.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 = Wn(n);
  si(e, d, {
    labelFetcher: a,
    labelDataIndex: r,
    defaultText: Em(a.getData(), r),
    inheritColor: l.fill,
    defaultOpacity: l.opacity,
    defaultOutsidePosition: v
  });
  var g = e.getTextContent();
  if (s && g) {
    var y = n.get(["label", "position"]);
    e.textConfig.inside = y === "middle" ? !0 : null, yoe(e, y === "outside" ? v : y, w9(o), n.get(["label", "rotate"]));
  }
  PW(g, d, a.getRawValue(r), function(S) {
    return v9(t, S);
  });
  var x = n.getModel(["emphasis"]);
  Hr(e, x.get("focus"), x.get("blurScope"), x.get("disabled")), Un(e, n), boe(i) && (e.style.fill = "none", e.style.stroke = "none", F(e.states, function(S) {
    S.style && (S.style.fill = S.style.stroke = "none");
  }));
}
function Coe(e, t) {
  var r = e.get(["itemStyle", "borderColor"]);
  if (!r || r === "none")
    return 0;
  var n = e.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 Aoe = (
  /** @class */
  /* @__PURE__ */ (function() {
    function e() {
    }
    return e;
  })()
), J5 = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r) {
      var n = e.call(this, r) || this;
      return n.type = "largeBar", n;
    }
    return t.prototype.getDefaultShape = function() {
      return new Aoe();
    }, t.prototype.buildPath = function(r, n) {
      for (var i = n.points, a = this.baseDimIdx, o = 1 - this.baseDimIdx, s = [], l = [], u = this.barWidth, f = 0; f < i.length; f += 3)
        l[a] = u, l[o] = i[f + 2], s[a] = i[f + a], s[o] = i[f + o], r.rect(s[0], s[1], l[0], l[1]);
    }, t;
  })(zt)
);
function ez(e, t, r, n) {
  var i = e.getData(), a = i.getLayout("valueAxisHorizontal") ? 1 : 0, o = i.getLayout("largeDataIndices"), s = i.getLayout("size"), l = e.getModel("backgroundStyle"), u = i.getLayout("largeBackgroundPoints");
  if (u) {
    var f = new J5({
      shape: {
        points: u
      },
      incremental: !!n,
      silent: !0,
      z2: 0
    });
    f.baseDimIdx = a, f.largeDataIndices = o, f.barWidth = s, f.useStyle(l.getItemStyle()), t.add(f), r && r.push(f);
  }
  var c = new J5({
    shape: {
      points: i.getLayout("largePoints")
    },
    incremental: !!n,
    ignoreCoarsePointer: !0,
    z2: 1
  });
  c.baseDimIdx = a, c.largeDataIndices = o, c.barWidth = s, t.add(c), c.useStyle(i.getVisual("style")), c.style.stroke = null, pt(c).seriesIndex = e.seriesIndex, e.get("silent") || (c.on("mousedown", tz), c.on("mousemove", tz)), r && r.push(c);
}
var tz = NC(function(e) {
  var t = this, r = Moe(t, e.offsetX, e.offsetY);
  pt(t).dataIndex = r >= 0 ? r : null;
}, 30, !1);
function Moe(e, t, r) {
  for (var n = e.baseDimIdx, i = 1 - n, a = e.shape.points, o = e.largeDataIndices, s = [], l = [], u = e.barWidth, f = 0, c = a.length / 3; f < c; f++) {
    var h = f * 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] && r >= s[1] && r <= s[1] + l[1])
      return o[f];
  }
  return -1;
}
function T9(e, t, r) {
  if (qc(r, "cartesian2d")) {
    var n = t, i = r.getArea();
    return {
      x: e ? n.x : i.x,
      y: e ? i.y : n.y,
      width: e ? n.width : i.width,
      height: e ? i.height : n.height
    };
  } else {
    var i = r.getArea(), a = t;
    return {
      cx: i.cx,
      cy: i.cy,
      r0: e ? i.r0 : a.r0,
      r: e ? i.r : a.r,
      startAngle: e ? a.startAngle : 0,
      endAngle: e ? a.endAngle : Math.PI * 2
    };
  }
}
function Loe(e, t, r) {
  var n = e.type === "polar" ? Ui : Mt;
  return new n({
    shape: T9(t, r, e),
    silent: !0,
    z2: 0
  });
}
function Doe(e) {
  e.registerChartView(xoe), e.registerSeriesModel(poe), e.registerLayout(e.PRIORITY.VISUAL.LAYOUT, St(w6, "bar")), e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, T6("bar")), e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC, S9("bar")), e.registerAction({
    type: "changeAxisOrder",
    event: "changeAxisOrder",
    update: "update"
  }, function(t, r) {
    var n = t.componentType || "series";
    r.eachComponent({
      mainType: n,
      query: t
    }, function(i) {
      t.sortInfo && i.axis.setCategorySortInfo(t.sortInfo);
    });
  });
}
var rz = Math.PI * 2, gT = Math.PI / 180;
function Eoe(e, t, r) {
  t.eachSeriesByType(e, function(n) {
    var i = n.getData(), a = i.mapDimension("value"), o = jW(n, r), s = o.cx, l = o.cy, u = o.r, f = o.r0, c = o.viewRect, h = -n.get("startAngle") * gT, v = n.get("endAngle"), d = n.get("padAngle") * gT;
    v = v === "auto" ? h - rz : -v * gT;
    var g = n.get("minAngle") * gT, y = g + d, x = 0;
    i.each(a, function(ee) {
      !isNaN(ee) && x++;
    });
    var S = i.getSum(a), T = Math.PI / (S || x) * 2, C = n.get("clockwise"), A = n.get("roseType"), M = n.get("stillShowZeroSum"), E = i.getDataExtent(a);
    E[0] = 0;
    var P = C ? 1 : -1, R = [h, v], O = P * d / 2;
    TC(R, !C), h = R[0], v = R[1];
    var N = b9(n);
    N.startAngle = h, N.endAngle = v, N.clockwise = C, N.cx = s, N.cy = l, N.r = u, N.r0 = f;
    var G = Math.abs(v - h), z = G, H = 0, W = h;
    if (i.setLayout({
      viewRect: c,
      r: u
    }), i.each(a, function(ee, V) {
      var Q;
      if (isNaN(ee)) {
        i.setItemLayout(V, {
          angle: NaN,
          startAngle: NaN,
          endAngle: NaN,
          clockwise: C,
          cx: s,
          cy: l,
          r0: f,
          r: A ? NaN : u
        });
        return;
      }
      A !== "area" ? Q = S === 0 && M ? T : ee * T : Q = G / x, Q < y ? (Q = y, z -= y) : H += ee;
      var q = W + P * Q, X = 0, K = 0;
      d > Q ? (X = W + P * Q / 2, K = X) : (X = W + O, K = q - O), i.setItemLayout(V, {
        angle: Q,
        startAngle: X,
        endAngle: K,
        clockwise: C,
        cx: s,
        cy: l,
        r0: f,
        r: A ? er(ee, E, [f, u]) : u
      }), W = q;
    }), z < rz && x)
      if (z <= 1e-3) {
        var Z = G / x;
        i.each(a, function(ee, V) {
          if (!isNaN(ee)) {
            var Q = i.getItemLayout(V);
            Q.angle = Z;
            var q = 0, X = 0;
            Z < d ? (q = h + P * (V + 1 / 2) * Z, X = q) : (q = h + P * V * Z + O, X = h + P * (V + 1) * Z - O), Q.startAngle = q, Q.endAngle = X;
          }
        });
      } else
        T = z / H, W = h, i.each(a, function(ee, V) {
          if (!isNaN(ee)) {
            var Q = i.getItemLayout(V), q = Q.angle === y ? y : ee * T, X = 0, K = 0;
            q < d ? (X = W + P * q / 2, K = X) : (X = W + O, K = W + P * q - O), Q.startAngle = X, Q.endAngle = K, W += P * q;
          }
        });
  });
}
var b9 = Bt();
function fy(e) {
  return {
    seriesType: e,
    reset: function(t, r) {
      var n = r.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 Poe = Math.PI / 180;
function nz(e, t, r, n, i, a, o, s, l, u) {
  if (e.length < 2)
    return;
  function f(g) {
    for (var y = g.rB, x = y * y, S = 0; S < g.list.length; S++) {
      var T = g.list[S], C = Math.abs(T.label.y - r), A = n + T.len, M = A * A, E = Math.sqrt(Math.abs((1 - C * C / x) * M)), P = t + (E + T.len2) * i, R = P - T.label.x, O = T.targetTextWidth - R * i;
      C9(T, O, !0), T.label.x = P;
    }
  }
  function c(g) {
    for (var y = {
      list: [],
      maxY: 0
    }, x = {
      list: [],
      maxY: 0
    }, S = 0; S < g.length; S++)
      if (g[S].labelAlignTo === "none") {
        var T = g[S], C = T.label.y > r ? x : y, A = Math.abs(T.label.y - r);
        if (A >= C.maxY) {
          var M = T.label.x - t - T.len2 * i, E = n + T.len, P = Math.abs(M) < E ? Math.sqrt(A * A / (1 - M * M / E / E)) : E;
          C.rB = P, C.maxY = A;
        }
        C.list.push(T);
      }
    f(y), f(x);
  }
  for (var h = e.length, v = 0; v < h; v++)
    if (e[v].position === "outer" && e[v].labelAlignTo === "labelLine") {
      var d = e[v].label.x - u;
      e[v].linePoints[1][0] += d, e[v].label.x = u;
    }
  FP(e, 1, l, l + o) && c(e);
}
function Ioe(e, t, r, n, i, a, o, s) {
  for (var l = [], u = [], f = Number.MAX_VALUE, c = -Number.MAX_VALUE, h = 0; h < e.length; h++) {
    var v = e[h].label;
    NL(e[h]) || (v.x < t ? (f = Math.min(f, v.x), l.push(e[h])) : (c = Math.max(c, v.x), u.push(e[h])));
  }
  for (var h = 0; h < e.length; h++) {
    var d = e[h];
    if (!NL(d) && d.linePoints) {
      if (d.labelStyleWidth != null)
        continue;
      var v = d.label, g = d.linePoints, y = void 0;
      d.labelAlignTo === "edge" ? v.x < t ? y = g[2][0] - d.labelDistance - o - d.edgeDistance : y = o + i - d.edgeDistance - g[2][0] - d.labelDistance : d.labelAlignTo === "labelLine" ? v.x < t ? y = f - o - d.bleedMargin : y = o + i - c - d.bleedMargin : v.x < t ? y = v.x - o - d.bleedMargin : y = o + i - v.x - d.bleedMargin, d.targetTextWidth = y, C9(d, y, !1);
    }
  }
  nz(u, t, r, n, 1, i, a, o, s, c), nz(l, t, r, n, -1, i, a, o, s, f);
  for (var h = 0; h < e.length; h++) {
    var d = e[h];
    if (!NL(d) && d.linePoints) {
      var v = d.label, g = d.linePoints, x = d.labelAlignTo === "edge", S = v.style.padding, T = S ? S[1] + S[3] : 0, C = v.style.backgroundColor ? 0 : T, A = d.rect.width + C, M = g[1][0] - g[2][0];
      x ? v.x < t ? g[2][0] = o + d.edgeDistance + A + d.labelDistance : g[2][0] = o + i - d.edgeDistance - A - d.labelDistance : (v.x < t ? g[2][0] = v.x + d.labelDistance : g[2][0] = v.x - d.labelDistance, g[1][0] = g[2][0] + M), g[1][1] = g[2][1] = v.y;
    }
  }
}
function C9(e, t, r) {
  if (e.labelStyleWidth == null) {
    var n = e.label, i = n.style, a = e.rect, o = i.backgroundColor, s = i.padding, l = s ? s[1] + s[3] : 0, u = i.overflow, f = a.width + (o ? 0 : l);
    if (t < f || r) {
      if (u && u.match("break")) {
        n.setStyle("backgroundColor", null), n.setStyle("width", t - l);
        var c = n.getBoundingRect();
        n.setStyle("width", Math.ceil(c.width)), n.setStyle("backgroundColor", o);
      } else {
        var h = t - l, v = t < f ? h : (
          // Current available width is enough, but the text may have
          // already been wrapped with a smaller available width.
          r ? h > e.unconstrainedWidth ? null : h : null
        );
        n.setStyle("width", v);
      }
      A9(a, n);
    }
  }
}
function A9(e, t) {
  iz.rect = e, $6(iz, t, Roe);
}
var Roe = {
  minMarginForce: [null, 0, null, 0],
  marginDefault: [1, 0, 1, 0]
}, iz = {};
function NL(e) {
  return e.position === "center";
}
function Ooe(e) {
  var t = e.getData(), r = [], n, i, a = !1, o = (e.get("minShowLabelAngle") || 0) * Poe, s = t.getLayout("viewRect"), l = t.getLayout("r"), u = s.width, f = s.x, c = s.y, h = s.height;
  function v(M) {
    M.ignore = !0;
  }
  function d(M) {
    if (!M.ignore)
      return !0;
    for (var E in M.states)
      if (M.states[E].ignore === !1)
        return !0;
    return !1;
  }
  t.each(function(M) {
    var E = t.getItemGraphicEl(M), P = E.shape, R = E.getTextContent(), O = E.getTextGuideLine(), N = t.getItemModel(M), G = N.getModel("label"), z = G.get("position") || N.get(["emphasis", "label", "position"]), H = G.get("distanceToLabelLine"), W = G.get("alignTo"), Z = Be(G.get("edgeDistance"), u), ee = G.get("bleedMargin");
    ee == null && (ee = Math.min(u, h) > 200 ? 10 : 2);
    var V = N.getModel("labelLine"), Q = V.get("length");
    Q = Be(Q, u);
    var q = V.get("length2");
    if (q = Be(q, u), Math.abs(P.endAngle - P.startAngle) < o) {
      F(R.states, v), R.ignore = !0, O && (F(O.states, v), O.ignore = !0);
      return;
    }
    if (d(R)) {
      var X = (P.startAngle + P.endAngle) / 2, K = Math.cos(X), ue = Math.sin(X), oe, te, pe, me;
      n = P.cx, i = P.cy;
      var de = z === "inside" || z === "inner";
      if (z === "center")
        oe = P.cx, te = P.cy, me = "center";
      else {
        var ve = (de ? (P.r + P.r0) / 2 * K : P.r * K) + n, Ae = (de ? (P.r + P.r0) / 2 * ue : P.r * ue) + i;
        if (oe = ve + K * 3, te = Ae + ue * 3, !de) {
          var be = ve + K * (Q + l - P.r), De = Ae + ue * (Q + l - P.r), Ue = be + (K < 0 ? -1 : 1) * q, Xe = De;
          W === "edge" ? oe = K < 0 ? f + Z : f + u - Z : oe = Ue + (K < 0 ? -H : H), te = Xe, pe = [[ve, Ae], [be, De], [Ue, Xe]];
        }
        me = de ? "center" : W === "edge" ? K > 0 ? "right" : "left" : K > 0 ? "left" : "right";
      }
      var $e = Math.PI, vt = 0, Lt = G.get("rotate");
      if (Xt(Lt))
        vt = Lt * ($e / 180);
      else if (z === "center")
        vt = 0;
      else if (Lt === "radial" || Lt === !0) {
        var cr = K < 0 ? -X + $e : -X;
        vt = cr;
      } else if (Lt === "tangential" && z !== "outside" && z !== "outer") {
        var mr = Math.atan2(K, ue);
        mr < 0 && (mr = $e * 2 + mr);
        var Kt = ue > 0;
        Kt && (mr = $e + mr), vt = mr - $e;
      }
      if (a = !!vt, R.x = oe, R.y = te, R.rotation = vt, R.setStyle({
        verticalAlign: "middle"
      }), de) {
        R.setStyle({
          align: me
        });
        var ir = R.states.select;
        ir && (ir.x += R.x, ir.y += R.y);
      } else {
        var wt = new st(0, 0, 0, 0);
        A9(wt, R), r.push({
          label: R,
          labelLine: O,
          position: z,
          len: Q,
          len2: q,
          minTurnAngle: V.get("minTurnAngle"),
          maxSurfaceAngle: V.get("maxSurfaceAngle"),
          surfaceNormal: new ht(K, ue),
          linePoints: pe,
          textAlign: me,
          labelDistance: H,
          labelAlignTo: W,
          edgeDistance: Z,
          bleedMargin: ee,
          rect: wt,
          unconstrainedWidth: wt.width,
          labelStyleWidth: R.style.width
        });
      }
      E.setTextConfig({
        inside: de
      });
    }
  }), !a && e.get("avoidLabelOverlap") && Ioe(r, n, i, l, u, h, f, c);
  for (var g = 0; g < r.length; g++) {
    var y = r[g], x = y.label, S = y.labelLine, T = isNaN(x.x) || isNaN(x.y);
    if (x) {
      x.setStyle({
        align: y.textAlign
      }), T && (F(x.states, v), x.ignore = !0);
      var C = x.states.select;
      C && (C.x += x.x, C.y += x.y);
    }
    if (S) {
      var A = y.linePoints;
      T || !A ? (F(S.states, v), S.ignore = !0) : (X6(A, y.minTurnAngle), rae(A, y.surfaceNormal, y.maxSurfaceAngle), S.setShape({
        points: A
      }), x.__hostTarget.textGuideLineConfig = {
        anchor: new ht(A[0][0], A[0][1])
      });
    }
  }
}
var Noe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r, n, i) {
      var a = e.call(this) || this;
      a.z2 = 2;
      var o = new Rt();
      return a.setTextContent(o), a.updateData(r, n, i, !0), a;
    }
    return t.prototype.updateData = function(r, n, i, a) {
      var o = this, s = r.hostModel, l = r.getItemModel(n), u = l.getModel("emphasis"), f = r.getItemLayout(n), c = xe(Yl(l.getModel("itemStyle"), f, !0), f);
      if (isNaN(c.startAngle)) {
        o.setShape(c);
        return;
      }
      if (a) {
        o.setShape(c);
        var h = s.getShallow("animationType");
        s.ecModel.ssr ? (Ir(o, {
          scaleX: 0,
          scaleY: 0
        }, s, {
          dataIndex: n,
          isFrom: !0
        }), o.originX = c.cx, o.originY = c.cy) : h === "scale" ? (o.shape.r = f.r0, Ir(o, {
          shape: {
            r: f.r
          }
        }, s, n)) : i != null ? (o.setShape({
          startAngle: i,
          endAngle: i
        }), Ir(o, {
          shape: {
            startAngle: f.startAngle,
            endAngle: f.endAngle
          }
        }, s, n)) : (o.shape.endAngle = f.startAngle, Wt(o, {
          shape: {
            endAngle: f.endAngle
          }
        }, s, n));
      } else
        vs(o), Wt(o, {
          shape: c
        }, s, n);
      o.useStyle(r.getItemVisual(n, "style")), Un(o, l);
      var v = (f.startAngle + f.endAngle) / 2, d = s.get("selectedOffset"), g = Math.cos(v) * d, y = Math.sin(v) * d, x = l.getShallow("cursor");
      x && o.attr("cursor", x), this._updateLabel(s, r, n), o.ensureState("emphasis").shape = xe({
        r: f.r + (u.get("scale") && u.get("scaleSize") || 0)
      }, Yl(u.getModel("itemStyle"), f)), xe(o.ensureState("select"), {
        x: g,
        y,
        shape: Yl(l.getModel(["select", "itemStyle"]), f)
      }), xe(o.ensureState("blur"), {
        shape: Yl(l.getModel(["blur", "itemStyle"]), f)
      });
      var S = o.getTextGuideLine(), T = o.getTextContent();
      S && xe(S.ensureState("select"), {
        x: g,
        y
      }), xe(T.ensureState("select"), {
        x: g,
        y
      }), Hr(this, u.get("focus"), u.get("blurScope"), u.get("disabled"));
    }, t.prototype._updateLabel = function(r, n, i) {
      var a = this, o = n.getItemModel(i), s = o.getModel("labelLine"), l = n.getItemVisual(i, "style"), u = l && l.fill, f = l && l.opacity;
      si(a, Wn(o), {
        labelFetcher: n.hostModel,
        labelDataIndex: i,
        inheritColor: u,
        defaultOpacity: f,
        defaultText: r.getFormattedLabel(i, "normal") || n.getName(i)
      });
      var c = a.getTextContent();
      a.setTextConfig({
        // reset position, rotation
        position: null,
        rotation: null
      }), c.attr({
        z2: 10
      });
      var h = o.get(["label", "position"]);
      if (h !== "outside" && h !== "outer")
        a.removeTextGuideLine();
      else {
        var v = this.getTextGuideLine();
        v || (v = new Ci(), this.setTextGuideLine(v)), DO(this, EO(o), {
          stroke: u,
          opacity: $a(s.get(["lineStyle", "opacity"]), f, 1)
        });
      }
    }, t;
  })(Ui)
), koe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.ignoreLabelLineUpdate = !0, r;
    }
    return t.prototype.render = function(r, n, i, a) {
      var o = r.getData(), s = this._data, l = this.group, u;
      if (!s && o.count() > 0) {
        for (var f = o.getItemLayout(0), c = 1; isNaN(f && f.startAngle) && c < o.count(); ++c)
          f = o.getItemLayout(c);
        f && (u = f.startAngle);
      }
      if (this._emptyCircleSector && l.remove(this._emptyCircleSector), o.count() === 0 && r.get("showEmptyCircle")) {
        var h = b9(r), v = new Ui({
          shape: it(h)
        });
        v.useStyle(r.getModel("emptyCircleStyle").getItemStyle()), this._emptyCircleSector = v, l.add(v);
      }
      o.diff(s).add(function(d) {
        var g = new Noe(o, d, u);
        o.setItemGraphicEl(d, g), l.add(g);
      }).update(function(d, g) {
        var y = s.getItemGraphicEl(g);
        y.updateData(o, d, u), y.off("click"), l.add(y), o.setItemGraphicEl(d, y);
      }).remove(function(d) {
        var g = s.getItemGraphicEl(d);
        ff(g, r, d);
      }).execute(), Ooe(r), r.get("animationTypeUpdate") !== "expansion" && (this._data = o);
    }, t.prototype.dispose = function() {
    }, t.prototype.containPoint = function(r, n) {
      var i = n.getData(), a = i.getItemLayout(0);
      if (a) {
        var o = r[0] - a.cx, s = r[1] - a.cy, l = Math.sqrt(o * o + s * s);
        return l <= a.r && l >= a.r0;
      }
    }, t.type = "pie", t;
  })(Ut)
);
function cy(e, t, r) {
  t = Se(t) && {
    coordDimensions: t
  } || xe({
    encodeDefine: e.getEncode()
  }, t);
  var n = e.getSource(), i = sy(n, t).dimensions, a = new zr(i, e);
  return a.initData(n, r), a;
}
var hy = (
  /** @class */
  (function() {
    function e(t, r) {
      this._getDataWithEncodedVisual = t, this._getRawData = r;
    }
    return e.prototype.getAllNames = function() {
      var t = this._getRawData();
      return t.mapArray(t.getName);
    }, e.prototype.containName = function(t) {
      var r = this._getRawData();
      return r.indexOfName(t) >= 0;
    }, e.prototype.indexOfName = function(t) {
      var r = this._getDataWithEncodedVisual();
      return r.indexOfName(t);
    }, e.prototype.getItemVisual = function(t, r) {
      var n = this._getDataWithEncodedVisual();
      return n.getItemVisual(t, r);
    }, e;
  })()
), Boe = Bt(), M9 = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      return e !== null && e.apply(this, arguments) || this;
    }
    return t.prototype.init = function(r) {
      e.prototype.init.apply(this, arguments), this.legendVisualProvider = new hy(Ge(this.getData, this), Ge(this.getRawData, this)), this._defaultLabelLine(r);
    }, t.prototype.mergeOption = function() {
      e.prototype.mergeOption.apply(this, arguments);
    }, t.prototype.getInitialData = function() {
      return cy(this, {
        coordDimensions: ["value"],
        encodeDefaulter: St(JR, this)
      });
    }, t.prototype.getDataParams = function(r) {
      var n = this.getData(), i = Boe(n), a = i.seats;
      if (!a) {
        var o = [];
        n.each(n.mapDimension("value"), function(l) {
          o.push(l);
        }), a = i.seats = NU(o, n.hostModel.get("percentPrecision"));
      }
      var s = e.prototype.getDataParams.call(this, r);
      return s.percent = a[r] || 0, s.$vars.push("percent"), s;
    }, t.prototype._defaultLabelLine = function(r) {
      xd(r, "labelLine", ["show"]);
      var n = r.labelLine, i = r.emphasis.labelLine;
      n.show = n.show && r.label.show, i.show = i.show && r.emphasis.label.show;
    }, t.type = "series.pie", t.defaultOption = {
      // zlevel: 0,
      z: 2,
      legendHoverLink: !0,
      colorBy: "data",
      // 默认全局居中
      center: ["50%", "50%"],
      radius: [0, "50%"],
      // 默认顺时针
      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,
      coordinateSystemUsage: "box",
      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'.
        // The default `bleedMargin` is auto determined according to view rect size.
        // 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: 30,
        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;
  })(Yt)
);
Hee({
  fullType: M9.type,
  getCoord2: function(e) {
    return e.getShallow("center");
  }
});
function zoe(e) {
  return {
    seriesType: e,
    reset: function(t, r) {
      var n = t.getData();
      n.filterSelf(function(i) {
        var a = n.mapDimension("value"), o = n.get(a, i);
        return !(Xt(o) && !isNaN(o) && o < 0);
      });
    }
  };
}
function Foe(e) {
  e.registerChartView(koe), e.registerSeriesModel(M9), V8("pie", e.registerAction), e.registerLayout(St(Eoe, "pie")), e.registerProcessor(fy("pie")), e.registerProcessor(zoe("pie"));
}
var Goe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.hasSymbolVisual = !0, r;
    }
    return t.prototype.getInitialData = function(r, n) {
      return ou(null, this, {
        useEncodeDefaulter: !0
      });
    }, t.prototype.getProgressive = function() {
      var r = this.option.progressive;
      return r ?? (this.option.large ? 5e3 : this.get("progressive"));
    }, t.prototype.getProgressiveThreshold = function() {
      var r = this.option.progressiveThreshold;
      return r ?? (this.option.large ? 1e4 : this.get("progressiveThreshold"));
    }, t.prototype.brushSelector = function(r, n, i) {
      return i.point(n.getItemLayout(r));
    }, t.prototype.getZLevelKey = function() {
      return this.getData().count() > this.getProgressiveThreshold() ? this.id : "";
    }, t.type = "series.scatter", t.dependencies = ["grid", "polar", "geo", "singleAxis", "calendar", "matrix"], 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: fe.color.primary
        }
      },
      universalTransition: {
        divideShape: "clone"
      }
      // progressive: null
    }, t;
  })(Yt)
), L9 = 4, Voe = (
  /** @class */
  /* @__PURE__ */ (function() {
    function e() {
    }
    return e;
  })()
), Hoe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r) {
      var n = e.call(this, r) || this;
      return n._off = 0, n.hoverDataIdx = -1, n;
    }
    return t.prototype.getDefaultShape = function() {
      return new Voe();
    }, t.prototype.reset = function() {
      this.notClear = !1, this._off = 0;
    }, t.prototype.buildPath = function(r, n) {
      var i = n.points, a = n.size, o = this.symbolProxy, s = o.shape, l = r.getContext ? r.getContext() : r, u = l && a[0] < L9, f = this.softClipShape, c;
      if (u) {
        this._ctx = l;
        return;
      }
      for (this._ctx = null, c = this._off; c < i.length; ) {
        var h = i[c++], v = i[c++];
        isNaN(h) || isNaN(v) || f && !f.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(r, s, !0));
      }
      this.incremental && (this._off = c, this.notClear = !0);
    }, t.prototype.afterBrush = function() {
      var r = this.shape, n = r.points, i = r.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(r, 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 f = u * 2, c = a[f] - s / 2, h = a[f + 1] - l / 2;
        if (r >= c && n >= h && r <= c + s && n <= h + l)
          return u;
      }
      return -1;
    }, t.prototype.contain = function(r, n) {
      var i = this.transformCoordToLocal(r, n), a = this.getBoundingRect();
      if (r = i[0], n = i[1], a.contain(r, n)) {
        var o = this.hoverDataIdx = this.findDataIndex(r, n);
        return o >= 0;
      }
      return this.hoverDataIdx = -1, !1;
    }, t.prototype.getBoundingRect = function() {
      var r = this._rect;
      if (!r) {
        for (var n = this.shape, i = n.points, a = n.size, o = a[0], s = a[1], l = 1 / 0, u = 1 / 0, f = -1 / 0, c = -1 / 0, h = 0; h < i.length; ) {
          var v = i[h++], d = i[h++];
          l = Math.min(v, l), f = Math.max(v, f), u = Math.min(d, u), c = Math.max(d, c);
        }
        r = this._rect = new st(l - o / 2, u - s / 2, f - l + o, c - u + s);
      }
      return r;
    }, t;
  })(zt)
), Uoe = (
  /** @class */
  (function() {
    function e() {
      this.group = new rt();
    }
    return e.prototype.updateData = function(t, r) {
      this._clear();
      var n = this._create();
      n.setShape({
        points: t.getLayout("points")
      }), this._setCommon(n, t, r);
    }, e.prototype.updateLayout = function(t) {
      var r = t.getLayout("points");
      this.group.eachChild(function(n) {
        if (n.startIndex != null) {
          var i = (n.endIndex - n.startIndex) * 2, a = n.startIndex * 4 * 2;
          r = new Float32Array(r.buffer, a, i);
        }
        n.setShape("points", r), n.reset();
      });
    }, e.prototype.incrementalPrepareUpdate = function(t) {
      this._clear();
    }, e.prototype.incrementalUpdate = function(t, r, n) {
      var i = this._newAdded[0], a = r.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, r, n);
      }
    }, e.prototype.eachRendered = function(t) {
      this._newAdded[0] && t(this._newAdded[0]);
    }, e.prototype._create = function() {
      var t = new Hoe({
        cursor: "default"
      });
      return t.ignoreCoarsePointer = !0, this.group.add(t), this._newAdded.push(t), t;
    }, e.prototype._setCommon = function(t, r, n) {
      var i = r.hostModel;
      n = n || {};
      var a = r.getVisual("symbolSize");
      t.setShape("size", a instanceof Array ? a : [a, a]), t.softClipShape = n.clipShape || null, t.symbolProxy = en(r.getVisual("symbol"), 0, 0, 0, 0), t.setColor = t.symbolProxy.setColor;
      var o = t.shape.size[0] < L9;
      t.useStyle(
        // Draw shadow when doing fillRect is extremely slow.
        i.getModel("itemStyle").getItemStyle(o ? ["color", "shadowBlur", "shadowColor"] : ["color"])
      );
      var s = r.getVisual("style"), l = s && s.fill;
      l && t.setColor(l);
      var u = pt(t);
      u.seriesIndex = i.seriesIndex, t.on("mousemove", function(f) {
        u.dataIndex = null;
        var c = t.hoverDataIdx;
        c >= 0 && (u.dataIndex = c + (t.startIndex || 0));
      });
    }, e.prototype.remove = function() {
      this._clear();
    }, e.prototype._clear = function() {
      this._newAdded = [], this.group.removeAll();
    }, e;
  })()
), Woe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.render = function(r, n, i) {
      var a = r.getData(), o = this._updateSymbolDraw(a, r);
      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(r)
      }), this._finished = !0;
    }, t.prototype.incrementalPrepareRender = function(r, n, i) {
      var a = r.getData(), o = this._updateSymbolDraw(a, r);
      o.incrementalPrepareUpdate(a), this._finished = !1;
    }, t.prototype.incrementalRender = function(r, n, i) {
      this._symbolDraw.incrementalUpdate(r, n.getData(), {
        clipShape: this._getClipShape(n)
      }), this._finished = r.end === n.getData().count();
    }, t.prototype.updateTransform = function(r, n, i) {
      var a = r.getData();
      if (this.group.dirty(), !this._finished || a.count() > 1e4)
        return {
          update: !0
        };
      var o = zx("").reset(r, n, i);
      o.progress && o.progress({
        start: 0,
        end: a.count(),
        count: a.count()
      }, a), this._symbolDraw.updateLayout(a);
    }, t.prototype.eachRendered = function(r) {
      this._symbolDraw && this._symbolDraw.eachRendered(r);
    }, t.prototype._getClipShape = function(r) {
      if (r.get("clip", !0)) {
        var n = r.coordinateSystem;
        return n && n.getArea && n.getArea(0.1);
      }
    }, t.prototype._updateSymbolDraw = function(r, n) {
      var i = this._symbolDraw, a = n.pipelineContext, o = a.large;
      return (!i || o !== this._isLargeDraw) && (i && i.remove(), i = this._symbolDraw = o ? new Uoe() : new kx(), this._isLargeDraw = o, this.group.removeAll()), this.group.add(i.group), i;
    }, t.prototype.remove = function(r, n) {
      this._symbolDraw && this._symbolDraw.remove(!0), this._symbolDraw = null;
    }, t.prototype.dispose = function() {
    }, t.type = "scatter", t;
  })(Ut)
), D9 = {
  left: 0,
  right: 0,
  top: 0,
  bottom: 0
}, Cb = ["25%", "25%"], Xoe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      return e !== null && e.apply(this, arguments) || this;
    }
    return t.prototype.mergeDefaultAndTheme = function(r, n) {
      var i = Bd(r.outerBounds);
      e.prototype.mergeDefaultAndTheme.apply(this, arguments), i && r.outerBounds && nu(r.outerBounds, i);
    }, t.prototype.mergeOption = function(r, n) {
      e.prototype.mergeOption.apply(this, arguments), this.option.outerBounds && r.outerBounds && nu(this.option.outerBounds, r.outerBounds);
    }, t.type = "grid", t.dependencies = ["xAxis", "yAxis"], t.layoutMode = "box", t.defaultOption = {
      show: !1,
      // zlevel: 0,
      z: 0,
      left: "15%",
      top: 65,
      right: "10%",
      bottom: 80,
      // If grid size contain label
      containLabel: !1,
      outerBoundsMode: "auto",
      outerBounds: D9,
      outerBoundsContain: "all",
      outerBoundsClampWidth: Cb[0],
      outerBoundsClampHeight: Cb[1],
      // width: {totalWidth} - left - right,
      // height: {totalHeight} - top - bottom,
      backgroundColor: fe.color.transparent,
      borderWidth: 1,
      borderColor: fe.color.neutral30
    }, t;
  })(At)
), WP = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      return e !== null && e.apply(this, arguments) || this;
    }
    return t.prototype.getCoordSysModel = function() {
      return this.getReferringComponents("grid", an).models[0];
    }, t.type = "cartesian2dAxis", t;
  })(At)
);
cn(WP, uy);
var E9 = {
  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: {
    // textMargin: never, // The default value will be specified based on `nameLocation`.
  },
  // 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: fe.color.axisLine,
      width: 1,
      type: "solid"
    },
    // The arrow at both ends the the axis.
    symbol: ["none", "none"],
    symbolSize: [10, 15],
    breakLine: !0
  },
  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,
    color: fe.color.axisLabel,
    // In scenarios like axis labels, when labels text's progression direction matches the label
    // layout direction (e.g., when all letters are in a single line), extra start/end margin is
    // needed to prevent the text from appearing visually joined. In the other case, when lables
    // are stacked (e.g., having rotation or horizontal labels on yAxis), the layout needs to be
    // compact, so NO extra top/bottom margin should be applied.
    textMargin: [0, 3]
  },
  splitLine: {
    show: !0,
    showMinLine: !0,
    showMaxLine: !0,
    lineStyle: {
      color: fe.color.axisSplitLine,
      width: 1,
      type: "solid"
    }
  },
  splitArea: {
    show: !1,
    areaStyle: {
      color: [fe.color.backgroundTint, fe.color.backgroundTransparent]
    }
  },
  breakArea: {
    show: !0,
    itemStyle: {
      color: fe.color.neutral00,
      // Break border color should be darker than the splitLine
      // because it has opacity and should be more prominent
      borderColor: fe.color.border,
      borderWidth: 1,
      borderType: [3, 3],
      opacity: 0.6
    },
    zigzagAmplitude: 4,
    zigzagMinSpan: 4,
    zigzagMaxSpan: 20,
    zigzagZ: 100,
    expandOnClick: !0
  },
  breakLabelLayout: {
    moveOverlap: "auto"
  }
}, Yoe = je({
  // The gap at both ends of the axis. For categoryAxis, boolean.
  boundaryGap: !0,
  // Set false to faster category collection.
  deduplication: null,
  jitter: 0,
  jitterOverlap: !0,
  jitterMargin: 2,
  // splitArea: {
  // show: false
  // },
  splitLine: {
    show: !1
  },
  axisTick: {
    // If tick is align with label when boundaryGap is true
    alignWithLabel: !1,
    interval: "auto",
    show: "auto"
  },
  axisLabel: {
    interval: "auto"
  }
}, E9), BO = je({
  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: fe.color.axisMinorSplitLine,
      width: 1
    }
  }
}, E9), Zoe = je({
  splitNumber: 6,
  axisLabel: {
    // To eliminate labels that are not nice
    showMinLabel: !1,
    showMaxLabel: !1,
    rich: {
      primary: {
        fontWeight: "bold"
      }
    }
  },
  splitLine: {
    show: !1
  }
}, BO), $oe = tt({
  logBase: 10
}, BO);
const P9 = {
  category: Yoe,
  value: BO,
  time: Zoe,
  log: $oe
};
var qoe = {
  value: 1,
  category: 1,
  time: 1,
  log: 1
}, XP = null;
function joe(e) {
  XP || (XP = e);
}
function Fx() {
  return XP;
}
function Pm(e, t, r, n) {
  F(qoe, function(i, a) {
    var o = je(je({}, P9[a], !0), n, !0), s = (
      /** @class */
      (function(l) {
        ae(u, l);
        function u() {
          var f = l !== null && l.apply(this, arguments) || this;
          return f.type = t + "Axis." + a, f;
        }
        return u.prototype.mergeDefaultAndTheme = function(f, c) {
          var h = V1(this), v = h ? Bd(f) : {}, d = c.getTheme();
          je(f, d.get(a + "Axis")), je(f, this.getDefaultOption()), f.type = az(f), h && nu(f, v, h);
        }, u.prototype.optionUpdated = function() {
          var f = this.option;
          f.type === "category" && (this.__ordinalMeta = Mm.createByAxisModel(this));
        }, u.prototype.getCategories = function(f) {
          var c = this.option;
          if (c.type === "category")
            return f ? c.data : this.__ordinalMeta.categories;
        }, u.prototype.getOrdinalMeta = function() {
          return this.__ordinalMeta;
        }, u.prototype.updateAxisBreaks = function(f) {
          var c = Fx();
          return c ? c.updateModelAxisBreak(this, f) : {
            breaks: []
          };
        }, u.type = t + "Axis." + a, u.defaultOption = o, u;
      })(r)
    );
    e.registerComponentModel(s);
  }), e.registerSubTypeDefaulter(t + "Axis", az);
}
function az(e) {
  return e.type || (e.data ? "category" : "value");
}
var zO = (
  /** @class */
  (function() {
    function e(t) {
      this.type = "cartesian", this._dimList = [], this._axes = {}, this.name = t || "";
    }
    return e.prototype.getAxis = function(t) {
      return this._axes[t];
    }, e.prototype.getAxes = function() {
      return Ce(this._dimList, function(t) {
        return this._axes[t];
      }, this);
    }, e.prototype.getAxesByScale = function(t) {
      return t = t.toLowerCase(), nr(this.getAxes(), function(r) {
        return r.scale.type === t;
      });
    }, e.prototype.addAxis = function(t) {
      var r = t.dim;
      this._axes[r] = t, this._dimList.push(r);
    }, e;
  })()
), YP = ["x", "y"];
function oz(e) {
  return (e.type === "interval" || e.type === "time") && !e.hasBreaks();
}
var Koe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = "cartesian2d", r.dimensions = YP, r;
    }
    return t.prototype.calcAffineTransform = function() {
      this._transform = this._invTransform = null;
      var r = this.getAxis("x").scale, n = this.getAxis("y").scale;
      if (!(!oz(r) || !oz(n))) {
        var i = r.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 f = (s[0] - o[0]) / l, c = (s[1] - o[1]) / u, h = o[0] - i[0] * f, v = o[1] - a[0] * c, d = this._transform = [f, 0, 0, c, h, v];
          this._invTransform = cs([], d);
        }
      }
    }, t.prototype.getBaseAxis = function() {
      return this.getAxesByScale("ordinal")[0] || this.getAxesByScale("time")[0] || this.getAxis("x");
    }, t.prototype.containPoint = function(r) {
      var n = this.getAxis("x"), i = this.getAxis("y");
      return n.contain(n.toLocalCoord(r[0])) && i.contain(i.toLocalCoord(r[1]));
    }, t.prototype.containData = function(r) {
      return this.getAxis("x").containData(r[0]) && this.getAxis("y").containData(r[1]);
    }, t.prototype.containZone = function(r, n) {
      var i = this.dataToPoint(r), a = this.dataToPoint(n), o = this.getArea(), s = new st(i[0], i[1], a[0] - i[0], a[1] - i[1]);
      return o.intersect(s);
    }, t.prototype.dataToPoint = function(r, n, i) {
      i = i || [];
      var a = r[0], o = r[1];
      if (this._transform && a != null && isFinite(a) && o != null && isFinite(o))
        return fn(i, r, 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(r, n) {
      var i = this.getAxis("x").scale, a = this.getAxis("y").scale, o = i.getExtent(), s = a.getExtent(), l = i.parse(r[0]), u = a.parse(r[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(r, n, i) {
      if (i = i || [], this._invTransform)
        return fn(i, r, this._invTransform);
      var a = this.getAxis("x"), o = this.getAxis("y");
      return i[0] = a.coordToData(a.toLocalCoord(r[0]), n), i[1] = o.coordToData(o.toLocalCoord(r[1]), n), i;
    }, t.prototype.getOtherAxis = function(r) {
      return this.getAxis(r.dim === "x" ? "y" : "x");
    }, t.prototype.getArea = function(r) {
      r = r || 0;
      var n = this.getAxis("x").getGlobalExtent(), i = this.getAxis("y").getGlobalExtent(), a = Math.min(n[0], n[1]) - r, o = Math.min(i[0], i[1]) - r, s = Math.max(n[0], n[1]) - a + r, l = Math.max(i[0], i[1]) - o + r;
      return new st(a, o, s, l);
    }, t;
  })(zO)
), I9 = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r, n, i, a, o) {
      var s = e.call(this, r, n, i) || this;
      return s.index = 0, s.type = a || "value", s.position = o || "bottom", s;
    }
    return t.prototype.isHorizontal = function() {
      var r = this.position;
      return r === "top" || r === "bottom";
    }, t.prototype.getGlobalExtent = function(r) {
      var n = this.getExtent();
      return n[0] = this.toGlobalCoord(n[0]), n[1] = this.toGlobalCoord(n[1]), r && n[0] > n[1] && n.reverse(), n;
    }, t.prototype.pointToData = function(r, n) {
      return this.coordToData(this.toLocalCoord(r[this.dim === "x" ? 0 : 1]), n);
    }, t.prototype.setCategorySortInfo = function(r) {
      if (this.type !== "category")
        return !1;
      this.model.option.categorySortInfo = r, this.scale.setSortInfo(r);
    }, t;
  })(ra)
), UC = "expandAxisBreak", R9 = "collapseAxisBreak", O9 = "toggleAxisBreak", FO = "axisbreakchanged", Qoe = {
  type: UC,
  event: FO,
  update: "update",
  refineEvent: GO
}, Joe = {
  type: R9,
  event: FO,
  update: "update",
  refineEvent: GO
}, ese = {
  type: O9,
  event: FO,
  update: "update",
  refineEvent: GO
};
function GO(e, t, r, n) {
  var i = [];
  return F(e, function(a) {
    i = i.concat(a.eventBreaks);
  }), {
    eventContent: {
      breaks: i
    }
  };
}
function tse(e) {
  e.registerAction(Qoe, t), e.registerAction(Joe, t), e.registerAction(ese, t);
  function t(r, n) {
    var i = [], a = dm(n, r);
    function o(s, l) {
      F(a[s], function(u) {
        var f = u.updateAxisBreaks(r);
        F(f.breaks, function(c) {
          var h;
          i.push(tt((h = {}, h[l] = u.componentIndex, h), c));
        });
      });
    }
    return o("xAxisModels", "xAxisIndex"), o("yAxisModels", "yAxisIndex"), o("singleAxisModels", "singleAxisIndex"), {
      eventBreaks: i
    };
  }
}
var Oc = Math.PI, rse = [[1, 2, 1, 2], [5, 3, 5, 3], [8, 3, 8, 3]], nse = [[0, 1, 0, 1], [0, 3, 0, 3], [0, 3, 0, 3]], Im = Bt(), N9 = Bt(), k9 = (
  /** @class */
  (function() {
    function e(t) {
      this.recordMap = {}, this.resolveAxisNameOverlap = t;
    }
    return e.prototype.ensureRecord = function(t) {
      var r = t.axis.dim, n = t.componentIndex, i = this.recordMap, a = i[r] || (i[r] = []);
      return a[n] || (a[n] = {
        ready: {}
      });
    }, e;
  })()
);
function ise(e, t, r, n) {
  var i = r.axis, a = t.ensureRecord(r), o = [], s, l = VO(e.axisName) && Dm(e.nameLocation);
  F(n, function(d) {
    var g = iu(d);
    if (!(!g || g.label.ignore)) {
      o.push(g);
      var y = a.transGroup;
      l && (y.transform ? cs(c_, y.transform) : Sx(c_), g.transform && Hs(c_, c_, g.transform), st.copy(mT, g.localRect), mT.applyTransform(c_), s ? s.union(mT) : st.copy(s = new st(0, 0, 0, 0), mT));
    }
  });
  var u = Math.abs(a.dirVec.x) > 0.1 ? "x" : "y", f = a.transGroup[u];
  if (o.sort(function(d, g) {
    return Math.abs(d.label[u] - f) - Math.abs(g.label[u] - f);
  }), l && s) {
    var c = i.getExtent(), h = Math.min(c[0], c[1]), v = Math.max(c[0], c[1]) - h;
    s.union(new st(h, 0, v, 1));
  }
  a.stOccupiedRect = s, a.labelInfoList = o;
}
var c_ = ii(), mT = new st(0, 0, 0, 0), B9 = function(e, t, r, n, i, a) {
  if (Dm(e.nameLocation)) {
    var o = a.stOccupiedRect;
    o && z9(aae({}, o, a.transGroup.transform), n, i);
  } else
    F9(a.labelInfoList, a.dirVec, n, i);
};
function z9(e, t, r) {
  var n = new ht();
  VC(e, t, n, {
    direction: Math.atan2(r.y, r.x),
    bidirectional: !1,
    touchThreshold: 0.05
  }) && BP(t, n);
}
function F9(e, t, r, n) {
  for (var i = ht.dot(n, t) >= 0, a = 0, o = e.length; a < o; a++) {
    var s = e[i ? a : o - 1 - a];
    s.label.ignore || z9(s, r, n);
  }
}
var xa = (
  /** @class */
  (function() {
    function e(t, r, n, i) {
      this.group = new rt(), this._axisModel = t, this._api = r, this._local = {}, this._shared = i || new k9(B9), this._resetCfgDetermined(n);
    }
    return e.prototype.updateCfg = function(t) {
      var r = this._cfg.raw;
      r.position = t.position, r.labelOffset = t.labelOffset, this._resetCfgDetermined(r);
    }, e.prototype.__getRawCfg = function() {
      return this._cfg.raw;
    }, e.prototype._resetCfgDetermined = function(t) {
      var r = this._axisModel, n = r.getDefaultOption ? r.getDefaultOption() : {}, i = et(t.axisName, r.get("name")), a = r.get("nameMoveOverlap");
      (a == null || a === "auto") && (a = et(t.defaultNameMoveOverlap, !0));
      var o = {
        raw: t,
        position: t.position,
        rotation: t.rotation,
        nameDirection: et(t.nameDirection, 1),
        tickDirection: et(t.tickDirection, 1),
        labelDirection: et(t.labelDirection, 1),
        labelOffset: et(t.labelOffset, 0),
        silent: et(t.silent, !0),
        axisName: i,
        nameLocation: $a(r.get("nameLocation"), n.nameLocation, "end"),
        shouldNameMoveOverlap: VO(i) && a,
        optionHideOverlap: r.get(["axisLabel", "hideOverlap"]),
        showMinorTicks: r.get(["minorTick", "show"])
      };
      this._cfg = o;
      var s = new rt({
        x: o.position[0],
        y: o.position[1],
        rotation: o.rotation
      });
      s.updateTransform(), this._transformGroup = s;
      var l = this._shared.ensureRecord(r);
      l.transGroup = this._transformGroup, l.dirVec = new ht(Math.cos(-o.rotation), Math.sin(-o.rotation));
    }, e.prototype.build = function(t, r) {
      var n = this;
      return t || (t = {
        axisLine: !0,
        axisTickLabelEstimate: !1,
        axisTickLabelDetermine: !0,
        axisName: !0
      }), F(ase, function(i) {
        t[i] && ose[i](n._cfg, n._local, n._shared, n._axisModel, n.group, n._transformGroup, n._api, r || {});
      }), this;
    }, e.innerTextLayout = function(t, r, n) {
      var i = pR(r - t), a, o;
      return wm(i) ? (o = n > 0 ? "top" : "bottom", a = "center") : wm(i - Oc) ? (o = n > 0 ? "bottom" : "top", a = "center") : (o = "middle", i > 0 && i < Oc ? a = n > 0 ? "right" : "left" : a = n > 0 ? "left" : "right"), {
        rotation: i,
        textAlign: a,
        textVerticalAlign: o
      };
    }, e.makeAxisEventDataBase = function(t) {
      var r = {
        componentType: t.mainType,
        componentIndex: t.componentIndex
      };
      return r[t.mainType + "Index"] = t.componentIndex, r;
    }, e.isLabelSilent = function(t) {
      var r = t.get("tooltip");
      return t.get("silent") || !(t.get("triggerEvent") || r && r.show);
    }, e;
  })()
), ase = ["axisLine", "axisTickLabelEstimate", "axisTickLabelDetermine", "axisName"], ose = {
  axisLine: function(e, t, r, n, i, a, o) {
    var s = n.get(["axisLine", "show"]);
    if (s === "auto" && (s = !0, e.raw.axisLineAutoShow != null && (s = !!e.raw.axisLineAutoShow)), !!s) {
      var l = n.axis.getExtent(), u = a.transform, f = [l[0], 0], c = [l[1], 0], h = f[0] > c[0];
      u && (fn(f, f, u), fn(c, c, u));
      var v = xe({
        lineCap: "round"
      }, n.getModel(["axisLine", "lineStyle"]).getLineStyle()), d = {
        strokeContainThreshold: e.raw.strokeContainThreshold || 5,
        silent: !0,
        z2: 1,
        style: v
      };
      if (n.get(["axisLine", "breakLine"]) && n.axis.scale.hasBreaks())
        Fx().buildAxisBreakLine(n, i, a, d);
      else {
        var g = new wn(xe({
          shape: {
            x1: f[0],
            y1: f[1],
            x2: c[0],
            y2: c[1]
          }
        }, d));
        bm(g.shape, g.style.lineWidth), g.anid = "line", i.add(g);
      }
      var y = n.get(["axisLine", "symbol"]);
      if (y != null) {
        var x = n.get(["axisLine", "symbolSize"]);
        Fe(y) && (y = [y, y]), (Fe(x) || Xt(x)) && (x = [x, x]);
        var S = Fd(n.get(["axisLine", "symbolOffset"]) || 0, x), T = x[0], C = x[1];
        F([{
          rotate: e.rotation + Math.PI / 2,
          offset: S[0],
          r: 0
        }, {
          rotate: e.rotation - Math.PI / 2,
          offset: S[1],
          r: Math.sqrt((f[0] - c[0]) * (f[0] - c[0]) + (f[1] - c[1]) * (f[1] - c[1]))
        }], function(A, M) {
          if (y[M] !== "none" && y[M] != null) {
            var E = en(y[M], -T / 2, -C / 2, T, C, v.stroke, !0), P = A.r + A.offset, R = h ? c : f;
            E.attr({
              rotation: A.rotate,
              x: R[0] + P * Math.cos(e.rotation),
              y: R[1] - P * Math.sin(e.rotation),
              silent: !0,
              z2: 11
            }), i.add(E);
          }
        });
      }
    }
  },
  /**
   * [CAUTION] This method can be called multiple times, following the change due to `resetCfg` called
   *  in size measurement. Thus this method should be idempotent, and should be performant.
   */
  axisTickLabelEstimate: function(e, t, r, n, i, a, o, s) {
    var l = lz(t, i, s);
    l && sz(e, t, r, n, i, a, o, qs.estimate);
  },
  /**
   * Finish axis tick label build.
   * Can be only called once.
   */
  axisTickLabelDetermine: function(e, t, r, n, i, a, o, s) {
    var l = lz(t, i, s);
    l && sz(e, t, r, n, i, a, o, qs.determine);
    var u = fse(e, i, a, n);
    use(e, t.labelLayoutList, u), cse(e, i, a, n, e.tickDirection);
  },
  /**
   * [CAUTION] This method can be called multiple times, following the change due to `resetCfg` called
   *  in size measurement. Thus this method should be idempotent, and should be performant.
   */
  axisName: function(e, t, r, n, i, a, o, s) {
    var l = r.ensureRecord(n);
    t.nameEl && (i.remove(t.nameEl), t.nameEl = l.nameLayout = l.nameLocation = null);
    var u = e.axisName;
    if (VO(u)) {
      var f = e.nameLocation, c = e.nameDirection, h = n.getModel("nameTextStyle"), v = n.get("nameGap") || 0, d = n.axis.getExtent(), g = n.axis.inverse ? -1 : 1, y = new ht(0, 0), x = new ht(0, 0);
      f === "start" ? (y.x = d[0] - g * v, x.x = -g) : f === "end" ? (y.x = d[1] + g * v, x.x = g) : (y.x = (d[0] + d[1]) / 2, y.y = e.labelOffset + c * v, x.y = c);
      var S = ii();
      x.transform(Tf(S, S, e.rotation));
      var T = n.get("nameRotate");
      T != null && (T = T * Oc / 180);
      var C, A;
      Dm(f) ? C = xa.innerTextLayout(
        e.rotation,
        T ?? e.rotation,
        // Adapt to axis.
        c
      ) : (C = sse(e.rotation, f, T || 0, d), A = e.raw.axisNameAvailableWidth, A != null && (A = Math.abs(A / Math.sin(C.rotation)), !isFinite(A) && (A = null)));
      var M = h.getFont(), E = n.get("nameTruncate", !0) || {}, P = E.ellipsis, R = Ti(e.raw.nameTruncateMaxWidth, E.maxWidth, A), O = s.nameMarginLevel || 0, N = new Rt({
        x: y.x,
        y: y.y,
        rotation: C.rotation,
        silent: xa.isLabelSilent(n),
        style: gr(h, {
          text: u,
          font: M,
          overflow: "truncate",
          width: R,
          ellipsis: P,
          fill: h.getTextColor() || n.get(["axisLine", "lineStyle", "color"]),
          align: h.get("align") || C.textAlign,
          verticalAlign: h.get("verticalAlign") || C.textVerticalAlign
        }),
        z2: 1
      });
      if (Cf({
        el: N,
        componentModel: n,
        itemName: u
      }), N.__fullText = u, N.anid = "name", n.get("triggerEvent")) {
        var G = xa.makeAxisEventDataBase(n);
        G.targetType = "axisName", G.name = u, pt(N).eventData = G;
      }
      a.add(N), N.updateTransform(), t.nameEl = N;
      var z = l.nameLayout = iu({
        label: N,
        priority: N.z2,
        defaultAttr: {
          ignore: N.ignore
        },
        marginDefault: Dm(f) ? rse[O] : nse[O]
      });
      if (l.nameLocation = f, i.add(N), N.decomposeTransform(), e.shouldNameMoveOverlap && z) {
        var H = r.ensureRecord(n);
        r.resolveAxisNameOverlap(e, r, n, z, x, H);
      }
    }
  }
};
function sz(e, t, r, n, i, a, o, s) {
  V9(t) || hse(e, t, i, s, n, o);
  var l = t.labelLayoutList;
  vse(e, n, l, a), gse(n, e.rotation, l);
  var u = e.optionHideOverlap;
  lse(n, l, u), u && q6(
    // Filter the already ignored labels by the previous overlap resolving methods.
    nr(l, function(f) {
      return f && !f.label.ignore;
    })
  ), ise(e, r, n, l);
}
function sse(e, t, r, n) {
  var i = pR(r - e), a, o, s = n[0] > n[1], l = t === "start" && !s || t !== "start" && s;
  return wm(i - Oc / 2) ? (o = l ? "bottom" : "top", a = "center") : wm(i - Oc * 1.5) ? (o = l ? "top" : "bottom", a = "center") : (o = "middle", i < Oc * 1.5 && i > Oc / 2 ? a = l ? "left" : "right" : a = l ? "right" : "left"), {
    rotation: i,
    textAlign: a,
    textVerticalAlign: o
  };
}
function lse(e, t, r) {
  if (E6(e.axis))
    return;
  function n(s, l, u) {
    var f = iu(t[l]), c = iu(t[u]);
    if (!(!f || !c)) {
      if (s === !1 || f.suggestIgnore) {
        $_(f.label);
        return;
      }
      if (c.suggestIgnore) {
        $_(c.label);
        return;
      }
      var h = 0.1;
      if (!r) {
        var v = [0, 0, 0, 0];
        f = zP({
          marginForce: v
        }, f), c = zP({
          marginForce: v
        }, c);
      }
      VC(f, c, null, {
        touchThreshold: h
      }) && $_(s ? c.label : f.label);
    }
  }
  var i = e.get(["axisLabel", "showMinLabel"]), a = e.get(["axisLabel", "showMaxLabel"]), o = t.length;
  n(i, 0, 1), n(a, o - 1, o - 2);
}
function use(e, t, r) {
  e.showMinorTicks || F(t, function(n) {
    if (n && n.label.ignore)
      for (var i = 0; i < r.length; i++) {
        var a = r[i], o = N9(a), s = Im(n.label);
        if (o.tickValue != null && !o.onBand && o.tickValue === s.tickValue) {
          $_(a);
          return;
        }
      }
  });
}
function $_(e) {
  e && (e.ignore = !0);
}
function G9(e, t, r, n, i) {
  for (var a = [], o = [], s = [], l = 0; l < e.length; l++) {
    var u = e[l].coord;
    o[0] = u, o[1] = 0, s[0] = u, s[1] = r, t && (fn(o, o, t), fn(s, s, t));
    var f = new wn({
      shape: {
        x1: o[0],
        y1: o[1],
        x2: s[0],
        y2: s[1]
      },
      style: n,
      z2: 2,
      autoBatch: !0,
      silent: !0
    });
    bm(f.shape, f.style.lineWidth), f.anid = i + "_" + e[l].tickValue, a.push(f);
    var c = N9(f);
    c.onBand = !!e[l].onBand, c.tickValue = e[l].tickValue;
  }
  return a;
}
function fse(e, t, r, n) {
  var i = n.axis, a = n.getModel("axisTick"), o = a.get("show");
  if (o === "auto" && (o = !0, e.raw.axisTickAutoShow != null && (o = !!e.raw.axisTickAutoShow)), !o || i.scale.isBlank())
    return [];
  for (var s = a.getModel("lineStyle"), l = e.tickDirection * a.get("length"), u = i.getTicksCoords(), f = G9(u, r.transform, l, tt(s.getLineStyle(), {
    stroke: n.get(["axisLine", "lineStyle", "color"])
  }), "ticks"), c = 0; c < f.length; c++)
    t.add(f[c]);
  return f;
}
function cse(e, t, r, n, i) {
  var a = n.axis, o = n.getModel("minorTick");
  if (!(!e.showMinorTicks || a.scale.isBlank())) {
    var s = a.getMinorTicksCoords();
    if (s.length)
      for (var l = o.getModel("lineStyle"), u = i * o.get("length"), f = tt(l.getLineStyle(), tt(n.getModel("axisTick").getLineStyle(), {
        stroke: n.get(["axisLine", "lineStyle", "color"])
      })), c = 0; c < s.length; c++)
        for (var h = G9(s[c], r.transform, u, f, "minorticks_" + c), v = 0; v < h.length; v++)
          t.add(h[v]);
  }
}
function lz(e, t, r) {
  if (V9(e)) {
    var n = e.axisLabelsCreationContext, i = n.out.noPxChangeTryDetermine;
    if (r.noPxChange) {
      for (var a = !0, o = 0; o < i.length; o++)
        a = a && i[o]();
      if (a)
        return !1;
    }
    i.length && (t.remove(e.labelGroup), ZP(e, null, null, null));
  }
  return !0;
}
function hse(e, t, r, n, i, a) {
  var o = i.axis, s = Ti(e.raw.axisLabelShow, i.get(["axisLabel", "show"])), l = new rt();
  r.add(l);
  var u = yb(n);
  if (!s || o.scale.isBlank()) {
    ZP(t, [], l, u);
    return;
  }
  var f = i.getModel("axisLabel"), c = o.getViewLabels(u), h = (Ti(e.raw.labelRotate, f.get("rotate")) || 0) * Oc / 180, v = xa.innerTextLayout(e.rotation, h, e.labelDirection), d = i.getCategories && i.getCategories(!0), g = [], y = i.get("triggerEvent"), x = 1 / 0, S = -1 / 0;
  F(c, function(C, A) {
    var M, E = o.scale.type === "ordinal" ? o.scale.getRawOrdinalNumber(C.tickValue) : C.tickValue, P = C.formattedLabel, R = C.rawLabel, O = f;
    if (d && d[E]) {
      var N = d[E];
      ot(N) && N.textStyle && (O = new It(N.textStyle, f, i.ecModel));
    }
    var G = O.getTextColor() || i.get(["axisLine", "lineStyle", "color"]), z = O.getShallow("align", !0) || v.textAlign, H = et(O.getShallow("alignMinLabel", !0), z), W = et(O.getShallow("alignMaxLabel", !0), z), Z = O.getShallow("verticalAlign", !0) || O.getShallow("baseline", !0) || v.textVerticalAlign, ee = et(O.getShallow("verticalAlignMinLabel", !0), Z), V = et(O.getShallow("verticalAlignMaxLabel", !0), Z), Q = 10 + (((M = C.time) === null || M === void 0 ? void 0 : M.level) || 0);
    x = Math.min(x, Q), S = Math.max(S, Q);
    var q = new Rt({
      // --- transform props start ---
      // All of the transform props MUST not be set here, but should be set in
      // `updateAxisLabelChangableProps`, because they may change in estimation,
      // and need to calculate based on global coord sys by `decomposeTransform`.
      x: 0,
      y: 0,
      rotation: 0,
      // --- transform props end ---
      silent: xa.isLabelSilent(i),
      z2: Q,
      style: gr(O, {
        text: P,
        align: A === 0 ? H : A === c.length - 1 ? W : z,
        verticalAlign: A === 0 ? ee : A === c.length - 1 ? V : Z,
        fill: nt(G) ? G(
          // (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.
          o.type === "category" ? R : o.type === "value" ? E + "" : E,
          A
        ) : G
      })
    });
    q.anid = "label_" + E;
    var X = Im(q);
    if (X.break = C.break, X.tickValue = E, X.layoutRotation = v.rotation, Cf({
      el: q,
      componentModel: i,
      itemName: P,
      formatterParamsExtra: {
        isTruncated: function() {
          return q.isTruncated;
        },
        value: R,
        tickIndex: A
      }
    }), y) {
      var K = xa.makeAxisEventDataBase(i);
      K.targetType = "axisLabel", K.value = R, K.tickIndex = A, C.break && (K.break = {
        // type: labelItem.break.type,
        start: C.break.parsedBreak.vmin,
        end: C.break.parsedBreak.vmax
      }), o.type === "category" && (K.dataIndex = E), pt(q).eventData = K, C.break && pse(i, a, q, C.break);
    }
    g.push(q), l.add(q);
  });
  var T = Ce(g, function(C) {
    return {
      label: C,
      priority: Im(C).break ? C.z2 + (S - x + 1) : C.z2,
      defaultAttr: {
        ignore: C.ignore
      }
    };
  });
  ZP(t, T, l, u);
}
function V9(e) {
  return !!e.labelLayoutList;
}
function ZP(e, t, r, n) {
  e.labelLayoutList = t, e.labelGroup = r, e.axisLabelsCreationContext = n;
}
function vse(e, t, r, n) {
  var i = t.get(["axisLabel", "margin"]);
  F(r, function(a, o) {
    var s = iu(a);
    if (s) {
      var l = s.label, u = Im(l);
      s.suggestIgnore = l.ignore, l.ignore = !1, Z2(Hu, dse), Hu.x = t.axis.dataToCoord(u.tickValue), Hu.y = e.labelOffset + e.labelDirection * i, Hu.rotation = u.layoutRotation, n.add(Hu), Hu.updateTransform(), n.remove(Hu), Hu.decomposeTransform(), Z2(l, Hu), l.markRedraw(), wb(s, !0), iu(s);
    }
  });
}
var Hu = new Mt(), dse = new Mt();
function VO(e) {
  return !!e;
}
function pse(e, t, r, n) {
  r.on("click", function(i) {
    var a = {
      type: UC,
      breaks: [{
        start: n.parsedBreak.breakOption.start,
        end: n.parsedBreak.breakOption.end
      }]
    };
    a[e.axis.dim + "AxisIndex"] = e.componentIndex, t.dispatchAction(a);
  });
}
function gse(e, t, r) {
  var n = En();
  if (n) {
    var i = n.retrieveAxisBreakPairs(r, function(o) {
      return o && Im(o.label).break;
    }, !0), a = e.get(["breakLabelLayout", "moveOverlap"], !0);
    (a === !0 || a === "auto") && F(i, function(o) {
      Fx().adjustBreakLabelPair(e.axis.inverse, t, [iu(r[o[0]]), iu(r[o[1]])]);
    });
  }
}
function Ab(e, t, r) {
  r = r || {};
  var n = t.axis, i = {}, a = n.getAxesOnZeroOf()[0], o = n.position, s = a ? "onZero" : o, l = n.dim, u = [e.x, e.x + e.width, e.y, e.y + e.height], f = {
    left: 0,
    right: 1,
    top: 0,
    bottom: 1,
    onZero: 2
  }, c = t.get("offset") || 0, h = l === "x" ? [u[2] - c, u[3] + c] : [u[0] - c, u[1] + c];
  if (a) {
    var v = a.toGlobalCoord(a.dataToCoord(0));
    h[f.onZero] = Math.max(Math.min(v, h[1]), h[0]);
  }
  i.position = [l === "y" ? h[f[s]] : u[0], l === "x" ? h[f[s]] : u[3]], i.rotation = Math.PI / 2 * (l === "x" ? 0 : 1);
  var d = {
    top: -1,
    bottom: 1,
    left: -1,
    right: 1
  };
  i.labelDirection = i.tickDirection = i.nameDirection = d[o], i.labelOffset = a ? h[f[o]] - h[f.onZero] : 0, t.get(["axisTick", "inside"]) && (i.tickDirection = -i.tickDirection), Ti(r.labelInside, t.get(["axisLabel", "inside"])) && (i.labelDirection = -i.labelDirection);
  var g = t.get(["axisLabel", "rotate"]);
  return i.labelRotate = s === "top" ? -g : g, i.z2 = 1, i;
}
function mse(e) {
  return e.coordinateSystem && e.coordinateSystem.type === "cartesian2d";
}
function uz(e) {
  var t = {
    xAxisModel: null,
    yAxisModel: null
  };
  return F(t, function(r, n) {
    var i = n.replace(/Model$/, ""), a = e.getReferringComponents(i, an).models[0];
    t[n] = a;
  }), t;
}
function yse(e, t, r, n, i, a) {
  for (var o = Ab(e, r), s = !1, l = !1, u = 0; u < t.length; u++)
    IP(t[u].getOtherAxis(r.axis).scale) && (s = l = !0, r.axis.type === "category" && r.axis.onBand && (l = !1));
  return o.axisLineAutoShow = s, o.axisTickAutoShow = l, o.defaultNameMoveOverlap = a, new xa(r, n, o, i);
}
function _se(e, t, r) {
  var n = Ab(t, r);
  e.updateCfg(n);
}
function H9(e, t, r) {
  var n = Sf.prototype, i = n.getTicks.call(r), a = n.getTicks.call(r, {
    expandToNicedExtent: !0
  }), o = i.length - 1, s = n.getInterval.call(r), l = D6(e, t), u = l.extent, f = l.fixMin, c = l.fixMax;
  e.type === "log" && (u = RP(e.base, u, !0)), e.setBreaksFromOption(P6(t)), e.setExtent(u[0], u[1]), e.calcNiceExtent({
    splitNumber: o,
    fixMin: f,
    fixMax: c
  });
  var h = n.getExtent.call(e);
  f && (u[0] = h[0]), c && (u[1] = h[1]);
  var v = n.getInterval.call(e), d = u[0], g = u[1];
  if (f && c)
    v = (g - d) / o;
  else if (f)
    for (g = u[0] + v * o; g < u[1] && isFinite(g) && isFinite(u[1]); )
      v = xL(v), g = u[0] + v * o;
  else if (c)
    for (d = u[1] - v * o; d > u[0] && isFinite(d) && isFinite(u[0]); )
      v = xL(v), d = u[1] - v * o;
  else {
    var y = e.getTicks().length - 1;
    y > o && (v = xL(v));
    var x = v * o;
    g = Math.ceil(u[1] / v) * v, d = jr(g - x), d < 0 && u[0] >= 0 ? (d = 0, g = jr(x)) : g > 0 && u[1] <= 0 && (g = 0, d = -jr(x));
  }
  var S = (i[0].value - a[0].value) / s, T = (i[o].value - a[o].value) / s;
  n.setExtent.call(e, d + v * S, g + v * T), n.setInterval.call(e, v), (S || T) && n.setNiceExtent.call(e, d + v, g - v);
}
var fz = [
  [3, 1],
  [0, 2]
  // xyIdx 1 => 'y'
], xse = (
  /** @class */
  (function() {
    function e(t, r, n) {
      this.type = "grid", this._coordsMap = {}, this._coordsList = [], this._axesMap = {}, this._axesList = [], this.axisPointerEnabled = !0, this.dimensions = YP, this._initCartesian(t, r, n), this.model = t;
    }
    return e.prototype.getRect = function() {
      return this._rect;
    }, e.prototype.update = function(t, r) {
      var n = this._axesMap;
      this._updateScale(t, this.model);
      function i(o) {
        var s, l = Ht(o), u = l.length;
        if (u) {
          for (var f = [], c = u - 1; c >= 0; c--) {
            var h = +l[c], v = o[h], d = v.model, g = v.scale;
            // Only value and log axis without interval support alignTicks.
            IP(g) && d.get("alignTicks") && d.get("interval") == null ? f.push(v) : (Md(g, d), IP(g) && (s = v));
          }
          f.length && (s || (s = f.pop(), Md(s.scale, s.model)), F(f, function(y) {
            H9(y.scale, y.model, s.scale);
          }));
        }
      }
      i(n.x), i(n.y);
      var a = {};
      F(n.x, function(o) {
        cz(n, "y", o, a);
      }), F(n.y, function(o) {
        cz(n, "x", o, a);
      }), this.resize(this.model, r);
    }, e.prototype.resize = function(t, r, n) {
      var i = Yn(t, r), a = this._rect = Tr(t.getBoxLayoutParams(), i.refContainer), o = this._axesMap, s = this._coordsList, l = t.get("containLabel");
      if ($P(o, a), !n) {
        var u = Tse(a, s, o, l, r), f = void 0;
        if (l)
          qP ? (qP(this._axesList, a), $P(o, a)) : f = dz(a.clone(), "axisLabel", null, a, o, u, i);
        else {
          var c = bse(t, a, i), h = c.outerBoundsRect, v = c.parsedOuterBoundsContain, d = c.outerBoundsClamp;
          h && (f = dz(h, v, d, a, o, u, i));
        }
        U9(a, o, qs.determine, null, f, i);
      }
      F(this._coordsList, function(g) {
        g.calcAffineTransform();
      });
    }, e.prototype.getAxis = function(t, r) {
      var n = this._axesMap[t];
      if (n != null)
        return n[r || 0];
    }, e.prototype.getAxes = function() {
      return this._axesList.slice();
    }, e.prototype.getCartesian = function(t, r) {
      if (t != null && r != null) {
        var n = "x" + t + "y" + r;
        return this._coordsMap[n];
      }
      ot(t) && (r = 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 === r)
          return a[i];
    }, e.prototype.getCartesians = function() {
      return this._coordsList.slice();
    }, e.prototype.convertToPixel = function(t, r, n) {
      var i = this._findConvertTarget(r);
      return i.cartesian ? i.cartesian.dataToPoint(n) : i.axis ? i.axis.toGlobalCoord(i.axis.dataToCoord(n)) : null;
    }, e.prototype.convertFromPixel = function(t, r, n) {
      var i = this._findConvertTarget(r);
      return i.cartesian ? i.cartesian.pointToData(n) : i.axis ? i.axis.coordToData(i.axis.toLocalCoord(n)) : null;
    }, e.prototype._findConvertTarget = function(t) {
      var r = t.seriesModel, n = t.xAxisModel || r && r.getReferringComponents("xAxis", an).models[0], i = t.yAxisModel || r && r.getReferringComponents("yAxis", an).models[0], a = t.gridModel, o = this._coordsList, s, l;
      if (r)
        s = r.coordinateSystem, Tt(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
      };
    }, e.prototype.containPoint = function(t) {
      var r = this._coordsList[0];
      if (r)
        return r.containPoint(t);
    }, e.prototype._initCartesian = function(t, r, n) {
      var i = this, a = this, o = {
        left: !1,
        right: !1,
        top: !1,
        bottom: !1
      }, s = {
        x: {},
        y: {}
      }, l = {
        x: 0,
        y: 0
      };
      if (r.eachComponent("xAxis", u("x"), this), r.eachComponent("yAxis", u("y"), this), !l.x || !l.y) {
        this._axesMap = {}, this._axesList = [];
        return;
      }
      this._axesMap = s, F(s.x, function(f, c) {
        F(s.y, function(h, v) {
          var d = "x" + c + "y" + v, g = new Koe(d);
          g.master = i, g.model = t, i._coordsMap[d] = g, i._coordsList.push(g), g.addAxis(f), g.addAxis(h);
        });
      });
      function u(f) {
        return function(c, h) {
          if (kL(c, t)) {
            var v = c.get("position");
            f === "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 I9(f, Ox(c), [0, 0], c.get("type"), v), g = d.type === "category";
            d.onBand = g && c.get("boundaryGap"), d.inverse = c.get("inverse"), c.axis = d, d.model = c, d.grid = a, d.index = h, a._axesList.push(d), s[f][h] = d, l[f]++;
          }
        };
      }
    }, e.prototype._updateScale = function(t, r) {
      F(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 (mse(i)) {
          var a = uz(i), o = a.xAxisModel, s = a.yAxisModel;
          if (!kL(o, r) || !kL(s, r))
            return;
          var l = this.getCartesian(o.componentIndex, s.componentIndex), u = i.getData(), f = l.getAxis("x"), c = l.getAxis("y");
          n(u, f), n(u, c);
        }
      }, this);
      function n(i, a) {
        F(mb(i, a.dim), function(o) {
          a.scale.unionExtentFromData(i, o);
        });
      }
    }, e.prototype.getTooltipAxes = function(t) {
      var r = [], n = [];
      return F(this.getCartesians(), function(i) {
        var a = t != null && t !== "auto" ? i.getAxis(t) : i.getBaseAxis(), o = i.getOtherAxis(a);
        Tt(r, a) < 0 && r.push(a), Tt(n, o) < 0 && n.push(o);
      }), {
        baseAxes: r,
        otherAxes: n
      };
    }, e.create = function(t, r) {
      var n = [];
      return t.eachComponent("grid", function(i, a) {
        var o = new e(i, t, r);
        o.name = "grid_" + a, o.resize(i, r, !0), i.coordinateSystem = o, n.push(o);
      }), t.eachSeries(function(i) {
        Ex({
          targetModel: i,
          coordSysType: "cartesian2d",
          coordSysProvider: a
        });
        function a() {
          var o = uz(i), s = o.xAxisModel, l = o.yAxisModel, u = s.getCoordSysModel(), f = u.coordinateSystem;
          return f.getCartesian(s.componentIndex, l.componentIndex);
        }
      }), n;
    }, e.dimensions = YP, e;
  })()
);
function kL(e, t) {
  return e.getCoordSysModel() === t;
}
function cz(e, t, r, n) {
  r.getAxesOnZeroOf = function() {
    return a ? [a] : [];
  };
  var i = e[t], a, o = r.model, s = o.get(["axisLine", "onZero"]), l = o.get(["axisLine", "onZeroAxisIndex"]);
  if (!s)
    return;
  if (l != null)
    hz(i[l]) && (a = i[l]);
  else
    for (var u in i)
      if (i.hasOwnProperty(u) && hz(i[u]) && !n[f(i[u])]) {
        a = i[u];
        break;
      }
  a && (n[f(a)] = !0);
  function f(c) {
    return c.dim + "_" + c.index;
  }
}
function hz(e) {
  return e && e.type !== "category" && e.type !== "time" && wie(e);
}
function Sse(e, t) {
  var r = e.getExtent(), n = r[0] + r[1];
  e.toGlobalCoord = e.dim === "x" ? function(i) {
    return i + t;
  } : function(i) {
    return n - i + t;
  }, e.toLocalCoord = e.dim === "x" ? function(i) {
    return i - t;
  } : function(i) {
    return n - i + t;
  };
}
function $P(e, t) {
  F(e.x, function(r) {
    return vz(r, t.x, t.width);
  }), F(e.y, function(r) {
    return vz(r, t.y, t.height);
  });
}
function vz(e, t, r) {
  var n = [0, r], i = e.inverse ? 1 : 0;
  e.setExtent(n[i], n[1 - i]), Sse(e, t);
}
var qP;
function wse(e) {
  qP = e;
}
function dz(e, t, r, n, i, a, o) {
  U9(n, i, qs.estimate, t, !1, o);
  var s = [0, 0, 0, 0];
  u(0), u(1), f(n, 0, NaN), f(n, 1, NaN);
  var l = eh(s, function(h) {
    return h > 0;
  }) == null;
  return bd(n, s, !0, !0, r), $P(i, n), l;
  function u(h) {
    F(i[_t[h]], function(v) {
      if (Z1(v.model)) {
        var d = a.ensureRecord(v.model), g = d.labelInfoList;
        if (g)
          for (var y = 0; y < g.length; y++) {
            var x = g[y], S = v.scale.normalize(Im(x.label).tickValue);
            S = h === 1 ? 1 - S : S, f(x.rect, h, S), f(x.rect, 1 - h, NaN);
          }
        var T = d.nameLayout;
        if (T) {
          var S = Dm(d.nameLocation) ? 0.5 : NaN;
          f(T.rect, h, S), f(T.rect, 1 - h, NaN);
        }
      }
    });
  }
  function f(h, v, d) {
    var g = e[_t[v]] - h[_t[v]], y = h[In[v]] + h[_t[v]] - (e[In[v]] + e[_t[v]]);
    g = c(g, 1 - d), y = c(y, d);
    var x = fz[v][0], S = fz[v][1];
    s[x] = Sn(s[x], g), s[S] = Sn(s[S], y);
  }
  function c(h, v) {
    return h > 0 && !Gi(v) && v > 1e-4 && (h /= v), h;
  }
}
function Tse(e, t, r, n, i) {
  var a = new k9(Cse);
  return F(r, function(o) {
    return F(o, function(s) {
      if (Z1(s.model)) {
        var l = !n;
        s.axisBuilder = yse(e, t, s.model, i, a, l);
      }
    });
  }), a;
}
function U9(e, t, r, n, i, a) {
  var o = r === qs.determine;
  F(t, function(u) {
    return F(u, function(f) {
      Z1(f.model) && (_se(f.axisBuilder, e, f.model), f.axisBuilder.build(o ? {
        axisTickLabelDetermine: !0
      } : {
        axisTickLabelEstimate: !0
      }, {
        noPxChange: i
      }));
    });
  });
  var s = {
    x: 0,
    y: 0
  };
  l(0), l(1);
  function l(u) {
    s[_t[1 - u]] = e[In[u]] <= a.refContainer[In[u]] * 0.5 ? 0 : 1 - u === 1 ? 2 : 1;
  }
  F(t, function(u, f) {
    return F(u, function(c) {
      Z1(c.model) && ((n === "all" || o) && c.axisBuilder.build({
        axisName: !0
      }, {
        nameMarginLevel: s[f]
      }), o && c.axisBuilder.build({
        axisLine: !0
      }));
    });
  });
}
function bse(e, t, r) {
  var n, i = e.get("outerBoundsMode", !0);
  i === "same" ? n = t.clone() : (i == null || i === "auto") && (n = Tr(e.get("outerBounds", !0) || D9, r.refContainer));
  var a = e.get("outerBoundsContain", !0), o;
  a == null || a === "auto" || Tt(["all", "axisLabel"], a) < 0 ? o = "all" : o = a;
  var s = [j2(et(e.get("outerBoundsClampWidth", !0), Cb[0]), t.width), j2(et(e.get("outerBoundsClampHeight", !0), Cb[1]), t.height)];
  return {
    outerBoundsRect: n,
    parsedOuterBoundsContain: o,
    outerBoundsClamp: s
  };
}
var Cse = function(e, t, r, n, i, a) {
  var o = r.axis.dim === "x" ? "y" : "x";
  B9(e, t, r, n, i, a), Dm(e.nameLocation) || F(t.recordMap[o], function(s) {
    s && s.labelInfoList && s.dirVec && F9(s.labelInfoList, s.dirVec, n, i);
  });
};
function Ase(e, t) {
  var r = {
    /**
     * 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 Mse(r, e, t), r.seriesInvolved && Dse(r, e), r;
}
function Mse(e, t, r) {
  var n = t.getComponent("tooltip"), i = t.getComponent("axisPointer"), a = i.get("link", !0) || [], o = [];
  F(r.getCoordinateSystems(), function(s) {
    if (!s.axisPointerEnabled)
      return;
    var l = Q1(s.model), u = e.coordSysAxesInfo[l] = {};
    e.coordSysMap[l] = s;
    var f = s.model, c = f.getModel("tooltip", n);
    if (F(s.getAxes(), St(g, !1, null)), s.getTooltipAxes && n && c.get("show")) {
      var h = c.get("trigger") === "axis", v = c.get(["axisPointer", "type"]) === "cross", d = s.getTooltipAxes(c.get(["axisPointer", "axis"]));
      (h || v) && F(d.baseAxes, St(g, v ? "cross" : !0, h)), v && F(d.otherAxes, St(g, "cross", !1));
    }
    function g(y, x, S) {
      var T = S.model.getModel("axisPointer", i), C = T.get("show");
      if (!(!C || C === "auto" && !y && !jP(T))) {
        x == null && (x = T.get("triggerTooltip")), T = y ? Lse(S, c, i, t, y, x) : T;
        var A = T.get("snap"), M = T.get("triggerEmphasis"), E = Q1(S.model), P = x || A || S.type === "category", R = e.axesInfo[E] = {
          key: E,
          axis: S,
          coordSys: s,
          axisPointerModel: T,
          triggerTooltip: x,
          triggerEmphasis: M,
          involveSeries: P,
          snap: A,
          useHandle: jP(T),
          seriesModels: [],
          linkGroup: null
        };
        u[E] = R, e.seriesInvolved = e.seriesInvolved || P;
        var O = Ese(a, S);
        if (O != null) {
          var N = o[O] || (o[O] = {
            axesInfo: {}
          });
          N.axesInfo[E] = R, N.mapper = a[O].mapper, R.linkGroup = N;
        }
      }
    }
  });
}
function Lse(e, t, r, n, i, a) {
  var o = t.getModel("axisPointer"), s = ["type", "snap", "lineStyle", "shadowStyle", "label", "animation", "animationDurationUpdate", "animationEasingUpdate", "z"], l = {};
  F(s, function(h) {
    l[h] = it(o.get(h));
  }), l.snap = e.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 f = o.get(["label", "show"]);
    if (u.show = f ?? !0, !a) {
      var c = l.lineStyle = o.get("crossStyle");
      c && tt(u, c.textStyle);
    }
  }
  return e.model.getModel("axisPointer", new It(l, r, n));
}
function Dse(e, t) {
  t.eachSeries(function(r) {
    var n = r.coordinateSystem, i = r.get(["tooltip", "trigger"], !0), a = r.get(["tooltip", "show"], !0);
    !n || !n.model || i === "none" || i === !1 || i === "item" || a === !1 || r.get(["axisPointer", "show"], !0) === !1 || F(e.coordSysAxesInfo[Q1(n.model)], function(o) {
      var s = o.axis;
      n.getAxis(s.dim) === s && (o.seriesModels.push(r), o.seriesDataCount == null && (o.seriesDataCount = 0), o.seriesDataCount += r.getData().count());
    });
  });
}
function Ese(e, t) {
  for (var r = t.model, n = t.dim, i = 0; i < e.length; i++) {
    var a = e[i] || {};
    if (BL(a[n + "AxisId"], r.id) || BL(a[n + "AxisIndex"], r.componentIndex) || BL(a[n + "AxisName"], r.name))
      return i;
  }
}
function BL(e, t) {
  return e === "all" || Se(e) && Tt(e, t) >= 0 || e === t;
}
function Pse(e) {
  var t = HO(e);
  if (t) {
    var r = t.axisPointerModel, n = t.axis.scale, i = r.option, a = r.get("status"), o = r.get("value");
    o != null && (o = n.parse(o));
    var s = jP(r);
    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 HO(e) {
  var t = (e.ecModel.getComponent("axisPointer") || {}).coordSysAxesInfo;
  return t && t.axesInfo[Q1(e)];
}
function Ise(e) {
  var t = HO(e);
  return t && t.axisPointerModel;
}
function jP(e) {
  return !!e.get(["handle", "show"]);
}
function Q1(e) {
  return e.type + "||" + e.id;
}
var pz = {}, Gd = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.render = function(r, n, i, a) {
      this.axisPointerClass && Pse(r), e.prototype.render.apply(this, arguments), this._doUpdateAxisPointerClass(r, i, !0);
    }, t.prototype.updateAxisPointer = function(r, n, i, a) {
      this._doUpdateAxisPointerClass(r, i, !1);
    }, t.prototype.remove = function(r, n) {
      var i = this._axisPointer;
      i && i.remove(n);
    }, t.prototype.dispose = function(r, n) {
      this._disposeAxisPointer(n), e.prototype.dispose.apply(this, arguments);
    }, t.prototype._doUpdateAxisPointerClass = function(r, n, i) {
      var a = t.getAxisPointerClass(this.axisPointerClass);
      if (a) {
        var o = Ise(r);
        o ? (this._axisPointer || (this._axisPointer = new a())).render(r, o, n, i) : this._disposeAxisPointer(n);
      }
    }, t.prototype._disposeAxisPointer = function(r) {
      this._axisPointer && this._axisPointer.dispose(r), this._axisPointer = null;
    }, t.registerAxisPointerClass = function(r, n) {
      pz[r] = n;
    }, t.getAxisPointerClass = function(r) {
      return r && pz[r];
    }, t.type = "axis", t;
  })(fr)
), KP = Bt();
function W9(e, t, r, n) {
  var i = r.axis;
  if (!i.scale.isBlank()) {
    var a = r.getModel("splitArea"), o = a.getModel("areaStyle"), s = o.get("color"), l = n.coordinateSystem.getRect(), u = i.getTicksCoords({
      tickModel: a,
      clamp: !0,
      breakTicks: "none",
      pruneByBreak: "preserve_extent_bound"
    });
    if (u.length) {
      var f = s.length, c = KP(e).splitAreaColors, h = Je(), v = 0;
      if (c)
        for (var d = 0; d < u.length; d++) {
          var g = c.get(u[d].tickValue);
          if (g != null) {
            v = (g + (f - 1) * d) % f;
            break;
          }
        }
      var y = i.toGlobalCoord(u[0].coord), x = o.getAreaStyle();
      s = Se(s) ? s : [s];
      for (var d = 1; d < u.length; d++) {
        var S = i.toGlobalCoord(u[d].coord), T = void 0, C = void 0, A = void 0, M = void 0;
        i.isHorizontal() ? (T = y, C = l.y, A = S - T, M = l.height, y = T + A) : (T = l.x, C = y, A = l.width, M = S - C, y = C + M);
        var E = u[d - 1].tickValue;
        E != null && h.set(E, v), t.add(new Mt({
          anid: E != null ? "area_" + E : null,
          shape: {
            x: T,
            y: C,
            width: A,
            height: M
          },
          style: tt({
            fill: s[v]
          }, x),
          autoBatch: !0,
          silent: !0
        })), v = (v + 1) % f;
      }
      KP(e).splitAreaColors = h;
    }
  }
}
function X9(e) {
  KP(e).splitAreaColors = null;
}
var Rse = ["splitArea", "splitLine", "minorSplitLine", "breakArea"], Y9 = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.axisPointerClass = "CartesianAxisPointer", r;
    }
    return t.prototype.render = function(r, n, i, a) {
      this.group.removeAll();
      var o = this._axisGroup;
      if (this._axisGroup = new rt(), this.group.add(this._axisGroup), !!Z1(r)) {
        this._axisGroup.add(r.axis.axisBuilder.group), F(Rse, function(l) {
          r.get([l, "show"]) && Ose[l](this, this._axisGroup, r, r.getCoordSysModel(), i);
        }, this);
        var s = a && a.type === "changeAxisOrder" && a.isInitSort;
        s || Lx(o, this._axisGroup, r), e.prototype.render.call(this, r, n, i, a);
      }
    }, t.prototype.remove = function() {
      X9(this);
    }, t.type = "cartesianAxis", t;
  })(Gd)
), Ose = {
  splitLine: function(e, t, r, n, i) {
    var a = r.axis;
    if (!a.scale.isBlank()) {
      var o = r.getModel("splitLine"), s = o.getModel("lineStyle"), l = s.get("color"), u = o.get("showMinLine") !== !1, f = o.get("showMaxLine") !== !1;
      l = Se(l) ? l : [l];
      for (var c = n.coordinateSystem.getRect(), h = a.isHorizontal(), v = 0, d = a.getTicksCoords({
        tickModel: o,
        breakTicks: "none",
        pruneByBreak: "preserve_extent_bound"
      }), g = [], y = [], x = s.getLineStyle(), S = 0; S < d.length; S++) {
        var T = a.toGlobalCoord(d[S].coord);
        if (!(S === 0 && !u || S === d.length - 1 && !f)) {
          var C = d[S].tickValue;
          h ? (g[0] = T, g[1] = c.y, y[0] = T, y[1] = c.y + c.height) : (g[0] = c.x, g[1] = T, y[0] = c.x + c.width, y[1] = T);
          var A = v++ % l.length, M = new wn({
            anid: C != null ? "line_" + C : null,
            autoBatch: !0,
            shape: {
              x1: g[0],
              y1: g[1],
              x2: y[0],
              y2: y[1]
            },
            style: tt({
              stroke: l[A]
            }, x),
            silent: !0
          });
          bm(M.shape, x.lineWidth), t.add(M);
        }
      }
    }
  },
  minorSplitLine: function(e, t, r, n, i) {
    var a = r.axis, o = r.getModel("minorSplitLine"), s = o.getModel("lineStyle"), l = n.coordinateSystem.getRect(), u = a.isHorizontal(), f = a.getMinorTicksCoords();
    if (f.length)
      for (var c = [], h = [], v = s.getLineStyle(), d = 0; d < f.length; d++)
        for (var g = 0; g < f[d].length; g++) {
          var y = a.toGlobalCoord(f[d][g].coord);
          u ? (c[0] = y, c[1] = l.y, h[0] = y, h[1] = l.y + l.height) : (c[0] = l.x, c[1] = y, h[0] = l.x + l.width, h[1] = y);
          var x = new wn({
            anid: "minor_line_" + f[d][g].tickValue,
            autoBatch: !0,
            shape: {
              x1: c[0],
              y1: c[1],
              x2: h[0],
              y2: h[1]
            },
            style: v,
            silent: !0
          });
          bm(x.shape, v.lineWidth), t.add(x);
        }
  },
  splitArea: function(e, t, r, n, i) {
    W9(e, t, r, n);
  },
  breakArea: function(e, t, r, n, i) {
    var a = Fx(), o = r.axis.scale;
    a && o.type !== "ordinal" && a.rectCoordBuildBreakAxis(t, e, r, n.coordinateSystem.getRect(), i);
  }
}, Z9 = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.type = "xAxis", t;
  })(Y9)
), Nse = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = Z9.type, r;
    }
    return t.type = "yAxis", t;
  })(Y9)
), kse = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = "grid", r;
    }
    return t.prototype.render = function(r, n) {
      this.group.removeAll(), r.get("show") && this.group.add(new Mt({
        shape: r.coordinateSystem.getRect(),
        style: tt({
          fill: r.get("backgroundColor")
        }, r.getItemStyle()),
        silent: !0,
        z2: -1
      }));
    }, t.type = "grid", t;
  })(fr)
), gz = {
  // gridIndex: 0,
  // gridId: '',
  offset: 0
};
function $9(e) {
  e.registerComponentView(kse), e.registerComponentModel(Xoe), e.registerCoordinateSystem("cartesian2d", xse), Pm(e, "x", WP, gz), Pm(e, "y", WP, gz), e.registerComponentView(Z9), e.registerComponentView(Nse), e.registerPreprocessor(function(t) {
    t.xAxis && t.yAxis && !t.grid && (t.grid = {});
  });
}
function Bse(e, t) {
  var r = e.coordinateSystem, n = r && r.type, i = r && r.getBaseAxis && r.getBaseAxis(), a = i && i.scale && i.scale.type, o = n === "cartesian2d" && a === "ordinal" || n === "single", s = t.model.get("jitter") > 0;
  return o && s;
}
var zse = Bt();
function mz(e, t, r, n) {
  if (e instanceof I9) {
    var i = e.scale.type;
    if (i !== "category" && i !== "ordinal")
      return r;
  }
  var a = e.model, o = a.get("jitter"), s = a.get("jitterOverlap"), l = a.get("jitterMargin") || 0, u = e.scale.type === "ordinal" ? e.getBandWidth() : null;
  return o > 0 ? s ? q9(r, o, u, n) : Fse(e, t, r, n, o, l) : r;
}
function q9(e, t, r, n) {
  if (r === null)
    return e + (Math.random() - 0.5) * t;
  var i = r - n * 2, a = Math.min(Math.max(0, t), i);
  return e + (Math.random() - 0.5) * a;
}
function Fse(e, t, r, n, i, a) {
  var o = zse(e);
  o.items || (o.items = []);
  var s = o.items, l = yz(s, t, r, n, i, a, 1), u = yz(s, t, r, n, i, a, -1), f = Math.abs(l - r) < Math.abs(u - r) ? l : u, c = e.scale.type === "ordinal" ? e.getBandWidth() : null, h = Math.abs(f - r);
  return h > i / 2 || c && h > c / 2 - n ? q9(r, i, c, n) : (s.push({
    fixedCoord: t,
    floatCoord: f,
    r: n
  }), f);
}
function yz(e, t, r, n, i, a, o) {
  for (var s = r, l = 0; l < e.length; l++) {
    var u = e[l], f = t - u.fixedCoord, c = s - u.floatCoord, h = f * f + c * c, v = n + u.r + a;
    if (h < v * v) {
      var d = u.floatCoord + Math.sqrt(v * v - f * f) * o;
      if (Math.abs(d - r) > i / 2)
        return Number.MAX_VALUE;
      if (o === 1 && d > s || o === -1 && d < s) {
        s = d, l = -1;
        continue;
      }
    }
  }
  return s;
}
function Gse(e) {
  e.eachSeriesByType("scatter", function(t) {
    var r = t.coordinateSystem;
    if (r && (r.type === "cartesian2d" || r.type === "single")) {
      var n = r.getBaseAxis ? r.getBaseAxis() : null, i = n && Bse(t, n);
      if (i) {
        var a = t.getData();
        a.each(function(o) {
          var s = n.dim, l = n.orient, u = l === "horizontal" && n.type !== "category" || l === "vertical" && n.type === "category", f = a.getItemLayout(o), c = a.getItemVisual(o, "symbolSize"), h = c instanceof Array ? (c[1] + c[0]) / 2 : c;
          if (s === "y" || s === "single" && u) {
            var v = mz(n, f[0], f[1], h / 2);
            a.setItemLayout(o, [f[0], v]);
          } else if (s === "x" || s === "single" && !u) {
            var v = mz(n, f[1], f[0], h / 2);
            a.setItemLayout(o, [v, f[1]]);
          }
        });
      }
    }
  });
}
function Vse(e) {
  ft($9), e.registerSeriesModel(Goe), e.registerChartView(Woe), e.registerLayout(zx("scatter"));
}
function Hse(e) {
  e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT, Gse);
}
function Use(e) {
  e.eachSeriesByType("radar", function(t) {
    var r = t.getData(), n = [], i = t.coordinateSystem;
    if (i) {
      var a = i.getIndicatorAxes();
      F(a, function(o, s) {
        r.each(r.mapDimension(a[s].dim), function(l, u) {
          n[u] = n[u] || [];
          var f = i.dataToPoint(l, s);
          n[u][s] = _z(f) ? f : xz(i);
        });
      }), r.each(function(o) {
        var s = eh(n[o], function(l) {
          return _z(l);
        }) || xz(i);
        n[o].push(s.slice()), r.setItemLayout(o, n[o]);
      });
    }
  });
}
function _z(e) {
  return !isNaN(e[0]) && !isNaN(e[1]);
}
function xz(e) {
  return [e.cx, e.cy];
}
function Wse(e) {
  var t = e.polar;
  if (t) {
    Se(t) || (t = [t]);
    var r = [];
    F(t, function(n, i) {
      n.indicator ? (n.type && !n.shape && (n.shape = n.type), e.radar = e.radar || [], Se(e.radar) || (e.radar = [e.radar]), e.radar.push(n)) : r.push(n);
    }), e.polar = r;
  }
  F(e.series, function(n) {
    n && n.type === "radar" && n.polarIndex && (n.radarIndex = n.polarIndex);
  });
}
var Xse = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.render = function(r, n, i) {
      var a = r.coordinateSystem, o = this.group, s = r.getData(), l = this._data;
      function u(h, v) {
        var d = h.getItemVisual(v, "symbol") || "circle";
        if (d !== "none") {
          var g = oy(h.getItemVisual(v, "symbolSize")), y = en(d, -1, -1, 2, 2), x = h.getItemVisual(v, "symbolRotate") || 0;
          return y.attr({
            style: {
              strokeNoScale: !0
            },
            z2: 100,
            scaleX: g[0] / 2,
            scaleY: g[1] / 2,
            rotation: x * Math.PI / 180 || 0
          }), y;
        }
      }
      function f(h, v, d, g, y, x) {
        d.removeAll();
        for (var S = 0; S < v.length - 1; S++) {
          var T = u(g, y);
          T && (T.__dimIdx = S, h[S] ? (T.setPosition(h[S]), kd[x ? "initProps" : "updateProps"](T, {
            x: v[S][0],
            y: v[S][1]
          }, r, y)) : T.setPosition(v[S]), d.add(T));
        }
      }
      function c(h) {
        return Ce(h, function(v) {
          return [a.cx, a.cy];
        });
      }
      s.diff(l).add(function(h) {
        var v = s.getItemLayout(h);
        if (v) {
          var d = new Wi(), g = new Ci(), y = {
            shape: {
              points: v
            }
          };
          d.shape.points = c(v), g.shape.points = c(v), Ir(d, y, r, h), Ir(g, y, r, h);
          var x = new rt(), S = new rt();
          x.add(g), x.add(d), x.add(S), f(g.shape.points, v, S, s, h, !0), s.setItemGraphicEl(h, x);
        }
      }).update(function(h, v) {
        var d = l.getItemGraphicEl(v), g = d.childAt(0), y = d.childAt(1), x = d.childAt(2), S = {
          shape: {
            points: s.getItemLayout(h)
          }
        };
        S.shape.points && (f(g.shape.points, S.shape.points, x, s, h, !1), vs(y), vs(g), Wt(g, S, r), Wt(y, S, r), s.setItemGraphicEl(h, d));
      }).remove(function(h) {
        o.remove(l.getItemGraphicEl(h));
      }).execute(), s.eachItemGraphicEl(function(h, v) {
        var d = s.getItemModel(v), g = h.childAt(0), y = h.childAt(1), x = h.childAt(2), S = s.getItemVisual(v, "style"), T = S.fill;
        o.add(h), g.useStyle(tt(d.getModel("lineStyle").getLineStyle(), {
          fill: "none",
          stroke: T
        })), Un(g, d, "lineStyle"), Un(y, d, "areaStyle");
        var C = d.getModel("areaStyle"), A = C.isEmpty() && C.parentModel.isEmpty();
        y.ignore = A, F(["emphasis", "select", "blur"], function(E) {
          var P = d.getModel([E, "areaStyle"]), R = P.isEmpty() && P.parentModel.isEmpty();
          y.ensureState(E).ignore = R && A;
          var O = d.getModel([E, "lineStyle"]).getLineStyle();
          g.ensureState(E).style = O;
          var N = P.getAreaStyle();
          y.ensureState(E).style = N;
          var G = d.getModel([E, "itemStyle"]).getItemStyle();
          x.eachChild(function(z) {
            z.ensureState(E).style = it(G);
          });
        }), y.useStyle(tt(d.getModel("areaStyle").getAreaStyle(), {
          fill: T,
          opacity: 0.7,
          decal: S.decal
        }));
        var M = d.getModel("emphasis");
        x.eachChild(function(E) {
          if (E instanceof Xn) {
            var P = E.style;
            E.useStyle(xe({
              // TODO other properties like x, y ?
              image: P.image,
              x: P.x,
              y: P.y,
              width: P.width,
              height: P.height
            }, S));
          } else
            E.useStyle(S), E.setColor(T), E.style.strokeNoScale = !0;
          var R = s.getStore().get(s.getDimensionIndex(E.__dimIdx), v);
          (R == null || isNaN(R)) && (R = ""), si(E, Wn(d), {
            labelFetcher: s.hostModel,
            labelDataIndex: v,
            labelDimIndex: E.__dimIdx,
            defaultText: R,
            inheritColor: T,
            defaultOpacity: S.opacity
          });
        }), Hr(h, M.get("focus"), M.get("blurScope"), M.get("disabled"));
      }), this._data = s;
    }, t.prototype.remove = function() {
      this.group.removeAll(), this._data = null;
    }, t.type = "radar", t;
  })(Ut)
), Yse = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.hasSymbolVisual = !0, r;
    }
    return t.prototype.init = function(r) {
      e.prototype.init.apply(this, arguments), this.legendVisualProvider = new hy(Ge(this.getData, this), Ge(this.getRawData, this));
    }, t.prototype.getInitialData = function(r, n) {
      return cy(this, {
        generateCoord: "indicator_",
        generateCoordCount: 1 / 0
      });
    }, t.prototype.formatTooltip = function(r, n, i) {
      var a = this.getData(), o = this.coordinateSystem, s = o.getIndicatorAxes(), l = this.getData().getName(r), u = l === "" ? this.name : l, f = D8(this, r);
      return Rn("section", {
        header: u,
        sortBlocks: !0,
        blocks: Ce(s, function(c) {
          var h = a.get(a.mapDimension(c.dim), r);
          return Rn("nameValue", {
            markerType: "subItem",
            markerColor: f,
            name: c.name,
            value: h,
            sortParam: h
          });
        })
      });
    }, t.prototype.getTooltipPosition = function(r) {
      if (r != null) {
        for (var n = this.getData(), i = this.coordinateSystem, a = n.getValues(Ce(i.dimensions, function(u) {
          return n.mapDimension(u);
        }), r), 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;
  })(Yt)
), h_ = P9.value;
function yT(e, t) {
  return tt({
    show: t
  }, e);
}
var Zse = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.optionUpdated = function() {
      var r = 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"]), f = this.get(["axisName", "formatter"]), c = this.get("axisNameGap"), h = this.get("triggerEvent"), v = Ce(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 g = l;
        d.color != null && (g = tt({
          color: d.color
        }, l));
        var y = je(it(d), {
          boundaryGap: r,
          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: c,
          // min: 0,
          nameTextStyle: g,
          triggerEvent: h
        }, !1);
        if (Fe(f)) {
          var x = y.name;
          y.name = f.replace("{value}", x ?? "");
        } else nt(f) && (y.name = f(y.name, y));
        var S = new It(y, null, this.ecModel);
        return cn(S, uy.prototype), S.mainType = "radar", S.componentIndex = this.componentIndex, S;
      }, this);
      this._indicatorModels = v;
    }, t.prototype.getIndicatorModels = function() {
      return this._indicatorModels;
    }, t.type = "radar", t.defaultOption = {
      // zlevel: 0,
      z: 0,
      center: ["50%", "50%"],
      radius: "50%",
      startAngle: 90,
      axisName: {
        show: !0,
        color: fe.color.axisLabel
        // formatter: null
        // textStyle: {}
      },
      boundaryGap: [0, 0],
      splitNumber: 5,
      axisNameGap: 15,
      scale: !1,
      // Polygon or circle
      shape: "polygon",
      axisLine: je({
        lineStyle: {
          color: fe.color.neutral20
        }
      }, h_.axisLine),
      axisLabel: yT(h_.axisLabel, !1),
      axisTick: yT(h_.axisTick, !1),
      // axisType: 'value',
      splitLine: yT(h_.splitLine, !0),
      splitArea: yT(h_.splitArea, !0),
      // {text, min, max}
      indicator: []
    }, t;
  })(At)
), $se = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.render = function(r, n, i) {
      var a = this.group;
      a.removeAll(), this._buildAxes(r, i), this._buildSplitLineAndArea(r);
    }, t.prototype._buildAxes = function(r, n) {
      var i = r.coordinateSystem, a = i.getIndicatorAxes(), o = Ce(a, function(s) {
        var l = s.model.get("showName") ? s.name : "", u = new xa(s.model, n, {
          axisName: l,
          position: [i.cx, i.cy],
          rotation: s.angle,
          labelDirection: -1,
          tickDirection: -1,
          nameDirection: 1
        });
        return u;
      });
      F(o, function(s) {
        s.build(), this.group.add(s.group);
      }, this);
    }, t.prototype._buildSplitLineAndArea = function(r) {
      var n = r.coordinateSystem, i = n.getIndicatorAxes();
      if (!i.length)
        return;
      var a = r.get("shape"), o = r.getModel("splitLine"), s = r.getModel("splitArea"), l = o.getModel("lineStyle"), u = s.getModel("areaStyle"), f = o.get("show"), c = s.get("show"), h = l.get("color"), v = u.get("color"), d = Se(h) ? h : [h], g = Se(v) ? v : [v], y = [], x = [];
      function S(W, Z, ee) {
        var V = ee % Z.length;
        return W[V] = W[V] || [], V;
      }
      if (a === "circle")
        for (var T = i[0].getTicksCoords(), C = n.cx, A = n.cy, M = 0; M < T.length; M++) {
          if (f) {
            var E = S(y, d, M);
            y[E].push(new Qs({
              shape: {
                cx: C,
                cy: A,
                r: T[M].coord
              }
            }));
          }
          if (c && M < T.length - 1) {
            var E = S(x, g, M);
            x[E].push(new qm({
              shape: {
                cx: C,
                cy: A,
                r0: T[M].coord,
                r: T[M + 1].coord
              }
            }));
          }
        }
      else
        for (var P, R = Ce(i, function(W, Z) {
          var ee = W.getTicksCoords();
          return P = P == null ? ee.length - 1 : Math.min(ee.length - 1, P), Ce(ee, function(V) {
            return n.coordToPoint(V.coord, Z);
          });
        }), O = [], M = 0; M <= P; M++) {
          for (var N = [], G = 0; G < i.length; G++)
            N.push(R[G][M]);
          if (N[0] && N.push(N[0].slice()), f) {
            var E = S(y, d, M);
            y[E].push(new Ci({
              shape: {
                points: N
              }
            }));
          }
          if (c && O) {
            var E = S(x, g, M - 1);
            x[E].push(new Wi({
              shape: {
                points: N.concat(O)
              }
            }));
          }
          O = N.slice().reverse();
        }
      var z = l.getLineStyle(), H = u.getAreaStyle();
      F(x, function(W, Z) {
        this.group.add(yo(W, {
          style: tt({
            stroke: "none",
            fill: g[Z % g.length]
          }, H),
          silent: !0
        }));
      }, this), F(y, function(W, Z) {
        this.group.add(yo(W, {
          style: tt({
            fill: "none",
            stroke: d[Z % d.length]
          }, z),
          silent: !0
        }));
      }, this);
    }, t.type = "radar", t;
  })(fr)
), qse = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r, n, i) {
      var a = e.call(this, r, n, i) || this;
      return a.type = "value", a.angle = 0, a.name = "", a;
    }
    return t;
  })(ra)
), jse = (
  /** @class */
  (function() {
    function e(t, r, n) {
      this.dimensions = [], this._model = t, this._indicatorAxes = Ce(t.getIndicatorModels(), function(i, a) {
        var o = "indicator_" + a, s = new qse(
          o,
          new Sf()
          // (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 e.prototype.getIndicatorAxes = function() {
      return this._indicatorAxes;
    }, e.prototype.dataToPoint = function(t, r) {
      var n = this._indicatorAxes[r];
      return this.coordToPoint(n.dataToCoord(t), r);
    }, e.prototype.coordToPoint = function(t, r) {
      var n = this._indicatorAxes[r], i = n.angle, a = this.cx + t * Math.cos(i), o = this.cy - t * Math.sin(i);
      return [a, o];
    }, e.prototype.pointToData = function(t) {
      var r = t[0] - this.cx, n = t[1] - this.cy, i = Math.sqrt(r * r + n * n);
      r /= i, n /= i;
      for (var a = Math.atan2(-n, r), o = 1 / 0, s, l = -1, u = 0; u < this._indicatorAxes.length; u++) {
        var f = this._indicatorAxes[u], c = Math.abs(a - f.angle);
        c < o && (s = f, l = u, o = c);
      }
      return [l, +(s && s.coordToData(i))];
    }, e.prototype.resize = function(t, r) {
      var n = Yn(t, r).refContainer, i = t.get("center"), a = Math.min(n.width, n.height) / 2;
      this.cx = Be(i[0], n.width) + n.x, this.cy = Be(i[1], n.height) + n.y, this.startAngle = t.get("startAngle") * Math.PI / 180;
      var o = t.get("radius");
      (Fe(o) || Xt(o)) && (o = [0, o]), this.r0 = Be(o[0], a), this.r = Be(o[1], a), F(this._indicatorAxes, function(s, l) {
        s.setExtent(this.r0, this.r);
        var u = this.startAngle + l * Math.PI * 2 / this._indicatorAxes.length;
        u = Math.atan2(Math.sin(u), Math.cos(u)), s.angle = u;
      }, this);
    }, e.prototype.update = function(t, r) {
      var n = this._indicatorAxes, i = this._model;
      F(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();
          F(n, function(f) {
            f.scale.unionExtentFromData(u, u.mapDimension(f.dim));
          });
        }
      }, this);
      var a = i.get("splitNumber"), o = new Sf();
      o.setExtent(0, a), o.setInterval(1), F(n, function(s, l) {
        H9(s.scale, s.model, o);
      });
    }, e.prototype.convertToPixel = function(t, r, n) {
      return console.warn("Not implemented."), null;
    }, e.prototype.convertFromPixel = function(t, r, n) {
      return console.warn("Not implemented."), null;
    }, e.prototype.containPoint = function(t) {
      return console.warn("Not implemented."), !1;
    }, e.create = function(t, r) {
      var n = [];
      return t.eachComponent("radar", function(i) {
        var a = new e(i, t, r);
        n.push(a), i.coordinateSystem = a;
      }), t.eachSeriesByType("radar", function(i) {
        i.get("coordinateSystem") === "radar" && (i.coordinateSystem = n[i.get("radarIndex") || 0]);
      }), n;
    }, e.dimensions = [], e;
  })()
);
function Kse(e) {
  e.registerCoordinateSystem("radar", jse), e.registerComponentModel(Zse), e.registerComponentView($se), e.registerVisual({
    seriesType: "radar",
    reset: function(t) {
      var r = t.getData();
      r.each(function(n) {
        r.setItemVisual(n, "legendIcon", "roundRect");
      }), r.setVisual("legendIcon", "roundRect");
    }
  });
}
function Qse(e) {
  ft(Kse), e.registerChartView(Xse), e.registerSeriesModel(Yse), e.registerLayout(Use), e.registerProcessor(fy("radar")), e.registerPreprocessor(Wse);
}
var UO = Bt();
function Jse(e, t, r) {
  UO(e)[t] = r;
}
function ele(e, t, r) {
  var n = UO(e), i = n[t];
  i === r && (n[t] = null);
}
function Sz(e, t) {
  return !!UO(e)[t];
}
el({
  type: "takeGlobalCursor",
  event: "globalCursorTaken",
  update: "update"
}, un);
var tle = {
  axisPointer: 1,
  tooltip: 1,
  brush: 1
};
function j9(e, t, r) {
  var n = t.getComponentByElement(e.topTarget);
  if (!n || n === r || tle.hasOwnProperty(n.mainType))
    return !1;
  var i = n.coordinateSystem;
  if (!i || i.model === r)
    return !1;
  var a = Cd(n), o = Cd(r);
  return !((a.zlevel - o.zlevel || a.z - o.z) <= 0);
}
var Vd = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r) {
      var n = e.call(this) || this;
      n._zr = r;
      var i = Ge(n._mousedownHandler, n), a = Ge(n._mousemoveHandler, n), o = Ge(n._mouseupHandler, n), s = Ge(n._mousewheelHandler, n), l = Ge(n._pinchHandler, n);
      return n.enable = function(u, f) {
        var c = f.zInfo, h = Cd(c.component), v = h.z, d = h.zlevel, g = {
          component: c.component,
          z: v,
          zlevel: d,
          // By default roam controller is the lowest z2 comparing to other elememts in a component.
          z2: et(c.z2, -1 / 0)
        }, y = xe({}, f.triggerInfo);
        this._opt = tt(xe({}, f), {
          zoomOnMouseWheel: !0,
          moveOnMouseMove: !0,
          // By default, wheel do not trigger move.
          moveOnMouseWheel: !1,
          preventDefaultMouseMove: !0,
          zInfoParsed: g,
          triggerInfo: y
        }), u == null && (u = !0), (!this._enabled || this._controlType !== u) && (this._enabled = !0, this.disable(), (u === !0 || u === "move" || u === "pan") && (d_(r, "mousedown", i, g), d_(r, "mousemove", a, g), d_(r, "mouseup", o, g)), (u === !0 || u === "scale" || u === "zoom") && (d_(r, "mousewheel", s, g), d_(r, "pinch", l, g)));
      }, n.disable = function() {
        this._enabled = !1, p_(r, "mousedown", i), p_(r, "mousemove", a), p_(r, "mouseup", o), p_(r, "mousewheel", s), p_(r, "pinch", l);
      }, n;
    }
    return t.prototype.isDragging = function() {
      return this._dragging;
    }, t.prototype.isPinching = function() {
      return this._pinching;
    }, t.prototype._checkPointer = function(r, n, i) {
      var a = this._opt, o = a.zInfoParsed;
      if (j9(r, a.api, o.component))
        return !1;
      var s = a.triggerInfo, l = s.roamTrigger, u = !1;
      return l === "global" && (u = !0), u || (u = s.isInSelf(r, n, i)), u && s.isInClip && !s.isInClip(r, n, i) && (u = !1), u;
    }, t.prototype._decideCursorStyle = function(r, n, i, a) {
      var o = r.target;
      if (!o && this._checkPointer(r, n, i))
        return "grab";
      if (a)
        return o && o.cursor || "default";
    }, t.prototype.dispose = function() {
      this.disable();
    }, t.prototype._mousedownHandler = function(r) {
      if (!(H3(r) || v_(r))) {
        for (var n = r.target; n; ) {
          if (n.draggable)
            return;
          n = n.__hostTarget || n.parent;
        }
        var i = r.offsetX, a = r.offsetY;
        this._checkPointer(r, i, a) && (this._x = i, this._y = a, this._dragging = !0);
      }
    }, t.prototype._mousemoveHandler = function(r) {
      var n = this._zr;
      if (!(r.gestureEvent === "pinch" || Sz(n, "globalPan") || v_(r))) {
        var i = r.offsetX, a = r.offsetY;
        if (!this._dragging || !A2("moveOnMouseMove", r, this._opt)) {
          var o = this._decideCursorStyle(r, i, a, !1);
          o && n.setCursorStyle(o);
          return;
        }
        n.setCursorStyle("grabbing");
        var s = this._x, l = this._y, u = i - s, f = a - l;
        this._x = i, this._y = a, this._opt.preventDefaultMouseMove && gf(r.event), r.__ecRoamConsumed = !0, wz(this, "pan", "moveOnMouseMove", r, {
          dx: u,
          dy: f,
          oldX: s,
          oldY: l,
          newX: i,
          newY: a,
          isAvailableBehavior: null
        });
      }
    }, t.prototype._mouseupHandler = function(r) {
      if (!v_(r)) {
        var n = this._zr;
        if (!H3(r)) {
          this._dragging = !1;
          var i = this._decideCursorStyle(r, r.offsetX, r.offsetY, !0);
          i && n.setCursorStyle(i);
        }
      }
    }, t.prototype._mousewheelHandler = function(r) {
      if (!v_(r)) {
        var n = A2("zoomOnMouseWheel", r, this._opt), i = A2("moveOnMouseWheel", r, this._opt), a = r.wheelDelta, o = Math.abs(a), s = r.offsetX, l = r.offsetY;
        if (!(a === 0 || !n && !i)) {
          if (n) {
            var u = o > 3 ? 1.4 : o > 1 ? 1.2 : 1.1, f = a > 0 ? u : 1 / u;
            this._checkTriggerMoveZoom(this, "zoom", "zoomOnMouseWheel", r, {
              scale: f,
              originX: s,
              originY: l,
              isAvailableBehavior: null
            });
          }
          if (i) {
            var c = Math.abs(a), h = (a > 0 ? 1 : -1) * (c > 3 ? 0.4 : c > 1 ? 0.15 : 0.05);
            this._checkTriggerMoveZoom(this, "scrollMove", "moveOnMouseWheel", r, {
              scrollDelta: h,
              originX: s,
              originY: l,
              isAvailableBehavior: null
            });
          }
        }
      }
    }, t.prototype._pinchHandler = function(r) {
      if (!(Sz(this._zr, "globalPan") || v_(r))) {
        var n = r.pinchScale > 1 ? 1.1 : 1 / 1.1;
        this._checkTriggerMoveZoom(this, "zoom", null, r, {
          scale: n,
          originX: r.pinchX,
          originY: r.pinchY,
          isAvailableBehavior: null
        });
      }
    }, t.prototype._checkTriggerMoveZoom = function(r, n, i, a, o) {
      r._checkPointer(a, o.originX, o.originY) && (gf(a.event), a.__ecRoamConsumed = !0, wz(r, n, i, a, o));
    }, t;
  })(ds)
);
function v_(e) {
  return e.__ecRoamConsumed;
}
var rle = Bt();
function WC(e) {
  var t = rle(e);
  return t.roam = t.roam || {}, t.uniform = t.uniform || {}, t;
}
function d_(e, t, r, n) {
  for (var i = WC(e), a = i.roam, o = a[t] = a[t] || [], s = 0; s < o.length; s++) {
    var l = o[s].zInfoParsed;
    if ((l.zlevel - n.zlevel || l.z - n.z || l.z2 - n.z2) <= 0)
      break;
  }
  o.splice(s, 0, {
    listener: r,
    zInfoParsed: n
  }), nle(e, t);
}
function p_(e, t, r) {
  for (var n = WC(e), i = n.roam[t] || [], a = 0; a < i.length; a++)
    if (i[a].listener === r) {
      i.splice(a, 1), i.length || ile(e, t);
      return;
    }
}
function nle(e, t) {
  var r = WC(e);
  r.uniform[t] || e.on(t, r.uniform[t] = function(n) {
    var i = r.roam[t];
    if (i)
      for (var a = 0; a < i.length; a++)
        i[a].listener(n);
  });
}
function ile(e, t) {
  var r = WC(e), n = r.uniform;
  n[t] && (e.off(t, n[t]), n[t] = null);
}
function wz(e, t, r, n, i) {
  i.isAvailableBehavior = Ge(A2, null, r, n), e.trigger(t, i);
}
function A2(e, t, r) {
  var n = r[e];
  return !e || n && (!Fe(n) || t.event[n + "Key"]);
}
function WO(e, t, r) {
  var n = e.target;
  n.x += t, n.y += r, n.dirty();
}
function XO(e, t, r, n) {
  var i = e.target, a = e.zoomLimit, o = e.zoom = e.zoom || 1;
  o *= t, o = YO(o, a);
  var s = o / e.zoom;
  e.zoom = o, Q9(i, r, n, s), i.dirty();
}
function K9(e, t, r, n, i, a) {
  var o = new st(0, 0, 0, 0);
  n.enable(e.get("roam"), {
    api: t,
    zInfo: {
      component: e
    },
    triggerInfo: {
      roamTrigger: e.get("roamTrigger"),
      isInSelf: function(u, f, c) {
        return o.copy(r.getBoundingRect()), o.applyTransform(r.getComputedTransform()), o.contain(f, c);
      },
      isInClip: function(u, f, c) {
        return !a || a.contain(f, c);
      }
    }
  }), i.zoomLimit = e.get("scaleLimit");
  var s = e.coordinateSystem;
  i.zoom = s ? s.getZoom() : 1;
  var l = e.subType + "Roam";
  n.off("pan").off("zoom").on("pan", function(u) {
    WO(i, u.dx, u.dy), t.dispatchAction({
      seriesId: e.id,
      type: l,
      dx: u.dx,
      dy: u.dy
    });
  }).on("zoom", function(u) {
    XO(i, u.scale, u.originX, u.originY), t.dispatchAction({
      seriesId: e.id,
      type: l,
      zoom: u.scale,
      originX: u.originX,
      originY: u.originY
    }), t.updateLabelLayout();
  });
}
function Tz(e, t) {
  return e.pointToProjected ? e.pointToProjected(t) : e.pointToData(t);
}
function XC(e, t, r) {
  var n = e.getZoom(), i = e.getCenter(), a = t.zoom, o = e.projectedToPoint ? e.projectedToPoint(i) : e.dataToPoint(i);
  return t.dx != null && t.dy != null && (o[0] -= t.dx, o[1] -= t.dy, e.setCenter(Tz(e, o))), a != null && (a = YO(n * a, r) / n, Q9(e, t.originX, t.originY, a), e.updateTransform(), e.setCenter(Tz(e, o)), e.setZoom(a * n)), {
    center: e.getCenter(),
    zoom: e.getZoom()
  };
}
function Q9(e, t, r, n) {
  e.x -= (t - e.x) * (n - 1), e.y -= (r - e.y) * (n - 1), e.scaleX *= n, e.scaleY *= n;
}
function YO(e, t) {
  if (t) {
    var r = t.min || 0, n = t.max || 1 / 0;
    e = Math.max(Math.min(n, e), r);
  }
  return e;
}
function J9(e) {
  if (Fe(e)) {
    var t = new DOMParser();
    e = t.parseFromString(e, "text/xml");
  }
  var r = e;
  for (r.nodeType === 9 && (r = r.firstChild); r.nodeName.toLowerCase() !== "svg" || r.nodeType !== 1; )
    r = r.nextSibling;
  return r;
}
var zL, Mb = {
  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"
}, bz = Ht(Mb), Lb = {
  "alignment-baseline": "textBaseline",
  "stop-color": "stopColor"
}, Cz = Ht(Lb), ale = (function() {
  function e() {
    this._defs = {}, this._root = null;
  }
  return e.prototype.parse = function(t, r) {
    r = r || {};
    var n = J9(t);
    this._defsUsePending = [];
    var i = new rt();
    this._root = i;
    var a = [], o = n.getAttribute("viewBox") || "", s = parseFloat(n.getAttribute("width") || r.width), l = parseFloat(n.getAttribute("height") || r.height);
    isNaN(s) && (s = null), isNaN(l) && (l = null), vo(n, i, null, !0, !1);
    for (var u = n.firstChild; u; )
      this._parseNode(u, i, a, null, !1, !1), u = u.nextSibling;
    lle(this._defs, this._defsUsePending), this._defsUsePending = [];
    var f, c;
    if (o) {
      var h = YC(o);
      h.length >= 4 && (f = {
        x: parseFloat(h[0] || 0),
        y: parseFloat(h[1] || 0),
        width: parseFloat(h[2]),
        height: parseFloat(h[3])
      });
    }
    if (f && s != null && l != null && (c = t7(f, { x: 0, y: 0, width: s, height: l }), !r.ignoreViewBox)) {
      var v = i;
      i = new rt(), i.add(v), v.scaleX = v.scaleY = c.scale, v.x = c.x, v.y = c.y;
    }
    return !r.ignoreRootClip && s != null && l != null && i.setClipPath(new Mt({
      shape: { x: 0, y: 0, width: s, height: l }
    })), {
      root: i,
      width: s,
      height: l,
      viewBoxRect: f,
      viewBoxTransform: c,
      named: a
    };
  }, e.prototype._parseNode = function(t, r, 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 = r;
    else {
      if (!a) {
        var f = zL[s];
        if (f && qe(zL, s)) {
          l = f.call(this, t, r);
          var c = t.getAttribute("name");
          if (c) {
            var h = {
              name: c,
              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
          });
          r.add(l);
        }
      }
      var v = Az[s];
      if (v && qe(Az, s)) {
        var d = v.call(this, t), g = t.getAttribute("id");
        g && (this._defs[g] = d);
      }
    }
    if (l && l.isGroup)
      for (var y = t.firstChild; y; )
        y.nodeType === 1 ? this._parseNode(y, l, n, u, a, o) : y.nodeType === 3 && o && this._parseText(y, l), y = y.nextSibling;
  }, e.prototype._parseText = function(t, r) {
    var n = new Tm({
      style: {
        text: t.textContent
      },
      silent: !0,
      x: this._textX || 0,
      y: this._textY || 0
    });
    Yo(r, n), vo(t, n, this._defsUsePending, !1, !1), ole(n, r);
    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, r.add(n), n;
  }, e.internalField = (function() {
    zL = {
      g: function(t, r) {
        var n = new rt();
        return Yo(r, n), vo(t, n, this._defsUsePending, !1, !1), n;
      },
      rect: function(t, r) {
        var n = new Mt();
        return Yo(r, n), vo(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, r) {
        var n = new Qs();
        return Yo(r, n), vo(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, r) {
        var n = new wn();
        return Yo(r, n), vo(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, r) {
        var n = new Ax();
        return Yo(r, n), vo(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, r) {
        var n = t.getAttribute("points"), i;
        n && (i = Dz(n));
        var a = new Wi({
          shape: {
            points: i || []
          },
          silent: !0
        });
        return Yo(r, a), vo(t, a, this._defsUsePending, !1, !1), a;
      },
      polyline: function(t, r) {
        var n = t.getAttribute("points"), i;
        n && (i = Dz(n));
        var a = new Ci({
          shape: {
            points: i || []
          },
          silent: !0
        });
        return Yo(r, a), vo(t, a, this._defsUsePending, !1, !1), a;
      },
      image: function(t, r) {
        var n = new Xn();
        return Yo(r, n), vo(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, r) {
        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 rt();
        return Yo(r, s), vo(t, s, this._defsUsePending, !1, !0), s;
      },
      tspan: function(t, r) {
        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 rt();
        return Yo(r, s), vo(t, s, this._defsUsePending, !1, !0), this._textX += parseFloat(a), this._textY += parseFloat(o), s;
      },
      path: function(t, r) {
        var n = t.getAttribute("d") || "", i = mW(n);
        return Yo(r, i), vo(t, i, this._defsUsePending, !1, !1), i.silent = !0, i;
      }
    };
  })(), e;
})(), Az = {
  lineargradient: function(e) {
    var t = parseInt(e.getAttribute("x1") || "0", 10), r = parseInt(e.getAttribute("y1") || "0", 10), n = parseInt(e.getAttribute("x2") || "10", 10), i = parseInt(e.getAttribute("y2") || "0", 10), a = new Nd(t, r, n, i);
    return Mz(e, a), Lz(e, a), a;
  },
  radialgradient: function(e) {
    var t = parseInt(e.getAttribute("cx") || "0", 10), r = parseInt(e.getAttribute("cy") || "0", 10), n = parseInt(e.getAttribute("r") || "0", 10), i = new ER(t, r, n);
    return Mz(e, i), Lz(e, i), i;
  }
};
function Mz(e, t) {
  var r = e.getAttribute("gradientUnits");
  r === "userSpaceOnUse" && (t.global = !0);
}
function Lz(e, t) {
  for (var r = e.firstChild; r; ) {
    if (r.nodeType === 1 && r.nodeName.toLocaleLowerCase() === "stop") {
      var n = r.getAttribute("offset"), i = void 0;
      n && n.indexOf("%") > 0 ? i = parseInt(n, 10) / 100 : n ? i = parseFloat(n) : i = 0;
      var a = {};
      e7(r, a, a);
      var o = a.stopColor || r.getAttribute("stop-color") || "#000000", s = a.stopOpacity || r.getAttribute("stop-opacity");
      if (s) {
        var l = bi(o), u = l && l[3];
        u && (l[3] *= lf(s), o = os(l, "rgba"));
      }
      t.colorStops.push({
        offset: i,
        color: o
      });
    }
    r = r.nextSibling;
  }
}
function Yo(e, t) {
  e && e.__inheritedStyle && (t.__inheritedStyle || (t.__inheritedStyle = {}), tt(t.__inheritedStyle, e.__inheritedStyle));
}
function Dz(e) {
  for (var t = YC(e), r = [], n = 0; n < t.length; n += 2) {
    var i = parseFloat(t[n]), a = parseFloat(t[n + 1]);
    r.push([i, a]);
  }
  return r;
}
function vo(e, t, r, n, i) {
  var a = t, o = a.__inheritedStyle = a.__inheritedStyle || {}, s = {};
  e.nodeType === 1 && (cle(e, t), e7(e, o, s), n || hle(e, o, s)), a.style = a.style || {}, o.fill != null && (a.style.fill = Ez(a, "fill", o.fill, r)), o.stroke != null && (a.style.stroke = Ez(a, "stroke", o.stroke, r)), F([
    "lineWidth",
    "opacity",
    "fillOpacity",
    "strokeOpacity",
    "miterLimit",
    "fontSize"
  ], function(l) {
    o[l] != null && (a.style[l] = parseFloat(o[l]));
  }), F([
    "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 = Ce(YC(o.lineDash), function(l) {
    return parseFloat(l);
  })), (o.visibility === "hidden" || o.visibility === "collapse") && (a.invisible = !0), o.display === "none" && (a.ignore = !0);
}
function ole(e, t) {
  var r = t.__selfStyle;
  if (r) {
    var n = r.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"), e.style.textBaseline = i;
  }
  var a = t.__inheritedStyle;
  if (a) {
    var o = a.textAlign, s = o;
    o && (o === "middle" && (s = "center"), e.style.textAlign = s);
  }
}
var sle = /^url\(\s*#(.*?)\)/;
function Ez(e, t, r, n) {
  var i = r && r.match(sle);
  if (i) {
    var a = _o(i[1]);
    n.push([e, t, a]);
    return;
  }
  return r === "none" && (r = null), r;
}
function lle(e, t) {
  for (var r = 0; r < t.length; r++) {
    var n = t[r];
    n[0].style[n[1]] = e[n[2]];
  }
}
var ule = /-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;
function YC(e) {
  return e.match(ule) || [];
}
var fle = /(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.eE,]*)\)/g, FL = Math.PI / 180;
function cle(e, t) {
  var r = e.getAttribute("transform");
  if (r) {
    r = r.replace(/,/g, " ");
    var n = [], i = null;
    r.replace(fle, function(c, 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 = YC(o);
      switch (i = i || ii(), s) {
        case "translate":
          Zs(i, i, [parseFloat(l[0]), parseFloat(l[1] || "0")]);
          break;
        case "scale":
          vC(i, i, [parseFloat(l[0]), parseFloat(l[1] || l[0])]);
          break;
        case "rotate":
          Tf(i, i, -parseFloat(l[0]) * FL, [
            parseFloat(l[1] || "0"),
            parseFloat(l[2] || "0")
          ]);
          break;
        case "skewX":
          var u = Math.tan(parseFloat(l[0]) * FL);
          Hs(i, [1, 0, u, 1, 0, 0], i);
          break;
        case "skewY":
          var f = Math.tan(parseFloat(l[0]) * FL);
          Hs(i, [1, f, 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 Pz = /([^\s:;]+)\s*:\s*([^:;]+)/g;
function e7(e, t, r) {
  var n = e.getAttribute("style");
  if (n) {
    Pz.lastIndex = 0;
    for (var i; (i = Pz.exec(n)) != null; ) {
      var a = i[1], o = qe(Mb, a) ? Mb[a] : null;
      o && (t[o] = i[2]);
      var s = qe(Lb, a) ? Lb[a] : null;
      s && (r[s] = i[2]);
    }
  }
}
function hle(e, t, r) {
  for (var n = 0; n < bz.length; n++) {
    var i = bz[n], a = e.getAttribute(i);
    a != null && (t[Mb[i]] = a);
  }
  for (var n = 0; n < Cz.length; n++) {
    var i = Cz[n], a = e.getAttribute(i);
    a != null && (r[Lb[i]] = a);
  }
}
function t7(e, t) {
  var r = t.width / e.width, n = t.height / e.height, i = Math.min(r, n);
  return {
    scale: i,
    x: -(e.x + e.width / 2) * i + (t.x + t.width / 2),
    y: -(e.y + e.height / 2) * i + (t.y + t.height / 2)
  };
}
function vle(e, t) {
  var r = new ale();
  return r.parse(e, t);
}
var dle = Je([
  "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"
]), ple = (
  /** @class */
  (function() {
    function e(t, r) {
      this.type = "geoSVG", this._usedGraphicMap = Je(), this._freedGraphics = [], this._mapName = t, this._parsedXML = J9(r);
    }
    return e.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 r = mle(t.named), n = r.regions, i = r.regionsMap;
        this._regions = n, this._regionsMap = i;
      }
      return {
        boundingRect: this._boundingRect,
        regions: this._regions,
        regionsMap: this._regionsMap
      };
    }, e.prototype._buildGraphic = function(t) {
      var r, n;
      try {
        r = t && vle(t, {
          ignoreViewBox: !0,
          ignoreRootClip: !0
        }) || {}, n = r.root, Hi(n != null);
      } catch (y) {
        throw new Error(`Invalid svg format
` + y.message);
      }
      var i = new rt();
      i.add(n), i.isGeoSVGGraphicRoot = !0;
      var a = r.width, o = r.height, s = r.viewBoxRect, l = this._boundingRect;
      if (!l) {
        var u = void 0, f = void 0, c = void 0, h = void 0;
        if (a != null ? (u = 0, c = a) : s && (u = s.x, c = s.width), o != null ? (f = 0, h = o) : s && (f = s.y, h = s.height), u == null || f == null) {
          var v = n.getBoundingRect();
          u == null && (u = v.x, c = v.width), f == null && (f = v.y, h = v.height);
        }
        l = this._boundingRect = new st(u, f, c, h);
      }
      if (s) {
        var d = t7(s, l);
        n.scaleX = n.scaleY = d.scale, n.x = d.x, n.y = d.y;
      }
      i.setClipPath(new Mt({
        shape: l.plain()
      }));
      var g = [];
      return F(r.named, function(y) {
        dle.get(y.svgNodeTagLower) != null && (g.push(y), gle(y.el));
      }), {
        root: i,
        boundingRect: l,
        named: g
      };
    }, e.prototype.useGraphic = function(t) {
      var r = this._usedGraphicMap, n = r.get(t);
      return n || (n = this._freedGraphics.pop() || this._buildGraphic(this._parsedXML), r.set(t, n), n);
    }, e.prototype.freeGraphic = function(t) {
      var r = this._usedGraphicMap, n = r.get(t);
      n && (r.removeKey(t), this._freedGraphics.push(n));
    }, e;
  })()
);
function gle(e) {
  e.silent = !1, e.isGroup && e.traverse(function(t) {
    t.silent = !1;
  });
}
function mle(e) {
  var t = [], r = Je();
  return F(e, function(n) {
    if (n.namedFrom == null) {
      var i = new Die(n.name, n.el);
      t.push(i), r.set(n.name, i);
    }
  }), {
    regions: t,
    regionsMap: r
  };
}
var QP = [126, 25], Iz = "南海诸岛", Xv = [[[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 kv = 0; kv < Xv.length; kv++)
  for (var Eg = 0; Eg < Xv[kv].length; Eg++)
    Xv[kv][Eg][0] /= 10.5, Xv[kv][Eg][1] /= -10.5 / 0.75, Xv[kv][Eg][0] += QP[0], Xv[kv][Eg][1] += QP[1];
function yle(e, t) {
  if (e === "china") {
    for (var r = 0; r < t.length; r++)
      if (t[r].name === Iz)
        return;
    t.push(new N6(Iz, Ce(Xv, function(n) {
      return {
        type: "polygon",
        exterior: n
      };
    }), QP));
  }
}
var _le = {
  南海诸岛: [32, 80],
  // 全国
  广东: [0, -10],
  香港: [10, 5],
  澳门: [-10, 10],
  // '北京': [-10, 0],
  天津: [5, 5]
};
function r7(e, t) {
  if (e === "china") {
    var r = _le[t.name];
    if (r) {
      var n = t.getCenter();
      n[0] += r[0] / 10.5, n[1] += -r[1] / (10.5 / 0.75), t.setCenter(n);
    }
  }
}
var xle = [[[123.45165252685547, 25.73527164402261], [123.49731445312499, 25.73527164402261], [123.49731445312499, 25.750734064600884], [123.45165252685547, 25.750734064600884], [123.45165252685547, 25.73527164402261]]];
function Sle(e, t) {
  e === "china" && t.name === "台湾" && t.geometries.push({
    type: "polygon",
    exterior: xle[0]
  });
}
var wle = "name", Tle = (
  /** @class */
  (function() {
    function e(t, r, n) {
      this.type = "geoJSON", this._parsedMap = Je(), this._mapName = t, this._specialAreas = n, this._geoJSON = Cle(r);
    }
    return e.prototype.load = function(t, r) {
      r = r || wle;
      var n = this._parsedMap.get(r);
      if (!n) {
        var i = this._parseToRegions(r);
        n = this._parsedMap.set(r, {
          regions: i,
          boundingRect: ble(i)
        });
      }
      var a = Je(), o = [];
      return F(n.regions, function(s) {
        var l = s.name;
        t && qe(t, l) && (s = s.cloneShallow(l = t[l])), o.push(s), a.set(l, s);
      }), {
        regions: o,
        boundingRect: n.boundingRect || new st(0, 0, 0, 0),
        regionsMap: a
      };
    }, e.prototype._parseToRegions = function(t) {
      var r = this._mapName, n = this._geoJSON, i;
      try {
        i = n ? $1(n, t) : [];
      } catch (a) {
        throw new Error(`Invalid geoJson format
` + a.message);
      }
      return yle(r, i), F(i, function(a) {
        var o = a.name;
        r7(r, a), Sle(r, a);
        var s = this._specialAreas && this._specialAreas[o];
        s && a.transformTo(s.left, s.top, s.width, s.height);
      }, this), i;
    }, e.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
      };
    }, e;
  })()
);
function ble(e) {
  for (var t, r = 0; r < e.length; r++) {
    var n = e[r].getBoundingRect();
    t = t || n.clone(), t.union(n);
  }
  return t;
}
function Cle(e) {
  return Fe(e) ? typeof JSON < "u" && JSON.parse ? JSON.parse(e) : new Function("return (" + e + ");")() : e;
}
var g_ = Je();
const wf = {
  /**
   * 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(e, t, r) {
    if (t.svg) {
      var n = new ple(e, t.svg);
      g_.set(e, n);
    } else {
      var i = t.geoJson || t.geoJSON;
      i && !t.features ? r = t.specialAreas : i = t;
      var n = new Tle(e, i, r);
      g_.set(e, n);
    }
  },
  getGeoResource: function(e) {
    return g_.get(e);
  },
  /**
   * Only for exporting to users.
   * **MUST NOT** used internally.
   */
  getMapForUser: function(e) {
    var t = g_.get(e);
    return t && t.type === "geoJSON" && t.getMapForUser();
  },
  load: function(e, t, r) {
    var n = g_.get(e);
    if (n)
      return n.load(t, r);
  }
};
var ZO = ["rect", "circle", "line", "ellipse", "polygon", "polyline", "path"], Ale = Je(ZO), Mle = Je(ZO.concat(["g"])), Lle = Je(ZO.concat(["g"])), n7 = Bt();
function _T(e) {
  var t = e.getItemStyle(), r = e.get("areaColor");
  return r != null && (t.fill = r), t;
}
function Rz(e) {
  var t = e.style;
  t && (t.stroke = t.stroke || t.fill, t.fill = null);
}
var i7 = (
  /** @class */
  (function() {
    function e(t) {
      var r = this.group = new rt(), n = this._transformGroup = new rt();
      r.add(n), this.uid = ty("ec_map_draw"), this._controller = new Vd(t.getZr()), this._controllerHost = {
        target: n
      }, n.add(this._regionsGroup = new rt()), n.add(this._svgGroup = new rt());
    }
    return e.prototype.draw = function(t, r, n, i, a) {
      var o = t.mainType === "geo", s = t.getData && t.getData();
      o && r.eachComponent({
        mainType: "series",
        subType: "map"
      }, function(T) {
        !s && T.getHostGeoModel() === t && (s = T.getData());
      });
      var l = t.coordinateSystem, u = this._regionsGroup, f = this._transformGroup, c = l.getTransformInfo(), h = c.raw, v = c.roam, d = !u.childAt(0) || a, g = t.getShallow("clip", !0), y;
      g ? (y = l.getViewRect().clone(), this.group.setClipPath(new Mt({
        shape: y.clone()
      }))) : this.group.removeClipPath(), d ? (f.x = v.x, f.y = v.y, f.scaleX = v.scaleX, f.scaleY = v.scaleY, f.dirty()) : Wt(f, v, t);
      var x = s && s.getVisual("visualMeta") && s.getVisual("visualMeta").length > 0, S = {
        api: n,
        geo: l,
        mapOrGeoModel: t,
        data: s,
        isVisualEncodedByVisualMap: x,
        isGeo: o,
        transformInfoRaw: h
      };
      l.resourceType === "geoJSON" ? this._buildGeoJSON(S) : l.resourceType === "geoSVG" && this._buildSVG(S), this._updateController(t, y, r, n), this._updateMapSelectHandler(t, u, n, i);
    }, e.prototype._buildGeoJSON = function(t) {
      var r = this._regionsGroupByName = Je(), n = Je(), i = this._regionsGroup, a = t.transformInfoRaw, o = t.mapOrGeoModel, s = t.data, l = t.geo.projection, u = l && l.stream;
      function f(v, d) {
        return d && (v = d(v)), v && [v[0] * a.scaleX + a.x, v[1] * a.scaleY + a.y];
      }
      function c(v) {
        for (var d = [], g = !u && l && l.project, y = 0; y < v.length; ++y) {
          var x = f(v[y], g);
          x && d.push(x);
        }
        return d;
      }
      function h(v) {
        return {
          shape: {
            points: c(v)
          }
        };
      }
      i.removeAll(), F(t.geo.regions, function(v) {
        var d = v.name, g = r.get(d), y = n.get(d) || {}, x = y.dataIdx, S = y.regionModel;
        if (!g) {
          g = r.set(d, new rt()), i.add(g), x = s ? s.indexOfName(d) : null, S = t.isGeo ? o.getRegionModel(d) : s ? s.getItemModel(x) : null;
          var T = S.get("silent", !0);
          T != null && (g.silent = T), n.set(d, {
            dataIdx: x,
            regionModel: S
          });
        }
        var C = [], A = [];
        F(v.geometries, function(P) {
          if (P.type === "polygon") {
            var R = [P.exterior].concat(P.interiors || []);
            u && (R = Fz(R, u)), F(R, function(N) {
              C.push(new Wi(h(N)));
            });
          } else {
            var O = P.points;
            u && (O = Fz(O, u, !0)), F(O, function(N) {
              A.push(new Ci(h(N)));
            });
          }
        });
        var M = f(v.getCenter(), l && l.project);
        function E(P, R) {
          if (P.length) {
            var O = new Km({
              culling: !0,
              segmentIgnoreThreshold: 1,
              shape: {
                paths: P
              }
            });
            g.add(O), Oz(t, O, x, S), Nz(t, O, d, S, o, x, M), R && (Rz(O), F(O.states, Rz));
          }
        }
        E(C), E(A, !0);
      }), r.each(function(v, d) {
        var g = n.get(d), y = g.dataIdx, x = g.regionModel;
        kz(t, v, d, x, o, y), Bz(t, v, d, x, o), zz(t, v, d, x, o);
      }, this);
    }, e.prototype._buildSVG = function(t) {
      var r = 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(r) && (this._freeSVG(), this._useSVG(r));
      var i = this._svgDispatcherMap = Je(), a = !1;
      F(this._svgGraphicRecord.named, function(o) {
        var s = o.name, l = t.mapOrGeoModel, u = t.data, f = o.svgNodeTagLower, c = o.el, h = u ? u.indexOfName(s) : null, v = l.getRegionModel(s);
        Ale.get(f) != null && c instanceof hs && Oz(t, c, h, v), c instanceof hs && (c.culling = !0);
        var d = v.get("silent", !0);
        if (d != null && (c.silent = d), c.z2EmphasisLift = 0, !o.namedFrom && (Lle.get(f) != null && Nz(t, c, s, v, l, h, null), kz(t, c, s, v, l, h), Bz(t, c, s, v, l), Mle.get(f) != null)) {
          var g = zz(t, c, s, v, l);
          g === "self" && (a = !0);
          var y = i.get(s) || i.set(s, []);
          y.push(c);
        }
      }, this), this._enableBlurEntireSVG(a, t);
    }, e.prototype._enableBlurEntireSVG = function(t, r) {
      if (t && r.isGeo) {
        var n = r.mapOrGeoModel.getModel(["blur", "itemStyle"]).getItemStyle(), i = n.opacity;
        this._svgGraphicRecord.root.traverse(function(a) {
          if (!a.isGroup) {
            Td(a);
            var o = a.ensureState("blur").style || {};
            o.opacity == null && i != null && (o.opacity = i), a.ensureState("emphasis");
          }
        });
      }
    }, e.prototype.remove = function() {
      this._regionsGroup.removeAll(), this._regionsGroupByName = null, this._svgGroup.removeAll(), this._freeSVG(), this._controller.dispose(), this._controllerHost = null;
    }, e.prototype.findHighDownDispatchers = function(t, r) {
      if (t == null)
        return [];
      var n = r.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) || [];
    }, e.prototype._svgResourceChanged = function(t) {
      return this._svgMapName !== t;
    }, e.prototype._useSVG = function(t) {
      var r = wf.getGeoResource(t);
      if (r && r.type === "geoSVG") {
        var n = r.useGraphic(this.uid);
        this._svgGroup.add(n.root), this._svgGraphicRecord = n, this._svgMapName = t;
      }
    }, e.prototype._freeSVG = function() {
      var t = this._svgMapName;
      if (t != null) {
        var r = wf.getGeoResource(t);
        r && r.type === "geoSVG" && r.freeGraphic(this.uid), this._svgGraphicRecord = null, this._svgDispatcherMap = null, this._svgGroup.removeAll(), this._svgMapName = null;
      }
    }, e.prototype._updateController = function(t, r, n, i) {
      var a = t.coordinateSystem, o = this._controller, s = this._controllerHost;
      s.zoomLimit = t.get("scaleLimit"), s.zoom = a.getZoom(), o.enable(t.get("roam") || !1, {
        api: i,
        zInfo: {
          component: t
        },
        triggerInfo: {
          roamTrigger: t.get("roamTrigger"),
          isInSelf: function(f, c, h) {
            return a.containPoint([c, h]);
          },
          isInClip: function(f, c, h) {
            return !r || r.contain(c, h);
          }
        }
      });
      var l = t.mainType;
      function u() {
        var f = {
          type: "geoRoam",
          componentType: l
        };
        return f[l + "Id"] = t.id, f;
      }
      o.off("pan").on("pan", function(f) {
        this._mouseDownFlag = !1, WO(s, f.dx, f.dy), i.dispatchAction(xe(u(), {
          dx: f.dx,
          dy: f.dy,
          animation: {
            duration: 0
          }
        }));
      }, this), o.off("zoom").on("zoom", function(f) {
        this._mouseDownFlag = !1, XO(s, f.scale, f.originX, f.originY), i.dispatchAction(xe(u(), {
          totalZoom: s.zoom,
          zoom: f.scale,
          originX: f.originX,
          originY: f.originY,
          animation: {
            duration: 0
          }
        }));
      }, this);
    }, e.prototype.resetForLabelLayout = function() {
      this.group.traverse(function(t) {
        var r = t.getTextContent();
        r && (r.ignore = n7(r).ignore);
      });
    }, e.prototype._updateMapSelectHandler = function(t, r, n, i) {
      var a = this;
      r.off("mousedown"), r.off("click"), t.get("selectedMode") && (r.on("mousedown", function() {
        a._mouseDownFlag = !0;
      }), r.on("click", function(o) {
        a._mouseDownFlag && (a._mouseDownFlag = !1);
      }));
    }, e;
  })()
);
function Oz(e, t, r, n) {
  var i = n.getModel("itemStyle"), a = n.getModel(["emphasis", "itemStyle"]), o = n.getModel(["blur", "itemStyle"]), s = n.getModel(["select", "itemStyle"]), l = _T(i), u = _T(a), f = _T(s), c = _T(o), h = e.data;
  if (h) {
    var v = h.getItemVisual(r, "style"), d = h.getItemVisual(r, "decal");
    e.isVisualEncodedByVisualMap && v.fill && (l.fill = v.fill), d && (l.decal = Am(d, e.api));
  }
  t.setStyle(l), t.style.strokeNoScale = !0, t.ensureState("emphasis").style = u, t.ensureState("select").style = f, t.ensureState("blur").style = c, Td(t);
}
function Nz(e, t, r, n, i, a, o) {
  var s = e.data, l = e.isGeo, u = s && isNaN(s.get(s.mapDimension("value"), a)), f = s && s.getItemLayout(a);
  if (l || u || f && f.showLabel) {
    var c = l ? r : a, h = void 0;
    (!s || a >= 0) && (h = i);
    var v = o ? {
      normal: {
        align: "center",
        verticalAlign: "middle"
      }
    } : null;
    si(t, Wn(n), {
      labelFetcher: h,
      labelDataIndex: c,
      defaultText: r
    }, v);
    var d = t.getTextContent();
    if (d && (n7(d).ignore = d.ignore, t.textConfig && o)) {
      var g = t.getBoundingRect().clone();
      t.textConfig.layoutRect = g, t.textConfig.position = [(o[0] - g.x) / g.width * 100 + "%", (o[1] - g.y) / g.height * 100 + "%"];
    }
    t.disableLabelAnimation = !0;
  } else
    t.removeTextContent(), t.removeTextConfig(), t.disableLabelAnimation = null;
}
function kz(e, t, r, n, i, a) {
  e.data ? e.data.setItemGraphicEl(a, t) : pt(t).eventData = {
    componentType: "geo",
    componentIndex: i.componentIndex,
    geoIndex: i.componentIndex,
    name: r,
    region: n && n.option || {}
  };
}
function Bz(e, t, r, n, i) {
  e.data || Cf({
    el: t,
    componentModel: i,
    itemName: r,
    // @ts-ignore FIXME:TS fix the "compatible with each other"?
    itemTooltipOption: n.get("tooltip")
  });
}
function zz(e, t, r, n, i) {
  t.highDownSilentOnTouch = !!i.get("selectedMode");
  var a = n.getModel("emphasis"), o = a.get("focus");
  return Hr(t, o, a.get("blurScope"), a.get("disabled")), e.isGeo && kJ(t, i, r), o;
}
function Fz(e, t, r) {
  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 !r && s.polygonStart(), F(e, function(l) {
    s.lineStart();
    for (var u = 0; u < l.length; u++)
      s.point(l[u][0], l[u][1]);
    s.lineEnd();
  }), !r && s.polygonEnd(), n;
}
var Dle = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.render = function(r, n, i, a) {
      if (!(a && a.type === "mapToggleSelect" && a.from === this.uid)) {
        var o = this.group;
        if (o.removeAll(), !r.getHostGeoModel()) {
          if (this._mapDraw && a && a.type === "geoRoam" && this._mapDraw.resetForLabelLayout(), a && a.type === "geoRoam" && a.componentType === "series" && a.seriesId === r.id) {
            var s = this._mapDraw;
            s && o.add(s.group);
          } else if (r.needsDrawMap) {
            var s = this._mapDraw || new i7(i);
            o.add(s.group), s.draw(r, n, i, this, a), this._mapDraw = s;
          } else
            this._mapDraw && this._mapDraw.remove(), this._mapDraw = null;
          r.get("showLegendSymbol") && n.getComponent("legend") && this._renderSymbols(r, 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(r, n, i) {
      var a = r.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 f = u.point, c = u.offset, h = new Qs({
              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: r.getData().getVisual("style").fill
              },
              shape: {
                cx: f[0] + c * 9,
                cy: f[1],
                r: 3
              },
              silent: !0,
              // Do not overlap the first series, on which labels are displayed.
              z2: 8 + (c ? 0 : $m + 1)
            });
            if (!c) {
              var v = r.mainSeries.getData(), d = a.getName(l), g = v.indexOfName(d), y = a.getItemModel(l), x = y.getModel("label"), S = v.getItemGraphicEl(g);
              si(h, Wn(y), {
                labelFetcher: {
                  getFormattedLabel: function(T, C) {
                    return r.getFormattedLabel(g, C);
                  }
                },
                defaultText: d
              }), h.disableLabelAnimation = !0, x.get("position") || h.setTextConfig({
                position: "bottom"
              }), S.onHoverStateChange = function(T) {
                eb(h, T);
              };
            }
            o.add(h);
          }
        }
      });
    }, t.type = "map", t;
  })(Ut)
), Ele = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.needsDrawMap = !1, r.seriesGroup = [], r.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());
        }
      }, r;
    }
    return t.prototype.getInitialData = function(r) {
      for (var n = cy(this, {
        coordDimensions: ["value"],
        encodeDefaulter: St(JR, this)
      }), i = Je(), a = [], o = 0, s = n.count(); o < s; o++) {
        var l = n.getName(o);
        i.set(l, o);
      }
      var u = wf.load(this.getMapType(), this.option.nameMap, this.option.nameProperty);
      return F(u.regions, function(f) {
        var c = f.name, h = i.get(c), v = f.properties && f.properties.echartsStyle, d;
        h == null ? (d = {
          name: c
        }, a.push(d)) : d = n.getRawDataItem(h), v && je(d, v);
      }), n.appendData(a), n;
    }, t.prototype.getHostGeoModel = function() {
      if (YW(this).kind !== Gl.boxCoordSys)
        return this.getReferringComponents("geo", {
          useDefault: !1,
          enableAll: !1,
          enableNone: !1
        }).models[0];
    }, t.prototype.getMapType = function() {
      return (this.getHostGeoModel() || this).option.map;
    }, t.prototype.getRawValue = function(r) {
      var n = this.getData();
      return n.get(n.mapDimension("value"), r);
    }, t.prototype.getRegionModel = function(r) {
      var n = this.getData();
      return n.getItemModel(n.indexOfName(r));
    }, t.prototype.formatTooltip = function(r, n, i) {
      for (var a = this.getData(), o = this.getRawValue(r), s = a.getName(r), l = this.seriesGroup, u = [], f = 0; f < l.length; f++) {
        var c = l[f].originalData.indexOfName(s), h = a.mapDimension("value");
        isNaN(l[f].originalData.get(h, c)) || u.push(l[f].name);
      }
      return Rn("section", {
        header: u.join(", "),
        noHeader: !u.length,
        blocks: [Rn("nameValue", {
          name: s,
          value: o
        })]
      });
    }, t.prototype.setZoom = function(r) {
      this.option.zoom = r;
    }, t.prototype.setCenter = function(r) {
      this.option.center = r;
    }, t.prototype.getLegendIcon = function(r) {
      var n = r.icon || "roundRect", i = en(n, 0, 0, r.itemWidth, r.itemHeight, r.itemStyle.fill);
      return i.setStyle(r.itemStyle), i.style.stroke = "none", n.indexOf("empty") > -1 && (i.style.stroke = i.style.fill, i.style.fill = fe.color.neutral00, 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: fe.color.tertiary
      },
      // scaleLimit: null,
      itemStyle: {
        borderWidth: 0.5,
        borderColor: fe.color.border,
        areaColor: fe.color.background
      },
      emphasis: {
        label: {
          show: !0,
          color: fe.color.primary
        },
        itemStyle: {
          areaColor: fe.color.highlight
        }
      },
      select: {
        label: {
          show: !0,
          color: fe.color.primary
        },
        itemStyle: {
          color: fe.color.highlight
        }
      },
      nameProperty: "name"
    }, t;
  })(Yt)
);
function Ple(e, t) {
  var r = {};
  return F(e, function(n) {
    n.each(n.mapDimension("value"), function(i, a) {
      var o = "ec-" + n.getName(a);
      r[o] = r[o] || [], isNaN(i) || r[o].push(i);
    });
  }), e[0].map(e[0].mapDimension("value"), function(n, i) {
    for (var a = "ec-" + e[0].getName(i), o = 0, s = 1 / 0, l = -1 / 0, u = r[a].length, f = 0; f < u; f++)
      s = Math.min(s, r[a][f]), l = Math.max(l, r[a][f]), o += r[a][f];
    var c;
    return t === "min" ? c = s : t === "max" ? c = l : t === "average" ? c = o / u : c = o, u === 0 ? NaN : c;
  });
}
function Ile(e) {
  var t = {};
  e.eachSeriesByType("map", function(r) {
    var n = r.getHostGeoModel(), i = n ? "o" + n.id : "i" + r.getMapType();
    (t[i] = t[i] || []).push(r);
  }), F(t, function(r, n) {
    for (var i = Ple(Ce(r, function(o) {
      return o.getData();
    }), r[0].get("mapValueCalculation")), a = 0; a < r.length; a++)
      r[a].originalData = r[a].getData();
    for (var a = 0; a < r.length; a++)
      r[a].seriesGroup = r, r[a].needsDrawMap = a === 0 && !r[a].getHostGeoModel(), r[a].setData(i.cloneShallow()), r[a].mainSeries = r[0];
  });
}
function Rle(e) {
  var t = {};
  e.eachSeriesByType("map", function(r) {
    var n = r.getMapType();
    if (!(r.getHostGeoModel() || t[n])) {
      var i = {};
      F(r.seriesGroup, function(o) {
        var s = o.coordinateSystem, l = o.originalData;
        o.get("showLegendSymbol") && e.getComponent("legend") && l.each(l.mapDimension("value"), function(u, f) {
          var c = l.getName(f), h = s.getRegion(c);
          if (!(!h || isNaN(u))) {
            var v = i[c] || 0, d = s.dataToPoint(h.getCenter());
            i[c] = v + 1, l.setItemLayout(f, {
              point: d,
              offset: v
            });
          }
        });
      });
      var a = r.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 Gz = fn, Hd = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r, n) {
      var i = e.call(this) || this;
      return i.type = "view", i.dimensions = ["x", "y"], i._roamTransformable = new of(), i._rawTransformable = new of(), i.name = r, i._opt = n, i;
    }
    return t.prototype.setBoundingRect = function(r, n, i, a) {
      return this._rect = new st(r, n, i, a), this._updateCenterAndZoom(), this._rect;
    }, t.prototype.getBoundingRect = function() {
      return this._rect;
    }, t.prototype.setViewRect = function(r, n, i, a) {
      this._transformTo(r, n, i, a), this._viewRect = new st(r, n, i, a);
    }, t.prototype._transformTo = function(r, n, i, a) {
      var o = this.getBoundingRect(), s = this._rawTransformable;
      s.transform = o.calculateTransform(new st(r, n, i, a));
      var l = s.parent;
      s.parent = null, s.decomposeTransform(), s.parent = l, this._updateTransform();
    }, t.prototype.setCenter = function(r) {
      var n = this._opt;
      n && n.api && n.ecModel && n.ecModel.getShallow("legacyViewCoordSysCenterBase") && r && (r = [Be(r[0], n.api.getWidth()), Be(r[1], n.api.getWidth())]), this._centerOption = it(r), this._updateCenterAndZoom();
    }, t.prototype.setZoom = function(r) {
      this._zoom = YO(r || 1, this.zoomLimit), this._updateCenterAndZoom();
    }, t.prototype.getDefaultCenter = function() {
      var r = this.getBoundingRect(), n = r.x + r.width / 2, i = r.y + r.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 r = this._centerOption, n = this._rect;
      r && n && (this._center = [Be(r[0], n.width, n.x), Be(r[1], n.height, n.y)]);
      var i = this._rawTransformable.getLocalTransform(), a = this._roamTransformable, o = this.getDefaultCenter(), s = this.getCenter(), l = this.getZoom();
      s = fn([], s, i), o = fn([], o, i), a.originX = s[0], a.originY = s[1], a.x = o[0] - s[0], a.y = o[1] - s[1], a.scaleX = a.scaleY = l, this._updateTransform();
    }, t.prototype._updateTransform = function() {
      var r = this._roamTransformable, n = this._rawTransformable;
      n.parent = r, r.updateTransform(), n.updateTransform(), Tx(this.transform || (this.transform = []), n.transform || ii()), this._rawTransform = n.getLocalTransform(), this.invTransform = this.invTransform || [], cs(this.invTransform, this.transform), this.decomposeTransform();
    }, t.prototype.getTransformInfo = function() {
      var r = this._rawTransformable, n = this._roamTransformable, i = new of();
      return i.transform = n.transform, i.decomposeTransform(), {
        roam: {
          x: i.x,
          y: i.y,
          scaleX: i.scaleX,
          scaleY: i.scaleY
        },
        raw: {
          x: r.x,
          y: r.y,
          scaleX: r.scaleX,
          scaleY: r.scaleY
        }
      };
    }, t.prototype.getViewRect = function() {
      return this._viewRect;
    }, t.prototype.getViewRectAfterRoam = function() {
      var r = this.getBoundingRect().clone();
      return r.applyTransform(this.transform), r;
    }, t.prototype.dataToPoint = function(r, n, i) {
      var a = n ? this._rawTransform : this.transform;
      return i = i || [], a ? Gz(i, r, a) : ea(i, r);
    }, t.prototype.pointToData = function(r, n, i) {
      i = i || [];
      var a = this.invTransform;
      return a ? Gz(i, r, a) : (i[0] = r[0], i[1] = r[1], i);
    }, t.prototype.convertToPixel = function(r, n, i) {
      var a = Vz(n);
      return a === this ? a.dataToPoint(i) : null;
    }, t.prototype.convertFromPixel = function(r, n, i) {
      var a = Vz(n);
      return a === this ? a.pointToData(i) : null;
    }, t.prototype.containPoint = function(r) {
      return this.getViewRectAfterRoam().contain(r[0], r[1]);
    }, t.dimensions = ["x", "y"], t;
  })(of)
);
function Vz(e) {
  var t = e.seriesModel;
  return t ? t.coordinateSystem : null;
}
var Ole = {
  geoJSON: {
    aspectScale: 0.75,
    invertLongitute: !0
  },
  geoSVG: {
    aspectScale: 1,
    invertLongitute: !1
  }
}, a7 = ["lng", "lat"], JP = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r, n, i) {
      var a = e.call(this, r, {
        api: i.api,
        ecModel: i.ecModel
      }) || this;
      a.dimensions = a7, a.type = "geo", a._nameCoordMap = Je(), a.map = n;
      var o = i.projection, s = wf.load(n, i.nameMap, i.nameProperty), l = wf.getGeoResource(n);
      a.resourceType = l ? l.type : null;
      var u = a.regions = s.regions, f = Ole[l.type];
      a._regionsMap = s.regionsMap, a.regions = s.regions, a.projection = o;
      var c;
      if (o)
        for (var h = 0; h < u.length; h++) {
          var v = u[h].getBoundingRect(o);
          c = c || v.clone(), c.union(v);
        }
      else
        c = s.boundingRect;
      return a.setBoundingRect(c.x, c.y, c.width, c.height), a.aspectScale = o ? 1 : et(i.aspectScale, f.aspectScale), a._invertLongitute = o ? !1 : f.invertLongitute, a;
    }
    return t.prototype._transformTo = function(r, 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 st(r, 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(r) {
      return this._regionsMap.get(r);
    }, t.prototype.getRegionByCoord = function(r) {
      for (var n = this.regions, i = 0; i < n.length; i++) {
        var a = n[i];
        if (a.type === "geoJSON" && a.contain(r))
          return n[i];
      }
    }, t.prototype.addGeoCoord = function(r, n) {
      this._nameCoordMap.set(r, n);
    }, t.prototype.getGeoCoord = function(r) {
      var n = this._regionsMap.get(r);
      return this._nameCoordMap.get(r) || n && n.getCenter();
    }, t.prototype.dataToPoint = function(r, n, i) {
      if (Fe(r) && (r = this.getGeoCoord(r)), r) {
        var a = this.projection;
        return a && (r = a.project(r)), r && this.projectedToPoint(r, n, i);
      }
    }, t.prototype.pointToData = function(r, n, i) {
      var a = this.projection;
      return a && (r = a.unproject(r)), r && this.pointToProjected(r, i);
    }, t.prototype.pointToProjected = function(r, n) {
      return e.prototype.pointToData.call(this, r, 0, n);
    }, t.prototype.projectedToPoint = function(r, n, i) {
      return e.prototype.dataToPoint.call(this, r, n, i);
    }, t.prototype.convertToPixel = function(r, n, i) {
      var a = Hz(n);
      return a === this ? a.dataToPoint(i) : null;
    }, t.prototype.convertFromPixel = function(r, n, i) {
      var a = Hz(n);
      return a === this ? a.pointToData(i) : null;
    }, t;
  })(Hd)
);
cn(JP, Hd);
function Hz(e) {
  var t = e.geoModel, r = e.seriesModel;
  return t ? t.coordinateSystem : r ? r.coordinateSystem || (r.getReferringComponents("geo", an).models[0] || {}).coordinateSystem : null;
}
function Uz(e, t) {
  var r = e.get("boundingCoords");
  if (r != null) {
    var n = r[0], i = r[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 f = function(A, M, E, P) {
          for (var R = E - A, O = P - M, N = 0; N <= 100; N++) {
            var G = N / 100, z = a.project([A + R * G, M + O * G]);
            nf(n, n, z), af(i, i, z);
          }
        };
        f(o, s, l, s), f(l, s, l, u), f(l, u, o, u), f(o, u, l, s);
      }
      this.setBoundingRect(n[0], n[1], i[0] - n[0], i[1] - n[1]);
    }
  }
  var c = this.getBoundingRect(), h = e.get("layoutCenter"), v = e.get("layoutSize"), d = Yn(e, t).refContainer, g = c.width / c.height * this.aspectScale, y = !1, x, S;
  h && v && (x = [Be(h[0], d.width) + d.x, Be(h[1], d.height) + d.y], S = Be(v, Math.min(d.width, d.height)), !isNaN(x[0]) && !isNaN(x[1]) && !isNaN(S) && (y = !0));
  var T;
  if (y)
    T = {}, g > 1 ? (T.width = S, T.height = S / g) : (T.height = S, T.width = S * g), T.y = x[1] - T.height / 2, T.x = x[0] - T.width / 2;
  else {
    var C = e.getBoxLayoutParams();
    C.aspect = g, T = Tr(C, d), T = KW(e, T, g);
  }
  this.setViewRect(T.x, T.y, T.width, T.height), this.setCenter(e.get("center")), this.setZoom(e.get("zoom"));
}
function Nle(e, t) {
  F(t.get("geoCoord"), function(r, n) {
    e.addGeoCoord(n, r);
  });
}
var kle = (
  /** @class */
  (function() {
    function e() {
      this.dimensions = a7;
    }
    return e.prototype.create = function(t, r) {
      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 JP(l + s, l, xe({
          nameMap: o.get("nameMap"),
          api: r,
          ecModel: t
        }, i(o)));
        u.zoomLimit = o.get("scaleLimit"), n.push(u), o.coordinateSystem = u, u.model = o, u.resize = Uz, u.resize(o, r);
      }), t.eachSeries(function(o) {
        Ex({
          targetModel: o,
          coordSysType: "geo",
          coordSysProvider: function() {
            var s = o.subType === "map" ? o.getHostGeoModel() : o.getReferringComponents("geo", an).models[0];
            return s && s.coordinateSystem;
          },
          allowNotFound: !0
        });
      });
      var a = {};
      return t.eachSeriesByType("map", function(o) {
        if (!o.getHostGeoModel()) {
          var s = o.getMapType();
          a[s] = a[s] || [], a[s].push(o);
        }
      }), F(a, function(o, s) {
        var l = Ce(o, function(f) {
          return f.get("nameMap");
        }), u = new JP(s, s, xe({
          nameMap: fC(l),
          api: r,
          ecModel: t
        }, i(o[0])));
        u.zoomLimit = Ti.apply(null, Ce(o, function(f) {
          return f.get("scaleLimit");
        })), n.push(u), u.resize = Uz, u.resize(o[0], r), F(o, function(f) {
          f.coordinateSystem = u, Nle(u, f);
        });
      }), n;
    }, e.prototype.getFilledRegions = function(t, r, n, i) {
      for (var a = (t || []).slice(), o = Je(), s = 0; s < a.length; s++)
        o.set(a[s].name, a[s]);
      var l = wf.load(r, n, i);
      return F(l.regions, function(u) {
        var f = u.name, c = o.get(f), h = u.properties && u.properties.echartsStyle;
        c || (c = {
          name: f
        }, a.push(c)), h && je(c, h);
      }), a;
    }, e;
  })()
), o7 = new kle(), Ble = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.init = function(r, n, i) {
      this.mergeDefaultAndTheme(r, i);
      var a = wf.getGeoResource(r.map);
      if (a && a.type === "geoJSON") {
        var o = r.itemStyle = r.itemStyle || {};
        "color" in o || (o.color = r.defaultItemStyleColor || fe.color.backgroundTint);
      }
      xd(r, "label", ["show"]);
    }, t.prototype.optionUpdated = function() {
      var r = this, n = this.option;
      n.regions = o7.getFilledRegions(n.regions, n.map, n.nameMap, n.nameProperty);
      var i = {};
      this._optionModelMap = bo(n.regions || [], function(a, o) {
        var s = o.name;
        return s && (a.set(s, new It(o, r, r.ecModel)), o.selected && (i[s] = !0)), a;
      }, Je()), n.selectedMap || (n.selectedMap = i);
    }, t.prototype.getRegionModel = function(r) {
      return this._optionModelMap.get(r) || new It(null, this, this.ecModel);
    }, t.prototype.getFormattedLabel = function(r, n) {
      var i = this.getRegionModel(r), a = n === "normal" ? i.get(["label", "formatter"]) : i.get(["emphasis", "label", "formatter"]), o = {
        name: r
      };
      if (nt(a))
        return o.status = n, a(o);
      if (Fe(a))
        return a.replace("{a}", r ?? "");
    }, t.prototype.setZoom = function(r) {
      this.option.zoom = r;
    }, t.prototype.setCenter = function(r) {
      this.option.center = r;
    }, t.prototype.select = function(r) {
      var n = this.option, i = n.selectedMode;
      if (i) {
        i !== "multiple" && (n.selectedMap = null);
        var a = n.selectedMap || (n.selectedMap = {});
        a[r] = !0;
      }
    }, t.prototype.unSelect = function(r) {
      var n = this.option.selectedMap;
      n && (n[r] = !1);
    }, t.prototype.toggleSelected = function(r) {
      this[this.isSelected(r) ? "unSelect" : "select"](r);
    }, t.prototype.isSelected = function(r) {
      var n = this.option.selectedMap;
      return !!(n && n[r]);
    }, 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: fe.color.tertiary
      },
      itemStyle: {
        borderWidth: 0.5,
        borderColor: fe.color.border
      },
      emphasis: {
        label: {
          show: !0,
          color: fe.color.primary
        },
        itemStyle: {
          color: fe.color.highlight
        }
      },
      select: {
        label: {
          show: !0,
          color: fe.color.primary
        },
        itemStyle: {
          color: fe.color.highlight
        }
      },
      regions: []
      // tooltip: {
      //     show: false
      // }
    }, t;
  })(At)
), zle = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.focusBlurEnabled = !0, r;
    }
    return t.prototype.init = function(r, n) {
      this._api = n;
    }, t.prototype.render = function(r, n, i, a) {
      if (this._model = r, !r.get("show")) {
        this._mapDraw && this._mapDraw.remove(), this._mapDraw = null;
        return;
      }
      this._mapDraw || (this._mapDraw = new i7(i));
      var o = this._mapDraw;
      o.draw(r, n, i, this, a), o.group.on("click", this._handleRegionClick, this), o.group.silent = r.get("silent"), this.group.add(o.group), this.updateSelectStatus(r, n, i);
    }, t.prototype._handleRegionClick = function(r) {
      var n;
      id(r.target, function(i) {
        return (n = pt(i).eventData) != null;
      }, !0), n && this._api.dispatchAction({
        type: "geoToggleSelect",
        geoId: this._model.id,
        name: n.name
      });
    }, t.prototype.updateSelectStatus = function(r, n, i) {
      var a = this;
      this._mapDraw.group.traverse(function(o) {
        var s = pt(o).eventData;
        if (s)
          return a._model.isSelected(s.name) ? i.enterSelect(o) : i.leaveSelect(o), !0;
      });
    }, t.prototype.findHighDownDispatchers = function(r) {
      return this._mapDraw && this._mapDraw.findHighDownDispatchers(r, this._model);
    }, t.prototype.dispose = function() {
      this._mapDraw && this._mapDraw.remove();
    }, t.type = "geo", t;
  })(fr)
);
function Fle(e, t, r) {
  wf.registerMap(e, t, r);
}
function s7(e) {
  e.registerCoordinateSystem("geo", o7), e.registerComponentModel(Ble), e.registerComponentView(zle), e.registerImpl("registerMap", Fle), e.registerImpl("getMap", function(r) {
    return wf.getMapForUser(r);
  });
  function t(r, n) {
    n.update = "geo:updateSelectStatus", e.registerAction(n, function(i, a) {
      var o = {}, s = [];
      return a.eachComponent({
        mainType: "geo",
        query: i
      }, function(l) {
        l[r](i.name);
        var u = l.coordinateSystem;
        F(u.regions, function(c) {
          o[c.name] = l.isSelected(c.name) || !1;
        });
        var f = [];
        F(o, function(c, h) {
          o[h] && f.push(h);
        }), s.push({
          geoIndex: l.componentIndex,
          // Use singular, the same naming convention as the event `selectchanged`.
          name: f
        });
      }), {
        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"
  }), e.registerAction({
    type: "geoRoam",
    event: "geoRoam",
    update: "updateTransform"
  }, function(r, n, i) {
    var a = r.componentType;
    a || (r.geoId != null ? a = "geo" : r.seriesId != null && (a = "series")), a || (a = "series"), n.eachComponent({
      mainType: a,
      query: r
    }, function(o) {
      var s = o.coordinateSystem;
      if (s.type === "geo") {
        var l = XC(s, r, o.get("scaleLimit"));
        o.setCenter && o.setCenter(l.center), o.setZoom && o.setZoom(l.zoom), a === "series" && F(o.seriesGroup, function(u) {
          u.setCenter(l.center), u.setZoom(l.zoom);
        });
      }
    });
  });
}
function Gle(e) {
  ft(s7), e.registerChartView(Dle), e.registerSeriesModel(Ele), e.registerLayout(Rle), e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC, Ile), V8("map", e.registerAction);
}
function Vle(e) {
  var t = e;
  t.hierNode = {
    defaultAncestor: null,
    ancestor: t,
    prelim: 0,
    modifier: 0,
    change: 0,
    shift: 0,
    i: 0,
    thread: null
  };
  for (var r = [t], n, i; n = r.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
        }, r.push(s);
      }
}
function Hle(e, t) {
  var r = e.isExpand ? e.children : [], n = e.parentNode.children, i = e.hierNode.i ? n[e.hierNode.i - 1] : null;
  if (r.length) {
    Wle(e);
    var a = (r[0].hierNode.prelim + r[r.length - 1].hierNode.prelim) / 2;
    i ? (e.hierNode.prelim = i.hierNode.prelim + t(e, i), e.hierNode.modifier = e.hierNode.prelim - a) : e.hierNode.prelim = a;
  } else i && (e.hierNode.prelim = i.hierNode.prelim + t(e, i));
  e.parentNode.hierNode.defaultAncestor = Xle(e, i, e.parentNode.hierNode.defaultAncestor || n[0], t);
}
function Ule(e) {
  var t = e.hierNode.prelim + e.parentNode.hierNode.modifier;
  e.setLayout({
    x: t
  }, !0), e.hierNode.modifier += e.parentNode.hierNode.modifier;
}
function Wz(e) {
  return arguments.length ? e : $le;
}
function q_(e, t) {
  return e -= Math.PI / 2, {
    x: t * Math.cos(e),
    y: t * Math.sin(e)
  };
}
function Wle(e) {
  for (var t = e.children, r = t.length, n = 0, i = 0; --r >= 0; ) {
    var a = t[r];
    a.hierNode.prelim += n, a.hierNode.modifier += n, i += a.hierNode.change, n += a.hierNode.shift + i;
  }
}
function Xle(e, t, r, n) {
  if (t) {
    for (var i = e, a = e, o = a.parentNode.children[0], s = t, l = i.hierNode.modifier, u = a.hierNode.modifier, f = o.hierNode.modifier, c = s.hierNode.modifier; s = GL(s), a = VL(a), s && a; ) {
      i = GL(i), o = VL(o), i.hierNode.ancestor = e;
      var h = s.hierNode.prelim + c - a.hierNode.prelim - u + n(s, a);
      h > 0 && (Zle(Yle(s, e, r), e, h), u += h, l += h), c += s.hierNode.modifier, u += a.hierNode.modifier, l += i.hierNode.modifier, f += o.hierNode.modifier;
    }
    s && !GL(i) && (i.hierNode.thread = s, i.hierNode.modifier += c - l), a && !VL(o) && (o.hierNode.thread = a, o.hierNode.modifier += u - f, r = e);
  }
  return r;
}
function GL(e) {
  var t = e.children;
  return t.length && e.isExpand ? t[t.length - 1] : e.hierNode.thread;
}
function VL(e) {
  var t = e.children;
  return t.length && e.isExpand ? t[0] : e.hierNode.thread;
}
function Yle(e, t, r) {
  return e.hierNode.ancestor.parentNode === t.parentNode ? e.hierNode.ancestor : r;
}
function Zle(e, t, r) {
  var n = r / (t.hierNode.i - e.hierNode.i);
  t.hierNode.change -= n, t.hierNode.shift += r, t.hierNode.modifier += r, t.hierNode.prelim += r, e.hierNode.change += n;
}
function $le(e, t) {
  return e.parentNode === t.parentNode ? 1 : 2;
}
var qle = (
  /** @class */
  /* @__PURE__ */ (function() {
    function e() {
      this.parentPoint = [], this.childPoints = [];
    }
    return e;
  })()
), jle = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r) {
      return e.call(this, r) || this;
    }
    return t.prototype.getDefaultStyle = function() {
      return {
        stroke: fe.color.neutral99,
        fill: null
      };
    }, t.prototype.getDefaultShape = function() {
      return new qle();
    }, t.prototype.buildPath = function(r, n) {
      var i = n.childPoints, a = i.length, o = n.parentPoint, s = i[0], l = i[a - 1];
      if (a === 1) {
        r.moveTo(o[0], o[1]), r.lineTo(s[0], s[1]);
        return;
      }
      var u = n.orient, f = u === "TB" || u === "BT" ? 0 : 1, c = 1 - f, h = Be(n.forkPosition, 1), v = [];
      v[f] = o[f], v[c] = o[c] + (l[c] - o[c]) * h, r.moveTo(o[0], o[1]), r.lineTo(v[0], v[1]), r.moveTo(s[0], s[1]), v[f] = s[f], r.lineTo(v[0], v[1]), v[f] = l[f], r.lineTo(v[0], v[1]), r.lineTo(l[0], l[1]);
      for (var d = 1; d < a - 1; d++) {
        var g = i[d];
        r.moveTo(g[0], g[1]), v[f] = g[f], r.lineTo(v[0], v[1]);
      }
    }, t;
  })(zt)
), Kle = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r._mainGroup = new rt(), r;
    }
    return t.prototype.init = function(r, n) {
      this._controller = new Vd(n.getZr()), this._controllerHost = {
        target: this.group
      }, this.group.add(this._mainGroup);
    }, t.prototype.render = function(r, n, i) {
      var a = r.getData(), o = r.layoutInfo, s = this._mainGroup, l = r.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(r, i), this._updateController(r, null, n, i);
      var u = this._data;
      a.diff(u).add(function(f) {
        Xz(a, f) && Yz(a, f, null, s, r);
      }).update(function(f, c) {
        var h = u.getItemGraphicEl(c);
        if (!Xz(a, f)) {
          h && $z(u, c, h, s, r);
          return;
        }
        Yz(a, f, h, s, r);
      }).remove(function(f) {
        var c = u.getItemGraphicEl(f);
        c && $z(u, f, c, s, r);
      }).execute(), this._nodeScaleRatio = r.get("nodeScaleRatio"), this._updateNodeAndLinkScale(r), r.get("expandAndCollapse") === !0 && a.eachItemGraphicEl(function(f, c) {
        f.off("click").on("click", function() {
          i.dispatchAction({
            type: "treeExpandAndCollapse",
            seriesId: r.id,
            dataIndex: c
          });
        });
      }), this._data = a;
    }, t.prototype._updateViewCoordSys = function(r, n) {
      var i = r.getData(), a = [];
      i.each(function(c) {
        var h = i.getItemLayout(c);
        h && !isNaN(h.x) && !isNaN(h.y) && a.push([+h.x, +h.y]);
      });
      var o = [], s = [];
      wC(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 f = r.coordinateSystem = new Hd(null, {
        api: n,
        ecModel: r.ecModel
      });
      f.zoomLimit = r.get("scaleLimit"), f.setBoundingRect(o[0], o[1], s[0] - o[0], s[1] - o[1]), f.setCenter(r.get("center")), f.setZoom(r.get("zoom")), this.group.attr({
        x: f.x,
        y: f.y,
        scaleX: f.scaleX,
        scaleY: f.scaleY
      }), this._min = o, this._max = s;
    }, t.prototype._updateController = function(r, n, i, a) {
      var o = this;
      K9(r, a, this.group, this._controller, this._controllerHost, n), this._controller.on("zoom", function(s) {
        o._updateNodeAndLinkScale(r);
      });
    }, t.prototype._updateNodeAndLinkScale = function(r) {
      var n = r.getData(), i = this._getNodeGlobalScale(r);
      n.eachItemGraphicEl(function(a, o) {
        a.setSymbolScale(i);
      });
    }, t.prototype._getNodeGlobalScale = function(r) {
      var n = r.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;
  })(Ut)
);
function Xz(e, t) {
  var r = e.getItemLayout(t);
  return r && !isNaN(r.x) && !isNaN(r.y);
}
function Yz(e, t, r, n, i) {
  var a = !r, o = e.tree.getNodeByDataIndex(t), s = o.getModel(), l = o.getVisual("style").fill, u = o.isExpand === !1 && o.children.length !== 0 ? l : fe.color.neutral00, f = e.tree.root, c = o.parentNode === f ? o : o.parentNode || o, h = e.getItemGraphicEl(c.dataIndex), v = c.getLayout(), d = h ? {
    x: h.__oldX,
    y: h.__oldY,
    rawX: h.__radialOldRawX,
    rawY: h.__radialOldRawY
  } : v, g = o.getLayout();
  a ? (r = new Nx(e, t, null, {
    symbolInnerColor: u,
    useNameLabel: !0
  }), r.x = d.x, r.y = d.y) : r.updateData(e, t, null, {
    symbolInnerColor: u,
    useNameLabel: !0
  }), r.__radialOldRawX = r.__radialRawX, r.__radialOldRawY = r.__radialRawY, r.__radialRawX = g.rawX, r.__radialRawY = g.rawY, n.add(r), e.setItemGraphicEl(t, r), r.__oldX = r.x, r.__oldY = r.y, Wt(r, {
    x: g.x,
    y: g.y
  }, i);
  var y = r.getSymbolPath();
  if (i.get("layout") === "radial") {
    var x = f.children[0], S = x.getLayout(), T = x.children.length, C = void 0, A = void 0;
    if (g.x === S.x && o.isExpand === !0 && x.children.length) {
      var M = {
        x: (x.children[0].getLayout().x + x.children[T - 1].getLayout().x) / 2,
        y: (x.children[0].getLayout().y + x.children[T - 1].getLayout().y) / 2
      };
      C = Math.atan2(M.y - S.y, M.x - S.x), C < 0 && (C = Math.PI * 2 + C), A = M.x < S.x, A && (C = C - Math.PI);
    } else
      C = Math.atan2(g.y - S.y, g.x - S.x), C < 0 && (C = Math.PI * 2 + C), o.children.length === 0 || o.children.length !== 0 && o.isExpand === !1 ? (A = g.x < S.x, A && (C = C - Math.PI)) : (A = g.x > S.x, A || (C = C - Math.PI));
    var E = A ? "left" : "right", P = s.getModel("label"), R = P.get("rotate"), O = R * (Math.PI / 180), N = y.getTextContent();
    N && (y.setTextConfig({
      position: P.get("position") || E,
      rotation: R == null ? -C : O,
      origin: "center"
    }), N.setStyle("verticalAlign", "middle"));
  }
  var G = s.get(["emphasis", "focus"]), z = G === "relative" ? _m(o.getAncestorsIndices(), o.getDescendantIndices()) : G === "ancestor" ? o.getAncestorsIndices() : G === "descendant" ? o.getDescendantIndices() : null;
  z && (pt(r).focus = z), Qle(i, o, f, r, d, v, g, n), r.__edge && (r.onHoverStateChange = function(H) {
    if (H !== "blur") {
      var W = o.parentNode && e.getItemGraphicEl(o.parentNode.dataIndex);
      W && W.hoverState === Cx || eb(r.__edge, H);
    }
  });
}
function Qle(e, t, r, n, i, a, o, s) {
  var l = t.getModel(), u = e.get("edgeShape"), f = e.get("layout"), c = e.getOrient(), h = e.get(["lineStyle", "curveness"]), v = e.get("edgeForkPosition"), d = l.getModel("lineStyle").getLineStyle(), g = n.__edge;
  if (u === "curve")
    t.parentNode && t.parentNode !== r && (g || (g = n.__edge = new jm({
      shape: eI(f, c, h, i, i)
    })), Wt(g, {
      shape: eI(f, c, h, a, o)
    }, e));
  else if (u === "polyline" && f === "orthogonal" && t !== r && t.children && t.children.length !== 0 && t.isExpand === !0) {
    for (var y = t.children, x = [], S = 0; S < y.length; S++) {
      var T = y[S].getLayout();
      x.push([T.x, T.y]);
    }
    g || (g = n.__edge = new jle({
      shape: {
        parentPoint: [o.x, o.y],
        childPoints: [[o.x, o.y]],
        orient: c,
        forkPosition: v
      }
    })), Wt(g, {
      shape: {
        parentPoint: [o.x, o.y],
        childPoints: x
      }
    }, e);
  }
  g && !(u === "polyline" && !t.isExpand) && (g.useStyle(tt({
    strokeNoScale: !0,
    fill: null
  }, d)), Un(g, l, "lineStyle"), Td(g), s.add(g));
}
function Zz(e, t, r, n, i) {
  var a = t.tree.root, o = l7(a, e), s = o.source, l = o.sourceLayout, u = t.getItemGraphicEl(e.dataIndex);
  if (u) {
    var f = t.getItemGraphicEl(s.dataIndex), c = f.__edge, h = u.__edge || (s.isExpand === !1 || s.children.length === 1 ? c : void 0), v = n.get("edgeShape"), d = n.get("layout"), g = n.get("orient"), y = n.get(["lineStyle", "curveness"]);
    h && (v === "curve" ? Zc(h, {
      shape: eI(d, g, y, l, l),
      style: {
        opacity: 0
      }
    }, n, {
      cb: function() {
        r.remove(h);
      },
      removeOpt: i
    }) : v === "polyline" && n.get("layout") === "orthogonal" && Zc(h, {
      shape: {
        parentPoint: [l.x, l.y],
        childPoints: [[l.x, l.y]]
      },
      style: {
        opacity: 0
      }
    }, n, {
      cb: function() {
        r.remove(h);
      },
      removeOpt: i
    }));
  }
}
function l7(e, t) {
  for (var r = t.parentNode === e ? t : t.parentNode || t, n; n = r.getLayout(), n == null; )
    r = r.parentNode === e ? r : r.parentNode || r;
  return {
    source: r,
    sourceLayout: n
  };
}
function $z(e, t, r, n, i) {
  var a = e.tree.getNodeByDataIndex(t), o = e.tree.root, s = l7(o, a).sourceLayout, l = {
    duration: i.get("animationDurationUpdate"),
    easing: i.get("animationEasingUpdate")
  };
  Zc(r, {
    x: s.x + 1,
    y: s.y + 1
  }, i, {
    cb: function() {
      n.remove(r), e.setItemGraphicEl(t, null);
    },
    removeOpt: l
  }), r.fadeOut(null, e.hostModel, {
    fadeLabel: !0,
    animation: l
  }), a.children.forEach(function(u) {
    Zz(u, e, n, i, l);
  }), Zz(a, e, n, i, l);
}
function eI(e, t, r, n, i) {
  var a, o, s, l, u, f, c, h;
  if (e === "radial") {
    u = n.rawX, c = n.rawY, f = i.rawX, h = i.rawY;
    var v = q_(u, c), d = q_(u, c + (h - c) * r), g = q_(f, h + (c - h) * r), y = q_(f, h);
    return {
      x1: v.x || 0,
      y1: v.y || 0,
      x2: y.x || 0,
      y2: y.y || 0,
      cpx1: d.x || 0,
      cpy1: d.y || 0,
      cpx2: g.x || 0,
      cpy2: g.y || 0
    };
  } else
    u = n.x, c = n.y, f = i.x, h = i.y, (t === "LR" || t === "RL") && (a = u + (f - u) * r, o = c, s = f + (u - f) * r, l = h), (t === "TB" || t === "BT") && (a = u, o = c + (h - c) * r, s = f, l = h + (c - h) * r);
  return {
    x1: u,
    y1: c,
    x2: f,
    y2: h,
    cpx1: a,
    cpy1: o,
    cpx2: s,
    cpy2: l
  };
}
var ss = Bt();
function $O(e) {
  var t = e.mainData, r = e.datas;
  r || (r = {
    main: t
  }, e.datasAttr = {
    main: "data"
  }), e.datas = e.mainData = null, u7(t, r, e), F(r, function(n) {
    F(t.TRANSFERABLE_METHODS, function(i) {
      n.wrapMethod(i, St(Jle, e));
    });
  }), t.wrapMethod("cloneShallow", St(tue, e)), F(t.CHANGABLE_METHODS, function(n) {
    t.wrapMethod(n, St(eue, e));
  }), Hi(r[t.dataType] === t);
}
function Jle(e, t) {
  if (iue(this)) {
    var r = xe({}, ss(this).datas);
    r[this.dataType] = t, u7(t, r, e);
  } else
    qO(t, this.dataType, ss(this).mainData, e);
  return t;
}
function eue(e, t) {
  return e.struct && e.struct.update(), t;
}
function tue(e, t) {
  return F(ss(t).datas, function(r, n) {
    r !== t && qO(r.cloneShallow(), n, t, e);
  }), t;
}
function rue(e) {
  var t = ss(this).mainData;
  return e == null || t == null ? t : ss(t).datas[e];
}
function nue() {
  var e = ss(this).mainData;
  return e == null ? [{
    data: e
  }] : Ce(Ht(ss(e).datas), function(t) {
    return {
      type: t,
      data: ss(e).datas[t]
    };
  });
}
function iue(e) {
  return ss(e).mainData === e;
}
function u7(e, t, r) {
  ss(e).datas = {}, F(t, function(n, i) {
    qO(n, i, e, r);
  });
}
function qO(e, t, r, n) {
  ss(r).datas[t] = e, ss(e).mainData = r, e.dataType = t, n.struct && (e[n.structAttr] = n.struct, n.struct[n.datasAttr[t]] = e), e.getLinkedData = rue, e.getLinkedDataAll = nue;
}
var aue = (
  /** @class */
  (function() {
    function e(t, r) {
      this.depth = 0, this.height = 0, this.dataIndex = -1, this.children = [], this.viewChildren = [], this.isExpand = !1, this.name = t || "", this.hostTree = r;
    }
    return e.prototype.isRemoved = function() {
      return this.dataIndex < 0;
    }, e.prototype.eachNode = function(t, r, n) {
      nt(t) && (n = r, r = t, t = null), t = t || {}, Fe(t) && (t = {
        order: t
      });
      var i = t.order || "preorder", a = this[t.attr || "children"], o;
      i === "preorder" && (o = r.call(n, this));
      for (var s = 0; !o && s < a.length; s++)
        a[s].eachNode(t, r, n);
      i === "postorder" && r.call(n, this);
    }, e.prototype.updateDepthAndHeight = function(t) {
      var r = 0;
      this.depth = t;
      for (var n = 0; n < this.children.length; n++) {
        var i = this.children[n];
        i.updateDepthAndHeight(t + 1), i.height > r && (r = i.height);
      }
      this.height = r + 1;
    }, e.prototype.getNodeById = function(t) {
      if (this.getId() === t)
        return this;
      for (var r = 0, n = this.children, i = n.length; r < i; r++) {
        var a = n[r].getNodeById(t);
        if (a)
          return a;
      }
    }, e.prototype.contains = function(t) {
      if (t === this)
        return !0;
      for (var r = 0, n = this.children, i = n.length; r < i; r++) {
        var a = n[r].contains(t);
        if (a)
          return a;
      }
    }, e.prototype.getAncestors = function(t) {
      for (var r = [], n = t ? this : this.parentNode; n; )
        r.push(n), n = n.parentNode;
      return r.reverse(), r;
    }, e.prototype.getAncestorsIndices = function() {
      for (var t = [], r = this; r; )
        t.push(r.dataIndex), r = r.parentNode;
      return t.reverse(), t;
    }, e.prototype.getDescendantIndices = function() {
      var t = [];
      return this.eachNode(function(r) {
        t.push(r.dataIndex);
      }), t;
    }, e.prototype.getValue = function(t) {
      var r = this.hostTree.data;
      return r.getStore().get(r.getDimensionIndex(t || "value"), this.dataIndex);
    }, e.prototype.setLayout = function(t, r) {
      this.dataIndex >= 0 && this.hostTree.data.setItemLayout(this.dataIndex, t, r);
    }, e.prototype.getLayout = function() {
      return this.hostTree.data.getItemLayout(this.dataIndex);
    }, e.prototype.getModel = function(t) {
      if (!(this.dataIndex < 0)) {
        var r = this.hostTree, n = r.data.getItemModel(this.dataIndex);
        return n.getModel(t);
      }
    }, e.prototype.getLevelModel = function() {
      return (this.hostTree.levelModels || [])[this.depth];
    }, e.prototype.setVisual = function(t, r) {
      this.dataIndex >= 0 && this.hostTree.data.setItemVisual(this.dataIndex, t, r);
    }, e.prototype.getVisual = function(t) {
      return this.hostTree.data.getItemVisual(this.dataIndex, t);
    }, e.prototype.getRawIndex = function() {
      return this.hostTree.data.getRawIndex(this.dataIndex);
    }, e.prototype.getId = function() {
      return this.hostTree.data.getId(this.dataIndex);
    }, e.prototype.getChildIndex = function() {
      if (this.parentNode) {
        for (var t = this.parentNode.children, r = 0; r < t.length; ++r)
          if (t[r] === this)
            return r;
        return -1;
      }
      return -1;
    }, e.prototype.isAncestorOf = function(t) {
      for (var r = t.parentNode; r; ) {
        if (r === this)
          return !0;
        r = r.parentNode;
      }
      return !1;
    }, e.prototype.isDescendantOf = function(t) {
      return t !== this && t.isAncestorOf(this);
    }, e;
  })()
), jO = (
  /** @class */
  (function() {
    function e(t) {
      this.type = "tree", this._nodes = [], this.hostModel = t;
    }
    return e.prototype.eachNode = function(t, r, n) {
      this.root.eachNode(t, r, n);
    }, e.prototype.getNodeByDataIndex = function(t) {
      var r = this.data.getRawIndex(t);
      return this._nodes[r];
    }, e.prototype.getNodeById = function(t) {
      return this.root.getNodeById(t);
    }, e.prototype.update = function() {
      for (var t = this.data, r = this._nodes, n = 0, i = r.length; n < i; n++)
        r[n].dataIndex = -1;
      for (var n = 0, i = t.count(); n < i; n++)
        r[t.getRawIndex(n)].dataIndex = n;
    }, e.prototype.clearLayouts = function() {
      this.data.clearItemLayouts();
    }, e.createTree = function(t, r, n) {
      var i = new e(r), a = [], o = 1;
      s(t);
      function s(f, c) {
        var h = f.value;
        o = Math.max(o, Se(h) ? h.length : 1), a.push(f);
        var v = new aue(Gn(f.name, ""), i);
        c ? oue(v, c) : i.root = v, i._nodes.push(v);
        var d = f.children;
        if (d)
          for (var g = 0; g < d.length; g++)
            s(d[g], v);
      }
      i.root.updateDepthAndHeight(0);
      var l = sy(a, {
        coordDimensions: ["value"],
        dimensionsCount: o
      }).dimensions, u = new zr(l, r);
      return u.initData(a), n && n(u), $O({
        mainData: u,
        struct: i,
        structAttr: "tree"
      }), i.update(), i;
    }, e;
  })()
);
function oue(e, t) {
  var r = t.children;
  e.parentNode !== t && (r.push(e), e.parentNode = t);
}
function J1(e, t, r) {
  if (e && Tt(t, e.type) >= 0) {
    var n = r.getData().tree.root, i = e.targetNode;
    if (Fe(i) && (i = n.getNodeById(i)), i && n.contains(i))
      return {
        node: i
      };
    var a = e.targetNodeId;
    if (a != null && (i = n.getNodeById(a)))
      return {
        node: i
      };
  }
}
function f7(e) {
  for (var t = []; e; )
    e = e.parentNode, e && t.push(e);
  return t.reverse();
}
function KO(e, t) {
  var r = f7(e);
  return Tt(r, t) >= 0;
}
function ZC(e, t) {
  for (var r = []; e; ) {
    var n = e.dataIndex;
    r.push({
      name: e.name,
      dataIndex: n,
      value: t.getRawValue(n)
    }), e = e.parentNode;
  }
  return r.reverse(), r;
}
var sue = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.hasSymbolVisual = !0, r.ignoreStyleOnData = !0, r;
    }
    return t.prototype.getInitialData = function(r) {
      var n = {
        name: r.name,
        children: r.data
      }, i = r.leaves || {}, a = new It(i, this, this.ecModel), o = jO.createTree(n, this, s);
      function s(c) {
        c.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(c) {
        c.depth > l && (l = c.depth);
      });
      var u = r.expandAndCollapse, f = u && r.initialTreeDepth >= 0 ? r.initialTreeDepth : l;
      return o.root.eachNode("preorder", function(c) {
        var h = c.hostTree.data.getRawDataItem(c.dataIndex);
        c.isExpand = h && h.collapsed != null ? !h.collapsed : c.depth <= f;
      }), o.data;
    }, t.prototype.getOrient = function() {
      var r = this.get("orient");
      return r === "horizontal" ? r = "LR" : r === "vertical" && (r = "TB"), r;
    }, t.prototype.setZoom = function(r) {
      this.option.zoom = r;
    }, t.prototype.setCenter = function(r) {
      this.option.center = r;
    }, t.prototype.formatTooltip = function(r, n, i) {
      for (var a = this.getData().tree, o = a.root.children[0], s = a.getNodeByDataIndex(r), l = s.getValue(), u = s.name; s && s !== o; )
        u = s.parentNode.name + "." + u, s = s.parentNode;
      return Rn("nameValue", {
        name: u,
        value: l,
        noValue: isNaN(l) || l == null
      });
    }, t.prototype.getDataParams = function(r) {
      var n = e.prototype.getDataParams.apply(this, arguments), i = this.getData().tree.getNodeByDataIndex(r);
      return n.treeAncestors = ZC(i, this), n.collapsed = !i.isExpand, n;
    }, t.type = "series.tree", t.layoutMode = "box", t.defaultOption = {
      // zlevel: 0,
      z: 2,
      // `coordinateSystem` can be declared as 'matrix', 'calendar',
      //  which provides box layout container.
      coordinateSystemUsage: "box",
      // 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,
      roamTrigger: "global",
      // 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: fe.color.borderTint,
        width: 1.5,
        curveness: 0.5
      },
      itemStyle: {
        color: "lightsteelblue",
        // borderColor: '#c23531',
        borderWidth: 1.5
      },
      label: {
        show: !0
      },
      animationEasing: "linear",
      animationDuration: 700,
      animationDurationUpdate: 500
    }, t;
  })(Yt)
);
function lue(e, t, r) {
  for (var n = [e], 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, r);
}
function m_(e, t) {
  for (var r = [e], n; n = r.pop(); )
    if (t(n), n.isExpand) {
      var i = n.children;
      if (i.length)
        for (var a = i.length - 1; a >= 0; a--)
          r.push(i[a]);
    }
}
function uue(e, t) {
  e.eachSeriesByType("tree", function(r) {
    fue(r, t);
  });
}
function fue(e, t) {
  var r = Yn(e, t).refContainer, n = Tr(e.getBoxLayoutParams(), r);
  e.layoutInfo = n;
  var i = e.get("layout"), a = 0, o = 0, s = null;
  i === "radial" ? (a = 2 * Math.PI, o = Math.min(n.height, n.width) / 2, s = Wz(function(C, A) {
    return (C.parentNode === A.parentNode ? 1 : 2) / C.depth;
  })) : (a = n.width, o = n.height, s = Wz());
  var l = e.getData().tree.root, u = l.children[0];
  if (u) {
    Vle(l), lue(u, Hle, s), l.hierNode.modifier = -u.hierNode.prelim, m_(u, Ule);
    var f = u, c = u, h = u;
    m_(u, function(C) {
      var A = C.getLayout().x;
      A < f.getLayout().x && (f = C), A > c.getLayout().x && (c = C), C.depth > h.depth && (h = C);
    });
    var v = f === c ? 1 : s(f, c) / 2, d = v - f.getLayout().x, g = 0, y = 0, x = 0, S = 0;
    if (i === "radial")
      g = a / (c.getLayout().x + v + d), y = o / (h.depth - 1 || 1), m_(u, function(C) {
        x = (C.getLayout().x + d) * g, S = (C.depth - 1) * y;
        var A = q_(x, S);
        C.setLayout({
          x: A.x,
          y: A.y,
          rawX: x,
          rawY: S
        }, !0);
      });
    else {
      var T = e.getOrient();
      T === "RL" || T === "LR" ? (y = o / (c.getLayout().x + v + d), g = a / (h.depth - 1 || 1), m_(u, function(C) {
        S = (C.getLayout().x + d) * y, x = T === "LR" ? (C.depth - 1) * g : a - (C.depth - 1) * g, C.setLayout({
          x,
          y: S
        }, !0);
      })) : (T === "TB" || T === "BT") && (g = a / (c.getLayout().x + v + d), y = o / (h.depth - 1 || 1), m_(u, function(C) {
        x = (C.getLayout().x + d) * g, S = T === "TB" ? (C.depth - 1) * y : o - (C.depth - 1) * y, C.setLayout({
          x,
          y: S
        }, !0);
      }));
    }
  }
}
function cue(e) {
  e.eachSeriesByType("tree", function(t) {
    var r = t.getData(), n = r.tree;
    n.eachNode(function(i) {
      var a = i.getModel(), o = a.getModel("itemStyle").getItemStyle(), s = r.ensureUniqueItemVisual(i.dataIndex, "style");
      xe(s, o);
    });
  });
}
function hue(e) {
  e.registerAction({
    type: "treeExpandAndCollapse",
    event: "treeExpandAndCollapse",
    update: "update"
  }, function(t, r) {
    r.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;
    });
  }), e.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, r, n) {
    r.eachComponent({
      mainType: "series",
      subType: "tree",
      query: t
    }, function(i) {
      var a = i.coordinateSystem, o = XC(a, t, i.get("scaleLimit"));
      i.setCenter(o.center), i.setZoom(o.zoom);
    });
  });
}
function vue(e) {
  e.registerChartView(Kle), e.registerSeriesModel(sue), e.registerLayout(uue), e.registerVisual(cue), hue(e);
}
var qz = ["treemapZoomToNode", "treemapRender", "treemapMove"];
function due(e) {
  for (var t = 0; t < qz.length; t++)
    e.registerAction({
      type: qz[t],
      update: "updateView"
    }, un);
  e.registerAction({
    type: "treemapRootToNode",
    update: "updateView"
  }, function(r, n) {
    n.eachComponent({
      mainType: "series",
      subType: "treemap",
      query: r
    }, i);
    function i(a, o) {
      var s = ["treemapZoomToNode", "treemapRootToNode"], l = J1(r, s, a);
      if (l) {
        var u = a.getViewRoot();
        u && (r.direction = KO(u, l.node) ? "rollUp" : "drillDown"), a.resetViewRoot(l.node);
      }
    }
  });
}
function c7(e) {
  var t = e.getData(), r = t.tree, n = {};
  r.eachNode(function(i) {
    for (var a = i; a && a.depth > 1; )
      a = a.parentNode;
    var o = yP(e.ecModel, a.name || a.dataIndex + "", n);
    i.setVisual("decal", o);
  });
}
var pue = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.preventUsingHoverLayer = !0, r;
    }
    return t.prototype.getInitialData = function(r, n) {
      var i = {
        name: r.name,
        children: r.data
      };
      h7(i);
      var a = r.levels || [], o = this.designatedVisualItemStyle = {}, s = new It({
        itemStyle: o
      }, this, n);
      a = r.levels = gue(a, n);
      var l = Ce(a || [], function(c) {
        return new It(c, s, n);
      }, this), u = jO.createTree(i, this, f);
      function f(c) {
        c.wrapMethod("getItemModel", function(h, v) {
          var d = u.getNodeByDataIndex(v), g = d ? l[d.depth] : null;
          return h.parentModel = g || s, h;
        });
      }
      return u.data;
    }, t.prototype.optionUpdated = function() {
      this.resetViewRoot();
    }, t.prototype.formatTooltip = function(r, n, i) {
      var a = this.getData(), o = this.getRawValue(r), s = a.getName(r);
      return Rn("nameValue", {
        name: s,
        value: o
      });
    }, t.prototype.getDataParams = function(r) {
      var n = e.prototype.getDataParams.apply(this, arguments), i = this.getData().tree.getNodeByDataIndex(r);
      return n.treeAncestors = ZC(i, this), n.treePathInfo = n.treeAncestors, n;
    }, t.prototype.setLayoutInfo = function(r) {
      this.layoutInfo = this.layoutInfo || {}, xe(this.layoutInfo, r);
    }, t.prototype.mapIdToIndex = function(r) {
      var n = this._idIndexMap;
      n || (n = this._idIndexMap = Je(), this._idIndexMapCount = 0);
      var i = n.get(r);
      return i == null && n.set(r, i = this._idIndexMapCount++), i;
    }, t.prototype.getViewRoot = function() {
      return this._viewRoot;
    }, t.prototype.resetViewRoot = function(r) {
      r ? this._viewRoot = r : r = this._viewRoot;
      var n = this.getRawData().tree.root;
      (!r || r !== n && !n.contains(r)) && (this._viewRoot = n);
    }, t.prototype.enableAriaDecal = function() {
      c7(this);
    }, t.type = "series.treemap", t.layoutMode = "box", t.defaultOption = {
      // Disable progressive rendering
      progressive: 0,
      // size: ['80%', '80%'],            // deprecated, compatible with ec2.
      // `coordinateSystem` can be declared as 'matrix', 'calendar',
      //  which provides box layout container.
      coordinateSystemUsage: "box",
      left: fe.size.l,
      top: fe.size.xxxl,
      right: fe.size.l,
      bottom: fe.size.xxxl,
      sort: !0,
      clipWindow: "origin",
      squareRatio: 0.5 * (1 + Math.sqrt(5)),
      leafDepth: null,
      drillDownIcon: "▶",
      // to align specialized icon. ▷▶❒❐▼✚
      zoomToNodeRatio: 0.32 * 0.32,
      scaleLimit: {
        max: 5,
        min: 0.2
      },
      roam: !0,
      roamTrigger: "global",
      nodeClick: "zoomToNode",
      animation: !0,
      animationDurationUpdate: 900,
      animationEasing: "quinticInOut",
      breadcrumb: {
        show: !0,
        height: 22,
        left: "center",
        bottom: fe.size.m,
        // right
        // bottom
        emptyItemWidth: 25,
        itemStyle: {
          color: fe.color.backgroundShade,
          textStyle: {
            color: fe.color.secondary
          }
        },
        emphasis: {
          itemStyle: {
            color: fe.color.background
          }
        }
      },
      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: fe.color.neutral00,
        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: fe.color.neutral00,
        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;
  })(Yt)
);
function h7(e) {
  var t = 0;
  F(e.children, function(n) {
    h7(n);
    var i = n.value;
    Se(i) && (i = i[0]), t += i;
  });
  var r = e.value;
  Se(r) && (r = r[0]), (r == null || isNaN(r)) && (r = t), r < 0 && (r = 0), Se(e.value) ? e.value[0] = r : e.value = r;
}
function gue(e, t) {
  var r = Mr(t.get("color")), n = Mr(t.get(["aria", "decal", "decals"]));
  if (r) {
    e = e || [];
    var i, a;
    F(e, function(s) {
      var l = new It(s), u = l.get("color"), f = l.get("decal");
      (l.get(["itemStyle", "color"]) || u && u !== "none") && (i = !0), (l.get(["itemStyle", "decal"]) || f && f !== "none") && (a = !0);
    });
    var o = e[0] || (e[0] = {});
    return i || (o.color = r.slice()), !a && n && (o.decal = n.slice()), e;
  }
}
var mue = 8, jz = 8, HL = 5, yue = (
  /** @class */
  (function() {
    function e(t) {
      this.group = new rt(), t.add(this.group);
    }
    return e.prototype.render = function(t, r, 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"), f = l.getModel(["itemStyle", "textStyle"]), c = Yn(t, r).refContainer, h = {
          left: a.get("left"),
          right: a.get("right"),
          top: a.get("top"),
          bottom: a.get("bottom")
        }, v = {
          emptyItemWidth: a.get("emptyItemWidth"),
          totalWidth: 0,
          renderList: []
        }, d = Tr(h, c);
        this._prepare(n, v, u), this._renderContent(t, v, d, s, l, u, f, i), PC(o, h, c);
      }
    }, e.prototype._prepare = function(t, r, n) {
      for (var i = t; i; i = i.parentNode) {
        var a = Gn(i.getModel().get("name"), ""), o = n.getTextRect(a), s = Math.max(o.width + mue * 2, r.emptyItemWidth);
        r.totalWidth += s + jz, r.renderList.push({
          node: i,
          text: a,
          width: s
        });
      }
    }, e.prototype._renderContent = function(t, r, n, i, a, o, s, l) {
      for (var u = 0, f = r.emptyItemWidth, c = t.get(["breadcrumb", "height"]), h = r.totalWidth, v = r.renderList, d = a.getModel("itemStyle").getItemStyle(), g = v.length - 1; g >= 0; g--) {
        var y = v[g], x = y.node, S = y.width, T = y.text;
        h > n.width && (h -= S - f, S = f, T = null);
        var C = new Wi({
          shape: {
            points: _ue(u, 0, S, c, g === v.length - 1, g === 0)
          },
          style: tt(i.getItemStyle(), {
            lineJoin: "bevel"
          }),
          textContent: new Rt({
            style: gr(o, {
              text: T
            })
          }),
          textConfig: {
            position: "inside"
          },
          z2: $m * 1e4,
          onclick: St(l, x)
        });
        C.disableLabelAnimation = !0, C.getTextContent().ensureState("emphasis").style = gr(s, {
          text: T
        }), C.ensureState("emphasis").style = d, Hr(C, a.get("focus"), a.get("blurScope"), a.get("disabled")), this.group.add(C), xue(C, t, x), u += S + jz;
      }
    }, e.prototype.remove = function() {
      this.group.removeAll();
    }, e;
  })()
);
function _ue(e, t, r, n, i, a) {
  var o = [[i ? e : e - HL, t], [e + r, t], [e + r, t + n], [i ? e : e - HL, t + n]];
  return !a && o.splice(2, 0, [e + r + HL, t + n / 2]), !i && o.push([e, t + n / 2]), o;
}
function xue(e, t, r) {
  pt(e).eventData = {
    componentType: "series",
    componentSubType: "treemap",
    componentIndex: t.componentIndex,
    seriesIndex: t.seriesIndex,
    seriesName: t.name,
    seriesType: "treemap",
    selfType: "breadcrumb",
    nodeData: {
      dataIndex: r && r.dataIndex,
      name: r && r.name
    },
    treePathInfo: r && ZC(r, t)
  };
}
var Sue = (
  /** @class */
  (function() {
    function e() {
      this._storage = [], this._elExistsMap = {};
    }
    return e.prototype.add = function(t, r, n, i, a) {
      return this._elExistsMap[t.id] ? !1 : (this._elExistsMap[t.id] = !0, this._storage.push({
        el: t,
        target: r,
        duration: n,
        delay: i,
        easing: a
      }), !0);
    }, e.prototype.finished = function(t) {
      return this._finishedCallback = t, this;
    }, e.prototype.start = function() {
      for (var t = this, r = this._storage.length, n = function() {
        r--, r <= 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;
    }, e;
  })()
);
function wue() {
  return new Sue();
}
var tI = rt, Kz = Mt, Qz = 3, Jz = "label", e4 = "upperLabel", Tue = $m * 10, bue = $m * 2, Cue = $m * 3, Yv = wd([
  ["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.
]), t4 = function(e) {
  var t = Yv(e);
  return t.stroke = t.fill = t.lineWidth = null, t;
}, Db = Bt(), Aue = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r._state = "ready", r._storage = y_(), r;
    }
    return t.prototype.render = function(r, n, i, a) {
      var o = n.findComponents({
        mainType: "series",
        subType: "treemap",
        query: a
      });
      if (!(Tt(o, r) < 0)) {
        this.seriesModel = r, this.api = i, this.ecModel = n;
        var s = ["treemapZoomToNode", "treemapRootToNode"], l = J1(a, s, r), u = a && a.type, f = r.layoutInfo, c = !this._oldTree, h = this._storage, v = u === "treemapRootToNode" && l && h ? {
          rootNodeGroup: h.nodeGroup[l.node.getRawIndex()],
          direction: a.direction
        } : null, d = this._giveContainerGroup(f), g = r.get("animation"), y = this._doRender(d, r, v);
        g && !c && (!u || u === "treemapZoomToNode" || u === "treemapRootToNode") ? this._doAnimation(d, y, r, v) : y.renderFinally(), this._resetController(i), this._renderBreadcrumb(r, i, l);
      }
    }, t.prototype._giveContainerGroup = function(r) {
      var n = this._containerGroup;
      return n || (n = this._containerGroup = new tI(), this._initEvents(n), this.group.add(n)), n.x = r.x, n.y = r.y, n;
    }, t.prototype._doRender = function(r, n, i) {
      var a = n.getData().tree, o = this._oldTree, s = y_(), l = y_(), u = this._storage, f = [];
      function c(S, T, C, A) {
        return Mue(n, l, u, i, s, f, S, T, C, A);
      }
      g(a.root ? [a.root] : [], o && o.root ? [o.root] : [], r, a === o || !o, 0);
      var h = y(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: x
      };
      function g(S, T, C, A, M) {
        A ? (T = S, F(S, function(R, O) {
          !R.isRemoved() && P(O, O);
        })) : new _f(T, S, E, E).add(P).update(P).remove(St(P, null)).execute();
        function E(R) {
          return R.getId();
        }
        function P(R, O) {
          var N = R != null ? S[R] : null, G = O != null ? T[O] : null, z = c(N, G, C, M);
          z && g(N && N.viewChildren || [], G && G.viewChildren || [], z, A, M + 1);
        }
      }
      function y(S) {
        var T = y_();
        return S && F(S, function(C, A) {
          var M = T[A];
          F(C, function(E) {
            E && (M.push(E), Db(E).willDelete = !0);
          });
        }), T;
      }
      function x() {
        F(h, function(S) {
          F(S, function(T) {
            T.parent && T.parent.remove(T);
          });
        }), F(f, function(S) {
          S.invisible = !0, S.dirty();
        });
      }
    }, t.prototype._doAnimation = function(r, n, i, a) {
      var o = i.get("animationDurationUpdate"), s = i.get("animationEasing"), l = (nt(o) ? 0 : o) || 0, u = (nt(s) ? null : s) || "cubicOut", f = wue();
      F(n.willDeleteEls, function(c, h) {
        F(c, function(v, d) {
          if (!v.invisible) {
            var g = v.parent, y, x = Db(g);
            if (a && a.direction === "drillDown")
              y = g === a.rootNodeGroup ? {
                shape: {
                  x: 0,
                  y: 0,
                  width: x.nodeWidth,
                  height: x.nodeHeight
                },
                style: {
                  opacity: 0
                }
              } : {
                style: {
                  opacity: 0
                }
              };
            else {
              var S = 0, T = 0;
              x.willDelete || (S = x.nodeWidth / 2, T = x.nodeHeight / 2), y = h === "nodeGroup" ? {
                x: S,
                y: T,
                style: {
                  opacity: 0
                }
              } : {
                shape: {
                  x: S,
                  y: T,
                  width: 0,
                  height: 0
                },
                style: {
                  opacity: 0
                }
              };
            }
            y && f.add(v, y, l, 0, u);
          }
        });
      }), F(this._storage, function(c, h) {
        F(c, function(v, d) {
          var g = n.lastsForAnimation[h][d], y = {};
          g && (v instanceof rt ? g.oldX != null && (y.x = v.x, y.y = v.y, v.x = g.oldX, v.y = g.oldY) : (g.oldShape && (y.shape = xe({}, v.shape), v.setShape(g.oldShape)), g.fadein ? (v.setStyle("opacity", 0), y.style = {
            opacity: 1
          }) : v.style.opacity !== 1 && (y.style = {
            opacity: 1
          })), f.add(v, y, l, 0, u));
        });
      }, this), this._state = "animating", f.finished(Ge(function() {
        this._state = "ready", n.renderFinally();
      }, this)).start();
    }, t.prototype._resetController = function(r) {
      var n = this, i = this._controller, a = this._controllerHost;
      a || (this._controllerHost = {
        target: this.group
      }, a = this._controllerHost);
      var o = this.seriesModel;
      i || (i = this._controller = new Vd(r.getZr()), i.on("pan", Ge(this._onPan, this)), i.on("zoom", Ge(this._onZoom, this))), i.enable(o.get("roam"), {
        api: r,
        zInfo: {
          component: o
        },
        triggerInfo: {
          roamTrigger: o.get("roamTrigger"),
          isInSelf: function(s, l, u) {
            var f = n._containerGroup;
            return f ? f.getBoundingRect().contain(l - f.x, u - f.y) : !1;
          }
        }
      }), a.zoomLimit = o.get("scaleLimit"), a.zoom = o.get("zoom");
    }, t.prototype._clearController = function() {
      var r = this._controller;
      this._controllerHost = null, r && (r.dispose(), r = null);
    }, t.prototype._onPan = function(r) {
      if (this._state !== "animating" && (Math.abs(r.dx) > Qz || Math.abs(r.dy) > Qz)) {
        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 + r.dx,
            y: i.y + r.dy,
            width: i.width,
            height: i.height
          }
        });
      }
    }, t.prototype._onZoom = function(r) {
      var n = r.originX, i = r.originY, a = r.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 st(s.x, s.y, s.width, s.height), u = null, f = this._controllerHost;
        u = f.zoomLimit;
        var c = f.zoom = f.zoom || 1;
        if (c *= a, u) {
          var h = u.min || 0, v = u.max || 1 / 0;
          c = Math.max(Math.min(v, c), h);
        }
        var d = c / f.zoom;
        f.zoom = c;
        var g = this.seriesModel.layoutInfo;
        n -= g.x, i -= g.y;
        var y = ii();
        Zs(y, y, [-n, -i]), vC(y, y, [d, d]), Zs(y, y, [n, i]), l.applyTransform(y), 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(r) {
      var n = this;
      r.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), f = l.get("target", !0) || "blank";
                u && ib(u, f);
              }
            }
          }
        }
      }, this);
    }, t.prototype._renderBreadcrumb = function(r, n, i) {
      var a = this;
      i || (i = r.get("leafDepth", !0) != null ? {
        node: r.getViewRoot()
      } : this.findTarget(n.getWidth() / 2, n.getHeight() / 2), i || (i = {
        node: r.getData().tree.root
      })), (this._breadcrumb || (this._breadcrumb = new yue(this.group))).render(r, n, i.node, function(o) {
        a._state !== "animating" && (KO(r.getViewRoot(), o) ? a._rootToNode({
          node: o
        }) : a._zoomToNode({
          node: o
        }));
      });
    }, t.prototype.remove = function() {
      this._clearController(), this._containerGroup && this._containerGroup.removeAll(), this._storage = y_(), this._state = "ready", this._breadcrumb && this._breadcrumb.remove();
    }, t.prototype.dispose = function() {
      this._clearController();
    }, t.prototype._zoomToNode = function(r) {
      this.api.dispatchAction({
        type: "treemapZoomToNode",
        from: this.uid,
        seriesId: this.seriesModel.id,
        targetNode: r.node
      });
    }, t.prototype._rootToNode = function(r) {
      this.api.dispatchAction({
        type: "treemapRootToNode",
        from: this.uid,
        seriesId: this.seriesModel.id,
        targetNode: r.node
      });
    }, t.prototype.findTarget = function(r, 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(r, 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;
  })(Ut)
);
function y_() {
  return {
    nodeGroup: [],
    background: [],
    content: []
  };
}
function Mue(e, t, r, n, i, a, o, s, l, u) {
  if (!o)
    return;
  var f = o.getLayout(), c = e.getData(), h = o.getModel();
  if (c.setItemGraphicEl(o.dataIndex, null), !f || !f.isInView)
    return;
  var v = f.width, d = f.height, g = f.borderWidth, y = f.invisible, x = o.getRawIndex(), S = s && s.getRawIndex(), T = o.viewChildren, C = f.upperHeight, A = T && T.length, M = h.getModel("itemStyle"), E = h.getModel(["emphasis", "itemStyle"]), P = h.getModel(["blur", "itemStyle"]), R = h.getModel(["select", "itemStyle"]), O = M.get("borderRadius") || 0, N = te("nodeGroup", tI);
  if (!N)
    return;
  if (l.add(N), N.x = f.x || 0, N.y = f.y || 0, N.markRedraw(), Db(N).nodeWidth = v, Db(N).nodeHeight = d, f.isAboveViewRoot)
    return N;
  var G = te("background", Kz, u, bue);
  G && q(N, G, A && f.upperLabelHeight);
  var z = h.getModel("emphasis"), H = z.get("focus"), W = z.get("blurScope"), Z = z.get("disabled"), ee = H === "ancestor" ? o.getAncestorsIndices() : H === "descendant" ? o.getDescendantIndices() : H;
  if (A)
    B1(N) && rd(N, !1), G && (rd(G, !Z), c.setItemGraphicEl(o.dataIndex, G), sP(G, ee, W));
  else {
    var V = te("content", Kz, u, Cue);
    V && X(N, V), G.disableMorphing = !0, G && B1(G) && rd(G, !1), rd(N, !Z), c.setItemGraphicEl(o.dataIndex, N);
    var Q = h.getShallow("cursor");
    Q && V.attr("cursor", Q), sP(N, ee, W);
  }
  return N;
  function q(de, ve, Ae) {
    var be = pt(ve);
    if (be.dataIndex = o.dataIndex, be.seriesIndex = e.seriesIndex, ve.setShape({
      x: 0,
      y: 0,
      width: v,
      height: d,
      r: O
    }), y)
      K(ve);
    else {
      ve.invisible = !1;
      var De = o.getVisual("style"), Ue = De.stroke, Xe = t4(M);
      Xe.fill = Ue;
      var $e = Yv(E);
      $e.fill = E.get("borderColor");
      var vt = Yv(P);
      vt.fill = P.get("borderColor");
      var Lt = Yv(R);
      if (Lt.fill = R.get("borderColor"), Ae) {
        var cr = v - 2 * g;
        ue(
          // PENDING: convert ZRColor to ColorString for text.
          ve,
          Ue,
          De.opacity,
          {
            x: g,
            y: 0,
            width: cr,
            height: C
          }
        );
      } else
        ve.removeTextContent();
      ve.setStyle(Xe), ve.ensureState("emphasis").style = $e, ve.ensureState("blur").style = vt, ve.ensureState("select").style = Lt, Td(ve);
    }
    de.add(ve);
  }
  function X(de, ve) {
    var Ae = pt(ve);
    Ae.dataIndex = o.dataIndex, Ae.seriesIndex = e.seriesIndex;
    var be = Math.max(v - 2 * g, 0), De = Math.max(d - 2 * g, 0);
    if (ve.culling = !0, ve.setShape({
      x: g,
      y: g,
      width: be,
      height: De,
      r: O
    }), y)
      K(ve);
    else {
      ve.invisible = !1;
      var Ue = o.getVisual("style"), Xe = Ue.fill, $e = t4(M);
      $e.fill = Xe, $e.decal = Ue.decal;
      var vt = Yv(E), Lt = Yv(P), cr = Yv(R);
      ue(ve, Xe, Ue.opacity, null), ve.setStyle($e), ve.ensureState("emphasis").style = vt, ve.ensureState("blur").style = Lt, ve.ensureState("select").style = cr, Td(ve);
    }
    de.add(ve);
  }
  function K(de) {
    !de.invisible && a.push(de);
  }
  function ue(de, ve, Ae, be) {
    var De = h.getModel(be ? e4 : Jz), Ue = Gn(h.get("name"), null), Xe = De.getShallow("show");
    si(de, Wn(h, be ? e4 : Jz), {
      defaultText: Xe ? Ue : null,
      inheritColor: ve,
      defaultOpacity: Ae,
      labelFetcher: e,
      labelDataIndex: o.dataIndex
    });
    var $e = de.getTextContent();
    if ($e) {
      var vt = $e.style, Lt = _x(vt.padding || 0);
      be && (de.setTextConfig({
        layoutRect: be
      }), $e.disableLabelLayout = !0), $e.beforeUpdate = function() {
        var mr = Math.max((be ? be.width : de.shape.width) - Lt[1] - Lt[3], 0), Kt = Math.max((be ? be.height : de.shape.height) - Lt[0] - Lt[2], 0);
        (vt.width !== mr || vt.height !== Kt) && $e.setStyle({
          width: mr,
          height: Kt
        });
      }, vt.truncateMinChar = 2, vt.lineOverflow = "truncate", oe(vt, be, f);
      var cr = $e.getState("emphasis");
      oe(cr ? cr.style : null, be, f);
    }
  }
  function oe(de, ve, Ae) {
    var be = de ? de.text : null;
    if (!ve && Ae.isLeafRoot && be != null) {
      var De = e.get("drillDownIcon", !0);
      de.text = De ? De + " " + be : be;
    }
  }
  function te(de, ve, Ae, be) {
    var De = S != null && r[de][S], Ue = i[de];
    return De ? (r[de][S] = null, pe(Ue, De)) : y || (De = new ve(), De instanceof hs && (De.z2 = Lue(Ae, be)), me(Ue, De)), t[de][x] = De;
  }
  function pe(de, ve) {
    var Ae = de[x] = {};
    ve instanceof tI ? (Ae.oldX = ve.x, Ae.oldY = ve.y) : Ae.oldShape = xe({}, ve.shape);
  }
  function me(de, ve) {
    var Ae = de[x] = {}, be = o.parentNode, De = ve instanceof rt;
    if (be && (!n || n.direction === "drillDown")) {
      var Ue = 0, Xe = 0, $e = i.background[be.getRawIndex()];
      !n && $e && $e.oldShape && (Ue = $e.oldShape.width, Xe = $e.oldShape.height), De ? (Ae.oldX = 0, Ae.oldY = Xe) : Ae.oldShape = {
        x: Ue,
        y: Xe,
        width: 0,
        height: 0
      };
    }
    Ae.fadein = !De;
  }
}
function Lue(e, t) {
  return e * Tue + t;
}
var ex = F, Due = ot, Eb = -1, ai = (
  /** @class */
  (function() {
    function e(t) {
      var r = t.mappingMethod, n = t.type, i = this.option = it(t);
      this.type = n, this.mappingMethod = r, this._normalizeData = Iue[r];
      var a = e.visualHandlers[n];
      this.applyVisual = a.applyVisual, this.getColorMapper = a.getColorMapper, this._normalizedToVisual = a._normalizedToVisual[r], r === "piecewise" ? (UL(i), Eue(i)) : r === "category" ? i.categories ? Pue(i) : UL(i, !0) : (Hi(r !== "linear" || i.dataExtent), UL(i));
    }
    return e.prototype.mapValueToVisual = function(t) {
      var r = this._normalizeData(t);
      return this._normalizedToVisual(r, t);
    }, e.prototype.getNormalizer = function() {
      return Ge(this._normalizeData, this);
    }, e.listVisualTypes = function() {
      return Ht(e.visualHandlers);
    }, e.isValidType = function(t) {
      return e.visualHandlers.hasOwnProperty(t);
    }, e.eachVisual = function(t, r, n) {
      ot(t) ? F(t, r, n) : r.call(n, t);
    }, e.mapVisual = function(t, r, n) {
      var i, a = Se(t) ? [] : ot(t) ? {} : (i = !0, null);
      return e.eachVisual(t, function(o, s) {
        var l = r.call(n, o, s);
        i ? a = l : a[s] = l;
      }), a;
    }, e.retrieveVisuals = function(t) {
      var r = {}, n;
      return t && ex(e.visualHandlers, function(i, a) {
        t.hasOwnProperty(a) && (r[a] = t[a], n = !0);
      }), n ? r : null;
    }, e.prepareVisualTypes = function(t) {
      if (Se(t))
        t = t.slice();
      else if (Due(t)) {
        var r = [];
        ex(t, function(n, i) {
          r.push(i);
        }), t = r;
      } else
        return [];
      return t.sort(function(n, i) {
        return i === "color" && n !== "color" && n.indexOf("color") === 0 ? 1 : -1;
      }), t;
    }, e.dependsOn = function(t, r) {
      return r === "color" ? !!(t && t.indexOf(r) === 0) : t === r;
    }, e.findPieceIndex = function(t, r, n) {
      for (var i, a = 1 / 0, o = 0, s = r.length; o < s; o++) {
        var l = r[o].value;
        if (l != null) {
          if (l === t || Fe(l) && l === t + "")
            return o;
          n && h(l, o);
        }
      }
      for (var o = 0, s = r.length; o < s; o++) {
        var u = r[o], f = u.interval, c = u.close;
        if (f) {
          if (f[0] === -1 / 0) {
            if (ST(c[1], t, f[1]))
              return o;
          } else if (f[1] === 1 / 0) {
            if (ST(c[0], f[0], t))
              return o;
          } else if (ST(c[0], f[0], t) && ST(c[1], t, f[1]))
            return o;
          n && h(f[0], o), n && h(f[1], o);
        }
      }
      if (n)
        return t === 1 / 0 ? r.length - 1 : t === -1 / 0 ? 0 : i;
      function h(v, d) {
        var g = Math.abs(v - t);
        g < a && (a = g, i = d);
      }
    }, e.visualHandlers = {
      color: {
        applyVisual: __("color"),
        getColorMapper: function() {
          var t = this.option;
          return Ge(t.mappingMethod === "category" ? function(r, n) {
            return !n && (r = this._normalizeData(r)), j_.call(this, r);
          } : function(r, n, i) {
            var a = !!i;
            return !n && (r = this._normalizeData(r)), i = c1(r, t.parsedVisual, i), a ? i : os(i, "rgba");
          }, this);
        },
        _normalizedToVisual: {
          linear: function(t) {
            return os(c1(t, this.option.parsedVisual), "rgba");
          },
          category: j_,
          piecewise: function(t, r) {
            var n = nI.call(this, r);
            return n == null && (n = os(c1(t, this.option.parsedVisual), "rgba")), n;
          },
          fixed: Zv
        }
      },
      colorHue: xT(function(t, r) {
        return uf(t, r);
      }),
      colorSaturation: xT(function(t, r) {
        return uf(t, null, r);
      }),
      colorLightness: xT(function(t, r) {
        return uf(t, null, null, r);
      }),
      colorAlpha: xT(function(t, r) {
        return I1(t, r);
      }),
      decal: {
        applyVisual: __("decal"),
        _normalizedToVisual: {
          linear: null,
          category: j_,
          piecewise: null,
          fixed: null
        }
      },
      opacity: {
        applyVisual: __("opacity"),
        _normalizedToVisual: rI([0, 1])
      },
      liftZ: {
        applyVisual: __("liftZ"),
        _normalizedToVisual: {
          linear: Zv,
          category: Zv,
          piecewise: Zv,
          fixed: Zv
        }
      },
      symbol: {
        applyVisual: function(t, r, n) {
          var i = this.mapValueToVisual(t);
          n("symbol", i);
        },
        _normalizedToVisual: {
          linear: r4,
          category: j_,
          piecewise: function(t, r) {
            var n = nI.call(this, r);
            return n == null && (n = r4.call(this, t)), n;
          },
          fixed: Zv
        }
      },
      symbolSize: {
        applyVisual: __("symbolSize"),
        _normalizedToVisual: rI([0, 1])
      }
    }, e;
  })()
);
function Eue(e) {
  var t = e.pieceList;
  e.hasSpecialVisual = !1, F(t, function(r, n) {
    r.originIndex = n, r.visual != null && (e.hasSpecialVisual = !0);
  });
}
function Pue(e) {
  var t = e.categories, r = e.categoryMap = {}, n = e.visual;
  if (ex(t, function(o, s) {
    r[o] = s;
  }), !Se(n)) {
    var i = [];
    ot(n) ? ex(n, function(o, s) {
      var l = r[s];
      i[l ?? Eb] = o;
    }) : i[Eb] = n, n = v7(e, i);
  }
  for (var a = t.length - 1; a >= 0; a--)
    n[a] == null && (delete r[t[a]], t.pop());
}
function UL(e, t) {
  var r = e.visual, n = [];
  ot(r) ? ex(r, function(a) {
    n.push(a);
  }) : r != null && n.push(r);
  var i = {
    color: 1,
    symbol: 1
  };
  !t && n.length === 1 && !i.hasOwnProperty(e.type) && (n[1] = n[0]), v7(e, n);
}
function xT(e) {
  return {
    applyVisual: function(t, r, n) {
      var i = this.mapValueToVisual(t);
      n("color", e(r("color"), i));
    },
    _normalizedToVisual: rI([0, 1])
  };
}
function r4(e) {
  var t = this.option.visual;
  return t[Math.round(er(e, [0, 1], [0, t.length - 1], !0))] || {};
}
function __(e) {
  return function(t, r, n) {
    n(e, this.mapValueToVisual(t));
  };
}
function j_(e) {
  var t = this.option.visual;
  return t[this.option.loop && e !== Eb ? e % t.length : e];
}
function Zv() {
  return this.option.visual[0];
}
function rI(e) {
  return {
    linear: function(t) {
      return er(t, e, this.option.visual, !0);
    },
    category: j_,
    piecewise: function(t, r) {
      var n = nI.call(this, r);
      return n == null && (n = er(t, e, this.option.visual, !0)), n;
    },
    fixed: Zv
  };
}
function nI(e) {
  var t = this.option, r = t.pieceList;
  if (t.hasSpecialVisual) {
    var n = ai.findPieceIndex(e, r), i = r[n];
    if (i && i.visual)
      return i.visual[this.type];
  }
}
function v7(e, t) {
  return e.visual = t, e.type === "color" && (e.parsedVisual = Ce(t, function(r) {
    var n = bi(r);
    return n || [0, 0, 0, 1];
  })), t;
}
var Iue = {
  linear: function(e) {
    return er(e, this.option.dataExtent, [0, 1], !0);
  },
  piecewise: function(e) {
    var t = this.option.pieceList, r = ai.findPieceIndex(e, t, !0);
    if (r != null)
      return er(r, [0, t.length - 1], [0, 1], !0);
  },
  category: function(e) {
    var t = this.option.categories ? this.option.categoryMap[e] : e;
    return t ?? Eb;
  },
  fixed: un
};
function ST(e, t, r) {
  return e ? t <= r : t < r;
}
var Rue = "itemStyle", d7 = Bt();
const Oue = {
  seriesType: "treemap",
  reset: function(e) {
    var t = e.getData().tree, r = t.root;
    r.isRemoved() || p7(
      r,
      // Visual should calculate from tree root but not view root.
      {},
      e.getViewRoot().getAncestors(),
      e
    );
  }
};
function p7(e, t, r, n) {
  var i = e.getModel(), a = e.getLayout(), o = e.hostTree.data;
  if (!(!a || a.invisible || !a.isInView)) {
    var s = i.getModel(Rue), l = Nue(s, t, n), u = o.ensureUniqueItemVisual(e.dataIndex, "style"), f = s.get("borderColor"), c = s.get("borderColorSaturation"), h;
    c != null && (h = n4(l), f = kue(c, h)), u.stroke = f;
    var v = e.viewChildren;
    if (!v || !v.length)
      h = n4(l), u.fill = h;
    else {
      var d = Bue(e, i, a, s, l, v);
      F(v, function(g, y) {
        if (g.depth >= r.length || g === r[g.depth]) {
          var x = zue(i, l, g, y, d, n);
          p7(g, x, r, n);
        }
      });
    }
  }
}
function Nue(e, t, r) {
  var n = xe({}, t), i = r.designatedVisualItemStyle;
  return F(["color", "colorAlpha", "colorSaturation"], function(a) {
    i[a] = t[a];
    var o = e.get(a);
    i[a] = null, o != null && (n[a] = o);
  }), n;
}
function n4(e) {
  var t = WL(e, "color");
  if (t) {
    var r = WL(e, "colorAlpha"), n = WL(e, "colorSaturation");
    return n && (t = uf(t, null, null, n)), r && (t = I1(t, r)), t;
  }
}
function kue(e, t) {
  return t != null ? uf(t, null, null, e) : null;
}
function WL(e, t) {
  var r = e[t];
  if (r != null && r !== "none")
    return r;
}
function Bue(e, t, r, n, i, a) {
  if (!(!a || !a.length)) {
    var o = XL(t, "color") || i.color != null && i.color !== "none" && (XL(t, "colorAlpha") || XL(t, "colorSaturation"));
    if (o) {
      var s = t.get("visualMin"), l = t.get("visualMax"), u = r.dataExtent.slice();
      s != null && s < u[0] && (u[0] = s), l != null && l > u[1] && (u[1] = l);
      var f = t.get("colorMappingBy"), c = {
        type: o.name,
        dataExtent: u,
        visual: o.range
      };
      c.type === "color" && (f === "index" || f === "id") ? (c.mappingMethod = "category", c.loop = !0) : c.mappingMethod = "linear";
      var h = new ai(c);
      return d7(h).drColorMappingBy = f, h;
    }
  }
}
function XL(e, t) {
  var r = e.get(t);
  return Se(r) && r.length ? {
    name: t,
    range: r
  } : null;
}
function zue(e, t, r, n, i, a) {
  var o = xe({}, t);
  if (i) {
    var s = i.type, l = s === "color" && d7(i).drColorMappingBy, u = l === "index" ? n : l === "id" ? a.mapIdToIndex(r.getId()) : r.getValue(e.get("visualDimension"));
    o[s] = i.mapValueToVisual(u);
  }
  return o;
}
var tx = Math.max, Pb = Math.min, i4 = Ti, QO = F, g7 = ["itemStyle", "borderWidth"], Fue = ["itemStyle", "gapWidth"], Gue = ["upperLabel", "show"], Vue = ["upperLabel", "height"];
const Hue = {
  seriesType: "treemap",
  reset: function(e, t, r, n) {
    var i = e.option, a = Yn(e, r).refContainer, o = Tr(e.getBoxLayoutParams(), a), s = i.size || [], l = Be(i4(o.width, s[0]), a.width), u = Be(i4(o.height, s[1]), a.height), f = n && n.type, c = ["treemapZoomToNode", "treemapRootToNode"], h = J1(n, c, e), v = f === "treemapRender" || f === "treemapMove" ? n.rootRect : null, d = e.getViewRoot(), g = f7(d);
    if (f !== "treemapMove") {
      var y = f === "treemapZoomToNode" ? $ue(e, h, d, l, u) : v ? [v.width, v.height] : [l, u], x = i.sort;
      x && x !== "asc" && x !== "desc" && (x = "desc");
      var S = {
        squareRatio: i.squareRatio,
        sort: x,
        leafDepth: i.leafDepth
      };
      d.hostTree.clearLayouts();
      var T = {
        x: 0,
        y: 0,
        width: y[0],
        height: y[1],
        area: y[0] * y[1]
      };
      d.setLayout(T), m7(d, S, !1, 0), T = d.getLayout(), QO(g, function(A, M) {
        var E = (g[M + 1] || d).getValue();
        A.setLayout(xe({
          dataExtent: [E, E],
          borderWidth: 0,
          upperHeight: 0
        }, T));
      });
    }
    var C = e.getData().tree.root;
    C.setLayout(que(o, v, h), !0), e.setLayoutInfo(o), y7(
      C,
      // Transform to base element coordinate system.
      new st(-o.x, -o.y, r.getWidth(), r.getHeight()),
      g,
      d,
      0
    );
  }
};
function m7(e, t, r, n) {
  var i, a;
  if (!e.isRemoved()) {
    var o = e.getLayout();
    i = o.width, a = o.height;
    var s = e.getModel(), l = s.get(g7), u = s.get(Fue) / 2, f = _7(s), c = Math.max(l, f), h = l - u, v = c - u;
    e.setLayout({
      borderWidth: l,
      upperHeight: c,
      upperLabelHeight: f
    }, !0), i = tx(i - 2 * h, 0), a = tx(a - h - v, 0);
    var d = i * a, g = Uue(e, s, d, t, r, n);
    if (g.length) {
      var y = {
        x: h,
        y: v,
        width: i,
        height: a
      }, x = Pb(i, a), S = 1 / 0, T = [];
      T.area = 0;
      for (var C = 0, A = g.length; C < A; ) {
        var M = g[C];
        T.push(M), T.area += M.getLayout().area;
        var E = Zue(T, x, t.squareRatio);
        E <= S ? (C++, S = E) : (T.area -= T.pop().getLayout().area, a4(T, x, y, u, !1), x = Pb(y.width, y.height), T.length = T.area = 0, S = 1 / 0);
      }
      if (T.length && a4(T, x, y, u, !0), !r) {
        var P = s.get("childrenVisibleMin");
        P != null && d < P && (r = !0);
      }
      for (var C = 0, A = g.length; C < A; C++)
        m7(g[C], t, r, n + 1);
    }
  }
}
function Uue(e, t, r, n, i, a) {
  var o = e.children || [], s = n.sort;
  s !== "asc" && s !== "desc" && (s = null);
  var l = n.leafDepth != null && n.leafDepth <= a;
  if (i && !l)
    return e.viewChildren = [];
  o = nr(o, function(v) {
    return !v.isRemoved();
  }), Xue(o, s);
  var u = Yue(t, o, s);
  if (u.sum === 0)
    return e.viewChildren = [];
  if (u.sum = Wue(t, r, u.sum, s, o), u.sum === 0)
    return e.viewChildren = [];
  for (var f = 0, c = o.length; f < c; f++) {
    var h = o[f].getValue() / u.sum * r;
    o[f].setLayout({
      area: h
    });
  }
  return l && (o.length && e.setLayout({
    isLeafRoot: !0
  }, !0), o.length = 0), e.viewChildren = o, e.setLayout({
    dataExtent: u.dataExtent
  }, !0), o;
}
function Wue(e, t, r, n, i) {
  if (!n)
    return r;
  for (var a = e.get("visibleMin"), o = i.length, s = o, l = o - 1; l >= 0; l--) {
    var u = i[n === "asc" ? o - l - 1 : l].getValue();
    u / r * t < a && (s = l, r -= u);
  }
  return n === "asc" ? i.splice(0, o - s) : i.splice(s, o - s), r;
}
function Xue(e, t) {
  return t && e.sort(function(r, n) {
    var i = t === "asc" ? r.getValue() - n.getValue() : n.getValue() - r.getValue();
    return i === 0 ? t === "asc" ? r.dataIndex - n.dataIndex : n.dataIndex - r.dataIndex : i;
  }), e;
}
function Yue(e, t, r) {
  for (var n = 0, i = 0, a = t.length; i < a; i++)
    n += t[i].getValue();
  var o = e.get("visualDimension"), s;
  return !t || !t.length ? s = [NaN, NaN] : o === "value" && r ? (s = [t[t.length - 1].getValue(), t[0].getValue()], r === "asc" && s.reverse()) : (s = [1 / 0, -1 / 0], QO(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 Zue(e, t, r) {
  for (var n = 0, i = 1 / 0, a = 0, o = void 0, s = e.length; a < s; a++)
    o = e[a].getLayout().area, o && (o < i && (i = o), o > n && (n = o));
  var l = e.area * e.area, u = t * t * r;
  return l ? tx(u * n / l, l / (u * i)) : 1 / 0;
}
function a4(e, t, r, n, i) {
  var a = t === r.width ? 0 : 1, o = 1 - a, s = ["x", "y"], l = ["width", "height"], u = r[s[a]], f = t ? e.area / t : 0;
  (i || f > r[l[o]]) && (f = r[l[o]]);
  for (var c = 0, h = e.length; c < h; c++) {
    var v = e[c], d = {}, g = f ? v.getLayout().area / f : 0, y = d[l[o]] = tx(f - 2 * n, 0), x = r[s[a]] + r[l[a]] - u, S = c === h - 1 || x < g ? x : g, T = d[l[a]] = tx(S - 2 * n, 0);
    d[s[o]] = r[s[o]] + Pb(n, y / 2), d[s[a]] = u + Pb(n, T / 2), u += S, v.setLayout(d, !0);
  }
  r[s[o]] += f, r[l[o]] -= f;
}
function $ue(e, t, r, n, i) {
  var a = (t || {}).node, o = [n, i];
  if (!a || a === r)
    return o;
  for (var s, l = n * i, u = l * e.option.zoomToNodeRatio; s = a.parentNode; ) {
    for (var f = 0, c = s.children, h = 0, v = c.length; h < v; h++)
      f += c[h].getValue();
    var d = a.getValue();
    if (d === 0)
      return o;
    u *= f / d;
    var g = s.getModel(), y = g.get(g7), x = Math.max(y, _7(g));
    u += 4 * y * y + (3 * y + x) * Math.pow(u, 0.5), u > jE && (u = jE), a = s;
  }
  u < l && (u = l);
  var S = Math.pow(u / l, 0.5);
  return [n * S, i * S];
}
function que(e, t, r) {
  if (t)
    return {
      x: t.x,
      y: t.y
    };
  var n = {
    x: 0,
    y: 0
  };
  if (!r)
    return n;
  var i = r.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: e.width / 2 - o[0],
    y: e.height / 2 - o[1]
  };
}
function y7(e, t, r, n, i) {
  var a = e.getLayout(), o = r[i], s = o && o === e;
  if (!(o && !s || i === r.length && e !== n)) {
    e.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 st(t.x - a.x, t.y - a.y, t.width, t.height);
    QO(e.viewChildren || [], function(u) {
      y7(u, l, r, n, i + 1);
    });
  }
}
function _7(e) {
  return e.get(Gue) ? e.get(Vue) : 0;
}
function jue(e) {
  e.registerSeriesModel(pue), e.registerChartView(Aue), e.registerVisual(Oue), e.registerLayout(Hue), due(e);
}
function Kue(e) {
  var t = e.findComponents({
    mainType: "legend"
  });
  !t || !t.length || e.eachSeriesByType("graph", function(r) {
    var n = r.getCategoriesData(), i = r.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) {
        Xt(u) && (u = o[u]);
        for (var f = 0; f < t.length; f++)
          if (!t[f].isSelected(u))
            return !1;
      }
      return !0;
    });
  });
}
function Que(e) {
  var t = {};
  e.eachSeriesByType("graph", function(r) {
    var n = r.getCategoriesData(), i = r.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 = r.getColorFromPalette(s, t)), n.setItemVisual(o, "style", u);
      for (var f = ["symbol", "symbolSize", "symbolKeepAspect"], c = 0; c < f.length; c++) {
        var h = l.getShallow(f[c], !0);
        h != null && n.setItemVisual(o, f[c], h);
      }
    }), n.count() && i.each(function(o) {
      var s = i.getItemModel(o), l = s.getShallow("category");
      if (l != null) {
        Fe(l) && (l = a["ec-" + l]);
        var u = n.getItemVisual(l, "style"), f = i.ensureUniqueItemVisual(o, "style");
        xe(f, u);
        for (var c = ["symbol", "symbolSize", "symbolKeepAspect"], h = 0; h < c.length; h++)
          i.setItemVisual(o, c[h], n.getItemVisual(l, c[h]));
      }
    });
  });
}
function wT(e) {
  return e instanceof Array || (e = [e, e]), e;
}
function Jue(e) {
  e.eachSeriesByType("graph", function(t) {
    var r = t.getGraph(), n = t.getEdgeData(), i = wT(t.get("edgeSymbol")), a = wT(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 = r.getEdgeByIndex(o), u = wT(s.getShallow("symbol", !0)), f = wT(s.getShallow("symbolSize", !0)), c = s.getModel("lineStyle").getLineStyle(), h = n.ensureUniqueItemVisual(o, "style");
      switch (xe(h, c), 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]), f[0] && l.setVisual("fromSymbolSize", f[0]), f[1] && l.setVisual("toSymbolSize", f[1]);
    });
  });
}
var iI = "-->", $C = function(e) {
  return e.get("autoCurveness") || null;
}, x7 = function(e, t) {
  var r = $C(e), n = 20, i = [];
  if (Xt(r))
    n = r;
  else if (Se(r)) {
    e.__curvenessList = r;
    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));
  e.__curvenessList = i;
}, rx = function(e, t, r) {
  var n = [e.id, e.dataIndex].join("."), i = [t.id, t.dataIndex].join(".");
  return [r.uid, n, i].join(iI);
}, S7 = function(e) {
  var t = e.split(iI);
  return [t[0], t[2], t[1]].join(iI);
}, efe = function(e, t) {
  var r = rx(e.node1, e.node2, t);
  return t.__edgeMap[r];
}, tfe = function(e, t) {
  var r = aI(rx(e.node1, e.node2, t), t), n = aI(rx(e.node2, e.node1, t), t);
  return r + n;
}, aI = function(e, t) {
  var r = t.__edgeMap;
  return r[e] ? r[e].length : 0;
};
function rfe(e) {
  $C(e) && (e.__curvenessList = [], e.__edgeMap = {}, x7(e));
}
function nfe(e, t, r, n) {
  if ($C(r)) {
    var i = rx(e, t, r), a = r.__edgeMap, o = a[S7(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 JO(e, t, r, n) {
  var i = $C(t), a = Se(i);
  if (!i)
    return null;
  var o = efe(e, t);
  if (!o)
    return null;
  for (var s = -1, l = 0; l < o.length; l++)
    if (o[l] === r) {
      s = l;
      break;
    }
  var u = tfe(e, t);
  x7(t, u), e.lineStyle = e.lineStyle || {};
  var f = rx(e.node1, e.node2, t), c = t.__curvenessList, h = a || u % 2 ? 0 : 1;
  if (o.isForward)
    return c[h + s];
  var v = S7(f), d = aI(v, t), g = c[s + d + h];
  return n ? a ? i && i[0] === 0 ? (d + h) % 2 ? g : -g : ((d % 2 ? 0 : 1) + h) % 2 ? g : -g : (d + h) % 2 ? g : -g : c[s + d + h];
}
function w7(e) {
  var t = e.coordinateSystem;
  if (!(t && t.type !== "view")) {
    var r = e.getGraph();
    r.eachNode(function(n) {
      var i = n.getModel();
      n.setLayout([+i.get("x"), +i.get("y")]);
    }), eN(r, e);
  }
}
function eN(e, t) {
  e.eachEdge(function(r, n) {
    var i = $a(r.getModel().get(["lineStyle", "curveness"]), -JO(r, t, n, !0), 0), a = Zl(r.node1.getLayout()), o = Zl(r.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]), r.setLayout(s);
  });
}
function ife(e, t) {
  e.eachSeriesByType("graph", function(r) {
    var n = r.get("layout"), i = r.coordinateSystem;
    if (i && i.type !== "view") {
      var a = r.getData(), o = [];
      F(i.dimensions, function(h) {
        o = o.concat(a.mapDimensionsAll(h));
      });
      for (var s = 0; s < a.count(); s++) {
        for (var l = [], u = !1, f = 0; f < o.length; f++) {
          var c = a.get(o[f], s);
          isNaN(c) || (u = !0), l.push(c);
        }
        u ? a.setItemLayout(s, i.dataToPoint(l)) : a.setItemLayout(s, [NaN, NaN]);
      }
      eN(a.graph, r);
    } else (!n || n === "none") && w7(r);
  });
}
function K_(e) {
  var t = e.coordinateSystem;
  if (t.type !== "view")
    return 1;
  var r = e.option.nodeScaleRatio, n = t.scaleX, i = t.getZoom(), a = (i - 1) * r + 1;
  return a / n;
}
function Q_(e) {
  var t = e.getVisual("symbolSize");
  return t instanceof Array && (t = (t[0] + t[1]) / 2), +t;
}
var o4 = Math.PI, YL = [];
function tN(e, t, r, n) {
  var i = e.coordinateSystem;
  if (!(i && i.type !== "view")) {
    var a = i.getBoundingRect(), o = e.getData(), s = o.graph, l = a.width / 2 + a.x, u = a.height / 2 + a.y, f = Math.min(a.width, a.height) / 2, c = o.count();
    if (o.setLayout({
      cx: l,
      cy: u
    }), !!c) {
      if (r) {
        var h = i.pointToData(n), v = h[0], d = h[1], g = [v - l, d - u];
        Od(g, g), s1(g, g, f), r.setLayout([l + g[0], u + g[1]], !0);
        var y = e.get(["circular", "rotateLabel"]);
        T7(r, y, l, u);
      }
      afe[t](e, s, o, f, l, u, c), s.eachEdge(function(x, S) {
        var T = $a(x.getModel().get(["lineStyle", "curveness"]), JO(x, e, S), 0), C = Zl(x.node1.getLayout()), A = Zl(x.node2.getLayout()), M, E = (C[0] + A[0]) / 2, P = (C[1] + A[1]) / 2;
        +T && (T *= 3, M = [l * T + E * (1 - T), u * T + P * (1 - T)]), x.setLayout([C, A, M]);
      });
    }
  }
}
var afe = {
  value: function(e, t, r, n, i, a, o) {
    var s = 0, l = r.getSum("value"), u = Math.PI * 2 / (l || o);
    t.eachNode(function(f) {
      var c = f.getValue("value"), h = u * (l ? c : 1) / 2;
      s += h, f.setLayout([n * Math.cos(s) + i, n * Math.sin(s) + a]), s += h;
    });
  },
  symbolSize: function(e, t, r, n, i, a, o) {
    var s = 0;
    YL.length = o;
    var l = K_(e);
    t.eachNode(function(c) {
      var h = Q_(c);
      isNaN(h) && (h = 2), h < 0 && (h = 0), h *= l;
      var v = Math.asin(h / 2 / n);
      isNaN(v) && (v = o4 / 2), YL[c.dataIndex] = v, s += v * 2;
    });
    var u = (2 * o4 - s) / o / 2, f = 0;
    t.eachNode(function(c) {
      var h = u + YL[c.dataIndex];
      f += h, (!c.getLayout() || !c.getLayout().fixed) && c.setLayout([n * Math.cos(f) + i, n * Math.sin(f) + a]), f += h;
    });
  }
};
function T7(e, t, r, n) {
  var i = e.getGraphicEl();
  if (i) {
    var a = e.getModel(), o = a.get(["label", "rotate"]) || 0, s = i.getSymbolPath();
    if (t) {
      var l = e.getLayout(), u = Math.atan2(l[1] - n, l[0] - r);
      u < 0 && (u = Math.PI * 2 + u);
      var f = l[0] < r;
      f && (u = u - Math.PI);
      var c = f ? "left" : "right";
      s.setTextConfig({
        rotation: -u,
        position: c,
        origin: "center"
      });
      var h = s.ensureState("emphasis");
      xe(h.textConfig || (h.textConfig = {}), {
        position: c
      });
    } else
      s.setTextConfig({
        rotation: o *= Math.PI / 180
      });
  }
}
function ofe(e) {
  e.eachSeriesByType("graph", function(t) {
    t.get("layout") === "circular" && tN(t, "symbolSize");
  });
}
var Pg = z2;
function sfe(e, t, r) {
  for (var n = e, i = t, a = r.rect, o = a.width, s = a.height, l = [a.x + o / 2, a.y + s / 2], u = r.gravity == null ? 0.1 : r.gravity, f = 0; f < n.length; f++) {
    var c = n[f];
    c.p || (c.p = th(o * (Math.random() - 0.5) + l[0], s * (Math.random() - 0.5) + l[1])), c.pp = Zl(c.p), c.edges = null;
  }
  var h = r.friction == null ? 0.6 : r.friction, v = h, d, g;
  return {
    warmUp: function() {
      v = h * 0.8;
    },
    setFixed: function(y) {
      n[y].fixed = !0;
    },
    setUnfixed: function(y) {
      n[y].fixed = !1;
    },
    /**
     * Before step hook
     */
    beforeStep: function(y) {
      d = y;
    },
    /**
     * After step hook
     */
    afterStep: function(y) {
      g = y;
    },
    /**
     * 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(y) {
      d && d(n, i);
      for (var x = [], S = n.length, T = 0; T < i.length; T++) {
        var C = i[T];
        if (!C.ignoreForceLayout) {
          var A = C.n1, M = C.n2;
          Ec(x, M.p, A.p);
          var E = D1(x) - C.d, P = M.w / (A.w + M.w);
          isNaN(P) && (P = 0), Od(x, x), !A.fixed && Pg(A.p, A.p, x, P * E * v), !M.fixed && Pg(M.p, M.p, x, -(1 - P) * E * v);
        }
      }
      for (var T = 0; T < S; T++) {
        var R = n[T];
        R.fixed || (Ec(x, l, R.p), Pg(R.p, R.p, x, u * v));
      }
      for (var T = 0; T < S; T++)
        for (var A = n[T], O = T + 1; O < S; O++) {
          var M = n[O];
          Ec(x, M.p, A.p);
          var E = D1(x);
          E === 0 && (hC(x, Math.random() - 0.5, Math.random() - 0.5), E = 1);
          var N = (A.rep + M.rep) / E / E;
          !A.fixed && Pg(A.pp, A.pp, x, N), !M.fixed && Pg(M.pp, M.pp, x, -N);
        }
      for (var G = [], T = 0; T < S; T++) {
        var R = n[T];
        R.fixed || (Ec(G, R.p, R.pp), Pg(R.p, R.p, G, v), ea(R.pp, R.p));
      }
      v = v * 0.992;
      var z = v < 0.01;
      g && g(n, i, z), y && y(z);
    }
  };
}
function lfe(e) {
  e.eachSeriesByType("graph", function(t) {
    var r = t.coordinateSystem;
    if (!(r && r.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(T) {
          var C = a.getId(T);
          a.setItemLayout(T, n[C] || [NaN, NaN]);
        }) : !l || l === "none" ? w7(t) : l === "circular" && tN(t, "value");
        var u = a.getDataExtent("value"), f = o.getDataExtent("value"), c = s.get("repulsion"), h = s.get("edgeLength"), v = Se(c) ? c : [c, c], d = Se(h) ? h : [h, h];
        d = [d[1], d[0]];
        var g = a.mapArray("value", function(T, C) {
          var A = a.getItemLayout(C), M = er(T, u, v);
          return isNaN(M) && (M = (v[0] + v[1]) / 2), {
            w: M,
            rep: M,
            fixed: a.getItemModel(C).get("fixed"),
            p: !A || isNaN(A[0]) || isNaN(A[1]) ? null : A
          };
        }), y = o.mapArray("value", function(T, C) {
          var A = i.getEdgeByIndex(C), M = er(T, f, d);
          isNaN(M) && (M = (d[0] + d[1]) / 2);
          var E = A.getModel(), P = $a(A.getModel().get(["lineStyle", "curveness"]), -JO(A, t, C, !0), 0);
          return {
            n1: g[A.node1.dataIndex],
            n2: g[A.node2.dataIndex],
            d: M,
            curveness: P,
            ignoreForceLayout: E.get("ignoreForceLayout")
          };
        }), x = r.getBoundingRect(), S = sfe(g, y, {
          rect: x,
          gravity: s.get("gravity"),
          friction: s.get("friction")
        });
        S.beforeStep(function(T, C) {
          for (var A = 0, M = T.length; A < M; A++)
            T[A].fixed && ea(T[A].p, i.getNodeByIndex(A).getLayout());
        }), S.afterStep(function(T, C, A) {
          for (var M = 0, E = T.length; M < E; M++)
            T[M].fixed || i.getNodeByIndex(M).setLayout(T[M].p), n[a.getId(M)] = T[M].p;
          for (var M = 0, E = C.length; M < E; M++) {
            var P = C[M], R = i.getEdgeByIndex(M), O = P.n1.p, N = P.n2.p, G = R.getLayout();
            G = G ? G.slice() : [], G[0] = G[0] || [], G[1] = G[1] || [], ea(G[0], O), ea(G[1], N), +P.curveness && (G[2] = [(O[0] + N[0]) / 2 - (O[1] - N[1]) * P.curveness, (O[1] + N[1]) / 2 - (N[0] - O[0]) * P.curveness]), R.setLayout(G);
          }
        }), t.forceLayout = S, t.preservedPoints = n, S.step();
      } else
        t.forceLayout = null;
  });
}
function ufe(e, t, r) {
  var n = Yn(e, t), i = xe(e.getBoxLayoutParams(), {
    aspect: r
  }), a = Tr(i, n.refContainer);
  return KW(e, a, r);
}
function ffe(e, t) {
  var r = [];
  return e.eachSeriesByType("graph", function(n) {
    Ex({
      targetModel: n,
      coordSysType: "view",
      coordSysProvider: i,
      isDefaultDataCoordSys: !0
    });
    function i() {
      var a = n.getData(), o = a.mapArray(function(d) {
        var g = a.getItemModel(d);
        return [+g.get("x"), +g.get("y")];
      }), s = [], l = [];
      wC(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]), f = ufe(n, t, u);
      isNaN(u) && (s = [f.x, f.y], l = [f.x + f.width, f.y + f.height]);
      var c = l[0] - s[0], h = l[1] - s[1], v = new Hd(null, {
        api: t,
        ecModel: e
      });
      return v.zoomLimit = n.get("scaleLimit"), v.setBoundingRect(s[0], s[1], c, h), v.setViewRect(f.x, f.y, f.width, f.height), v.setCenter(n.get("center")), v.setZoom(n.get("zoom")), r.push(v), v;
    }
  }), r;
}
var s4 = wn.prototype, ZL = jm.prototype, b7 = (
  /** @class */
  /* @__PURE__ */ (function() {
    function e() {
      this.x1 = 0, this.y1 = 0, this.x2 = 0, this.y2 = 0, this.percent = 1;
    }
    return e;
  })()
);
(function(e) {
  ae(t, e);
  function t() {
    return e !== null && e.apply(this, arguments) || this;
  }
  return t;
})(b7);
function $L(e) {
  return isNaN(+e.cpx1) || isNaN(+e.cpy1);
}
var C7 = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r) {
      var n = e.call(this, r) || this;
      return n.type = "ec-line", n;
    }
    return t.prototype.getDefaultStyle = function() {
      return {
        stroke: fe.color.neutral99,
        fill: null
      };
    }, t.prototype.getDefaultShape = function() {
      return new b7();
    }, t.prototype.buildPath = function(r, n) {
      $L(n) ? s4.buildPath.call(this, r, n) : ZL.buildPath.call(this, r, n);
    }, t.prototype.pointAt = function(r) {
      return $L(this.shape) ? s4.pointAt.call(this, r) : ZL.pointAt.call(this, r);
    }, t.prototype.tangentAt = function(r) {
      var n = this.shape, i = $L(n) ? [n.x2 - n.x1, n.y2 - n.y1] : ZL.tangentAt.call(this, r);
      return Od(i, i);
    }, t;
  })(zt)
), qL = ["fromSymbol", "toSymbol"];
function l4(e) {
  return "_" + e + "Type";
}
function u4(e, t, r) {
  var n = t.getItemVisual(r, e);
  if (!n || n === "none")
    return n;
  var i = t.getItemVisual(r, e + "Size"), a = t.getItemVisual(r, e + "Rotate"), o = t.getItemVisual(r, e + "Offset"), s = t.getItemVisual(r, e + "KeepAspect"), l = oy(i), u = Fd(o || 0, l);
  return n + l + u + (a || "") + (s || "");
}
function f4(e, t, r) {
  var n = t.getItemVisual(r, e);
  if (!(!n || n === "none")) {
    var i = t.getItemVisual(r, e + "Size"), a = t.getItemVisual(r, e + "Rotate"), o = t.getItemVisual(r, e + "Offset"), s = t.getItemVisual(r, e + "KeepAspect"), l = oy(i), u = Fd(o || 0, l), f = en(n, -l[0] / 2 + u[0], -l[1] / 2 + u[1], l[0], l[1], null, s);
    return f.__specifiedRotation = a == null || isNaN(a) ? void 0 : +a * Math.PI / 180 || 0, f.name = e, f;
  }
}
function cfe(e) {
  var t = new C7({
    name: "line",
    subPixelOptimize: !0
  });
  return oI(t.shape, e), t;
}
function oI(e, t) {
  e.x1 = t[0][0], e.y1 = t[0][1], e.x2 = t[1][0], e.y2 = t[1][1], e.percent = 1;
  var r = t[2];
  r ? (e.cpx1 = r[0], e.cpy1 = r[1]) : (e.cpx1 = NaN, e.cpy1 = NaN);
}
var rN = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r, n, i) {
      var a = e.call(this) || this;
      return a._createLine(r, n, i), a;
    }
    return t.prototype._createLine = function(r, n, i) {
      var a = r.hostModel, o = r.getItemLayout(n), s = r.getItemVisual(n, "z2"), l = cfe(o);
      l.shape.percent = 0, Ir(l, {
        z2: et(s, 0),
        shape: {
          percent: 1
        }
      }, a, n), this.add(l), F(qL, function(u) {
        var f = f4(u, r, n);
        this.add(f), this[l4(u)] = u4(u, r, n);
      }, this), this._updateCommonStl(r, n, i);
    }, t.prototype.updateData = function(r, n, i) {
      var a = r.hostModel, o = this.childOfName("line"), s = r.getItemLayout(n), l = {
        shape: {}
      };
      oI(l.shape, s), Wt(o, l, a, n), F(qL, function(u) {
        var f = u4(u, r, n), c = l4(u);
        if (this[c] !== f) {
          this.remove(this.childOfName(u));
          var h = f4(u, r, n);
          this.add(h);
        }
        this[c] = f;
      }, this), this._updateCommonStl(r, n, i);
    }, t.prototype.getLinePath = function() {
      return this.childAt(0);
    }, t.prototype._updateCommonStl = function(r, n, i) {
      var a = r.hostModel, o = this.childOfName("line"), s = i && i.emphasisLineStyle, l = i && i.blurLineStyle, u = i && i.selectLineStyle, f = i && i.labelStatesModels, c = i && i.emphasisDisabled, h = i && i.focus, v = i && i.blurScope;
      if (!i || r.hasItemOption) {
        var d = r.getItemModel(n), g = d.getModel("emphasis");
        s = g.getModel("lineStyle").getLineStyle(), l = d.getModel(["blur", "lineStyle"]).getLineStyle(), u = d.getModel(["select", "lineStyle"]).getLineStyle(), c = g.get("disabled"), h = g.get("focus"), v = g.get("blurScope"), f = Wn(d);
      }
      var y = r.getItemVisual(n, "style"), x = y.stroke;
      o.useStyle(y), o.style.fill = null, o.style.strokeNoScale = !0, o.ensureState("emphasis").style = s, o.ensureState("blur").style = l, o.ensureState("select").style = u, F(qL, function(M) {
        var E = this.childOfName(M);
        if (E) {
          E.setColor(x), E.style.opacity = y.opacity;
          for (var P = 0; P < Ta.length; P++) {
            var R = Ta[P], O = o.getState(R);
            if (O) {
              var N = O.style || {}, G = E.ensureState(R), z = G.style || (G.style = {});
              N.stroke != null && (z[E.__isEmptyBrush ? "stroke" : "fill"] = N.stroke), N.opacity != null && (z.opacity = N.opacity);
            }
          }
          E.markRedraw();
        }
      }, this);
      var S = a.getRawValue(n);
      si(this, f, {
        labelDataIndex: n,
        labelFetcher: {
          getFormattedLabel: function(M, E) {
            return a.getFormattedLabel(M, E, r.dataType);
          }
        },
        inheritColor: x || fe.color.neutral99,
        defaultOpacity: y.opacity,
        defaultText: (S == null ? r.getName(n) : isFinite(S) ? jr(S) : S) + ""
      });
      var T = this.getTextContent();
      if (T) {
        var C = f.normal;
        T.__align = T.style.align, T.__verticalAlign = T.style.verticalAlign, T.__position = C.get("position") || "middle";
        var A = C.get("distance");
        Se(A) || (A = [A, A]), T.__labelDistance = A;
      }
      this.setTextConfig({
        position: null,
        local: !0,
        inside: !1
        // Can't be inside for stroke element.
      }), Hr(this, h, v, c);
    }, t.prototype.highlight = function() {
      mf(this);
    }, t.prototype.downplay = function() {
      yf(this);
    }, t.prototype.updateLayout = function(r, n) {
      this.setLinePoints(r.getItemLayout(n));
    }, t.prototype.setLinePoints = function(r) {
      var n = this.childOfName("line");
      oI(n.shape, r), n.dirty();
    }, t.prototype.beforeUpdate = function() {
      var r = this, n = r.childOfName("fromSymbol"), i = r.childOfName("toSymbol"), a = r.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 = r.childOfName("line");
      if (!this.__dirty && !l.__dirty)
        return;
      var u = l.shape.percent, f = l.pointAt(0), c = l.pointAt(u), h = Ec([], c, f);
      Od(h, h);
      function v(O, N) {
        var G = O.__specifiedRotation;
        if (G == null) {
          var z = l.tangentAt(N);
          O.attr("rotation", (N === 1 ? -1 : 1) * Math.PI / 2 - Math.atan2(z[1], z[0]));
        } else
          O.attr("rotation", G);
      }
      if (n && (n.setPosition(f), v(n, 0), n.scaleX = n.scaleY = o * u, n.markRedraw()), i && (i.setPosition(c), 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, g = void 0, y = a.__labelDistance, x = y[0] * o, S = y[1] * o, T = u / 2, C = l.tangentAt(T), A = [C[1], -C[0]], M = l.pointAt(T);
        A[1] > 0 && (A[0] = -A[0], A[1] = -A[1]);
        var E = C[0] < 0 ? -1 : 1;
        if (a.__position !== "start" && a.__position !== "end") {
          var P = -Math.atan2(C[1], C[0]);
          c[0] < f[0] && (P = Math.PI + P), a.rotation = P;
        }
        var R = void 0;
        switch (a.__position) {
          case "insideStartTop":
          case "insideMiddleTop":
          case "insideEndTop":
          case "middle":
            R = -S, g = "bottom";
            break;
          case "insideStartBottom":
          case "insideMiddleBottom":
          case "insideEndBottom":
            R = S, g = "top";
            break;
          default:
            R = 0, g = "middle";
        }
        switch (a.__position) {
          case "end":
            a.x = h[0] * x + c[0], a.y = h[1] * S + c[1], d = h[0] > 0.8 ? "left" : h[0] < -0.8 ? "right" : "center", g = h[1] > 0.8 ? "top" : h[1] < -0.8 ? "bottom" : "middle";
            break;
          case "start":
            a.x = -h[0] * x + f[0], a.y = -h[1] * S + f[1], d = h[0] > 0.8 ? "right" : h[0] < -0.8 ? "left" : "center", g = h[1] > 0.8 ? "bottom" : h[1] < -0.8 ? "top" : "middle";
            break;
          case "insideStartTop":
          case "insideStart":
          case "insideStartBottom":
            a.x = x * E + f[0], a.y = f[1] + R, d = C[0] < 0 ? "right" : "left", a.originX = -x * E, a.originY = -R;
            break;
          case "insideMiddleTop":
          case "insideMiddle":
          case "insideMiddleBottom":
          case "middle":
            a.x = M[0], a.y = M[1] + R, d = "center", a.originY = -R;
            break;
          case "insideEndTop":
          case "insideEnd":
          case "insideEndBottom":
            a.x = -x * E + c[0], a.y = c[1] + R, d = C[0] >= 0 ? "right" : "left", a.originX = x * E, a.originY = -R;
            break;
        }
        a.scaleX = a.scaleY = o, a.setStyle({
          // Use the user specified text align and baseline first
          verticalAlign: a.__verticalAlign || g,
          align: a.__align || d
        });
      }
    }, t;
  })(rt)
), nN = (
  /** @class */
  (function() {
    function e(t) {
      this.group = new rt(), this._LineCtor = t || rN;
    }
    return e.prototype.updateData = function(t) {
      var r = this;
      this._progressiveEls = null;
      var n = this, i = n.group, a = n._lineData;
      n._lineData = t, a || i.removeAll();
      var o = c4(t);
      t.diff(a).add(function(s) {
        r._doAdd(t, s, o);
      }).update(function(s, l) {
        r._doUpdate(a, t, l, s, o);
      }).remove(function(s) {
        i.remove(a.getItemGraphicEl(s));
      }).execute();
    }, e.prototype.updateLayout = function() {
      var t = this._lineData;
      t && t.eachItemGraphicEl(function(r, n) {
        r.updateLayout(t, n);
      }, this);
    }, e.prototype.incrementalPrepareUpdate = function(t) {
      this._seriesScope = c4(t), this._lineData = null, this.group.removeAll();
    }, e.prototype.incrementalUpdate = function(t, r) {
      this._progressiveEls = [];
      function n(s) {
        !s.isGroup && !hfe(s) && (s.incremental = !0, s.ensureState("emphasis").hoverLayer = !0);
      }
      for (var i = t.start; i < t.end; i++) {
        var a = r.getItemLayout(i);
        if (jL(a)) {
          var o = new this._LineCtor(r, i, this._seriesScope);
          o.traverse(n), this.group.add(o), r.setItemGraphicEl(i, o), this._progressiveEls.push(o);
        }
      }
    }, e.prototype.remove = function() {
      this.group.removeAll();
    }, e.prototype.eachRendered = function(t) {
      rh(this._progressiveEls || this.group, t);
    }, e.prototype._doAdd = function(t, r, n) {
      var i = t.getItemLayout(r);
      if (jL(i)) {
        var a = new this._LineCtor(t, r, n);
        t.setItemGraphicEl(r, a), this.group.add(a);
      }
    }, e.prototype._doUpdate = function(t, r, n, i, a) {
      var o = t.getItemGraphicEl(n);
      if (!jL(r.getItemLayout(i))) {
        this.group.remove(o);
        return;
      }
      o ? o.updateData(r, i, a) : o = new this._LineCtor(r, i, a), r.setItemGraphicEl(i, o), this.group.add(o);
    }, e;
  })()
);
function hfe(e) {
  return e.animators && e.animators.length > 0;
}
function c4(e) {
  var t = e.hostModel, r = t.getModel("emphasis");
  return {
    lineStyle: t.getModel("lineStyle").getLineStyle(),
    emphasisLineStyle: r.getModel(["lineStyle"]).getLineStyle(),
    blurLineStyle: t.getModel(["blur", "lineStyle"]).getLineStyle(),
    selectLineStyle: t.getModel(["select", "lineStyle"]).getLineStyle(),
    emphasisDisabled: r.get("disabled"),
    blurScope: r.get("blurScope"),
    focus: r.get("focus"),
    labelStatesModels: Wn(t)
  };
}
function h4(e) {
  return isNaN(e[0]) || isNaN(e[1]);
}
function jL(e) {
  return e && !h4(e[0]) && !h4(e[1]);
}
var KL = [], QL = [], JL = [], Ig = Si, eD = Fc, v4 = Math.abs;
function d4(e, t, r) {
  for (var n = e[0], i = e[1], a = e[2], o = 1 / 0, s, l = r * r, u = 0.1, f = 0.1; f <= 0.9; f += 0.1) {
    KL[0] = Ig(n[0], i[0], a[0], f), KL[1] = Ig(n[1], i[1], a[1], f);
    var c = v4(eD(KL, t) - l);
    c < o && (o = c, s = f);
  }
  for (var h = 0; h < 32; h++) {
    var v = s + u;
    QL[0] = Ig(n[0], i[0], a[0], s), QL[1] = Ig(n[1], i[1], a[1], s), JL[0] = Ig(n[0], i[0], a[0], v), JL[1] = Ig(n[1], i[1], a[1], v);
    var c = eD(QL, t) - l;
    if (v4(c) < 0.01)
      break;
    var d = eD(JL, t) - l;
    u /= 2, c < 0 ? d >= 0 ? s = s + u : s = s - u : d >= 0 ? s = s - u : s = s + u;
  }
  return s;
}
function tD(e, t) {
  var r = [], n = E1, i = [[], [], []], a = [[], []], o = [];
  t /= 2, e.eachEdge(function(s, l) {
    var u = s.getLayout(), f = s.getVisual("fromSymbol"), c = s.getVisual("toSymbol");
    u.__original || (u.__original = [Zl(u[0]), Zl(u[1])], u[2] && u.__original.push(Zl(u[2])));
    var h = u.__original;
    if (u[2] != null) {
      if (ea(i[0], h[0]), ea(i[1], h[2]), ea(i[2], h[1]), f && f !== "none") {
        var v = Q_(s.node1), d = d4(i, h[0], v * t);
        n(i[0][0], i[1][0], i[2][0], d, r), i[0][0] = r[3], i[1][0] = r[4], n(i[0][1], i[1][1], i[2][1], d, r), i[0][1] = r[3], i[1][1] = r[4];
      }
      if (c && c !== "none") {
        var v = Q_(s.node2), d = d4(i, h[1], v * t);
        n(i[0][0], i[1][0], i[2][0], d, r), i[1][0] = r[1], i[2][0] = r[2], n(i[0][1], i[1][1], i[2][1], d, r), i[1][1] = r[1], i[2][1] = r[2];
      }
      ea(u[0], i[0]), ea(u[1], i[2]), ea(u[2], i[1]);
    } else {
      if (ea(a[0], h[0]), ea(a[1], h[1]), Ec(o, a[1], a[0]), Od(o, o), f && f !== "none") {
        var v = Q_(s.node1);
        z2(a[0], a[0], o, v * t);
      }
      if (c && c !== "none") {
        var v = Q_(s.node2);
        z2(a[1], a[1], o, -v * t);
      }
      ea(u[0], a[0]), ea(u[1], a[1]);
    }
  });
}
var A7 = Bt();
function vfe(e) {
  if (e)
    return A7(e).bridge;
}
function p4(e, t) {
  e && (A7(e).bridge = t);
}
function g4(e) {
  return e.type === "view";
}
var dfe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.init = function(r, n) {
      var i = new kx(), a = new nN(), o = this.group, s = new rt();
      this._controller = new Vd(n.getZr()), this._controllerHost = {
        target: s
      }, s.add(i.group), s.add(a.group), o.add(s), this._symbolDraw = i, this._lineDraw = a, this._mainGroup = s, this._firstRender = !0;
    }, t.prototype.render = function(r, n, i) {
      var a = this, o = r.coordinateSystem, s = !1;
      this._model = r, this._api = i, this._active = !0;
      var l = this._getThumbnailInfo();
      l && l.bridge.reset(i);
      var u = this._symbolDraw, f = this._lineDraw;
      if (g4(o)) {
        var c = {
          x: o.x,
          y: o.y,
          scaleX: o.scaleX,
          scaleY: o.scaleY
        };
        this._firstRender ? this._mainGroup.attr(c) : Wt(this._mainGroup, c, r);
      }
      tD(r.getGraph(), K_(r));
      var h = r.getData();
      u.updateData(h);
      var v = r.getEdgeData();
      f.updateData(v), this._updateNodeAndLinkScale(), this._updateController(null, r, i), clearTimeout(this._layoutTimeout);
      var d = r.forceLayout, g = r.get(["force", "layoutAnimation"]);
      d && (s = !0, this._startForceLayoutIteration(d, i, g));
      var y = r.get("layout");
      h.graph.eachNode(function(C) {
        var A = C.dataIndex, M = C.getGraphicEl(), E = C.getModel();
        if (M) {
          M.off("drag").off("dragend");
          var P = E.get("draggable");
          P && M.on("drag", function(O) {
            switch (y) {
              case "force":
                d.warmUp(), !a._layouting && a._startForceLayoutIteration(d, i, g), d.setFixed(A), h.setItemLayout(A, [M.x, M.y]);
                break;
              case "circular":
                h.setItemLayout(A, [M.x, M.y]), C.setLayout({
                  fixed: !0
                }, !0), tN(r, "symbolSize", C, [O.offsetX, O.offsetY]), a.updateLayout(r);
                break;
              default:
                h.setItemLayout(A, [M.x, M.y]), eN(r.getGraph(), r), a.updateLayout(r);
                break;
            }
          }).on("dragend", function() {
            d && d.setUnfixed(A);
          }), M.setDraggable(P, !!E.get("cursor"));
          var R = E.get(["emphasis", "focus"]);
          R === "adjacency" && (pt(M).focus = C.getAdjacentDataIndices());
        }
      }), h.graph.eachEdge(function(C) {
        var A = C.getGraphicEl(), M = C.getModel().get(["emphasis", "focus"]);
        A && M === "adjacency" && (pt(A).focus = {
          edge: [C.dataIndex],
          node: [C.node1.dataIndex, C.node2.dataIndex]
        });
      });
      var x = r.get("layout") === "circular" && r.get(["circular", "rotateLabel"]), S = h.getLayout("cx"), T = h.getLayout("cy");
      h.graph.eachNode(function(C) {
        T7(C, x, S, T);
      }), this._firstRender = !1, s || this._renderThumbnail(r, i, this._symbolDraw, this._lineDraw);
    }, t.prototype.dispose = function() {
      this.remove(), this._controller && this._controller.dispose(), this._controllerHost = null;
    }, t.prototype._startForceLayoutIteration = function(r, n, i) {
      var a = this, o = !1;
      (function s() {
        r.step(function(l) {
          a.updateLayout(a._model), (l || !o) && (o = !0, a._renderThumbnail(a._model, n, a._symbolDraw, a._lineDraw)), (a._layouting = !l) && (i ? a._layoutTimeout = setTimeout(s, 16) : s());
        });
      })();
    }, t.prototype._updateController = function(r, n, i) {
      var a = this._controller, o = this._controllerHost, s = n.coordinateSystem;
      if (!g4(s)) {
        a.disable();
        return;
      }
      a.enable(n.get("roam"), {
        api: i,
        zInfo: {
          component: n
        },
        triggerInfo: {
          roamTrigger: n.get("roamTrigger"),
          isInSelf: function(l, u, f) {
            return s.containPoint([u, f]);
          },
          isInClip: function(l, u, f) {
            return !r || r.contain(u, f);
          }
        }
      }), o.zoomLimit = n.get("scaleLimit"), o.zoom = s.getZoom(), a.off("pan").off("zoom").on("pan", function(l) {
        i.dispatchAction({
          seriesId: n.id,
          type: "graphRoam",
          dx: l.dx,
          dy: l.dy
        });
      }).on("zoom", function(l) {
        i.dispatchAction({
          seriesId: n.id,
          type: "graphRoam",
          zoom: l.scale,
          originX: l.originX,
          originY: l.originY
        });
      });
    }, t.prototype.updateViewOnPan = function(r, n, i) {
      this._active && (WO(this._controllerHost, i.dx, i.dy), this._updateThumbnailWindow());
    }, t.prototype.updateViewOnZoom = function(r, n, i) {
      this._active && (XO(this._controllerHost, i.zoom, i.originX, i.originY), this._updateNodeAndLinkScale(), tD(r.getGraph(), K_(r)), this._lineDraw.updateLayout(), n.updateLabelLayout(), this._updateThumbnailWindow());
    }, t.prototype._updateNodeAndLinkScale = function() {
      var r = this._model, n = r.getData(), i = K_(r);
      n.eachItemGraphicEl(function(a, o) {
        a && a.setSymbolScale(i);
      });
    }, t.prototype.updateLayout = function(r) {
      this._active && (tD(r.getGraph(), K_(r)), this._symbolDraw.updateLayout(), this._lineDraw.updateLayout());
    }, t.prototype.remove = function() {
      this._active = !1, clearTimeout(this._layoutTimeout), this._layouting = !1, this._layoutTimeout = null, this._symbolDraw && this._symbolDraw.remove(), this._lineDraw && this._lineDraw.remove(), this._controller && this._controller.disable();
    }, t.prototype._getThumbnailInfo = function() {
      var r = this._model, n = r.coordinateSystem;
      if (n.type === "view") {
        var i = vfe(r);
        if (i)
          return {
            bridge: i,
            coordSys: n
          };
      }
    }, t.prototype._updateThumbnailWindow = function() {
      var r = this._getThumbnailInfo();
      r && r.bridge.updateWindow(r.coordSys.transform, this._api);
    }, t.prototype._renderThumbnail = function(r, n, i, a) {
      var o = this._getThumbnailInfo();
      if (o) {
        var s = new rt(), l = i.group.children(), u = a.group.children(), f = new rt(), c = new rt();
        s.add(c), s.add(f);
        for (var h = 0; h < l.length; h++) {
          var v = l[h], d = v.children()[0], g = v.x, y = v.y, x = it(d.shape), S = xe(x, {
            width: d.scaleX,
            height: d.scaleY,
            x: g - d.scaleX / 2,
            y: y - d.scaleY / 2
          }), T = it(d.style), C = new d.constructor({
            shape: S,
            style: T,
            z2: 151
          });
          c.add(C);
        }
        for (var h = 0; h < u.length; h++) {
          var v = u[h], A = v.children()[0], T = it(A.style), S = it(A.shape), M = new C7({
            style: T,
            shape: S,
            z2: 151
          });
          f.add(M);
        }
        o.bridge.renderContent({
          api: n,
          roamType: r.get("roam"),
          viewportRect: null,
          group: s,
          targetTrans: o.coordSys.transform
        });
      }
    }, t.type = "graph", t;
  })(Ut)
);
function Rg(e) {
  return "_EC_" + e;
}
var M7 = (
  /** @class */
  (function() {
    function e(t) {
      this.type = "graph", this.nodes = [], this.edges = [], this._nodesMap = {}, this._edgesMap = {}, this._directed = t || !1;
    }
    return e.prototype.isDirected = function() {
      return this._directed;
    }, e.prototype.addNode = function(t, r) {
      t = t == null ? "" + r : "" + t;
      var n = this._nodesMap;
      if (!n[Rg(t)]) {
        var i = new $v(t, r);
        return i.hostGraph = this, this.nodes.push(i), n[Rg(t)] = i, i;
      }
    }, e.prototype.getNodeByIndex = function(t) {
      var r = this.data.getRawIndex(t);
      return this.nodes[r];
    }, e.prototype.getNodeById = function(t) {
      return this._nodesMap[Rg(t)];
    }, e.prototype.addEdge = function(t, r, n) {
      var i = this._nodesMap, a = this._edgesMap;
      if (Xt(t) && (t = this.nodes[t]), Xt(r) && (r = this.nodes[r]), t instanceof $v || (t = i[Rg(t)]), r instanceof $v || (r = i[Rg(r)]), !(!t || !r)) {
        var o = t.id + "-" + r.id, s = new L7(t, r, n);
        return s.hostGraph = this, this._directed && (t.outEdges.push(s), r.inEdges.push(s)), t.edges.push(s), t !== r && r.edges.push(s), this.edges.push(s), a[o] = s, s;
      }
    }, e.prototype.getEdgeByIndex = function(t) {
      var r = this.edgeData.getRawIndex(t);
      return this.edges[r];
    }, e.prototype.getEdge = function(t, r) {
      t instanceof $v && (t = t.id), r instanceof $v && (r = r.id);
      var n = this._edgesMap;
      return this._directed ? n[t + "-" + r] : n[t + "-" + r] || n[r + "-" + t];
    }, e.prototype.eachNode = function(t, r) {
      for (var n = this.nodes, i = n.length, a = 0; a < i; a++)
        n[a].dataIndex >= 0 && t.call(r, n[a], a);
    }, e.prototype.eachEdge = function(t, r) {
      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(r, n[a], a);
    }, e.prototype.breadthFirstTraverse = function(t, r, n, i) {
      if (r instanceof $v || (r = this._nodesMap[Rg(r)]), !!r) {
        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, r, null))
          for (var s = [r]; s.length; )
            for (var l = s.shift(), u = l[a], o = 0; o < u.length; o++) {
              var f = u[o], c = f.node1 === l ? f.node2 : f.node1;
              if (!c.__visited) {
                if (t.call(i, c, l))
                  return;
                s.push(c), c.__visited = !0;
              }
            }
      }
    }, e.prototype.update = function() {
      for (var t = this.data, r = 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;
      r.filterSelf(function(s) {
        var l = i[r.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 = r.count(); a < o; a++)
        i[r.getRawIndex(a)].dataIndex = a;
    }, e.prototype.clone = function() {
      for (var t = new e(this._directed), r = this.nodes, n = this.edges, i = 0; i < r.length; i++)
        t.addNode(r[i].id, r[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;
    }, e;
  })()
), $v = (
  /** @class */
  (function() {
    function e(t, r) {
      this.inEdges = [], this.outEdges = [], this.edges = [], this.dataIndex = -1, this.id = t ?? "", this.dataIndex = r ?? -1;
    }
    return e.prototype.degree = function() {
      return this.edges.length;
    }, e.prototype.inDegree = function() {
      return this.inEdges.length;
    }, e.prototype.outDegree = function() {
      return this.outEdges.length;
    }, e.prototype.getModel = function(t) {
      if (!(this.dataIndex < 0)) {
        var r = this.hostGraph, n = r.data.getItemModel(this.dataIndex);
        return n.getModel(t);
      }
    }, e.prototype.getAdjacentDataIndices = function() {
      for (var t = {
        edge: [],
        node: []
      }, r = 0; r < this.edges.length; r++) {
        var n = this.edges[r];
        n.dataIndex < 0 || (t.edge.push(n.dataIndex), t.node.push(n.node1.dataIndex, n.node2.dataIndex));
      }
      return t;
    }, e.prototype.getTrajectoryDataIndices = function() {
      for (var t = Je(), r = Je(), n = 0, i = this.edges.length; n < i; n++) {
        var a = this.edges[n];
        if (!(a.dataIndex < 0)) {
          t.set(a.dataIndex, !0);
          for (var o = [a.node1], s = [a.node2], l = 0; l < o.length; ) {
            var u = o[l];
            l++, r.set(u.dataIndex, !0);
            for (var f = u.inEdges, c = 0, h = f.length, v = void 0, d = void 0; c < h; c++)
              v = f[c], d = v.dataIndex, d >= 0 && !t.hasKey(d) && (t.set(d, !0), o.push(v.node1));
          }
          for (l = 0; l < s.length; ) {
            var g = s[l];
            l++, r.set(g.dataIndex, !0);
            for (var y = g.outEdges, c = 0, x = y.length, S = void 0, T = void 0; c < x; c++)
              S = y[c], T = S.dataIndex, T >= 0 && !t.hasKey(T) && (t.set(T, !0), s.push(S.node2));
          }
        }
      }
      return {
        edge: t.keys(),
        node: r.keys()
      };
    }, e;
  })()
), L7 = (
  /** @class */
  (function() {
    function e(t, r, n) {
      this.dataIndex = -1, this.node1 = t, this.node2 = r, this.dataIndex = n ?? -1;
    }
    return e.prototype.getModel = function(t) {
      if (!(this.dataIndex < 0)) {
        var r = this.hostGraph, n = r.edgeData.getItemModel(this.dataIndex);
        return n.getModel(t);
      }
    }, e.prototype.getAdjacentDataIndices = function() {
      return {
        edge: [this.dataIndex],
        node: [this.node1.dataIndex, this.node2.dataIndex]
      };
    }, e.prototype.getTrajectoryDataIndices = function() {
      var t = Je(), r = Je();
      t.set(this.dataIndex, !0);
      for (var n = [this.node1], i = [this.node2], a = 0; a < n.length; ) {
        var o = n[a];
        a++, r.set(o.dataIndex, !0);
        for (var s = o.inEdges, l = 0, u = s.length, f = void 0, c = void 0; l < u; l++)
          f = o.inEdges[l], c = f.dataIndex, c >= 0 && !t.hasKey(c) && (t.set(c, !0), n.push(f.node1));
      }
      for (a = 0; a < i.length; ) {
        var h = i[a];
        a++, r.set(h.dataIndex, !0);
        for (var v = h.outEdges, l = 0, u = v.length, d = void 0, g = void 0; l < u; l++)
          d = h.outEdges[l], g = d.dataIndex, g >= 0 && !t.hasKey(g) && (t.set(g, !0), i.push(d.node2));
      }
      return {
        edge: t.keys(),
        node: r.keys()
      };
    }, e;
  })()
);
function D7(e, t) {
  return {
    /**
     * @param Default 'value'. can be 'a', 'b', 'c', 'd', 'e'.
     */
    getValue: function(r) {
      var n = this[e][t];
      return n.getStore().get(n.getDimensionIndex(r || "value"), this.dataIndex);
    },
    // TODO: TYPE stricter type.
    setVisual: function(r, n) {
      this.dataIndex >= 0 && this[e][t].setItemVisual(this.dataIndex, r, n);
    },
    getVisual: function(r) {
      return this[e][t].getItemVisual(this.dataIndex, r);
    },
    setLayout: function(r, n) {
      this.dataIndex >= 0 && this[e][t].setItemLayout(this.dataIndex, r, n);
    },
    getLayout: function() {
      return this[e][t].getItemLayout(this.dataIndex);
    },
    getGraphicEl: function() {
      return this[e][t].getItemGraphicEl(this.dataIndex);
    },
    getRawIndex: function() {
      return this[e][t].getRawIndex(this.dataIndex);
    }
  };
}
cn($v, D7("hostGraph", "data"));
cn(L7, D7("hostGraph", "edgeData"));
function iN(e, t, r, n, i) {
  for (var a = new M7(n), o = 0; o < e.length; o++)
    a.addNode(Ti(
      // Id, name, dataIndex
      e[o].id,
      e[o].name,
      o
    ), o);
  for (var s = [], l = [], u = 0, o = 0; o < t.length; o++) {
    var f = t[o], c = f.source, h = f.target;
    a.addEdge(c, h, u) && (l.push(f), s.push(Ti(Gn(f.id, null), c + " > " + h)), u++);
  }
  var v = r.get("coordinateSystem"), d;
  if (v === "cartesian2d" || v === "polar" || v === "matrix")
    d = ou(e, r);
  else {
    var g = ny.get(v), y = g ? g.dimensions || [] : [];
    Tt(y, "value") < 0 && y.concat(["value"]);
    var x = sy(e, {
      coordDimensions: y,
      encodeDefine: r.getEncode()
    }).dimensions;
    d = new zr(x, r), d.initData(e);
  }
  var S = new zr(["value"], r);
  return S.initData(l, s), i && i(d, S), $O({
    mainData: d,
    struct: a,
    structAttr: "graph",
    datas: {
      node: d,
      edge: S
    },
    datasAttr: {
      node: "data",
      edge: "edgeData"
    }
  }), a.update(), a;
}
var pfe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.hasSymbolVisual = !0, r;
    }
    return t.prototype.init = function(r) {
      e.prototype.init.apply(this, arguments);
      var n = this;
      function i() {
        return n._categoriesData;
      }
      this.legendVisualProvider = new hy(i, i), this.fillDataTextStyle(r.edges || r.links), this._updateCategoriesData();
    }, t.prototype.mergeOption = function(r) {
      e.prototype.mergeOption.apply(this, arguments), this.fillDataTextStyle(r.edges || r.links), this._updateCategoriesData();
    }, t.prototype.mergeDefaultAndTheme = function(r) {
      e.prototype.mergeDefaultAndTheme.apply(this, arguments), xd(r, "edgeLabel", ["show"]);
    }, t.prototype.getInitialData = function(r, n) {
      var i = r.edges || r.links || [], a = r.data || r.nodes || [], o = this;
      if (a && i) {
        rfe(this);
        var s = iN(a, i, this, !0, l);
        return F(s.edges, function(u) {
          nfe(u.node1, u.node2, this, u.dataIndex);
        }, this), s.data;
      }
      function l(u, f) {
        u.wrapMethod("getItemModel", function(d) {
          var g = o._categoriesModels, y = d.getShallow("category"), x = g[y];
          return x && (x.parentModel = d.parentModel, d.parentModel = x), d;
        });
        var c = It.prototype.getModel;
        function h(d, g) {
          var y = c.call(this, d, g);
          return y.resolveParentPath = v, y;
        }
        f.wrapMethod("getItemModel", function(d) {
          return d.resolveParentPath = v, d.getModel = h, d;
        });
        function v(d) {
          if (d && (d[0] === "label" || d[1] === "label")) {
            var g = d.slice();
            return d[0] === "label" ? g[0] = "edgeLabel" : d[1] === "label" && (g[1] = "edgeLabel"), g;
          }
          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(r, n, i) {
      if (i === "edge") {
        var a = this.getData(), o = this.getDataParams(r, i), s = a.graph.getEdgeByIndex(r), l = a.getName(s.node1.dataIndex), u = a.getName(s.node2.dataIndex), f = [];
        return l != null && f.push(l), u != null && f.push(u), Rn("nameValue", {
          name: f.join(" > "),
          value: o.value,
          noValue: o.value == null
        });
      }
      var c = P8({
        series: this,
        dataIndex: r,
        multipleSeries: n
      });
      return c;
    }, t.prototype._updateCategoriesData = function() {
      var r = Ce(this.option.categories || [], function(i) {
        return i.value != null ? i : xe({
          value: 0
        }, i);
      }), n = new zr(["value"], this);
      n.initData(r), this._categoriesData = n, this._categoriesModels = n.mapArray(function(i) {
        return n.getItemModel(i);
      });
    }, t.prototype.setZoom = function(r) {
      this.option.zoom = r;
    }, t.prototype.setCenter = function(r) {
      this.option.center = r;
    }, t.prototype.isAnimationEnabled = function() {
      return e.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: {
        // Don't use tokens.color.border because of the opacity
        color: fe.color.neutral50,
        width: 1,
        opacity: 0.5
      },
      emphasis: {
        scale: !0,
        label: {
          show: !0
        }
      },
      select: {
        itemStyle: {
          borderColor: fe.color.primary
        }
      }
    }, t;
  })(Yt)
);
function gfe(e) {
  e.registerChartView(dfe), e.registerSeriesModel(pfe), e.registerProcessor(Kue), e.registerVisual(Que), e.registerVisual(Jue), e.registerLayout(ife), e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT, ofe), e.registerLayout(lfe), e.registerCoordinateSystem("graphView", {
    dimensions: Hd.dimensions,
    create: ffe
  }), e.registerAction({
    type: "focusNodeAdjacency",
    event: "focusNodeAdjacency",
    update: "series:focusNodeAdjacency"
  }, un), e.registerAction({
    type: "unfocusNodeAdjacency",
    event: "unfocusNodeAdjacency",
    update: "series:unfocusNodeAdjacency"
  }, un), e.registerAction({
    type: "graphRoam",
    event: "graphRoam",
    update: "none"
  }, function(t, r, n) {
    r.eachComponent({
      mainType: "series",
      query: t
    }, function(i) {
      var a = n.getViewOfSeriesModel(i);
      a && (t.dx != null && t.dy != null && a.updateViewOnPan(i, n, t), t.zoom != null && t.originX != null && t.originY != null && a.updateViewOnZoom(i, n, t));
      var o = i.coordinateSystem, s = XC(o, t, i.get("scaleLimit"));
      i.setCenter && i.setCenter(s.center), i.setZoom && i.setZoom(s.zoom);
    });
  });
}
var m4 = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r, n, i) {
      var a = e.call(this) || this;
      pt(a).dataType = "node", a.z2 = 2;
      var o = new Rt();
      return a.setTextContent(o), a.updateData(r, n, i, !0), a;
    }
    return t.prototype.updateData = function(r, n, i, a) {
      var o = this, s = r.graph.getNodeByIndex(n), l = r.hostModel, u = s.getModel(), f = u.getModel("emphasis"), c = r.getItemLayout(n), h = xe(Yl(u.getModel("itemStyle"), c, !0), c), v = this;
      if (isNaN(h.startAngle)) {
        v.setShape(h);
        return;
      }
      a ? v.setShape(h) : Wt(v, {
        shape: h
      }, l, n);
      var d = xe(Yl(u.getModel("itemStyle"), c, !0), c);
      o.setShape(d), o.useStyle(r.getItemVisual(n, "style")), Un(o, u), this._updateLabel(l, u, s), r.setItemGraphicEl(n, v), Un(v, u, "itemStyle");
      var g = f.get("focus");
      Hr(this, g === "adjacency" ? s.getAdjacentDataIndices() : g, f.get("blurScope"), f.get("disabled"));
    }, t.prototype._updateLabel = function(r, n, i) {
      var a = this.getTextContent(), o = i.getLayout(), s = (o.startAngle + o.endAngle) / 2, l = Math.cos(s), u = Math.sin(s), f = n.getModel("label");
      a.ignore = !f.get("show");
      var c = Wn(n), h = i.getVisual("style");
      si(a, c, {
        labelFetcher: {
          getFormattedLabel: function(S, T, C, A, M, E) {
            return r.getFormattedLabel(
              S,
              T,
              "node",
              A,
              // ensure edgeLabel formatter is provided
              // to prevent the inheritance from `label.formatter` of the series
              $a(M, c.normal && c.normal.get("formatter"), n.get("name")),
              E
            );
          }
        },
        labelDataIndex: i.dataIndex,
        defaultText: i.dataIndex + "",
        inheritColor: h.fill,
        defaultOpacity: h.opacity,
        defaultOutsidePosition: "startArc"
      });
      var v = f.get("position") || "outside", d = f.get("distance") || 0, g;
      v === "outside" ? g = o.r + d : g = (o.r + o.r0) / 2, this.textConfig = {
        inside: v !== "outside"
      };
      var y = v !== "outside" ? f.get("align") || "center" : l > 0 ? "left" : "right", x = v !== "outside" ? f.get("verticalAlign") || "middle" : u > 0 ? "top" : "bottom";
      a.attr({
        x: l * g + o.cx,
        y: u * g + o.cy,
        rotation: 0,
        style: {
          align: y,
          verticalAlign: x
        }
      });
    }, t;
  })(Ui)
), mfe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r, n, i, a) {
      var o = e.call(this) || this;
      return pt(o).dataType = "edge", o.updateData(r, n, i, a, !0), o;
    }
    return t.prototype.buildPath = function(r, n) {
      r.moveTo(n.s1[0], n.s1[1]);
      var i = 0.7, a = n.clockwise;
      r.arc(n.cx, n.cy, n.r, n.sStartAngle, n.sEndAngle, !a), r.bezierCurveTo((n.cx - n.s2[0]) * i + n.s2[0], (n.cy - n.s2[1]) * i + n.s2[1], (n.cx - n.t1[0]) * i + n.t1[0], (n.cy - n.t1[1]) * i + n.t1[1], n.t1[0], n.t1[1]), r.arc(n.cx, n.cy, n.r, n.tStartAngle, n.tEndAngle, !a), r.bezierCurveTo((n.cx - n.t2[0]) * i + n.t2[0], (n.cy - n.t2[1]) * i + n.t2[1], (n.cx - n.s1[0]) * i + n.s1[0], (n.cy - n.s1[1]) * i + n.s1[1], n.s1[0], n.s1[1]), r.closePath();
    }, t.prototype.updateData = function(r, n, i, a, o) {
      var s = r.hostModel, l = n.graph.getEdgeByIndex(i), u = l.getLayout(), f = l.node1.getModel(), c = n.getItemModel(l.dataIndex), h = c.getModel("lineStyle"), v = c.getModel("emphasis"), d = v.get("focus"), g = xe(Yl(f.getModel("itemStyle"), u, !0), u), y = this;
      if (isNaN(g.sStartAngle) || isNaN(g.tStartAngle)) {
        y.setShape(g);
        return;
      }
      o ? (y.setShape(g), y4(y, l, r, h)) : (vs(y), y4(y, l, r, h), Wt(y, {
        shape: g
      }, s, i)), Hr(this, d === "adjacency" ? l.getAdjacentDataIndices() : d, v.get("blurScope"), v.get("disabled")), Un(y, c, "lineStyle"), n.setItemGraphicEl(l.dataIndex, y);
    }, t;
  })(zt)
);
function y4(e, t, r, n) {
  var i = t.node1, a = t.node2, o = e.style;
  e.setStyle(n.getLineStyle());
  var s = n.get("color");
  switch (s) {
    case "source":
      o.fill = r.getItemVisual(i.dataIndex, "style").fill, o.decal = i.getVisual("style").decal;
      break;
    case "target":
      o.fill = r.getItemVisual(a.dataIndex, "style").fill, o.decal = a.getVisual("style").decal;
      break;
    case "gradient":
      var l = r.getItemVisual(i.dataIndex, "style").fill, u = r.getItemVisual(a.dataIndex, "style").fill;
      if (Fe(l) && Fe(u)) {
        var f = e.shape, c = (f.s1[0] + f.s2[0]) / 2, h = (f.s1[1] + f.s2[1]) / 2, v = (f.t1[0] + f.t2[0]) / 2, d = (f.t1[1] + f.t2[1]) / 2;
        o.fill = new Nd(c, h, v, d, [{
          offset: 0,
          color: l
        }, {
          offset: 1,
          color: u
        }], !0);
      }
      break;
  }
}
var yfe = Math.PI / 180, _fe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.init = function(r, n) {
    }, t.prototype.render = function(r, n, i) {
      var a = r.getData(), o = this._data, s = this.group, l = -r.get("startAngle") * yfe;
      if (a.diff(o).add(function(f) {
        var c = a.getItemLayout(f);
        if (c) {
          var h = new m4(a, f, l);
          pt(h).dataIndex = f, s.add(h);
        }
      }).update(function(f, c) {
        var h = o.getItemGraphicEl(c), v = a.getItemLayout(f);
        if (!v) {
          h && ff(h, r, c);
          return;
        }
        h ? h.updateData(a, f, l) : h = new m4(a, f, l), s.add(h);
      }).remove(function(f) {
        var c = o.getItemGraphicEl(f);
        c && ff(c, r, f);
      }).execute(), !o) {
        var u = r.get("center");
        this.group.scaleX = 0.01, this.group.scaleY = 0.01, this.group.originX = Be(u[0], i.getWidth()), this.group.originY = Be(u[1], i.getHeight()), Ir(this.group, {
          scaleX: 1,
          scaleY: 1
        }, r);
      }
      this._data = a, this.renderEdges(r, l);
    }, t.prototype.renderEdges = function(r, n) {
      var i = r.getData(), a = r.getEdgeData(), o = this._edgeData, s = this.group;
      a.diff(o).add(function(l) {
        var u = new mfe(i, a, l, n);
        pt(u).dataIndex = l, s.add(u);
      }).update(function(l, u) {
        var f = o.getItemGraphicEl(u);
        f.updateData(i, a, l, n), s.add(f);
      }).remove(function(l) {
        var u = o.getItemGraphicEl(l);
        u && ff(u, r, l);
      }).execute(), this._edgeData = a;
    }, t.prototype.dispose = function() {
    }, t.type = "chord", t;
  })(Ut)
), xfe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.init = function(r) {
      e.prototype.init.apply(this, arguments), this.fillDataTextStyle(r.edges || r.links), this.legendVisualProvider = new hy(Ge(this.getData, this), Ge(this.getRawData, this));
    }, t.prototype.mergeOption = function(r) {
      e.prototype.mergeOption.apply(this, arguments), this.fillDataTextStyle(r.edges || r.links);
    }, t.prototype.getInitialData = function(r, n) {
      var i = r.edges || r.links || [], a = r.data || r.nodes || [];
      if (a && i) {
        var o = iN(a, i, this, !0, s);
        return o.data;
      }
      function s(l, u) {
        var f = It.prototype.getModel;
        function c(v, d) {
          var g = f.call(this, v, d);
          return g.resolveParentPath = h, g;
        }
        u.wrapMethod("getItemModel", function(v) {
          return v.resolveParentPath = h, v.getModel = c, v;
        });
        function h(v) {
          if (v && (v[0] === "label" || v[1] === "label")) {
            var d = v.slice();
            return v[0] === "label" ? d[0] = "edgeLabel" : v[1] === "label" && (d[1] = "edgeLabel"), d;
          }
          return v;
        }
      }
    }, t.prototype.getGraph = function() {
      return this.getData().graph;
    }, t.prototype.getEdgeData = function() {
      return this.getGraph().edgeData;
    }, t.prototype.formatTooltip = function(r, n, i) {
      var a = this.getDataParams(r, i);
      if (i === "edge") {
        var o = this.getData(), s = o.graph.getEdgeByIndex(r), l = o.getName(s.node1.dataIndex), u = o.getName(s.node2.dataIndex), f = [];
        return l != null && f.push(l), u != null && f.push(u), Rn("nameValue", {
          name: f.join(" > "),
          value: a.value,
          noValue: a.value == null
        });
      }
      return Rn("nameValue", {
        name: a.name,
        value: a.value,
        noValue: a.value == null
      });
    }, t.prototype.getDataParams = function(r, n) {
      var i = e.prototype.getDataParams.call(this, r, n);
      if (n === "node") {
        var a = this.getData(), o = this.getGraph().getNodeByIndex(r);
        if (i.name == null && (i.name = a.getName(r)), i.value == null) {
          var s = o.getLayout().value;
          i.value = s;
        }
      }
      return i;
    }, t.type = "series.chord", t.defaultOption = {
      // zlevel: 0,
      z: 2,
      coordinateSystem: "none",
      legendHoverLink: !0,
      colorBy: "data",
      left: 0,
      top: 0,
      right: 0,
      bottom: 0,
      width: null,
      height: null,
      center: ["50%", "50%"],
      radius: ["70%", "80%"],
      clockwise: !0,
      startAngle: 90,
      endAngle: "auto",
      minAngle: 0,
      padAngle: 3,
      itemStyle: {
        borderRadius: [0, 0, 5, 5]
      },
      lineStyle: {
        width: 0,
        color: "source",
        opacity: 0.2
      },
      label: {
        show: !0,
        position: "outside",
        distance: 5
      },
      emphasis: {
        focus: "adjacency",
        lineStyle: {
          opacity: 0.5
        }
      }
    }, t;
  })(Yt)
), rD = Math.PI / 180;
function Sfe(e, t) {
  e.eachSeriesByType("chord", function(r) {
    wfe(r, t);
  });
}
function wfe(e, t) {
  var r = e.getData(), n = r.graph, i = e.getEdgeData(), a = i.count();
  if (a) {
    var o = jW(e, t), s = o.cx, l = o.cy, u = o.r, f = o.r0, c = Math.max((e.get("padAngle") || 0) * rD, 0), h = Math.max((e.get("minAngle") || 0) * rD, 0), v = -e.get("startAngle") * rD, d = v + Math.PI * 2, g = e.get("clockwise"), y = g ? 1 : -1, x = [v, d];
    TC(x, !g);
    var S = x[0], T = x[1], C = T - S, A = r.getSum("value") === 0 && i.getSum("value") === 0, M = [], E = 0;
    n.eachEdge(function(V) {
      var Q = A ? 1 : V.getValue("value");
      A && (Q > 0 || h) && (E += 2);
      var q = V.node1.dataIndex, X = V.node2.dataIndex;
      M[q] = (M[q] || 0) + Q, M[X] = (M[X] || 0) + Q;
    });
    var P = 0;
    if (n.eachNode(function(V) {
      var Q = V.getValue("value");
      isNaN(Q) || (M[V.dataIndex] = Math.max(Q, M[V.dataIndex] || 0)), !A && (M[V.dataIndex] > 0 || h) && E++, P += M[V.dataIndex] || 0;
    }), !(E === 0 || P === 0)) {
      c * E >= Math.abs(C) && (c = Math.max(0, (Math.abs(C) - h * E) / E)), (c + h) * E >= Math.abs(C) && (h = (Math.abs(C) - c * E) / E);
      var R = (C - c * E * y) / P, O = 0, N = 0, G = 0;
      n.eachNode(function(V) {
        var Q = M[V.dataIndex] || 0, q = R * (P ? Q : 1) * y;
        Math.abs(q) < h ? O += h - Math.abs(q) : (N += Math.abs(q) - h, G += Math.abs(q)), V.setLayout({
          angle: q,
          value: Q
        });
      });
      var z = !1;
      if (O > N) {
        var H = O / N;
        n.eachNode(function(V) {
          var Q = V.getLayout().angle;
          Math.abs(Q) >= h ? V.setLayout({
            angle: Q * H,
            ratio: H
          }, !0) : V.setLayout({
            angle: h,
            ratio: h === 0 ? 1 : Q / h
          }, !0);
        });
      } else
        n.eachNode(function(V) {
          if (!z) {
            var Q = V.getLayout().angle, q = Math.min(Q / G, 1), X = q * O;
            Q - X < h && (z = !0);
          }
        });
      var W = O;
      n.eachNode(function(V) {
        if (!(W <= 0)) {
          var Q = V.getLayout().angle;
          if (Q > h && h > 0) {
            var q = z ? 1 : Math.min(Q / G, 1), X = Q - h, K = Math.min(X, Math.min(W, O * q));
            W -= K, V.setLayout({
              angle: Q - K,
              ratio: (Q - K) / Q
            }, !0);
          } else h > 0 && V.setLayout({
            angle: h,
            ratio: Q === 0 ? 1 : h / Q
          }, !0);
        }
      });
      var Z = S, ee = [];
      n.eachNode(function(V) {
        var Q = Math.max(V.getLayout().angle, h);
        V.setLayout({
          cx: s,
          cy: l,
          r0: f,
          r: u,
          startAngle: Z,
          endAngle: Z + Q * y,
          clockwise: g
        }, !0), ee[V.dataIndex] = Z, Z += (Q + c) * y;
      }), n.eachEdge(function(V) {
        var Q = A ? 1 : V.getValue("value"), q = R * (P ? Q : 1) * y, X = V.node1.dataIndex, K = ee[X] || 0, ue = Math.abs((V.node1.getLayout().ratio || 1) * q), oe = K + ue * y, te = [s + f * Math.cos(K), l + f * Math.sin(K)], pe = [s + f * Math.cos(oe), l + f * Math.sin(oe)], me = V.node2.dataIndex, de = ee[me] || 0, ve = Math.abs((V.node2.getLayout().ratio || 1) * q), Ae = de + ve * y, be = [s + f * Math.cos(de), l + f * Math.sin(de)], De = [s + f * Math.cos(Ae), l + f * Math.sin(Ae)];
        V.setLayout({
          s1: te,
          s2: pe,
          sStartAngle: K,
          sEndAngle: oe,
          t1: be,
          t2: De,
          tStartAngle: de,
          tEndAngle: Ae,
          cx: s,
          cy: l,
          r: f,
          value: Q,
          clockwise: g
        }), ee[X] = oe, ee[me] = Ae;
      });
    }
  }
}
function Tfe(e) {
  e.registerChartView(_fe), e.registerSeriesModel(xfe), e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT, Sfe), e.registerProcessor(fy("chord"));
}
var bfe = (
  /** @class */
  /* @__PURE__ */ (function() {
    function e() {
      this.angle = 0, this.width = 10, this.r = 10, this.x = 0, this.y = 0;
    }
    return e;
  })()
), Cfe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r) {
      var n = e.call(this, r) || this;
      return n.type = "pointer", n;
    }
    return t.prototype.getDefaultShape = function() {
      return new bfe();
    }, t.prototype.buildPath = function(r, 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), f = n.y - a(l) * s * (s >= o / 3 ? 1 : 2);
      l = n.angle - Math.PI / 2, r.moveTo(u, f), r.lineTo(n.x + i(l) * s, n.y + a(l) * s), r.lineTo(n.x + i(n.angle) * o, n.y + a(n.angle) * o), r.lineTo(n.x - i(l) * s, n.y - a(l) * s), r.lineTo(u, f);
    }, t;
  })(zt)
);
function Afe(e, t) {
  var r = e.get("center"), n = t.getWidth(), i = t.getHeight(), a = Math.min(n, i), o = Be(r[0], t.getWidth()), s = Be(r[1], t.getHeight()), l = Be(e.get("radius"), a / 2);
  return {
    cx: o,
    cy: s,
    r: l
  };
}
function TT(e, t) {
  var r = e == null ? "" : e + "";
  return t && (Fe(t) ? r = t.replace("{value}", r) : nt(t) && (r = t(e))), r;
}
var Mfe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.render = function(r, n, i) {
      this.group.removeAll();
      var a = r.get(["axisLine", "lineStyle", "color"]), o = Afe(r, i);
      this._renderMain(r, n, i, a, o), this._data = r.getData();
    }, t.prototype.dispose = function() {
    }, t.prototype._renderMain = function(r, n, i, a, o) {
      var s = this.group, l = r.get("clockwise"), u = -r.get("startAngle") / 180 * Math.PI, f = -r.get("endAngle") / 180 * Math.PI, c = r.getModel("axisLine"), h = c.get("roundCap"), v = h ? bb : Ui, d = c.get("show"), g = c.getModel("lineStyle"), y = g.get("width"), x = [u, f];
      TC(x, !l), u = x[0], f = x[1];
      for (var S = f - u, T = u, C = [], A = 0; d && A < a.length; A++) {
        var M = Math.min(Math.max(a[A][0], 0), 1);
        f = u + S * M;
        var E = new v({
          shape: {
            startAngle: T,
            endAngle: f,
            cx: o.cx,
            cy: o.cy,
            clockwise: l,
            r0: o.r - y,
            r: o.r
          },
          silent: !0
        });
        E.setStyle({
          fill: a[A][1]
        }), E.setStyle(g.getLineStyle(
          // Because we use sector to simulate arc
          // so the properties for stroking are useless
          ["color", "width"]
        )), C.push(E), T = f;
      }
      C.reverse(), F(C, function(R) {
        return s.add(R);
      });
      var P = function(R) {
        if (R <= 0)
          return a[0][1];
        var O;
        for (O = 0; O < a.length; O++)
          if (a[O][0] >= R && (O === 0 ? 0 : a[O - 1][0]) < R)
            return a[O][1];
        return a[O - 1][1];
      };
      this._renderTicks(r, n, i, P, o, u, f, l, y), this._renderTitleAndDetail(r, n, i, P, o), this._renderAnchor(r, o), this._renderPointer(r, n, i, P, o, u, f, l, y);
    }, t.prototype._renderTicks = function(r, n, i, a, o, s, l, u, f) {
      for (var c = this.group, h = o.cx, v = o.cy, d = o.r, g = +r.get("min"), y = +r.get("max"), x = r.getModel("splitLine"), S = r.getModel("axisTick"), T = r.getModel("axisLabel"), C = r.get("splitNumber"), A = S.get("splitNumber"), M = Be(x.get("length"), d), E = Be(S.get("length"), d), P = s, R = (l - s) / C, O = R / A, N = x.getModel("lineStyle").getLineStyle(), G = S.getModel("lineStyle").getLineStyle(), z = x.get("distance"), H, W, Z = 0; Z <= C; Z++) {
        if (H = Math.cos(P), W = Math.sin(P), x.get("show")) {
          var ee = z ? z + f : f, V = new wn({
            shape: {
              x1: H * (d - ee) + h,
              y1: W * (d - ee) + v,
              x2: H * (d - M - ee) + h,
              y2: W * (d - M - ee) + v
            },
            style: N,
            silent: !0
          });
          N.stroke === "auto" && V.setStyle({
            stroke: a(Z / C)
          }), c.add(V);
        }
        if (T.get("show")) {
          var ee = T.get("distance") + z, Q = TT(jr(Z / C * (y - g) + g), T.get("formatter")), q = a(Z / C), X = H * (d - M - ee) + h, K = W * (d - M - ee) + v, ue = T.get("rotate"), oe = 0;
          ue === "radial" ? (oe = -P + 2 * Math.PI, oe > Math.PI / 2 && (oe += Math.PI)) : ue === "tangential" ? oe = -P - Math.PI / 2 : Xt(ue) && (oe = ue * Math.PI / 180), oe === 0 ? c.add(new Rt({
            style: gr(T, {
              text: Q,
              x: X,
              y: K,
              verticalAlign: W < -0.8 ? "top" : W > 0.8 ? "bottom" : "middle",
              align: H < -0.4 ? "left" : H > 0.4 ? "right" : "center"
            }, {
              inheritColor: q
            }),
            silent: !0
          })) : c.add(new Rt({
            style: gr(T, {
              text: Q,
              x: X,
              y: K,
              verticalAlign: "middle",
              align: "center"
            }, {
              inheritColor: q
            }),
            silent: !0,
            originX: X,
            originY: K,
            rotation: oe
          }));
        }
        if (S.get("show") && Z !== C) {
          var ee = S.get("distance");
          ee = ee ? ee + f : f;
          for (var te = 0; te <= A; te++) {
            H = Math.cos(P), W = Math.sin(P);
            var pe = new wn({
              shape: {
                x1: H * (d - ee) + h,
                y1: W * (d - ee) + v,
                x2: H * (d - E - ee) + h,
                y2: W * (d - E - ee) + v
              },
              silent: !0,
              style: G
            });
            G.stroke === "auto" && pe.setStyle({
              stroke: a((Z + te / A) / C)
            }), c.add(pe), P += O;
          }
          P -= O;
        } else
          P += R;
      }
    }, t.prototype._renderPointer = function(r, n, i, a, o, s, l, u, f) {
      var c = this.group, h = this._data, v = this._progressEls, d = [], g = r.get(["pointer", "show"]), y = r.getModel("progress"), x = y.get("show"), S = r.getData(), T = S.mapDimension("value"), C = +r.get("min"), A = +r.get("max"), M = [C, A], E = [s, l];
      function P(O, N) {
        var G = S.getItemModel(O), z = G.getModel("pointer"), H = Be(z.get("width"), o.r), W = Be(z.get("length"), o.r), Z = r.get(["pointer", "icon"]), ee = z.get("offsetCenter"), V = Be(ee[0], o.r), Q = Be(ee[1], o.r), q = z.get("keepAspect"), X;
        return Z ? X = en(Z, V - H / 2, Q - W, H, W, null, q) : X = new Cfe({
          shape: {
            angle: -Math.PI / 2,
            width: H,
            r: W,
            x: V,
            y: Q
          }
        }), X.rotation = -(N + Math.PI / 2), X.x = o.cx, X.y = o.cy, X;
      }
      function R(O, N) {
        var G = y.get("roundCap"), z = G ? bb : Ui, H = y.get("overlap"), W = H ? y.get("width") : f / S.count(), Z = H ? o.r - W : o.r - (O + 1) * W, ee = H ? o.r : o.r - O * W, V = new z({
          shape: {
            startAngle: s,
            endAngle: N,
            cx: o.cx,
            cy: o.cy,
            clockwise: u,
            r0: Z,
            r: ee
          }
        });
        return H && (V.z2 = er(S.get(T, O), [C, A], [100, 0], !0)), V;
      }
      (x || g) && (S.diff(h).add(function(O) {
        var N = S.get(T, O);
        if (g) {
          var G = P(O, s);
          Ir(G, {
            rotation: -((isNaN(+N) ? E[0] : er(N, M, E, !0)) + Math.PI / 2)
          }, r), c.add(G), S.setItemGraphicEl(O, G);
        }
        if (x) {
          var z = R(O, s), H = y.get("clip");
          Ir(z, {
            shape: {
              endAngle: er(N, M, E, H)
            }
          }, r), c.add(z), nP(r.seriesIndex, S.dataType, O, z), d[O] = z;
        }
      }).update(function(O, N) {
        var G = S.get(T, O);
        if (g) {
          var z = h.getItemGraphicEl(N), H = z ? z.rotation : s, W = P(O, H);
          W.rotation = H, Wt(W, {
            rotation: -((isNaN(+G) ? E[0] : er(G, M, E, !0)) + Math.PI / 2)
          }, r), c.add(W), S.setItemGraphicEl(O, W);
        }
        if (x) {
          var Z = v[N], ee = Z ? Z.shape.endAngle : s, V = R(O, ee), Q = y.get("clip");
          Wt(V, {
            shape: {
              endAngle: er(G, M, E, Q)
            }
          }, r), c.add(V), nP(r.seriesIndex, S.dataType, O, V), d[O] = V;
        }
      }).execute(), S.each(function(O) {
        var N = S.getItemModel(O), G = N.getModel("emphasis"), z = G.get("focus"), H = G.get("blurScope"), W = G.get("disabled");
        if (g) {
          var Z = S.getItemGraphicEl(O), ee = S.getItemVisual(O, "style"), V = ee.fill;
          if (Z instanceof Xn) {
            var Q = Z.style;
            Z.useStyle(xe({
              image: Q.image,
              x: Q.x,
              y: Q.y,
              width: Q.width,
              height: Q.height
            }, ee));
          } else
            Z.useStyle(ee), Z.type !== "pointer" && Z.setColor(V);
          Z.setStyle(N.getModel(["pointer", "itemStyle"]).getItemStyle()), Z.style.fill === "auto" && Z.setStyle("fill", a(er(S.get(T, O), M, [0, 1], !0))), Z.z2EmphasisLift = 0, Un(Z, N), Hr(Z, z, H, W);
        }
        if (x) {
          var q = d[O];
          q.useStyle(S.getItemVisual(O, "style")), q.setStyle(N.getModel(["progress", "itemStyle"]).getItemStyle()), q.z2EmphasisLift = 0, Un(q, N), Hr(q, z, H, W);
        }
      }), this._progressEls = d);
    }, t.prototype._renderAnchor = function(r, n) {
      var i = r.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"), f = en(s, n.cx - o / 2 + Be(l[0], n.r), n.cy - o / 2 + Be(l[1], n.r), o, o, null, u);
        f.z2 = i.get("showAbove") ? 1 : 0, f.setStyle(i.getModel("itemStyle").getItemStyle()), this.group.add(f);
      }
    }, t.prototype._renderTitleAndDetail = function(r, n, i, a, o) {
      var s = this, l = r.getData(), u = l.mapDimension("value"), f = +r.get("min"), c = +r.get("max"), h = new rt(), v = [], d = [], g = r.isAnimationEnabled(), y = r.get(["pointer", "showAbove"]);
      l.diff(this._data).add(function(x) {
        v[x] = new Rt({
          silent: !0
        }), d[x] = new Rt({
          silent: !0
        });
      }).update(function(x, S) {
        v[x] = s._titleEls[S], d[x] = s._detailEls[S];
      }).execute(), l.each(function(x) {
        var S = l.getItemModel(x), T = l.get(u, x), C = new rt(), A = a(er(T, [f, c], [0, 1], !0)), M = S.getModel("title");
        if (M.get("show")) {
          var E = M.get("offsetCenter"), P = o.cx + Be(E[0], o.r), R = o.cy + Be(E[1], o.r), O = v[x];
          O.attr({
            z2: y ? 0 : 2,
            style: gr(M, {
              x: P,
              y: R,
              text: l.getName(x),
              align: "center",
              verticalAlign: "middle"
            }, {
              inheritColor: A
            })
          }), C.add(O);
        }
        var N = S.getModel("detail");
        if (N.get("show")) {
          var G = N.get("offsetCenter"), z = o.cx + Be(G[0], o.r), H = o.cy + Be(G[1], o.r), W = Be(N.get("width"), o.r), Z = Be(N.get("height"), o.r), ee = r.get(["progress", "show"]) ? l.getItemVisual(x, "style").fill : A, O = d[x], V = N.get("formatter");
          O.attr({
            z2: y ? 0 : 2,
            style: gr(N, {
              x: z,
              y: H,
              text: TT(T, V),
              width: isNaN(W) ? null : W,
              height: isNaN(Z) ? null : Z,
              align: "center",
              verticalAlign: "middle"
            }, {
              inheritColor: ee
            })
          }), PW(O, {
            normal: N
          }, T, function(q) {
            return TT(q, V);
          }), g && IW(O, x, l, r, {
            getFormattedLabel: function(q, X, K, ue, oe, te) {
              return TT(te ? te.interpolatedValue : T, V);
            }
          }), C.add(O);
        }
        h.add(C);
      }), this.group.add(h), this._titleEls = v, this._detailEls = d;
    }, t.type = "gauge", t;
  })(Ut)
), Lfe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.visualStyleAccessPath = "itemStyle", r;
    }
    return t.prototype.getInitialData = function(r, n) {
      return cy(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, fe.color.neutral10]],
          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: fe.color.axisTick,
          width: 3,
          type: "solid"
        }
      },
      // 坐标轴小标记
      axisTick: {
        // 属性show控制显示与否，默认不显示
        show: !0,
        // 每份split细分多少段
        splitNumber: 5,
        // 属性length控制线长
        length: 6,
        distance: 10,
        // 属性lineStyle控制线条样式
        lineStyle: {
          color: fe.color.axisTickMinor,
          width: 1,
          type: "solid"
        }
      },
      axisLabel: {
        show: !0,
        distance: 15,
        // formatter: null,
        color: fe.color.axisLabel,
        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: fe.color.neutral00,
          borderWidth: 0,
          borderColor: fe.color.theme[0]
        }
      },
      title: {
        show: !0,
        // x, y，单位px
        offsetCenter: [0, "20%"],
        // 其余属性默认使用全局文本样式，详见TEXTSTYLE
        color: fe.color.secondary,
        fontSize: 16,
        valueAnimation: !1
      },
      detail: {
        show: !0,
        backgroundColor: fe.color.transparent,
        borderWidth: 0,
        borderColor: fe.color.neutral40,
        width: 100,
        height: null,
        padding: [5, 10],
        // x, y，单位px
        offsetCenter: [0, "40%"],
        // formatter: null,
        // 其余属性默认使用全局文本样式，详见TEXTSTYLE
        color: fe.color.primary,
        fontSize: 30,
        fontWeight: "bold",
        lineHeight: 30,
        valueAnimation: !1
      }
    }, t;
  })(Yt)
);
function Dfe(e) {
  e.registerChartView(Mfe), e.registerSeriesModel(Lfe);
}
var Efe = ["itemStyle", "opacity"], Pfe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r, n) {
      var i = e.call(this) || this, a = i, o = new Ci(), s = new Rt();
      return a.setTextContent(s), i.setTextGuideLine(o), i.updateData(r, n, !0), i;
    }
    return t.prototype.updateData = function(r, n, i) {
      var a = this, o = r.hostModel, s = r.getItemModel(n), l = r.getItemLayout(n), u = s.getModel("emphasis"), f = s.get(Efe);
      f = f ?? 1, i || vs(a), a.useStyle(r.getItemVisual(n, "style")), a.style.lineJoin = "round", i ? (a.setShape({
        points: l.points
      }), a.style.opacity = 0, Ir(a, {
        style: {
          opacity: f
        }
      }, o, n)) : Wt(a, {
        style: {
          opacity: f
        },
        shape: {
          points: l.points
        }
      }, o, n), Un(a, s), this._updateLabel(r, n), Hr(this, u.get("focus"), u.get("blurScope"), u.get("disabled"));
    }, t.prototype._updateLabel = function(r, n) {
      var i = this, a = this.getTextGuideLine(), o = i.getTextContent(), s = r.hostModel, l = r.getItemModel(n), u = r.getItemLayout(n), f = u.label, c = r.getItemVisual(n, "style"), h = c.fill;
      si(
        // position will not be used in setLabelStyle
        o,
        Wn(l),
        {
          labelFetcher: r.hostModel,
          labelDataIndex: n,
          defaultOpacity: c.opacity,
          defaultText: r.getName(n)
        },
        {
          normal: {
            align: f.textAlign,
            verticalAlign: f.verticalAlign
          }
        }
      );
      var v = l.getModel("label"), d = v.get("color"), g = d === "inherit" ? h : null;
      i.setTextConfig({
        local: !0,
        inside: !!f.inside,
        insideStroke: g,
        outsideFill: g
      });
      var y = f.linePoints;
      a.setShape({
        points: y
      }), i.textGuideLineConfig = {
        anchor: y ? new ht(y[0][0], y[0][1]) : null
      }, Wt(o, {
        style: {
          x: f.x,
          y: f.y
        }
      }, s, n), o.attr({
        rotation: f.rotation,
        originX: f.x,
        originY: f.y,
        z2: 10
      }), DO(i, EO(l), {
        // Default use item visual color
        stroke: h
      });
    }, t;
  })(Wi)
), Ife = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.ignoreLabelLineUpdate = !0, r;
    }
    return t.prototype.render = function(r, n, i) {
      var a = r.getData(), o = this._data, s = this.group;
      a.diff(o).add(function(l) {
        var u = new Pfe(a, l);
        a.setItemGraphicEl(l, u), s.add(u);
      }).update(function(l, u) {
        var f = o.getItemGraphicEl(u);
        f.updateData(a, l), s.add(f), a.setItemGraphicEl(l, f);
      }).remove(function(l) {
        var u = o.getItemGraphicEl(l);
        ff(u, r, l);
      }).execute(), this._data = a;
    }, t.prototype.remove = function() {
      this.group.removeAll(), this._data = null;
    }, t.prototype.dispose = function() {
    }, t.type = "funnel", t;
  })(Ut)
), Rfe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.init = function(r) {
      e.prototype.init.apply(this, arguments), this.legendVisualProvider = new hy(Ge(this.getData, this), Ge(this.getRawData, this)), this._defaultLabelLine(r);
    }, t.prototype.getInitialData = function(r, n) {
      return cy(this, {
        coordDimensions: ["value"],
        encodeDefaulter: St(JR, this)
      });
    }, t.prototype._defaultLabelLine = function(r) {
      xd(r, "labelLine", ["show"]);
      var n = r.labelLine, i = r.emphasis.labelLine;
      n.show = n.show && r.label.show, i.show = i.show && r.emphasis.label.show;
    }, t.prototype.getDataParams = function(r) {
      var n = this.getData(), i = e.prototype.getDataParams.call(this, r), a = n.mapDimension("value"), o = n.getSum(a);
      return i.percent = o ? +(n.get(a, r) / o * 100).toFixed(2) : 0, i.$vars.push("percent"), i;
    }, t.type = "series.funnel", t.defaultOption = {
      coordinateSystemUsage: "box",
      // zlevel: 0,                  // 一级层叠
      z: 2,
      legendHoverLink: !0,
      colorBy: "data",
      left: 80,
      top: 60,
      right: 80,
      bottom: 65,
      // 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: fe.color.neutral00,
        borderWidth: 1
      },
      emphasis: {
        label: {
          show: !0
        }
      },
      select: {
        itemStyle: {
          borderColor: fe.color.primary
        }
      }
    }, t;
  })(Yt)
);
function Ofe(e, t) {
  for (var r = e.mapDimension("value"), n = e.mapArray(r, function(l) {
    return l;
  }), i = [], a = t === "ascending", o = 0, s = e.count(); o < s; o++)
    i[o] = o;
  return nt(t) ? i.sort(t) : t !== "none" && i.sort(function(l, u) {
    return a ? n[l] - n[u] : n[u] - n[l];
  }), i;
}
function Nfe(e) {
  var t = e.hostModel, r = t.get("orient");
  e.each(function(n) {
    var i = e.getItemModel(n), a = i.getModel("label"), o = a.get("position"), s = i.getModel("labelLine"), l = e.getItemLayout(n), u = l.points, f = o === "inner" || o === "inside" || o === "center" || o === "insideLeft" || o === "insideRight", c, h, v, d;
    if (f)
      o === "insideLeft" ? (h = (u[0][0] + u[3][0]) / 2 + 5, v = (u[0][1] + u[3][1]) / 2, c = "left") : o === "insideRight" ? (h = (u[1][0] + u[2][0]) / 2 - 5, v = (u[1][1] + u[2][1]) / 2, c = "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, c = "center"), d = [[h, v], [h, v]];
    else {
      var g = void 0, y = void 0, x = void 0, S = void 0, T = s.get("length");
      o === "left" ? (g = (u[3][0] + u[0][0]) / 2, y = (u[3][1] + u[0][1]) / 2, x = g - T, h = x - 5, c = "right") : o === "right" ? (g = (u[1][0] + u[2][0]) / 2, y = (u[1][1] + u[2][1]) / 2, x = g + T, h = x + 5, c = "left") : o === "top" ? (g = (u[3][0] + u[0][0]) / 2, y = (u[3][1] + u[0][1]) / 2, S = y - T, v = S - 5, c = "center") : o === "bottom" ? (g = (u[1][0] + u[2][0]) / 2, y = (u[1][1] + u[2][1]) / 2, S = y + T, v = S + 5, c = "center") : o === "rightTop" ? (g = r === "horizontal" ? u[3][0] : u[1][0], y = r === "horizontal" ? u[3][1] : u[1][1], r === "horizontal" ? (S = y - T, v = S - 5, c = "center") : (x = g + T, h = x + 5, c = "top")) : o === "rightBottom" ? (g = u[2][0], y = u[2][1], r === "horizontal" ? (S = y + T, v = S + 5, c = "center") : (x = g + T, h = x + 5, c = "bottom")) : o === "leftTop" ? (g = u[0][0], y = r === "horizontal" ? u[0][1] : u[1][1], r === "horizontal" ? (S = y - T, v = S - 5, c = "center") : (x = g - T, h = x - 5, c = "right")) : o === "leftBottom" ? (g = r === "horizontal" ? u[1][0] : u[3][0], y = r === "horizontal" ? u[1][1] : u[2][1], r === "horizontal" ? (S = y + T, v = S + 5, c = "center") : (x = g - T, h = x - 5, c = "right")) : (g = (u[1][0] + u[2][0]) / 2, y = (u[1][1] + u[2][1]) / 2, r === "horizontal" ? (S = y + T, v = S + 5, c = "center") : (x = g + T, h = x + 5, c = "left")), r === "horizontal" ? (x = g, h = x) : (S = y, v = S), d = [[g, y], [x, S]];
    }
    l.label = {
      linePoints: d,
      x: h,
      y: v,
      verticalAlign: "middle",
      textAlign: c,
      inside: f
    };
  });
}
function kfe(e, t) {
  e.eachSeriesByType("funnel", function(r) {
    var n = r.getData(), i = n.mapDimension("value"), a = r.get("sort"), o = Yn(r, t), s = Tr(r.getBoxLayoutParams(), o.refContainer), l = r.get("orient"), u = s.width, f = s.height, c = Ofe(n, a), h = s.x, v = s.y, d = l === "horizontal" ? [Be(r.get("minSize"), f), Be(r.get("maxSize"), f)] : [Be(r.get("minSize"), u), Be(r.get("maxSize"), u)], g = n.getDataExtent(i), y = r.get("min"), x = r.get("max");
    y == null && (y = Math.min(g[0], 0)), x == null && (x = g[1]);
    var S = r.get("funnelAlign"), T = r.get("gap"), C = l === "horizontal" ? u : f, A = (C - T * (n.count() - 1)) / n.count(), M = function(W, Z) {
      if (l === "horizontal") {
        var ee = n.get(i, W) || 0, V = er(ee, [y, x], d, !0), Q = void 0;
        switch (S) {
          case "top":
            Q = v;
            break;
          case "center":
            Q = v + (f - V) / 2;
            break;
          case "bottom":
            Q = v + (f - V);
            break;
        }
        return [[Z, Q], [Z, Q + V]];
      }
      var q = n.get(i, W) || 0, X = er(q, [y, x], d, !0), K;
      switch (S) {
        case "left":
          K = h;
          break;
        case "center":
          K = h + (u - X) / 2;
          break;
        case "right":
          K = h + u - X;
          break;
      }
      return [[K, Z], [K + X, Z]];
    };
    a === "ascending" && (A = -A, T = -T, l === "horizontal" ? h += u : v += f, c = c.reverse());
    for (var E = 0; E < c.length; E++) {
      var P = c[E], R = c[E + 1], O = n.getItemModel(P);
      if (l === "horizontal") {
        var N = O.get(["itemStyle", "width"]);
        N == null ? N = A : (N = Be(N, u), a === "ascending" && (N = -N));
        var G = M(P, h), z = M(R, h + N);
        h += N + T, n.setItemLayout(P, {
          points: G.concat(z.slice().reverse())
        });
      } else {
        var H = O.get(["itemStyle", "height"]);
        H == null ? H = A : (H = Be(H, f), a === "ascending" && (H = -H));
        var G = M(P, v), z = M(R, v + H);
        v += H + T, n.setItemLayout(P, {
          points: G.concat(z.slice().reverse())
        });
      }
    }
    Nfe(n);
  });
}
function Bfe(e) {
  e.registerChartView(Ife), e.registerSeriesModel(Rfe), e.registerLayout(kfe), e.registerProcessor(fy("funnel"));
}
var zfe = 0.3, Ffe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r._dataGroup = new rt(), r._initialized = !1, r;
    }
    return t.prototype.init = function() {
      this.group.add(this._dataGroup);
    }, t.prototype.render = function(r, n, i, a) {
      this._progressiveEls = null;
      var o = this._dataGroup, s = r.getData(), l = this._data, u = r.coordinateSystem, f = u.dimensions, c = x4(r);
      s.diff(l).add(h).update(v).remove(d).execute();
      function h(y) {
        var x = _4(s, o, y, f, u);
        nD(x, s, y, c);
      }
      function v(y, x) {
        var S = l.getItemGraphicEl(x), T = E7(s, y, f, u);
        s.setItemGraphicEl(y, S), Wt(S, {
          shape: {
            points: T
          }
        }, r, y), vs(S), nD(S, s, y, c);
      }
      function d(y) {
        var x = l.getItemGraphicEl(y);
        o.remove(x);
      }
      if (!this._initialized) {
        this._initialized = !0;
        var g = Gfe(u, r, function() {
          setTimeout(function() {
            o.removeClipPath();
          });
        });
        o.setClipPath(g);
      }
      this._data = s;
    }, t.prototype.incrementalPrepareRender = function(r, n, i) {
      this._initialized = !0, this._data = null, this._dataGroup.removeAll();
    }, t.prototype.incrementalRender = function(r, n, i) {
      for (var a = n.getData(), o = n.coordinateSystem, s = o.dimensions, l = x4(n), u = this._progressiveEls = [], f = r.start; f < r.end; f++) {
        var c = _4(a, this._dataGroup, f, s, o);
        c.incremental = !0, nD(c, a, f, l), u.push(c);
      }
    }, t.prototype.remove = function() {
      this._dataGroup && this._dataGroup.removeAll(), this._data = null;
    }, t.type = "parallel", t;
  })(Ut)
);
function Gfe(e, t, r) {
  var n = e.model, i = e.getRect(), a = new Mt({
    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), Ir(a, {
    shape: {
      width: i.width,
      height: i.height
    }
  }, t, r), a;
}
function E7(e, t, r, n) {
  for (var i = [], a = 0; a < r.length; a++) {
    var o = r[a], s = e.get(e.mapDimension(o), t);
    Vfe(s, n.getAxis(o).type) || i.push(n.dataToPoint(s, o));
  }
  return i;
}
function _4(e, t, r, n, i) {
  var a = E7(e, r, n, i), o = new Ci({
    shape: {
      points: a
    },
    // silent: true,
    z2: 10
  });
  return t.add(o), e.setItemGraphicEl(r, o), o;
}
function x4(e) {
  var t = e.get("smooth", !0);
  return t === !0 && (t = zfe), t = tu(t), Gi(t) && (t = 0), {
    smooth: t
  };
}
function nD(e, t, r, n) {
  e.useStyle(t.getItemVisual(r, "style")), e.style.fill = null, e.setShape("smooth", n.smooth);
  var i = t.getItemModel(r), a = i.getModel("emphasis");
  Un(e, i, "lineStyle"), Hr(e, a.get("focus"), a.get("blurScope"), a.get("disabled"));
}
function Vfe(e, t) {
  return t === "category" ? e == null : e == null || isNaN(e);
}
var Hfe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.visualStyleAccessPath = "lineStyle", r.visualDrawType = "stroke", r;
    }
    return t.prototype.getInitialData = function(r, n) {
      return ou(null, this, {
        useEncodeDefaulter: Ge(Ufe, null, this)
      });
    }, t.prototype.getRawIndicesByActiveState = function(r) {
      var n = this.coordinateSystem, i = this.getData(), a = [];
      return n.eachActiveState(i, function(o, s) {
        r === 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;
  })(Yt)
);
function Ufe(e) {
  var t = e.ecModel.getComponent("parallel", e.get("parallelIndex"));
  if (t) {
    var r = {};
    return F(t.dimensions, function(n) {
      var i = Wfe(n);
      r[n] = i;
    }), r;
  }
}
function Wfe(e) {
  return +e.replace("dim", "");
}
var Xfe = ["lineStyle", "opacity"], Yfe = {
  seriesType: "parallel",
  reset: function(e, t) {
    var r = e.coordinateSystem, n = {
      normal: e.get(["lineStyle", "opacity"]),
      active: e.get("activeOpacity"),
      inactive: e.get("inactiveOpacity")
    };
    return {
      progress: function(i, a) {
        r.eachActiveState(a, function(o, s) {
          var l = n[o];
          if (o === "normal" && a.hasItemOption) {
            var u = a.getItemModel(s).get(Xfe, !0);
            u != null && (l = u);
          }
          var f = a.ensureUniqueItemVisual(s, "style");
          f.opacity = l;
        }, i.start, i.end);
      }
    };
  }
};
function Zfe(e) {
  $fe(e), qfe(e);
}
function $fe(e) {
  if (!e.parallel) {
    var t = !1;
    F(e.series, function(r) {
      r && r.type === "parallel" && (t = !0);
    }), t && (e.parallel = [{}]);
  }
}
function qfe(e) {
  var t = Mr(e.parallelAxis);
  F(t, function(r) {
    if (ot(r)) {
      var n = r.parallelIndex || 0, i = Mr(e.parallel)[n];
      i && i.parallelAxisDefault && je(r, i.parallelAxisDefault, !1);
    }
  });
}
var jfe = 5, Kfe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.render = function(r, n, i) {
      this._model = r, this._api = i, this._handlers || (this._handlers = {}, F(Qfe, function(a, o) {
        i.getZr().on(o, this._handlers[o] = Ge(a, this));
      }, this)), ay(this, "_throttledDispatchExpand", r.get("axisExpandRate"), "fixRate");
    }, t.prototype.dispose = function(r, n) {
      U1(this, "_throttledDispatchExpand"), F(this._handlers, function(i, a) {
        n.getZr().off(a, i);
      }), this._handlers = null;
    }, t.prototype._throttledDispatchExpand = function(r) {
      this._dispatchExpand(r);
    }, t.prototype._dispatchExpand = function(r) {
      r && this._api.dispatchAction(xe({
        type: "parallelAxisExpand"
      }, r));
    }, t.type = "parallel", t;
  })(fr)
), Qfe = {
  mousedown: function(e) {
    iD(this, "click") && (this._mouseDownPoint = [e.offsetX, e.offsetY]);
  },
  mouseup: function(e) {
    var t = this._mouseDownPoint;
    if (iD(this, "click") && t) {
      var r = [e.offsetX, e.offsetY], n = Math.pow(t[0] - r[0], 2) + Math.pow(t[1] - r[1], 2);
      if (n > jfe)
        return;
      var i = this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);
      i.behavior !== "none" && this._dispatchExpand({
        axisExpandWindow: i.axisExpandWindow
      });
    }
    this._mouseDownPoint = null;
  },
  mousemove: function(e) {
    if (!(this._mouseDownPoint || !iD(this, "mousemove"))) {
      var t = this._model, r = t.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]), n = r.behavior;
      n === "jump" && this._throttledDispatchExpand.debounceNextCall(t.get("axisExpandDebounce")), this._throttledDispatchExpand(n === "none" ? null : {
        axisExpandWindow: r.axisExpandWindow,
        // Jumping uses animation, and sliding suppresses animation.
        animation: n === "jump" ? null : {
          duration: 0
          // Disable animation.
        }
      });
    }
  }
};
function iD(e, t) {
  var r = e._model;
  return r.get("axisExpandable") && r.get("axisExpandTriggerOn") === t;
}
var Jfe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.init = function() {
      e.prototype.init.apply(this, arguments), this.mergeOption({});
    }, t.prototype.mergeOption = function(r) {
      var n = this.option;
      r && je(n, r, !0), this._initDimensions();
    }, t.prototype.contains = function(r, n) {
      var i = r.get("parallelIndex");
      return i != null && n.getComponent("parallel", i) === this;
    }, t.prototype.setAxisExpand = function(r) {
      F(["axisExpandable", "axisExpandCenter", "axisExpandCount", "axisExpandWidth", "axisExpandWindow"], function(n) {
        r.hasOwnProperty(n) && (this.option[n] = r[n]);
      }, this);
    }, t.prototype._initDimensions = function() {
      var r = this.dimensions = [], n = this.parallelAxisIndex = [], i = nr(this.ecModel.queryComponents({
        mainType: "parallelAxis"
      }), function(a) {
        return (a.get("parallelIndex") || 0) === this.componentIndex;
      }, this);
      F(i, function(a) {
        r.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;
  })(At)
), ece = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r, n, i, a, o) {
      var s = e.call(this, r, 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;
  })(ra)
);
function jc(e, t, r, n, i, a) {
  e = e || 0;
  var o = r[1] - r[0];
  if (i != null && (i = Og(i, [0, o])), a != null && (a = Math.max(a, i ?? 0)), n === "all") {
    var s = Math.abs(t[1] - t[0]);
    s = Og(s, [0, o]), i = a = Og(s, [i, a]), n = 0;
  }
  t[0] = Og(t[0], r), t[1] = Og(t[1], r);
  var l = aD(t, n);
  t[n] += e;
  var u = i || 0, f = r.slice();
  l.sign < 0 ? f[0] += u : f[1] -= u, t[n] = Og(t[n], f);
  var c;
  return c = aD(t, n), i != null && (c.sign !== l.sign || c.span < i) && (t[1 - n] = t[n] + l.sign * i), c = aD(t, n), a != null && c.span > a && (t[1 - n] = t[n] + c.sign * a), t;
}
function aD(e, t) {
  var r = e[t] - e[1 - t];
  return {
    span: Math.abs(r),
    sign: r > 0 ? -1 : r < 0 ? 1 : t ? -1 : 1
  };
}
function Og(e, t) {
  return Math.min(t[1] != null ? t[1] : 1 / 0, Math.max(t[0] != null ? t[0] : -1 / 0, e));
}
var oD = F, P7 = Math.min, I7 = Math.max, S4 = Math.floor, tce = Math.ceil, w4 = jr, rce = Math.PI, nce = (
  /** @class */
  (function() {
    function e(t, r, n) {
      this.type = "parallel", this._axesMap = Je(), this._axesLayout = {}, this.dimensions = t.dimensions, this._model = t, this._init(t, r, n);
    }
    return e.prototype._init = function(t, r, n) {
      var i = t.dimensions, a = t.parallelAxisIndex;
      oD(i, function(o, s) {
        var l = a[s], u = r.getComponent("parallelAxis", l), f = this._axesMap.set(o, new ece(o, Ox(u), [0, 0], u.get("type"), l)), c = f.type === "category";
        f.onBand = c && u.get("boundaryGap"), f.inverse = u.get("inverse"), u.axis = f, f.model = u, f.coordinateSystem = u.coordinateSystem = this;
      }, this);
    }, e.prototype.update = function(t, r) {
      this._updateAxesFromSeries(this._model, t);
    }, e.prototype.containPoint = function(t) {
      var r = this._makeLayoutInfo(), n = r.axisBase, i = r.layoutBase, a = r.pixelDimIndex, o = t[1 - a], s = t[a];
      return o >= n && o <= n + r.axisLength && s >= i && s <= i + r.layoutLength;
    }, e.prototype.getModel = function() {
      return this._model;
    }, e.prototype._updateAxesFromSeries = function(t, r) {
      r.eachSeries(function(n) {
        if (t.contains(n, r)) {
          var i = n.getData();
          oD(this.dimensions, function(a) {
            var o = this._axesMap.get(a);
            o.scale.unionExtentFromData(i, i.mapDimension(a)), Md(o.scale, o.model);
          }, this);
        }
      }, this);
    }, e.prototype.resize = function(t, r) {
      var n = Yn(t, r).refContainer;
      this._rect = Tr(t.getBoxLayoutParams(), n), this._layoutAxes();
    }, e.prototype.getRect = function() {
      return this._rect;
    }, e.prototype._makeLayoutInfo = function() {
      var t = this._model, r = this._rect, n = ["x", "y"], i = ["width", "height"], a = t.get("layout"), o = a === "horizontal" ? 0 : 1, s = r[i[o]], l = [0, s], u = this.dimensions.length, f = bT(t.get("axisExpandWidth"), l), c = bT(t.get("axisExpandCount") || 0, [0, u]), h = t.get("axisExpandable") && u > 3 && u > c && c > 1 && f > 0 && s > 0, v = t.get("axisExpandWindow"), d;
      if (v)
        d = bT(v[1] - v[0], l), v[1] = v[0] + d;
      else {
        d = bT(f * (c - 1), l);
        var g = t.get("axisExpandCenter") || S4(u / 2);
        v = [f * g - d / 2], v[1] = v[0] + d;
      }
      var y = (s - d) / (u - c);
      y < 3 && (y = 0);
      var x = [S4(w4(v[0] / f, 1)) + 1, tce(w4(v[1] / f, 1)) - 1], S = y / f * v[0];
      return {
        layout: a,
        pixelDimIndex: o,
        layoutBase: r[n[o]],
        layoutLength: s,
        axisBase: r[n[1 - o]],
        axisLength: r[i[1 - o]],
        axisExpandable: h,
        axisExpandWidth: f,
        axisCollapseWidth: y,
        axisExpandWindow: v,
        axisCount: u,
        winInnerIndices: x,
        axisExpandWindow0Pos: S
      };
    }, e.prototype._layoutAxes = function() {
      var t = this._rect, r = this._axesMap, n = this.dimensions, i = this._makeLayoutInfo(), a = i.layout;
      r.each(function(o) {
        var s = [0, i.axisLength], l = o.inverse ? 1 : 0;
        o.setExtent(s[l], s[1 - l]);
      }), oD(n, function(o, s) {
        var l = (i.axisExpandable ? ace : ice)(s, i), u = {
          horizontal: {
            x: l.position,
            y: i.axisLength
          },
          vertical: {
            x: 0,
            y: l.position
          }
        }, f = {
          horizontal: rce / 2,
          vertical: 0
        }, c = [u[a].x + t.x, u[a].y + t.y], h = f[a], v = ii();
        Tf(v, v, h), Zs(v, v, c), this._axesLayout[o] = {
          position: c,
          rotation: h,
          transform: v,
          axisNameAvailableWidth: l.axisNameAvailableWidth,
          axisLabelShow: l.axisLabelShow,
          nameTruncateMaxWidth: l.nameTruncateMaxWidth,
          tickDirection: 1,
          labelDirection: 1
        };
      }, this);
    }, e.prototype.getAxis = function(t) {
      return this._axesMap.get(t);
    }, e.prototype.dataToPoint = function(t, r) {
      return this.axisCoordToPoint(this._axesMap.get(r).dataToCoord(t), r);
    }, e.prototype.eachActiveState = function(t, r, n, i) {
      n == null && (n = 0), i == null && (i = t.count());
      var a = this._axesMap, o = this.dimensions, s = [], l = [];
      F(o, function(y) {
        s.push(t.mapDimension(y)), l.push(a.get(y).model);
      });
      for (var u = this.hasAxisBrushed(), f = n; f < i; f++) {
        var c = void 0;
        if (!u)
          c = "normal";
        else {
          c = "active";
          for (var h = t.getValues(s, f), v = 0, d = o.length; v < d; v++) {
            var g = l[v].getActiveState(h[v]);
            if (g === "inactive") {
              c = "inactive";
              break;
            }
          }
        }
        r(c, f);
      }
    }, e.prototype.hasAxisBrushed = function() {
      for (var t = this.dimensions, r = this._axesMap, n = !1, i = 0, a = t.length; i < a; i++)
        r.get(t[i]).model.getActiveState() !== "normal" && (n = !0);
      return n;
    }, e.prototype.axisCoordToPoint = function(t, r) {
      var n = this._axesLayout[r];
      return Ws([t, 0], n.transform);
    }, e.prototype.getAxisLayout = function(t) {
      return it(this._axesLayout[t]);
    }, e.prototype.getSlidedAxisExpandWindow = function(t) {
      var r = this._makeLayoutInfo(), n = r.pixelDimIndex, i = r.axisExpandWindow.slice(), a = i[1] - i[0], o = [0, r.axisExpandWidth * (r.axisCount - 1)];
      if (!this.containPoint(t))
        return {
          behavior: "none",
          axisExpandWindow: i
        };
      var s = t[n] - r.layoutBase - r.axisExpandWindow0Pos, l, u = "slide", f = r.axisCollapseWidth, c = this._model.get("axisExpandSlideTriggerArea"), h = c[0] != null;
      if (f)
        h && f && s < a * c[0] ? (u = "jump", l = s - a * c[2]) : h && f && s > a * (1 - c[0]) ? (u = "jump", l = s - a * (1 - c[2])) : (l = s - a * c[1]) >= 0 && (l = s - a * (1 - c[1])) <= 0 && (l = 0), l *= r.axisExpandWidth / f, l ? jc(l, i, o, "all") : u = "none";
      else {
        var v = i[1] - i[0], d = o[1] * s / v;
        i = [I7(0, d - v / 2)], i[1] = P7(o[1], i[0] + v), i[0] = i[1] - v;
      }
      return {
        axisExpandWindow: i,
        behavior: u
      };
    }, e;
  })()
);
function bT(e, t) {
  return P7(I7(e, t[0]), t[1]);
}
function ice(e, t) {
  var r = t.layoutLength / (t.axisCount - 1);
  return {
    position: r * e,
    axisNameAvailableWidth: r,
    axisLabelShow: !0
  };
}
function ace(e, t) {
  var r = t.layoutLength, n = t.axisExpandWidth, i = t.axisCount, a = t.axisCollapseWidth, o = t.winInnerIndices, s, l = a, u = !1, f;
  return e < o[0] ? (s = e * a, f = a) : e <= o[1] ? (s = t.axisExpandWindow0Pos + e * n - t.axisExpandWindow[0], l = n, u = !0) : (s = r - (i - 1 - e) * a, f = a), {
    position: s,
    axisNameAvailableWidth: l,
    axisLabelShow: u,
    nameTruncateMaxWidth: f
  };
}
function oce(e, t) {
  var r = [];
  return e.eachComponent("parallel", function(n, i) {
    var a = new nce(n, e, t);
    a.name = "parallel_" + i, a.resize(n, t), n.coordinateSystem = a, a.model = n, r.push(a);
  }), e.eachSeries(function(n) {
    if (n.get("coordinateSystem") === "parallel") {
      var i = n.getReferringComponents("parallel", an).models[0];
      n.coordinateSystem = i.coordinateSystem;
    }
  }), r;
}
var sce = {
  create: oce
}, sI = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.activeIntervals = [], r;
    }
    return t.prototype.getAreaSelectStyle = function() {
      return wd([
        ["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(r) {
      var n = this.activeIntervals = it(r);
      if (n)
        for (var i = n.length - 1; i >= 0; i--)
          xo(n[i]);
    }, t.prototype.getActiveState = function(r) {
      var n = this.activeIntervals;
      if (!n.length)
        return "normal";
      if (r == null || isNaN(+r))
        return "inactive";
      if (n.length === 1) {
        var i = n[0];
        if (i[0] <= r && r <= i[1])
          return "active";
      } else
        for (var a = 0, o = n.length; a < o; a++)
          if (n[a][0] <= r && r <= n[a][1])
            return "active";
      return "inactive";
    }, t;
  })(At)
);
cn(sI, uy);
var Ld = !0, nx = Math.min, Rm = Math.max, lce = Math.pow, uce = 1e4, fce = 6, cce = 6, T4 = "globalPan", hce = {
  w: [0, 0],
  e: [0, 1],
  n: [1, 0],
  s: [1, 1]
}, vce = {
  w: "ew",
  e: "ew",
  n: "ns",
  s: "ns",
  ne: "nesw",
  sw: "nesw",
  nw: "nwse",
  se: "nwse"
}, b4 = {
  brushStyle: {
    lineWidth: 2,
    stroke: fe.color.backgroundTint,
    fill: fe.color.borderTint
  },
  transformable: !0,
  brushMode: "single",
  removeOnClick: !1
}, dce = 0, aN = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r) {
      var n = e.call(this) || this;
      return n._track = [], n._covers = [], n._handlers = {}, n._zr = r, n.group = new rt(), n._uid = "brushController_" + dce++, F(Sce, function(i, a) {
        this._handlers[a] = Ge(i, this);
      }, n), n;
    }
    return t.prototype.enableBrush = function(r) {
      return this._brushType && this._doDisableBrush(), r.brushType && this._doEnableBrush(r), this;
    }, t.prototype._doEnableBrush = function(r) {
      var n = this._zr;
      this._enableGlobalPan || Jse(n, T4, this._uid), F(this._handlers, function(i, a) {
        n.on(a, i);
      }), this._brushType = r.brushType, this._brushOption = je(it(b4), r, !0);
    }, t.prototype._doDisableBrush = function() {
      var r = this._zr;
      ele(r, T4, this._uid), F(this._handlers, function(n, i) {
        r.off(i, n);
      }), this._brushType = this._brushOption = null;
    }, t.prototype.setPanels = function(r) {
      if (r && r.length) {
        var n = this._panels = {};
        F(r, function(i) {
          n[i.panelId] = it(i);
        });
      } else
        this._panels = null;
      return this;
    }, t.prototype.mount = function(r) {
      r = r || {}, this._enableGlobalPan = r.enableGlobalPan;
      var n = this.group;
      return this._zr.add(n), n.attr({
        x: r.x || 0,
        y: r.y || 0,
        rotation: r.rotation || 0,
        scaleX: r.scaleX || 1,
        scaleY: r.scaleY || 1
      }), this._transform = n.getLocalTransform(), this;
    }, t.prototype.updateCovers = function(r) {
      r = Ce(r, function(h) {
        return je(it(b4), h, !0);
      });
      var n = "\0-brush-index-", i = this._covers, a = this._covers = [], o = this, s = this._creatingCover;
      return new _f(i, r, u, l).add(f).update(f).remove(c).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 f(h, v) {
        var d = r[h];
        if (v != null && i[v] === s)
          a[h] = i[v];
        else {
          var g = a[h] = v != null ? (i[v].__brushOption = d, i[v]) : O7(o, R7(o, d));
          oN(o, g);
        }
      }
      function c(h) {
        i[h] !== s && o.group.remove(i[h]);
      }
    }, t.prototype.unmount = function() {
      return this.enableBrush(!1), lI(this), this._zr.remove(this.group), this;
    }, t.prototype.dispose = function() {
      this.unmount(), this.off();
    }, t;
  })(ds)
);
function R7(e, t) {
  var r = qC[t.brushType].createCover(e, t);
  return r.__brushOption = t, k7(r, t), e.group.add(r), r;
}
function O7(e, t) {
  var r = sN(t);
  return r.endCreating && (r.endCreating(e, t), k7(t, t.__brushOption)), t;
}
function N7(e, t) {
  var r = t.__brushOption;
  sN(t).updateCoverShape(e, t, r.range, r);
}
function k7(e, t) {
  var r = t.z;
  r == null && (r = uce), e.traverse(function(n) {
    n.z = r, n.z2 = r;
  });
}
function oN(e, t) {
  sN(t).updateCommon(e, t), N7(e, t);
}
function sN(e) {
  return qC[e.__brushOption.brushType];
}
function lN(e, t, r) {
  var n = e._panels;
  if (!n)
    return Ld;
  var i, a = e._transform;
  return F(n, function(o) {
    o.isTargetByCursor(t, r, a) && (i = o);
  }), i;
}
function B7(e, t) {
  var r = e._panels;
  if (!r)
    return Ld;
  var n = t.__brushOption.panelId;
  return n != null ? r[n] : Ld;
}
function lI(e) {
  var t = e._covers, r = t.length;
  return F(t, function(n) {
    e.group.remove(n);
  }, e), t.length = 0, !!r;
}
function Dd(e, t) {
  var r = Ce(e._covers, function(n) {
    var i = n.__brushOption, a = it(i.range);
    return {
      brushType: i.brushType,
      panelId: i.panelId,
      range: a
    };
  });
  e.trigger("brush", {
    areas: r,
    isEnd: !!t.isEnd,
    removeOnClick: !!t.removeOnClick
  });
}
function pce(e) {
  var t = e._track;
  if (!t.length)
    return !1;
  var r = t[t.length - 1], n = t[0], i = r[0] - n[0], a = r[1] - n[1], o = lce(i * i + a * a, 0.5);
  return o > fce;
}
function z7(e) {
  var t = e.length - 1;
  return t < 0 && (t = 0), [e[0], e[t]];
}
function F7(e, t, r, n) {
  var i = new rt();
  return i.add(new Mt({
    name: "main",
    style: uN(r),
    silent: !0,
    draggable: !0,
    cursor: "move",
    drift: St(C4, e, t, i, ["n", "s", "w", "e"]),
    ondragend: St(Dd, t, {
      isEnd: !0
    })
  })), F(n, function(a) {
    i.add(new Mt({
      name: a.join(""),
      style: {
        opacity: 0
      },
      draggable: !0,
      silent: !0,
      invisible: !0,
      drift: St(C4, e, t, i, a),
      ondragend: St(Dd, t, {
        isEnd: !0
      })
    }));
  }), i;
}
function G7(e, t, r, n) {
  var i = n.brushStyle.lineWidth || 0, a = Rm(i, cce), o = r[0][0], s = r[1][0], l = o - i / 2, u = s - i / 2, f = r[0][1], c = r[1][1], h = f - a + i / 2, v = c - a + i / 2, d = f - o, g = c - s, y = d + i, x = g + i;
  Uu(e, t, "main", o, s, d, g), n.transformable && (Uu(e, t, "w", l, u, a, x), Uu(e, t, "e", h, u, a, x), Uu(e, t, "n", l, u, y, a), Uu(e, t, "s", l, v, y, a), Uu(e, t, "nw", l, u, a, a), Uu(e, t, "ne", h, u, a, a), Uu(e, t, "sw", l, v, a, a), Uu(e, t, "se", h, v, a, a));
}
function uI(e, t) {
  var r = t.__brushOption, n = r.transformable, i = t.childAt(0);
  i.useStyle(uN(r)), i.attr({
    silent: !n,
    cursor: n ? "move" : "default"
  }), F([["w"], ["e"], ["n"], ["s"], ["s", "e"], ["s", "w"], ["n", "e"], ["n", "w"]], function(a) {
    var o = t.childOfName(a.join("")), s = a.length === 1 ? fI(e, a[0]) : mce(e, a);
    o && o.attr({
      silent: !n,
      invisible: !n,
      cursor: n ? vce[s] + "-resize" : null
    });
  });
}
function Uu(e, t, r, n, i, a, o) {
  var s = t.childOfName(r);
  s && s.setShape(_ce(fN(e, t, [[n, i], [n + a, i + o]])));
}
function uN(e) {
  return tt({
    strokeNoScale: !0
  }, e.brushStyle);
}
function V7(e, t, r, n) {
  var i = [nx(e, r), nx(t, n)], a = [Rm(e, r), Rm(t, n)];
  return [
    [i[0], a[0]],
    [i[1], a[1]]
    // y range
  ];
}
function gce(e) {
  return Hc(e.group);
}
function fI(e, t) {
  var r = {
    w: "left",
    e: "right",
    n: "top",
    s: "bottom"
  }, n = {
    left: "w",
    right: "e",
    top: "n",
    bottom: "s"
  }, i = MC(r[t], gce(e));
  return n[i];
}
function mce(e, t) {
  var r = [fI(e, t[0]), fI(e, t[1])];
  return (r[0] === "e" || r[0] === "w") && r.reverse(), r.join("");
}
function C4(e, t, r, n, i, a) {
  var o = r.__brushOption, s = e.toRectRange(o.range), l = H7(t, i, a);
  F(n, function(u) {
    var f = hce[u];
    s[f[0]][f[1]] += l[f[0]];
  }), o.range = e.fromRectRange(V7(s[0][0], s[1][0], s[0][1], s[1][1])), oN(t, r), Dd(t, {
    isEnd: !1
  });
}
function yce(e, t, r, n) {
  var i = t.__brushOption.range, a = H7(e, r, n);
  F(i, function(o) {
    o[0] += a[0], o[1] += a[1];
  }), oN(e, t), Dd(e, {
    isEnd: !1
  });
}
function H7(e, t, r) {
  var n = e.group, i = n.transformCoordToLocal(t, r), a = n.transformCoordToLocal(0, 0);
  return [i[0] - a[0], i[1] - a[1]];
}
function fN(e, t, r) {
  var n = B7(e, t);
  return n && n !== Ld ? n.clipPath(r, e._transform) : it(r);
}
function _ce(e) {
  var t = nx(e[0][0], e[1][0]), r = nx(e[0][1], e[1][1]), n = Rm(e[0][0], e[1][0]), i = Rm(e[0][1], e[1][1]);
  return {
    x: t,
    y: r,
    width: n - t,
    height: i - r
  };
}
function xce(e, t, r) {
  if (
    // Check active
    !(!e._brushType || wce(e, t.offsetX, t.offsetY))
  ) {
    var n = e._zr, i = e._covers, a = lN(e, t, r);
    if (!e._dragging)
      for (var o = 0; o < i.length; o++) {
        var s = i[o].__brushOption;
        if (a && (a === Ld || s.panelId === a.panelId) && qC[s.brushType].contain(i[o], r[0], r[1]))
          return;
      }
    a && n.setCursorStyle("crosshair");
  }
}
function cI(e) {
  var t = e.event;
  t.preventDefault && t.preventDefault();
}
function hI(e, t, r) {
  return e.childOfName("main").contain(t, r);
}
function U7(e, t, r, n) {
  var i = e._creatingCover, a = e._creatingPanel, o = e._brushOption, s;
  if (e._track.push(r.slice()), pce(e) || i) {
    if (a && !i) {
      o.brushMode === "single" && lI(e);
      var l = it(o);
      l.brushType = A4(l.brushType, a), l.panelId = a === Ld ? null : a.panelId, i = e._creatingCover = R7(e, l), e._covers.push(i);
    }
    if (i) {
      var u = qC[A4(e._brushType, a)], f = i.__brushOption;
      f.range = u.getCreatingRange(fN(e, i, e._track)), n && (O7(e, i), u.updateCommon(e, i)), N7(e, i), s = {
        isEnd: n
      };
    }
  } else n && o.brushMode === "single" && o.removeOnClick && lN(e, t, r) && lI(e) && (s = {
    isEnd: n,
    removeOnClick: !0
  });
  return s;
}
function A4(e, t) {
  return e === "auto" ? t.defaultBrushType : e;
}
var Sce = {
  mousedown: function(e) {
    if (this._dragging)
      M4(this, e);
    else if (!e.target || !e.target.draggable) {
      cI(e);
      var t = this.group.transformCoordToLocal(e.offsetX, e.offsetY);
      this._creatingCover = null;
      var r = this._creatingPanel = lN(this, e, t);
      r && (this._dragging = !0, this._track = [t.slice()]);
    }
  },
  mousemove: function(e) {
    var t = e.offsetX, r = e.offsetY, n = this.group.transformCoordToLocal(t, r);
    if (xce(this, e, n), this._dragging) {
      cI(e);
      var i = U7(this, e, n, !1);
      i && Dd(this, i);
    }
  },
  mouseup: function(e) {
    M4(this, e);
  }
};
function M4(e, t) {
  if (e._dragging) {
    cI(t);
    var r = t.offsetX, n = t.offsetY, i = e.group.transformCoordToLocal(r, n), a = U7(e, t, i, !0);
    e._dragging = !1, e._track = [], e._creatingCover = null, a && Dd(e, a);
  }
}
function wce(e, t, r) {
  var n = e._zr;
  return t < 0 || t > n.getWidth() || r < 0 || r > n.getHeight();
}
var qC = {
  lineX: L4(0),
  lineY: L4(1),
  rect: {
    createCover: function(e, t) {
      function r(n) {
        return n;
      }
      return F7({
        toRectRange: r,
        fromRectRange: r
      }, e, t, [["w"], ["e"], ["n"], ["s"], ["s", "e"], ["s", "w"], ["n", "e"], ["n", "w"]]);
    },
    getCreatingRange: function(e) {
      var t = z7(e);
      return V7(t[1][0], t[1][1], t[0][0], t[0][1]);
    },
    updateCoverShape: function(e, t, r, n) {
      G7(e, t, r, n);
    },
    updateCommon: uI,
    contain: hI
  },
  polygon: {
    createCover: function(e, t) {
      var r = new rt();
      return r.add(new Ci({
        name: "main",
        style: uN(t),
        silent: !0
      })), r;
    },
    getCreatingRange: function(e) {
      return e;
    },
    endCreating: function(e, t) {
      t.remove(t.childAt(0)), t.add(new Wi({
        name: "main",
        draggable: !0,
        drift: St(yce, e, t),
        ondragend: St(Dd, e, {
          isEnd: !0
        })
      }));
    },
    updateCoverShape: function(e, t, r, n) {
      t.childAt(0).setShape({
        points: fN(e, t, r)
      });
    },
    updateCommon: uI,
    contain: hI
  }
};
function L4(e) {
  return {
    createCover: function(t, r) {
      return F7({
        toRectRange: function(n) {
          var i = [n, [0, 100]];
          return e && i.reverse(), i;
        },
        fromRectRange: function(n) {
          return n[e];
        }
      }, t, r, [[["w"], ["e"]], [["n"], ["s"]]][e]);
    },
    getCreatingRange: function(t) {
      var r = z7(t), n = nx(r[0][e], r[1][e]), i = Rm(r[0][e], r[1][e]);
      return [n, i];
    },
    updateCoverShape: function(t, r, n, i) {
      var a, o = B7(t, r);
      if (o !== Ld && o.getLinearBrushOtherExtent)
        a = o.getLinearBrushOtherExtent(e);
      else {
        var s = t._zr;
        a = [0, [s.getWidth(), s.getHeight()][1 - e]];
      }
      var l = [n, a];
      e && l.reverse(), G7(t, r, l, i);
    },
    updateCommon: uI,
    contain: hI
  };
}
function W7(e) {
  return e = cN(e), function(t) {
    return NR(t, e);
  };
}
function X7(e, t) {
  return e = cN(e), function(r) {
    var n = t ?? r, i = n ? e.width : e.height, a = n ? e.x : e.y;
    return [a, a + (i || 0)];
  };
}
function Y7(e, t, r) {
  var n = cN(e);
  return function(i, a) {
    return n.contain(a[0], a[1]) && !j9(i, t, r);
  };
}
function cN(e) {
  return st.create(e);
}
var Tce = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.init = function(r, n) {
      e.prototype.init.apply(this, arguments), (this._brushController = new aN(n.getZr())).on("brush", Ge(this._onBrush, this));
    }, t.prototype.render = function(r, n, i, a) {
      if (!bce(r, n, a)) {
        this.axisModel = r, this.api = i, this.group.removeAll();
        var o = this._axisGroup;
        if (this._axisGroup = new rt(), this.group.add(this._axisGroup), !!r.get("show")) {
          var s = Ace(r, n), l = s.coordinateSystem, u = r.getAreaSelectStyle(), f = u.width, c = r.axis.dim, h = l.getAxisLayout(c), v = xe({
            strokeContainThreshold: f
          }, h), d = new xa(r, i, v);
          d.build(), this._axisGroup.add(d.group), this._refreshBrushController(v, u, r, s, f, i), Lx(o, this._axisGroup, r);
        }
      }
    }, t.prototype._refreshBrushController = function(r, n, i, a, o, s) {
      var l = i.axis.getExtent(), u = l[1] - l[0], f = Math.min(30, Math.abs(u) * 0.1), c = st.create({
        x: l[0],
        y: -o / 2,
        width: u,
        height: o
      });
      c.x -= f, c.width += 2 * f, this._brushController.mount({
        enableGlobalPan: !0,
        rotation: r.rotation,
        x: r.position[0],
        y: r.position[1]
      }).setPanels([{
        panelId: "pl",
        clipPath: W7(c),
        isTargetByCursor: Y7(c, s, a),
        getLinearBrushOtherExtent: X7(c, 0)
      }]).enableBrush({
        brushType: "lineX",
        brushStyle: n,
        removeOnClick: !0
      }).updateCovers(Cce(i));
    }, t.prototype._onBrush = function(r) {
      var n = r.areas, i = this.axisModel, a = i.axis, o = Ce(n, function(s) {
        return [a.coordToData(s.range[0], !0), a.coordToData(s.range[1], !0)];
      });
      (!i.option.realtime === r.isEnd || r.removeOnClick) && this.api.dispatchAction({
        type: "axisAreaSelect",
        parallelAxisId: i.id,
        intervals: o
      });
    }, t.prototype.dispose = function() {
      this._brushController.dispose();
    }, t.type = "parallelAxis", t;
  })(fr)
);
function bce(e, t, r) {
  return r && r.type === "axisAreaSelect" && t.findComponents({
    mainType: "parallelAxis",
    query: r
  })[0] === e;
}
function Cce(e) {
  var t = e.axis;
  return Ce(e.activeIntervals, function(r) {
    return {
      brushType: "lineX",
      panelId: "pl",
      range: [t.dataToCoord(r[0], !0), t.dataToCoord(r[1], !0)]
    };
  });
}
function Ace(e, t) {
  return t.getComponent("parallel", e.get("parallelIndex"));
}
var Mce = {
  type: "axisAreaSelect",
  event: "axisAreaSelected"
  // update: 'updateVisual'
};
function Lce(e) {
  e.registerAction(Mce, function(t, r) {
    r.eachComponent({
      mainType: "parallelAxis",
      query: t
    }, function(n) {
      n.axis.model.setActiveIntervals(t.intervals);
    });
  }), e.registerAction("parallelAxisExpand", function(t, r) {
    r.eachComponent({
      mainType: "parallel",
      query: t
    }, function(n) {
      n.setAxisExpand(t);
    });
  });
}
var Dce = {
  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 Z7(e) {
  e.registerComponentView(Kfe), e.registerComponentModel(Jfe), e.registerCoordinateSystem("parallel", sce), e.registerPreprocessor(Zfe), e.registerComponentModel(sI), e.registerComponentView(Tce), Pm(e, "parallel", sI, Dce), Lce(e);
}
function Ece(e) {
  ft(Z7), e.registerChartView(Ffe), e.registerSeriesModel(Hfe), e.registerVisual(e.PRIORITY.VISUAL.BRUSH, Yfe);
}
var Pce = (
  /** @class */
  /* @__PURE__ */ (function() {
    function e() {
      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 e;
  })()
), Ice = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r) {
      return e.call(this, r) || this;
    }
    return t.prototype.getDefaultShape = function() {
      return new Pce();
    }, t.prototype.buildPath = function(r, n) {
      var i = n.extent;
      r.moveTo(n.x1, n.y1), r.bezierCurveTo(n.cpx1, n.cpy1, n.cpx2, n.cpy2, n.x2, n.y2), n.orient === "vertical" ? (r.lineTo(n.x2 + i, n.y2), r.bezierCurveTo(n.cpx2 + i, n.cpy2, n.cpx1 + i, n.cpy1, n.x1 + i, n.y1)) : (r.lineTo(n.x2, n.y2 + i), r.bezierCurveTo(n.cpx2, n.cpy2 + i, n.cpx1, n.cpy1 + i, n.x1, n.y1 + i)), r.closePath();
    }, t.prototype.highlight = function() {
      mf(this);
    }, t.prototype.downplay = function() {
      yf(this);
    }, t;
  })(zt)
), Rce = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r._mainGroup = new rt(), r._focusAdjacencyDisabled = !1, r;
    }
    return t.prototype.init = function(r, n) {
      this._controller = new Vd(n.getZr()), this._controllerHost = {
        target: this.group
      }, this.group.add(this._mainGroup);
    }, t.prototype.render = function(r, n, i) {
      var a = this, o = r.getGraph(), s = this._mainGroup, l = r.layoutInfo, u = l.width, f = l.height, c = r.getData(), h = r.getData("edge"), v = r.get("orient");
      this._model = r, s.removeAll(), s.x = l.x, s.y = l.y, this._updateViewCoordSys(r, i), K9(r, i, s, this._controller, this._controllerHost, null), o.eachEdge(function(d) {
        var g = new Ice(), y = pt(g);
        y.dataIndex = d.dataIndex, y.seriesIndex = r.seriesIndex, y.dataType = "edge";
        var x = d.getModel(), S = x.getModel("lineStyle"), T = S.get("curveness"), C = d.node1.getLayout(), A = d.node1.getModel(), M = A.get("localX"), E = A.get("localY"), P = d.node2.getLayout(), R = d.node2.getModel(), O = R.get("localX"), N = R.get("localY"), G = d.getLayout(), z, H, W, Z, ee, V, Q, q;
        g.shape.extent = Math.max(1, G.dy), g.shape.orient = v, v === "vertical" ? (z = (M != null ? M * u : C.x) + G.sy, H = (E != null ? E * f : C.y) + C.dy, W = (O != null ? O * u : P.x) + G.ty, Z = N != null ? N * f : P.y, ee = z, V = H * (1 - T) + Z * T, Q = W, q = H * T + Z * (1 - T)) : (z = (M != null ? M * u : C.x) + C.dx, H = (E != null ? E * f : C.y) + G.sy, W = O != null ? O * u : P.x, Z = (N != null ? N * f : P.y) + G.ty, ee = z * (1 - T) + W * T, V = H, Q = z * T + W * (1 - T), q = Z), g.setShape({
          x1: z,
          y1: H,
          x2: W,
          y2: Z,
          cpx1: ee,
          cpy1: V,
          cpx2: Q,
          cpy2: q
        }), g.useStyle(S.getItemStyle()), D4(g.style, v, d);
        var X = "" + x.get("value"), K = Wn(x, "edgeLabel");
        si(g, K, {
          labelFetcher: {
            getFormattedLabel: function(te, pe, me, de, ve, Ae) {
              return r.getFormattedLabel(
                te,
                pe,
                "edge",
                de,
                // ensure edgeLabel formatter is provided
                // to prevent the inheritance from `label.formatter` of the series
                $a(ve, K.normal && K.normal.get("formatter"), X),
                Ae
              );
            }
          },
          labelDataIndex: d.dataIndex,
          defaultText: X
        }), g.setTextConfig({
          position: "inside"
        });
        var ue = x.getModel("emphasis");
        Un(g, x, "lineStyle", function(te) {
          var pe = te.getItemStyle();
          return D4(pe, v, d), pe;
        }), s.add(g), h.setItemGraphicEl(d.dataIndex, g);
        var oe = ue.get("focus");
        Hr(g, oe === "adjacency" ? d.getAdjacentDataIndices() : oe === "trajectory" ? d.getTrajectoryDataIndices() : oe, ue.get("blurScope"), ue.get("disabled"));
      }), o.eachNode(function(d) {
        var g = d.getLayout(), y = d.getModel(), x = y.get("localX"), S = y.get("localY"), T = y.getModel("emphasis"), C = y.get(["itemStyle", "borderRadius"]) || 0, A = new Mt({
          shape: {
            x: x != null ? x * u : g.x,
            y: S != null ? S * f : g.y,
            width: g.dx,
            height: g.dy,
            r: C
          },
          style: y.getModel("itemStyle").getItemStyle(),
          z2: 10
        });
        si(A, Wn(y), {
          labelFetcher: {
            getFormattedLabel: function(E, P) {
              return r.getFormattedLabel(E, P, "node");
            }
          },
          labelDataIndex: d.dataIndex,
          defaultText: d.id
        }), A.disableLabelAnimation = !0, A.setStyle("fill", d.getVisual("color")), A.setStyle("decal", d.getVisual("style").decal), Un(A, y), s.add(A), c.setItemGraphicEl(d.dataIndex, A), pt(A).dataType = "node";
        var M = T.get("focus");
        Hr(A, M === "adjacency" ? d.getAdjacentDataIndices() : M === "trajectory" ? d.getTrajectoryDataIndices() : M, T.get("blurScope"), T.get("disabled"));
      }), c.eachItemGraphicEl(function(d, g) {
        var y = c.getItemModel(g);
        y.get("draggable") && (d.drift = function(x, S) {
          a._focusAdjacencyDisabled = !0, this.shape.x += x, this.shape.y += S, this.dirty(), i.dispatchAction({
            type: "dragNode",
            seriesId: r.id,
            dataIndex: c.getRawIndex(g),
            localX: this.shape.x / u,
            localY: this.shape.y / f
          });
        }, d.ondragend = function() {
          a._focusAdjacencyDisabled = !1;
        }, d.draggable = !0, d.cursor = "move");
      }), !this._data && r.isAnimationEnabled() && s.setClipPath(Oce(s.getBoundingRect(), r, function() {
        s.removeClipPath();
      })), this._data = r.getData();
    }, t.prototype.dispose = function() {
      this._controller && this._controller.dispose(), this._controllerHost = null;
    }, t.prototype._updateViewCoordSys = function(r, n) {
      var i = r.layoutInfo, a = i.width, o = i.height, s = r.coordinateSystem = new Hd(null, {
        api: n,
        ecModel: r.ecModel
      });
      s.zoomLimit = r.get("scaleLimit"), s.setBoundingRect(0, 0, a, o), s.setCenter(r.get("center")), s.setZoom(r.get("zoom")), this._controllerHost.target.attr({
        x: s.x,
        y: s.y,
        scaleX: s.scaleX,
        scaleY: s.scaleY
      });
    }, t.type = "sankey", t;
  })(Ut)
);
function D4(e, t, r) {
  switch (e.fill) {
    case "source":
      e.fill = r.node1.getVisual("color"), e.decal = r.node1.getVisual("style").decal;
      break;
    case "target":
      e.fill = r.node2.getVisual("color"), e.decal = r.node2.getVisual("style").decal;
      break;
    case "gradient":
      var n = r.node1.getVisual("color"), i = r.node2.getVisual("color");
      Fe(n) && Fe(i) && (e.fill = new Nd(0, 0, +(t === "horizontal"), +(t === "vertical"), [{
        color: n,
        offset: 0
      }, {
        color: i,
        offset: 1
      }]));
  }
}
function Oce(e, t, r) {
  var n = new Mt({
    shape: {
      x: e.x - 10,
      y: e.y - 10,
      width: 0,
      height: e.height + 20
    }
  });
  return Ir(n, {
    shape: {
      width: e.width + 20
    }
  }, t, r), n;
}
var Nce = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.getInitialData = function(r, n) {
      var i = r.edges || r.links || [], a = r.data || r.nodes || [], o = r.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 It(o[l], this, n));
      var u = iN(a, i, this, !0, f);
      return u.data;
      function f(c, h) {
        c.wrapMethod("getItemModel", function(v, d) {
          var g = v.parentModel, y = g.getData().getItemLayout(d);
          if (y) {
            var x = y.depth, S = g.levelModels[x];
            S && (v.parentModel = S);
          }
          return v;
        }), h.wrapMethod("getItemModel", function(v, d) {
          var g = v.parentModel, y = g.getGraph().getEdgeByIndex(d), x = y.node1.getLayout();
          if (x) {
            var S = x.depth, T = g.levelModels[S];
            T && (v.parentModel = T);
          }
          return v;
        });
      }
    }, t.prototype.setNodePosition = function(r, n) {
      var i = this.option.data || this.option.nodes, a = i[r];
      a.localX = n[0], a.localY = n[1];
    }, t.prototype.setCenter = function(r) {
      this.option.center = r;
    }, t.prototype.setZoom = function(r) {
      this.option.zoom = r;
    }, t.prototype.getGraph = function() {
      return this.getData().graph;
    }, t.prototype.getEdgeData = function() {
      return this.getGraph().edgeData;
    }, t.prototype.formatTooltip = function(r, n, i) {
      function a(v) {
        return isNaN(v) || v == null;
      }
      if (i === "edge") {
        var o = this.getDataParams(r, i), s = o.data, l = o.value, u = s.source + " -- " + s.target;
        return Rn("nameValue", {
          name: u,
          value: l,
          noValue: a(l)
        });
      } else {
        var f = this.getGraph().getNodeByIndex(r), c = f.getLayout().value, h = this.getDataParams(r, i).data.name;
        return Rn("nameValue", {
          name: h != null ? h + "" : null,
          value: c,
          noValue: a(c)
        });
      }
    }, t.prototype.optionUpdated = function() {
    }, t.prototype.getDataParams = function(r, n) {
      var i = e.prototype.getDataParams.call(this, r, n);
      if (i.value == null && n === "node") {
        var a = this.getGraph().getNodeByIndex(r), o = a.getLayout().value;
        i.value = o;
      }
      return i;
    }, t.type = "series.sankey", t.layoutMode = "box", t.defaultOption = {
      // zlevel: 0,
      z: 2,
      // `coordinateSystem` can be declared as 'matrix', 'calendar',
      //  which provides box layout container.
      coordinateSystemUsage: "box",
      left: "5%",
      top: "5%",
      right: "20%",
      bottom: "5%",
      orient: "horizontal",
      nodeWidth: 20,
      nodeGap: 8,
      draggable: !0,
      layoutIterations: 32,
      // true | false | 'move' | 'scale', see module:component/helper/RoamController.
      roam: !1,
      roamTrigger: "global",
      center: null,
      zoom: 1,
      label: {
        show: !0,
        position: "right",
        fontSize: 12
      },
      edgeLabel: {
        show: !1,
        fontSize: 12
      },
      levels: [],
      nodeAlign: "justify",
      lineStyle: {
        color: fe.color.neutral50,
        opacity: 0.2,
        curveness: 0.5
      },
      emphasis: {
        label: {
          show: !0
        },
        lineStyle: {
          opacity: 0.5
        }
      },
      select: {
        itemStyle: {
          borderColor: fe.color.primary
        }
      },
      animationEasing: "linear",
      animationDuration: 1e3
    }, t;
  })(Yt)
);
function kce(e, t) {
  e.eachSeriesByType("sankey", function(r) {
    var n = r.get("nodeWidth"), i = r.get("nodeGap"), a = Yn(r, t).refContainer, o = Tr(r.getBoxLayoutParams(), a);
    r.layoutInfo = o;
    var s = o.width, l = o.height, u = r.getGraph(), f = u.nodes, c = u.edges;
    zce(f);
    var h = nr(f, function(y) {
      return y.getLayout().value === 0;
    }), v = h.length !== 0 ? 0 : r.get("layoutIterations"), d = r.get("orient"), g = r.get("nodeAlign");
    Bce(f, c, n, i, s, l, v, d, g);
  });
}
function Bce(e, t, r, n, i, a, o, s, l) {
  Fce(e, t, r, i, a, s, l), Uce(e, t, a, i, n, o, s), Qce(e, s);
}
function zce(e) {
  F(e, function(t) {
    var r = Xc(t.outEdges, Ib), n = Xc(t.inEdges, Ib), i = t.getValue() || 0, a = Math.max(r, n, i);
    t.setLayout({
      value: a
    }, !0);
  });
}
function Fce(e, t, r, n, i, a, o) {
  for (var s = [], l = [], u = [], f = [], c = 0, h = 0; h < t.length; h++)
    s[h] = 1;
  for (var h = 0; h < e.length; h++)
    l[h] = e[h].inEdges.length, l[h] === 0 && u.push(e[h]);
  for (var v = -1; u.length; ) {
    for (var d = 0; d < u.length; d++) {
      var g = u[d], y = g.hostGraph.data.getRawDataItem(g.dataIndex), x = y.depth != null && y.depth >= 0;
      x && y.depth > v && (v = y.depth), g.setLayout({
        depth: x ? y.depth : c
      }, !0), a === "vertical" ? g.setLayout({
        dy: r
      }, !0) : g.setLayout({
        dx: r
      }, !0);
      for (var S = 0; S < g.outEdges.length; S++) {
        var T = g.outEdges[S], C = t.indexOf(T);
        s[C] = 0;
        var A = T.node2, M = e.indexOf(A);
        --l[M] === 0 && f.indexOf(A) < 0 && f.push(A);
      }
    }
    ++c, u = f, f = [];
  }
  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 E = v > c - 1 ? v : c - 1;
  o && o !== "left" && Gce(e, o, a, E);
  var P = a === "vertical" ? (i - r) / E : (n - r) / E;
  Hce(e, P, a);
}
function $7(e) {
  var t = e.hostGraph.data.getRawDataItem(e.dataIndex);
  return t.depth != null && t.depth >= 0;
}
function Gce(e, t, r, n) {
  if (t === "right") {
    for (var i = [], a = e, 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 f = l.inEdges[u];
          i.indexOf(f.node1) < 0 && i.push(f.node1);
        }
      }
      a = i, i = [], ++o;
    }
    F(e, function(c) {
      $7(c) || c.setLayout({
        depth: Math.max(0, n - c.getLayout().skNodeHeight)
      }, !0);
    });
  } else t === "justify" && Vce(e, n);
}
function Vce(e, t) {
  F(e, function(r) {
    !$7(r) && !r.outEdges.length && r.setLayout({
      depth: t
    }, !0);
  });
}
function Hce(e, t, r) {
  F(e, function(n) {
    var i = n.getLayout().depth * t;
    r === "vertical" ? n.setLayout({
      y: i
    }, !0) : n.setLayout({
      x: i
    }, !0);
  });
}
function Uce(e, t, r, n, i, a, o) {
  var s = Wce(e, o);
  Xce(s, t, r, n, i, o), sD(s, i, r, n, o);
  for (var l = 1; a > 0; a--)
    l *= 0.99, Yce(s, l, o), sD(s, i, r, n, o), Kce(s, l, o), sD(s, i, r, n, o);
}
function Wce(e, t) {
  var r = [], n = t === "vertical" ? "y" : "x", i = QE(e, function(a) {
    return a.getLayout()[n];
  });
  return i.keys.sort(function(a, o) {
    return a - o;
  }), F(i.keys, function(a) {
    r.push(i.buckets.get(a));
  }), r;
}
function Xce(e, t, r, n, i, a) {
  var o = 1 / 0;
  F(e, function(s) {
    var l = s.length, u = 0;
    F(s, function(c) {
      u += c.getLayout().value;
    });
    var f = a === "vertical" ? (n - (l - 1) * i) / u : (r - (l - 1) * i) / u;
    f < o && (o = f);
  }), F(e, function(s) {
    F(s, function(l, u) {
      var f = l.getLayout().value * o;
      a === "vertical" ? (l.setLayout({
        x: u
      }, !0), l.setLayout({
        dx: f
      }, !0)) : (l.setLayout({
        y: u
      }, !0), l.setLayout({
        dy: f
      }, !0));
    });
  }), F(t, function(s) {
    var l = +s.getValue() * o;
    s.setLayout({
      dy: l
    }, !0);
  });
}
function sD(e, t, r, n, i) {
  var a = i === "vertical" ? "x" : "y";
  F(e, function(o) {
    o.sort(function(g, y) {
      return g.getLayout()[a] - y.getLayout()[a];
    });
    for (var s, l, u, f = 0, c = o.length, h = i === "vertical" ? "dx" : "dy", v = 0; v < c; v++)
      l = o[v], u = f - l.getLayout()[a], u > 0 && (s = l.getLayout()[a] + u, i === "vertical" ? l.setLayout({
        x: s
      }, !0) : l.setLayout({
        y: s
      }, !0)), f = l.getLayout()[a] + l.getLayout()[h] + t;
    var d = i === "vertical" ? n : r;
    if (u = f - t - d, u > 0) {
      s = l.getLayout()[a] - u, i === "vertical" ? l.setLayout({
        x: s
      }, !0) : l.setLayout({
        y: s
      }, !0), f = s;
      for (var v = c - 2; v >= 0; --v)
        l = o[v], u = l.getLayout()[a] + l.getLayout()[h] + t - f, u > 0 && (s = l.getLayout()[a] - u, i === "vertical" ? l.setLayout({
          x: s
        }, !0) : l.setLayout({
          y: s
        }, !0)), f = l.getLayout()[a];
    }
  });
}
function Yce(e, t, r) {
  F(e.slice().reverse(), function(n) {
    F(n, function(i) {
      if (i.outEdges.length) {
        var a = Xc(i.outEdges, Zce, r) / Xc(i.outEdges, Ib);
        if (isNaN(a)) {
          var o = i.outEdges.length;
          a = o ? Xc(i.outEdges, $ce, r) / o : 0;
        }
        if (r === "vertical") {
          var s = i.getLayout().x + (a - Kc(i, r)) * t;
          i.setLayout({
            x: s
          }, !0);
        } else {
          var l = i.getLayout().y + (a - Kc(i, r)) * t;
          i.setLayout({
            y: l
          }, !0);
        }
      }
    });
  });
}
function Zce(e, t) {
  return Kc(e.node2, t) * e.getValue();
}
function $ce(e, t) {
  return Kc(e.node2, t);
}
function qce(e, t) {
  return Kc(e.node1, t) * e.getValue();
}
function jce(e, t) {
  return Kc(e.node1, t);
}
function Kc(e, t) {
  return t === "vertical" ? e.getLayout().x + e.getLayout().dx / 2 : e.getLayout().y + e.getLayout().dy / 2;
}
function Ib(e) {
  return e.getValue();
}
function Xc(e, t, r) {
  for (var n = 0, i = e.length, a = -1; ++a < i; ) {
    var o = +t(e[a], r);
    isNaN(o) || (n += o);
  }
  return n;
}
function Kce(e, t, r) {
  F(e, function(n) {
    F(n, function(i) {
      if (i.inEdges.length) {
        var a = Xc(i.inEdges, qce, r) / Xc(i.inEdges, Ib);
        if (isNaN(a)) {
          var o = i.inEdges.length;
          a = o ? Xc(i.inEdges, jce, r) / o : 0;
        }
        if (r === "vertical") {
          var s = i.getLayout().x + (a - Kc(i, r)) * t;
          i.setLayout({
            x: s
          }, !0);
        } else {
          var l = i.getLayout().y + (a - Kc(i, r)) * t;
          i.setLayout({
            y: l
          }, !0);
        }
      }
    });
  });
}
function Qce(e, t) {
  var r = t === "vertical" ? "x" : "y";
  F(e, function(n) {
    n.outEdges.sort(function(i, a) {
      return i.node2.getLayout()[r] - a.node2.getLayout()[r];
    }), n.inEdges.sort(function(i, a) {
      return i.node1.getLayout()[r] - a.node1.getLayout()[r];
    });
  }), F(e, function(n) {
    var i = 0, a = 0;
    F(n.outEdges, function(o) {
      o.setLayout({
        sy: i
      }, !0), i += o.getLayout().dy;
    }), F(n.inEdges, function(o) {
      o.setLayout({
        ty: a
      }, !0), a += o.getLayout().dy;
    });
  });
}
function Jce(e) {
  e.eachSeriesByType("sankey", function(t) {
    var r = t.getGraph(), n = r.nodes, i = r.edges;
    if (n.length) {
      var a = 1 / 0, o = -1 / 0;
      F(n, function(s) {
        var l = s.getLayout().value;
        l < a && (a = l), l > o && (o = l);
      }), F(n, function(s) {
        var l = new ai({
          type: "color",
          mappingMethod: "linear",
          dataExtent: [a, o],
          visual: t.get("color")
        }), u = l.mapValueToVisual(s.getLayout().value), f = s.getModel().get(["itemStyle", "color"]);
        f != null ? (s.setVisual("color", f), s.setVisual("style", {
          fill: f
        })) : (s.setVisual("color", u), s.setVisual("style", {
          fill: u
        }));
      });
    }
    i.length && F(i, function(s) {
      var l = s.getModel().get("lineStyle");
      s.setVisual("style", l);
    });
  });
}
function ehe(e) {
  e.registerChartView(Rce), e.registerSeriesModel(Nce), e.registerLayout(kce), e.registerVisual(Jce), e.registerAction({
    type: "dragNode",
    event: "dragnode",
    // here can only use 'update' now, other value is not support in echarts.
    update: "update"
  }, function(t, r) {
    r.eachComponent({
      mainType: "series",
      subType: "sankey",
      query: t
    }, function(n) {
      n.setNodePosition(t.dataIndex, [t.localX, t.localY]);
    });
  }), e.registerAction({
    type: "sankeyRoam",
    event: "sankeyRoam",
    update: "none"
  }, function(t, r, n) {
    r.eachComponent({
      mainType: "series",
      subType: "sankey",
      query: t
    }, function(i) {
      var a = i.coordinateSystem, o = XC(a, t, i.get("scaleLimit"));
      i.setCenter(o.center), i.setZoom(o.zoom);
    });
  });
}
var q7 = (
  /** @class */
  (function() {
    function e() {
    }
    return e.prototype._hasEncodeRule = function(t) {
      var r = this.getEncode();
      return r && r.get(t) != null;
    }, e.prototype.getInitialData = function(t, r) {
      var n, i = r.getComponent("xAxis", this.get("xAxisIndex")), a = r.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"], f = t.layout === "horizontal" ? 0 : 1, c = this._baseAxisDim = u[f], h = u[1 - f], v = [i, a], d = v[f].get("type"), g = v[1 - f].get("type"), y = t.data;
      if (y && l) {
        var x = [];
        F(y, function(C, A) {
          var M;
          Se(C) ? (M = C.slice(), C.unshift(A)) : Se(C.value) ? (M = xe({}, C), M.value = M.value.slice(), C.value.unshift(A)) : M = C, x.push(M);
        }), t.data = x;
      }
      var S = this.defaultValueDimensions, T = [{
        name: c,
        type: pb(d),
        ordinalMeta: n,
        otherDims: {
          tooltip: !1,
          itemName: 0
        },
        dimsDef: ["base"]
      }, {
        name: h,
        type: pb(g),
        dimsDef: S.slice()
      }];
      return cy(this, {
        coordDimensions: T,
        dimensionsCount: S.length + 1,
        encodeDefaulter: St(i8, T, this)
      });
    }, e.prototype.getBaseAxis = function() {
      var t = this._baseAxisDim;
      return this.ecModel.getComponent(t + "Axis", this.get(t + "AxisIndex")).axis;
    }, e;
  })()
), j7 = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.defaultValueDimensions = [{
        name: "min",
        defaultTooltip: !0
      }, {
        name: "Q1",
        defaultTooltip: !0
      }, {
        name: "median",
        defaultTooltip: !0
      }, {
        name: "Q3",
        defaultTooltip: !0
      }, {
        name: "max",
        defaultTooltip: !0
      }], r.visualDrawType = "stroke", r;
    }
    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: fe.color.neutral00,
        borderWidth: 1
      },
      emphasis: {
        scale: !0,
        itemStyle: {
          borderWidth: 2,
          shadowBlur: 5,
          shadowOffsetX: 1,
          shadowOffsetY: 1,
          shadowColor: fe.color.shadow
        }
      },
      animationDuration: 800
    }, t;
  })(Yt)
);
cn(j7, q7, !0);
var the = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.render = function(r, n, i) {
      var a = r.getData(), o = this.group, s = this._data;
      this._data || o.removeAll();
      var l = r.get("layout") === "horizontal" ? 1 : 0;
      a.diff(s).add(function(u) {
        if (a.hasValue(u)) {
          var f = a.getItemLayout(u), c = E4(f, a, u, l, !0);
          a.setItemGraphicEl(u, c), o.add(c);
        }
      }).update(function(u, f) {
        var c = s.getItemGraphicEl(f);
        if (!a.hasValue(u)) {
          o.remove(c);
          return;
        }
        var h = a.getItemLayout(u);
        c ? (vs(c), K7(h, c, a, u)) : c = E4(h, a, u, l), o.add(c), a.setItemGraphicEl(u, c);
      }).remove(function(u) {
        var f = s.getItemGraphicEl(u);
        f && o.remove(f);
      }).execute(), this._data = a;
    }, t.prototype.remove = function(r) {
      var n = this.group, i = this._data;
      this._data = null, i && i.eachItemGraphicEl(function(a) {
        a && n.remove(a);
      });
    }, t.type = "boxplot", t;
  })(Ut)
), rhe = (
  /** @class */
  /* @__PURE__ */ (function() {
    function e() {
    }
    return e;
  })()
), nhe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r) {
      var n = e.call(this, r) || this;
      return n.type = "boxplotBoxPath", n;
    }
    return t.prototype.getDefaultShape = function() {
      return new rhe();
    }, t.prototype.buildPath = function(r, n) {
      var i = n.points, a = 0;
      for (r.moveTo(i[a][0], i[a][1]), a++; a < 4; a++)
        r.lineTo(i[a][0], i[a][1]);
      for (r.closePath(); a < i.length; a++)
        r.moveTo(i[a][0], i[a][1]), a++, r.lineTo(i[a][0], i[a][1]);
    }, t;
  })(zt)
);
function E4(e, t, r, n, i) {
  var a = e.ends, o = new nhe({
    shape: {
      points: i ? ihe(a, n, e) : a
    }
  });
  return K7(e, o, t, r, i), o;
}
function K7(e, t, r, n, i) {
  var a = r.hostModel, o = kd[i ? "initProps" : "updateProps"];
  o(t, {
    shape: {
      points: e.ends
    }
  }, a, n), t.useStyle(r.getItemVisual(n, "style")), t.style.strokeNoScale = !0, t.z2 = 100;
  var s = r.getItemModel(n), l = s.getModel("emphasis");
  Un(t, s), Hr(t, l.get("focus"), l.get("blurScope"), l.get("disabled"));
}
function ihe(e, t, r) {
  return Ce(e, function(n) {
    return n = n.slice(), n[t] = r.initBaseline, n;
  });
}
var x1 = F;
function ahe(e) {
  var t = ohe(e);
  x1(t, function(r) {
    var n = r.seriesModels;
    n.length && (she(r), x1(n, function(i, a) {
      lhe(i, r.boxOffsetList[a], r.boxWidthList[a]);
    }));
  });
}
function ohe(e) {
  var t = [], r = [];
  return e.eachSeriesByType("boxplot", function(n) {
    var i = n.getBaseAxis(), a = Tt(r, i);
    a < 0 && (a = r.length, r[a] = i, t[a] = {
      axis: i,
      seriesModels: []
    }), t[a].seriesModels.push(n);
  }), t;
}
function she(e) {
  var t = e.axis, r = e.seriesModels, n = r.length, i = e.boxWidthList = [], a = e.boxOffsetList = [], o = [], s;
  if (t.type === "category")
    s = t.getBandWidth();
  else {
    var l = 0;
    x1(r, function(d) {
      l = Math.max(l, d.getData().count());
    });
    var u = t.getExtent();
    s = Math.abs(u[1] - u[0]) / l;
  }
  x1(r, function(d) {
    var g = d.get("boxWidth");
    Se(g) || (g = [g, g]), o.push([Be(g[0], s) || 0, Be(g[1], s) || 0]);
  });
  var f = s * 0.8 - 2, c = f / n * 0.3, h = (f - c * (n - 1)) / n, v = h / 2 - f / 2;
  x1(r, function(d, g) {
    a.push(v), v += c + h, i.push(Math.min(Math.max(h, o[g][0]), o[g][1]));
  });
}
function lhe(e, t, r) {
  var n = e.coordinateSystem, i = e.getData(), a = r / 2, o = e.get("layout") === "horizontal" ? 0 : 1, s = 1 - o, l = ["x", "y"], u = i.mapDimension(l[o]), f = i.mapDimensionsAll(l[s]);
  if (u == null || f.length < 5)
    return;
  for (var c = 0; c < i.count(); c++) {
    var h = i.get(u, c), v = T(h, f[2], c), d = T(h, f[0], c), g = T(h, f[1], c), y = T(h, f[3], c), x = T(h, f[4], c), S = [];
    C(S, g, !1), C(S, y, !0), S.push(d, g, x, y), A(S, d), A(S, x), A(S, v), i.setItemLayout(c, {
      initBaseline: v[s],
      ends: S
    });
  }
  function T(M, E, P) {
    var R = i.get(E, P), O = [];
    O[o] = M, O[s] = R;
    var N;
    return isNaN(M) || isNaN(R) ? N = [NaN, NaN] : (N = n.dataToPoint(O), N[o] += t), N;
  }
  function C(M, E, P) {
    var R = E.slice(), O = E.slice();
    R[o] += a, O[o] -= a, P ? M.push(R, O) : M.push(O, R);
  }
  function A(M, E) {
    var P = E.slice(), R = E.slice();
    P[o] -= a, R[o] += a, M.push(P, R);
  }
}
function uhe(e, t) {
  t = t || {};
  for (var r = [], n = [], i = t.boundIQR, a = i === "none" || i === 0, o = 0; o < e.length; o++) {
    var s = xo(e[o].slice()), l = m2(s, 0.25), u = m2(s, 0.5), f = m2(s, 0.75), c = s[0], h = s[s.length - 1], v = (i ?? 1.5) * (f - l), d = a ? c : Math.max(c, l - v), g = a ? h : Math.min(h, f + v), y = t.itemNameFormatter, x = nt(y) ? y({
      value: o
    }) : Fe(y) ? y.replace("{value}", o + "") : o + "";
    r.push([x, d, l, u, f, g]);
    for (var S = 0; S < s.length; S++) {
      var T = s[S];
      if (T < d || T > g) {
        var C = [x, T];
        n.push(C);
      }
    }
  }
  return {
    boxData: r,
    outliers: n
  };
}
var fhe = {
  type: "echarts:boxplot",
  transform: function(t) {
    var r = t.upstream;
    if (r.sourceFormat !== Ai) {
      var n = "";
      or(n);
    }
    var i = uhe(r.getRawData(), t.config);
    return [{
      dimensions: ["ItemName", "Low", "Q1", "Q2", "Q3", "High"],
      data: i.boxData
    }, {
      data: i.outliers
    }];
  }
};
function che(e) {
  e.registerSeriesModel(j7), e.registerChartView(the), e.registerLayout(ahe), e.registerTransform(fhe);
}
var hhe = ["itemStyle", "borderColor"], vhe = ["itemStyle", "borderColor0"], dhe = ["itemStyle", "borderColorDoji"], phe = ["itemStyle", "color"], ghe = ["itemStyle", "color0"];
function hN(e, t) {
  return t.get(e > 0 ? phe : ghe);
}
function vN(e, t) {
  return t.get(e === 0 ? dhe : e > 0 ? hhe : vhe);
}
var mhe = {
  seriesType: "candlestick",
  plan: iy(),
  // For legend.
  performRawSeries: !0,
  reset: function(e, t) {
    if (!t.isSeriesFiltered(e)) {
      var r = e.pipelineContext.large;
      return !r && {
        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 = hN(s, o), l.stroke = vN(s, o) || l.fill;
            var u = i.ensureUniqueItemVisual(a, "style");
            xe(u, l);
          }
        }
      };
    }
  }
}, yhe = ["color", "borderColor"], _he = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.render = function(r, n, i) {
      this.group.removeClipPath(), this._progressiveEls = null, this._updateDrawMode(r), this._isLargeDraw ? this._renderLarge(r) : this._renderNormal(r);
    }, t.prototype.incrementalPrepareRender = function(r, n, i) {
      this._clear(), this._updateDrawMode(r);
    }, t.prototype.incrementalRender = function(r, n, i, a) {
      this._progressiveEls = [], this._isLargeDraw ? this._incrementalRenderLarge(r, n) : this._incrementalRenderNormal(r, n);
    }, t.prototype.eachRendered = function(r) {
      rh(this._progressiveEls || this.group, r);
    }, t.prototype._updateDrawMode = function(r) {
      var n = r.pipelineContext.large;
      (this._isLargeDraw == null || n !== this._isLargeDraw) && (this._isLargeDraw = n, this._clear());
    }, t.prototype._renderNormal = function(r) {
      var n = r.getData(), i = this._data, a = this.group, o = n.getLayout("isSimpleBox"), s = r.get("clip", !0), l = r.coordinateSystem, u = l.getArea && l.getArea();
      this._data || a.removeAll(), n.diff(i).add(function(f) {
        if (n.hasValue(f)) {
          var c = n.getItemLayout(f);
          if (s && P4(u, c))
            return;
          var h = lD(c, f, !0);
          Ir(h, {
            shape: {
              points: c.ends
            }
          }, r, f), uD(h, n, f, o), a.add(h), n.setItemGraphicEl(f, h);
        }
      }).update(function(f, c) {
        var h = i.getItemGraphicEl(c);
        if (!n.hasValue(f)) {
          a.remove(h);
          return;
        }
        var v = n.getItemLayout(f);
        if (s && P4(u, v)) {
          a.remove(h);
          return;
        }
        h ? (Wt(h, {
          shape: {
            points: v.ends
          }
        }, r, f), vs(h)) : h = lD(v), uD(h, n, f, o), a.add(h), n.setItemGraphicEl(f, h);
      }).remove(function(f) {
        var c = i.getItemGraphicEl(f);
        c && a.remove(c);
      }).execute(), this._data = n;
    }, t.prototype._renderLarge = function(r) {
      this._clear(), I4(r, this.group);
      var n = r.get("clip", !0) ? Bx(r.coordinateSystem, !1, r) : null;
      n ? this.group.setClipPath(n) : this.group.removeClipPath();
    }, t.prototype._incrementalRenderNormal = function(r, n) {
      for (var i = n.getData(), a = i.getLayout("isSimpleBox"), o; (o = r.next()) != null; ) {
        var s = i.getItemLayout(o), l = lD(s);
        uD(l, i, o, a), l.incremental = !0, this.group.add(l), this._progressiveEls.push(l);
      }
    }, t.prototype._incrementalRenderLarge = function(r, n) {
      I4(n, this.group, this._progressiveEls, !0);
    }, t.prototype.remove = function(r) {
      this._clear();
    }, t.prototype._clear = function() {
      this.group.removeAll(), this._data = null;
    }, t.type = "candlestick", t;
  })(Ut)
), xhe = (
  /** @class */
  /* @__PURE__ */ (function() {
    function e() {
    }
    return e;
  })()
), She = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r) {
      var n = e.call(this, r) || this;
      return n.type = "normalCandlestickBox", n;
    }
    return t.prototype.getDefaultShape = function() {
      return new xhe();
    }, t.prototype.buildPath = function(r, n) {
      var i = n.points;
      this.__simpleBox ? (r.moveTo(i[4][0], i[4][1]), r.lineTo(i[6][0], i[6][1])) : (r.moveTo(i[0][0], i[0][1]), r.lineTo(i[1][0], i[1][1]), r.lineTo(i[2][0], i[2][1]), r.lineTo(i[3][0], i[3][1]), r.closePath(), r.moveTo(i[4][0], i[4][1]), r.lineTo(i[5][0], i[5][1]), r.moveTo(i[6][0], i[6][1]), r.lineTo(i[7][0], i[7][1]));
    }, t;
  })(zt)
);
function lD(e, t, r) {
  var n = e.ends;
  return new She({
    shape: {
      points: r ? whe(n, e) : n
    },
    z2: 100
  });
}
function P4(e, t) {
  for (var r = !0, n = 0; n < t.ends.length; n++)
    if (e.contain(t.ends[n][0], t.ends[n][1])) {
      r = !1;
      break;
    }
  return r;
}
function uD(e, t, r, n) {
  var i = t.getItemModel(r);
  e.useStyle(t.getItemVisual(r, "style")), e.style.strokeNoScale = !0, e.__simpleBox = n, Un(e, i);
  var a = t.getItemLayout(r).sign;
  F(e.states, function(s, l) {
    var u = i.getModel(l), f = hN(a, u), c = vN(a, u) || f, h = s.style || (s.style = {});
    f && (h.fill = f), c && (h.stroke = c);
  });
  var o = i.getModel("emphasis");
  Hr(e, o.get("focus"), o.get("blurScope"), o.get("disabled"));
}
function whe(e, t) {
  return Ce(e, function(r) {
    return r = r.slice(), r[1] = t.initBaseline, r;
  });
}
var The = (
  /** @class */
  /* @__PURE__ */ (function() {
    function e() {
    }
    return e;
  })()
), fD = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r) {
      var n = e.call(this, r) || this;
      return n.type = "largeCandlestickBox", n;
    }
    return t.prototype.getDefaultShape = function() {
      return new The();
    }, t.prototype.buildPath = function(r, n) {
      for (var i = n.points, a = 0; a < i.length; )
        if (this.__sign === i[a++]) {
          var o = i[a++];
          r.moveTo(o, i[a++]), r.lineTo(o, i[a++]);
        } else
          a += 3;
    }, t;
  })(zt)
);
function I4(e, t, r, n) {
  var i = e.getData(), a = i.getLayout("largePoints"), o = new fD({
    shape: {
      points: a
    },
    __sign: 1,
    ignoreCoarsePointer: !0
  });
  t.add(o);
  var s = new fD({
    shape: {
      points: a
    },
    __sign: -1,
    ignoreCoarsePointer: !0
  });
  t.add(s);
  var l = new fD({
    shape: {
      points: a
    },
    __sign: 0,
    ignoreCoarsePointer: !0
  });
  t.add(l), cD(1, o, e), cD(-1, s, e), cD(0, l, e), n && (o.incremental = !0, s.incremental = !0), r && r.push(o, s);
}
function cD(e, t, r, n) {
  var i = vN(e, r) || hN(e, r), a = r.getModel("itemStyle").getItemStyle(yhe);
  t.useStyle(a), t.style.fill = null, t.style.stroke = i;
}
var Q7 = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.defaultValueDimensions = [{
        name: "open",
        defaultTooltip: !0
      }, {
        name: "close",
        defaultTooltip: !0
      }, {
        name: "lowest",
        defaultTooltip: !0
      }, {
        name: "highest",
        defaultTooltip: !0
      }], r;
    }
    return t.prototype.getShadowDim = function() {
      return "open";
    }, t.prototype.brushSelector = function(r, n, i) {
      var a = n.getItemLayout(r);
      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;
  })(Yt)
);
cn(Q7, q7, !0);
function bhe(e) {
  !e || !Se(e.series) || F(e.series, function(t) {
    ot(t) && t.type === "k" && (t.type = "candlestick");
  });
}
var Che = {
  seriesType: "candlestick",
  plan: iy(),
  reset: function(e) {
    var t = e.coordinateSystem, r = e.getData(), n = Ahe(e, r), i = 0, a = 1, o = ["x", "y"], s = r.getDimensionIndex(r.mapDimension(o[i])), l = Ce(r.mapDimensionsAll(o[a]), r.getDimensionIndex, r), u = l[0], f = l[1], c = l[2], h = l[3];
    if (r.setLayout({
      candleWidth: n,
      // The value is experimented visually.
      isSimpleBox: n <= 1.3
    }), s < 0 || l.length < 4)
      return;
    return {
      progress: e.pipelineContext.large ? d : v
    };
    function v(g, y) {
      for (var x, S = y.getStore(); (x = g.next()) != null; ) {
        var T = S.get(s, x), C = S.get(u, x), A = S.get(f, x), M = S.get(c, x), E = S.get(h, x), P = Math.min(C, A), R = Math.max(C, A), O = ee(P, T), N = ee(R, T), G = ee(M, T), z = ee(E, T), H = [];
        V(H, N, 0), V(H, O, 1), H.push(q(z), q(N), q(G), q(O));
        var W = y.getItemModel(x), Z = !!W.get(["itemStyle", "borderColorDoji"]);
        y.setItemLayout(x, {
          sign: R4(S, x, C, A, f, Z),
          initBaseline: C > A ? N[a] : O[a],
          ends: H,
          brushRect: Q(M, E, T)
        });
      }
      function ee(X, K) {
        var ue = [];
        return ue[i] = K, ue[a] = X, isNaN(K) || isNaN(X) ? [NaN, NaN] : t.dataToPoint(ue);
      }
      function V(X, K, ue) {
        var oe = K.slice(), te = K.slice();
        oe[i] = _2(oe[i] + n / 2, 1, !1), te[i] = _2(te[i] - n / 2, 1, !0), ue ? X.push(oe, te) : X.push(te, oe);
      }
      function Q(X, K, ue) {
        var oe = ee(X, ue), te = ee(K, ue);
        return oe[i] -= n / 2, te[i] -= n / 2, {
          x: oe[0],
          y: oe[1],
          width: n,
          height: te[1] - oe[1]
        };
      }
      function q(X) {
        return X[i] = _2(X[i], 1), X;
      }
    }
    function d(g, y) {
      for (var x = Wl(g.count * 4), S = 0, T, C = [], A = [], M, E = y.getStore(), P = !!e.get(["itemStyle", "borderColorDoji"]); (M = g.next()) != null; ) {
        var R = E.get(s, M), O = E.get(u, M), N = E.get(f, M), G = E.get(c, M), z = E.get(h, M);
        if (isNaN(R) || isNaN(G) || isNaN(z)) {
          x[S++] = NaN, S += 3;
          continue;
        }
        x[S++] = R4(E, M, O, N, f, P), C[i] = R, C[a] = G, T = t.dataToPoint(C, null, A), x[S++] = T ? T[0] : NaN, x[S++] = T ? T[1] : NaN, C[a] = z, T = t.dataToPoint(C, null, A), x[S++] = T ? T[1] : NaN;
      }
      y.setLayout("largePoints", x);
    }
  }
};
function R4(e, t, r, n, i, a) {
  var o;
  return r > n ? o = -1 : r < n ? o = 1 : o = a ? 0 : t > 0 ? e.get(i, t - 1) <= n ? 1 : -1 : 1, o;
}
function Ahe(e, t) {
  var r = e.getBaseAxis(), n, i = r.type === "category" ? r.getBandWidth() : (n = r.getExtent(), Math.abs(n[1] - n[0]) / t.count()), a = Be(et(e.get("barMaxWidth"), i), i), o = Be(et(e.get("barMinWidth"), 1), i), s = e.get("barWidth");
  return s != null ? Be(s, i) : Math.max(Math.min(i / 2, a), o);
}
function Mhe(e) {
  e.registerChartView(_he), e.registerSeriesModel(Q7), e.registerPreprocessor(bhe), e.registerVisual(mhe), e.registerLayout(Che);
}
function O4(e, t) {
  var r = t.rippleEffectColor || t.color;
  e.eachChild(function(n) {
    n.attr({
      z: t.z,
      zlevel: t.zlevel,
      style: {
        stroke: t.brushType === "stroke" ? r : null,
        fill: t.brushType === "fill" ? r : null
      }
    });
  });
}
var Lhe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r, n) {
      var i = e.call(this) || this, a = new Nx(r, n), o = new rt();
      return i.add(a), i.add(o), i.updateData(r, n), i;
    }
    return t.prototype.stopEffectAnimation = function() {
      this.childAt(1).removeAll();
    }, t.prototype.startEffectAnimation = function(r) {
      for (var n = r.symbolType, i = r.color, a = r.rippleNumber, o = this.childAt(1), s = 0; s < a; s++) {
        var l = en(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 * r.period + r.effectOffset;
        l.animate("", !0).when(r.period, {
          scaleX: r.rippleScale / 2,
          scaleY: r.rippleScale / 2
        }).delay(u).start(), l.animateStyle(!0).when(r.period, {
          opacity: 0
        }).delay(u).start(), o.add(l);
      }
      O4(o, r);
    }, t.prototype.updateEffectAnimation = function(r) {
      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] !== r[s]) {
          this.stopEffectAnimation(), this.startEffectAnimation(r);
          return;
        }
      }
      O4(i, r);
    }, t.prototype.highlight = function() {
      mf(this);
    }, t.prototype.downplay = function() {
      yf(this);
    }, t.prototype.getSymbolType = function() {
      var r = this.childAt(0);
      return r && r.getSymbolType();
    }, t.prototype.updateData = function(r, n) {
      var i = this, a = r.hostModel;
      this.childAt(0).updateData(r, n);
      var o = this.childAt(1), s = r.getItemModel(n), l = r.getItemVisual(n, "symbol"), u = oy(r.getItemVisual(n, "symbolSize")), f = r.getItemVisual(n, "style"), c = f && f.fill, h = s.getModel("emphasis");
      o.setScale(u), o.traverse(function(y) {
        y.setStyle("fill", c);
      });
      var v = Fd(r.getItemVisual(n, "symbolOffset"), u);
      v && (o.x = v[0], o.y = v[1]);
      var d = r.getItemVisual(n, "symbolRotate");
      o.rotation = (d || 0) * Math.PI / 180 || 0;
      var g = {};
      g.showEffectOn = a.get("showEffectOn"), g.rippleScale = s.get(["rippleEffect", "scale"]), g.brushType = s.get(["rippleEffect", "brushType"]), g.period = s.get(["rippleEffect", "period"]) * 1e3, g.effectOffset = n / r.count(), g.z = a.getShallow("z") || 0, g.zlevel = a.getShallow("zlevel") || 0, g.symbolType = l, g.color = c, g.rippleEffectColor = s.get(["rippleEffect", "color"]), g.rippleNumber = s.get(["rippleEffect", "number"]), g.showEffectOn === "render" ? (this._effectCfg ? this.updateEffectAnimation(g) : this.startEffectAnimation(g), this._effectCfg = g) : (this._effectCfg = null, this.stopEffectAnimation(), this.onHoverStateChange = function(y) {
        y === "emphasis" ? g.showEffectOn !== "render" && i.startEffectAnimation(g) : y === "normal" && g.showEffectOn !== "render" && i.stopEffectAnimation();
      }), this._effectCfg = g, Hr(this, h.get("focus"), h.get("blurScope"), h.get("disabled"));
    }, t.prototype.fadeOut = function(r) {
      r && r();
    }, t;
  })(rt)
), Dhe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.init = function() {
      this._symbolDraw = new kx(Lhe);
    }, t.prototype.render = function(r, n, i) {
      var a = r.getData(), o = this._symbolDraw;
      o.updateData(a, {
        clipShape: this._getClipShape(r)
      }), this.group.add(o.group);
    }, t.prototype._getClipShape = function(r) {
      var n = r.coordinateSystem, i = n && n.getArea && n.getArea();
      return r.get("clip", !0) ? i : null;
    }, t.prototype.updateTransform = function(r, n, i) {
      var a = r.getData();
      this.group.dirty();
      var o = zx("").reset(r, n, i);
      o.progress && o.progress({
        start: 0,
        end: a.count(),
        count: a.count()
      }, a), this._symbolDraw.updateLayout();
    }, t.prototype._updateGroupTransform = function(r) {
      var n = r.coordinateSystem;
      n && n.getRoamTransform && (this.group.transform = oU(n.getRoamTransform()), this.group.decomposeTransform());
    }, t.prototype.remove = function(r, n) {
      this._symbolDraw && this._symbolDraw.remove(!0);
    }, t.type = "effectScatter", t;
  })(Ut)
), Ehe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.hasSymbolVisual = !0, r;
    }
    return t.prototype.getInitialData = function(r, n) {
      return ou(null, this, {
        useEncodeDefaulter: !0
      });
    }, t.prototype.brushSelector = function(r, n, i) {
      return i.point(n.getItemLayout(r));
    }, 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;
  })(Yt)
);
function Phe(e) {
  e.registerChartView(Dhe), e.registerSeriesModel(Ehe), e.registerLayout(zx("effectScatter"));
}
var J7 = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r, n, i) {
      var a = e.call(this) || this;
      return a.add(a.createLine(r, n, i)), a._updateEffectSymbol(r, n), a;
    }
    return t.prototype.createLine = function(r, n, i) {
      return new rN(r, n, i);
    }, t.prototype._updateEffectSymbol = function(r, n) {
      var i = r.getItemModel(n), a = i.getModel("effect"), o = a.get("symbolSize"), s = a.get("symbol");
      Se(o) || (o = [o, o]);
      var l = r.getItemVisual(n, "style"), u = a.get("color") || l && l.stroke, f = this.childAt(1);
      this._symbolType !== s && (this.remove(f), f = en(s, -0.5, -0.5, 1, 1, u), f.z2 = 100, f.culling = !0, this.add(f)), f && (f.setStyle("shadowColor", u), f.setStyle(a.getItemStyle(["color"])), f.scaleX = o[0], f.scaleY = o[1], f.setColor(u), this._symbolType = s, this._symbolScale = o, this._updateEffectAnimation(r, a, n));
    }, t.prototype._updateEffectAnimation = function(r, n, i) {
      var a = this.childAt(1);
      if (a) {
        var o = r.getItemLayout(i), s = n.get("period") * 1e3, l = n.get("loop"), u = n.get("roundTrip"), f = n.get("constantSpeed"), c = Ti(n.get("delay"), function(v) {
          return v / r.count() * s / 3;
        });
        if (a.ignore = !0, this._updateAnimationPoints(a, o), f > 0 && (s = this._getLineLength(a) / f * 1e3), s !== this._period || l !== this._loop || u !== this._roundTrip) {
          a.stopAnimation();
          var h = void 0;
          nt(c) ? h = c(i) : h = c, 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(r, n, i, a, o) {
      if (n > 0) {
        r.__t = 0;
        var s = this, l = r.animate("", a).when(o ? n * 2 : n, {
          __t: o ? 2 : 1
        }).delay(i).during(function() {
          s._updateSymbolPosition(r);
        });
        a || l.done(function() {
          s.remove(r);
        }), l.start();
      }
    }, t.prototype._getLineLength = function(r) {
      return rf(r.__p1, r.__cp1) + rf(r.__cp1, r.__p2);
    }, t.prototype._updateAnimationPoints = function(r, n) {
      r.__p1 = n[0], r.__p2 = n[1], r.__cp1 = n[2] || [(n[0][0] + n[1][0]) / 2, (n[0][1] + n[1][1]) / 2];
    }, t.prototype.updateData = function(r, n, i) {
      this.childAt(0).updateData(r, n, i), this._updateEffectSymbol(r, n);
    }, t.prototype._updateSymbolPosition = function(r) {
      var n = r.__p1, i = r.__p2, a = r.__cp1, o = r.__t < 1 ? r.__t : 2 - r.__t, s = [r.x, r.y], l = s.slice(), u = Si, f = BE;
      s[0] = u(n[0], a[0], i[0], o), s[1] = u(n[1], a[1], i[1], o);
      var c = r.__t < 1 ? f(n[0], a[0], i[0], o) : f(i[0], a[0], n[0], 1 - o), h = r.__t < 1 ? f(n[1], a[1], i[1], o) : f(i[1], a[1], n[1], 1 - o);
      r.rotation = -Math.atan2(h, c) - Math.PI / 2, (this._symbolType === "line" || this._symbolType === "rect" || this._symbolType === "roundRect") && (r.__lastT !== void 0 && r.__lastT < r.__t ? (r.scaleY = rf(l, s) * 1.05, o === 1 && (s[0] = l[0] + (s[0] - l[0]) / 2, s[1] = l[1] + (s[1] - l[1]) / 2)) : r.__lastT === 1 ? r.scaleY = 2 * rf(n, s) : r.scaleY = this._symbolScale[1]), r.__lastT = r.__t, r.ignore = !1, r.x = s[0], r.y = s[1];
    }, t.prototype.updateLayout = function(r, n) {
      this.childAt(0).updateLayout(r, n);
      var i = r.getItemModel(n).getModel("effect");
      this._updateEffectAnimation(r, i, n);
    }, t;
  })(rt)
), eX = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r, n, i) {
      var a = e.call(this) || this;
      return a._createPolyline(r, n, i), a;
    }
    return t.prototype._createPolyline = function(r, n, i) {
      var a = r.getItemLayout(n), o = new Ci({
        shape: {
          points: a
        }
      });
      this.add(o), this._updateCommonStl(r, n, i);
    }, t.prototype.updateData = function(r, n, i) {
      var a = r.hostModel, o = this.childAt(0), s = {
        shape: {
          points: r.getItemLayout(n)
        }
      };
      Wt(o, s, a, n), this._updateCommonStl(r, n, i);
    }, t.prototype._updateCommonStl = function(r, n, i) {
      var a = this.childAt(0), o = r.getItemModel(n), s = i && i.emphasisLineStyle, l = i && i.focus, u = i && i.blurScope, f = i && i.emphasisDisabled;
      if (!i || r.hasItemOption) {
        var c = o.getModel("emphasis");
        s = c.getModel("lineStyle").getLineStyle(), f = c.get("disabled"), l = c.get("focus"), u = c.get("blurScope");
      }
      a.useStyle(r.getItemVisual(n, "style")), a.style.fill = null, a.style.strokeNoScale = !0;
      var h = a.ensureState("emphasis");
      h.style = s, Hr(this, l, u, f);
    }, t.prototype.updateLayout = function(r, n) {
      var i = this.childAt(0);
      i.setShape("points", r.getItemLayout(n));
    }, t;
  })(rt)
), Ihe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r._lastFrame = 0, r._lastFramePercent = 0, r;
    }
    return t.prototype.createLine = function(r, n, i) {
      return new eX(r, n, i);
    }, t.prototype._updateAnimationPoints = function(r, 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 += rf(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(r) {
      var n = r.__t < 1 ? r.__t : 2 - r.__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 f = (n - a[l]) / (a[l + 1] - a[l]), c = i[l], h = i[l + 1];
        r.x = c[0] * (1 - f) + f * h[0], r.y = c[1] * (1 - f) + f * h[1];
        var v = r.__t < 1 ? h[0] - c[0] : c[0] - h[0], d = r.__t < 1 ? h[1] - c[1] : c[1] - h[1];
        r.rotation = -Math.atan2(d, v) - Math.PI / 2, this._lastFrame = l, this._lastFramePercent = n, r.ignore = !1;
      }
    }, t;
  })(J7)
), Rhe = (
  /** @class */
  /* @__PURE__ */ (function() {
    function e() {
      this.polyline = !1, this.curveness = 0, this.segs = [];
    }
    return e;
  })()
), Ohe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r) {
      var n = e.call(this, r) || 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: fe.color.neutral99,
        fill: null
      };
    }, t.prototype.getDefaultShape = function() {
      return new Rhe();
    }, t.prototype.buildPath = function(r, 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) {
            r.moveTo(i[o++], i[o++]);
            for (var l = 1; l < s; l++)
              r.lineTo(i[o++], i[o++]);
          }
        }
      else
        for (o = this._off; o < i.length; ) {
          var u = i[o++], f = i[o++], c = i[o++], h = i[o++];
          if (r.moveTo(u, f), a > 0) {
            var v = (u + c) / 2 - (f - h) * a, d = (f + h) / 2 - (c - u) * a;
            r.quadraticCurveTo(v, d, c, h);
          } else
            r.lineTo(c, h);
        }
      this.incremental && (this._off = o, this.notClear = !0);
    }, t.prototype.findDataIndex = function(r, 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 f = a[u++];
          if (f > 0)
            for (var c = a[u++], h = a[u++], v = 1; v < f; v++) {
              var d = a[u++], g = a[u++];
              if (Lc(c, h, d, g, s, r, n))
                return l;
            }
          l++;
        }
      else
        for (var l = 0, u = 0; u < a.length; ) {
          var c = a[u++], h = a[u++], d = a[u++], g = a[u++];
          if (o > 0) {
            var y = (c + d) / 2 - (h - g) * o, x = (h + g) / 2 - (d - c) * o;
            if (JU(c, h, y, x, d, g, s, r, n))
              return l;
          } else if (Lc(c, h, d, g, s, r, n))
            return l;
          l++;
        }
      return -1;
    }, t.prototype.contain = function(r, n) {
      var i = this.transformCoordToLocal(r, n), a = this.getBoundingRect();
      if (r = i[0], n = i[1], a.contain(r, n)) {
        var o = this.hoverDataIdx = this.findDataIndex(r, n);
        return o >= 0;
      }
      return this.hoverDataIdx = -1, !1;
    }, t.prototype.getBoundingRect = function() {
      var r = this._rect;
      if (!r) {
        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 f = i[u++], c = i[u++];
          a = Math.min(f, a), s = Math.max(f, s), o = Math.min(c, o), l = Math.max(c, l);
        }
        r = this._rect = new st(a, o, s, l);
      }
      return r;
    }, t;
  })(zt)
), Nhe = (
  /** @class */
  (function() {
    function e() {
      this.group = new rt();
    }
    return e.prototype.updateData = function(t) {
      this._clear();
      var r = this._create();
      r.setShape({
        segs: t.getLayout("linesPoints")
      }), this._setCommon(r, t);
    }, e.prototype.incrementalPrepareUpdate = function(t) {
      this.group.removeAll(), this._clear();
    }, e.prototype.incrementalUpdate = function(t, r) {
      var n = this._newAdded[0], i = r.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, r), l.__startIndex = t.start;
      }
    }, e.prototype.remove = function() {
      this._clear();
    }, e.prototype.eachRendered = function(t) {
      this._newAdded[0] && t(this._newAdded[0]);
    }, e.prototype._create = function() {
      var t = new Ohe({
        cursor: "default",
        ignoreCoarsePointer: !0
      });
      return this._newAdded.push(t), this.group.add(t), t;
    }, e.prototype._setCommon = function(t, r, n) {
      var i = r.hostModel;
      t.setShape({
        polyline: i.get("polyline"),
        curveness: i.get(["lineStyle", "curveness"])
      }), t.useStyle(i.getModel("lineStyle").getLineStyle()), t.style.strokeNoScale = !0;
      var a = r.getVisual("style");
      a && a.stroke && t.setStyle("stroke", a.stroke), t.setStyle("fill", null);
      var o = pt(t);
      o.seriesIndex = i.seriesIndex, t.on("mousemove", function(s) {
        o.dataIndex = null;
        var l = t.hoverDataIdx;
        l > 0 && (o.dataIndex = l + t.__startIndex);
      });
    }, e.prototype._clear = function() {
      this._newAdded = [], this.group.removeAll();
    }, e;
  })()
), tX = {
  seriesType: "lines",
  plan: iy(),
  reset: function(e) {
    var t = e.coordinateSystem;
    if (t) {
      var r = e.get("polyline"), n = e.pipelineContext.large;
      return {
        progress: function(i, a) {
          var o = [];
          if (n) {
            var s = void 0, l = i.end - i.start;
            if (r) {
              for (var u = 0, f = i.start; f < i.end; f++)
                u += e.getLineCoordsCount(f);
              s = new Float32Array(l + u * 2);
            } else
              s = new Float32Array(l * 4);
            for (var c = 0, h = [], f = i.start; f < i.end; f++) {
              var v = e.getLineCoords(f, o);
              r && (s[c++] = v);
              for (var d = 0; d < v; d++)
                h = t.dataToPoint(o[d], !1, h), s[c++] = h[0], s[c++] = h[1];
            }
            a.setLayout("linesPoints", s);
          } else
            for (var f = i.start; f < i.end; f++) {
              var g = a.getItemModel(f), v = e.getLineCoords(f, o), y = [];
              if (r)
                for (var x = 0; x < v; x++)
                  y.push(t.dataToPoint(o[x]));
              else {
                y[0] = t.dataToPoint(o[0]), y[1] = t.dataToPoint(o[1]);
                var S = g.get(["lineStyle", "curveness"]);
                +S && (y[2] = [(y[0][0] + y[1][0]) / 2 - (y[0][1] - y[1][1]) * S, (y[0][1] + y[1][1]) / 2 - (y[1][0] - y[0][0]) * S]);
              }
              a.setItemLayout(f, y);
            }
        }
      };
    }
  }
}, khe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.render = function(r, n, i) {
      var a = r.getData(), o = this._updateLineDraw(a, r), s = r.get("zlevel"), l = r.get(["effect", "trailLength"]), u = i.getZr(), f = u.painter.getType() === "svg";
      f || u.painter.getLayer(s).clear(!0), this._lastZlevel != null && !f && u.configLayer(this._lastZlevel, {
        motionBlur: !1
      }), this._showEffect(r) && l > 0 && (f || u.configLayer(s, {
        motionBlur: !0,
        lastFrameAlpha: Math.max(Math.min(l / 10 + 0.9, 1), 0)
      })), o.updateData(a);
      var c = r.get("clip", !0) && Bx(r.coordinateSystem, !1, r);
      c ? this.group.setClipPath(c) : this.group.removeClipPath(), this._lastZlevel = s, this._finished = !0;
    }, t.prototype.incrementalPrepareRender = function(r, n, i) {
      var a = r.getData(), o = this._updateLineDraw(a, r);
      o.incrementalPrepareUpdate(a), this._clearLayer(i), this._finished = !1;
    }, t.prototype.incrementalRender = function(r, n, i) {
      this._lineDraw.incrementalUpdate(r, n.getData()), this._finished = r.end === n.getData().count();
    }, t.prototype.eachRendered = function(r) {
      this._lineDraw && this._lineDraw.eachRendered(r);
    }, t.prototype.updateTransform = function(r, n, i) {
      var a = r.getData(), o = r.pipelineContext;
      if (!this._finished || o.large || o.progressiveRender)
        return {
          update: !0
        };
      var s = tX.reset(r, 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(r, 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 Nhe() : new nN(o ? a ? Ihe : eX : a ? J7 : rN), this._hasEffet = a, this._isPolyline = o, this._isLargeDraw = l), this.group.add(i.group), i;
    }, t.prototype._showEffect = function(r) {
      return !!r.get(["effect", "show"]);
    }, t.prototype._clearLayer = function(r) {
      var n = r.getZr(), i = n.painter.getType() === "svg";
      !i && this._lastZlevel != null && n.painter.getLayer(this._lastZlevel).clear(!0);
    }, t.prototype.remove = function(r, n) {
      this._lineDraw && this._lineDraw.remove(), this._lineDraw = null, this._clearLayer(n);
    }, t.prototype.dispose = function(r, n) {
      this.remove(r, n);
    }, t.type = "lines", t;
  })(Ut)
), Bhe = typeof Uint32Array > "u" ? Array : Uint32Array, zhe = typeof Float64Array > "u" ? Array : Float64Array;
function N4(e) {
  var t = e.data;
  t && t[0] && t[0][0] && t[0][0].coord && (e.data = Ce(t, function(r) {
    var n = [r[0].coord, r[1].coord], i = {
      coords: n
    };
    return r[0].name && (i.fromName = r[0].name), r[1].name && (i.toName = r[1].name), fC([i, r[0], r[1]]);
  }));
}
var Fhe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.visualStyleAccessPath = "lineStyle", r.visualDrawType = "stroke", r;
    }
    return t.prototype.init = function(r) {
      r.data = r.data || [], N4(r);
      var n = this._processFlatCoordsArray(r.data);
      this._flatCoords = n.flatCoords, this._flatCoordsOffset = n.flatCoordsOffset, n.flatCoords && (r.data = new Float32Array(n.count)), e.prototype.init.apply(this, arguments);
    }, t.prototype.mergeOption = function(r) {
      if (N4(r), r.data) {
        var n = this._processFlatCoordsArray(r.data);
        this._flatCoords = n.flatCoords, this._flatCoordsOffset = n.flatCoordsOffset, n.flatCoords && (r.data = new Float32Array(n.count));
      }
      e.prototype.mergeOption.apply(this, arguments);
    }, t.prototype.appendData = function(r) {
      var n = this._processFlatCoordsArray(r.data);
      n.flatCoords && (this._flatCoords ? (this._flatCoords = _m(this._flatCoords, n.flatCoords), this._flatCoordsOffset = _m(this._flatCoordsOffset, n.flatCoordsOffset)) : (this._flatCoords = n.flatCoords, this._flatCoordsOffset = n.flatCoordsOffset), r.data = new Float32Array(n.count)), this.getRawData().appendData(r.data);
    }, t.prototype._getCoordsFromItemModel = function(r) {
      var n = this.getData().getItemModel(r), i = n.option instanceof Array ? n.option : n.getShallow("coords");
      return i;
    }, t.prototype.getLineCoordsCount = function(r) {
      return this._flatCoordsOffset ? this._flatCoordsOffset[r * 2 + 1] : this._getCoordsFromItemModel(r).length;
    }, t.prototype.getLineCoords = function(r, n) {
      if (this._flatCoordsOffset) {
        for (var i = this._flatCoordsOffset[r * 2], a = this._flatCoordsOffset[r * 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(r), 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(r) {
      var n = 0;
      if (this._flatCoords && (n = this._flatCoords.length), Xt(r[0])) {
        for (var i = r.length, a = new Bhe(i), o = new zhe(i), s = 0, l = 0, u = 0, f = 0; f < i; ) {
          u++;
          var c = r[f++];
          a[l++] = s + n, a[l++] = c;
          for (var h = 0; h < c; h++) {
            var v = r[f++], d = r[f++];
            o[s++] = v, o[s++] = d;
          }
        }
        return {
          flatCoordsOffset: new Uint32Array(a.buffer, 0, l),
          flatCoords: o,
          count: u
        };
      }
      return {
        flatCoordsOffset: null,
        flatCoords: null,
        count: r.length
      };
    }, t.prototype.getInitialData = function(r, n) {
      var i = new zr(["value"], this);
      return i.hasItemOption = !1, i.initData(r.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(r, n, i) {
      var a = this.getData(), o = a.getItemModel(r), s = o.get("name");
      if (s)
        return s;
      var l = o.get("fromName"), u = o.get("toName"), f = [];
      return l != null && f.push(l), u != null && f.push(u), Rn("nameValue", {
        name: f.join(" > ")
      });
    }, t.prototype.preventIncremental = function() {
      return !!this.get(["effect", "show"]);
    }, t.prototype.getProgressive = function() {
      var r = this.option.progressive;
      return r ?? (this.option.large ? 1e4 : this.get("progressive"));
    }, t.prototype.getProgressiveThreshold = function() {
      var r = this.option.progressiveThreshold;
      return r ?? (this.option.large ? 2e4 : this.get("progressiveThreshold"));
    }, t.prototype.getZLevelKey = function() {
      var r = this.getModel("effect"), n = r.get("trailLength");
      return this.getData().count() > this.getProgressiveThreshold() ? this.id : r.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;
  })(Yt)
);
function CT(e) {
  return e instanceof Array || (e = [e, e]), e;
}
var Ghe = {
  seriesType: "lines",
  reset: function(e) {
    var t = CT(e.get("symbol")), r = CT(e.get("symbolSize")), n = e.getData();
    n.setVisual("fromSymbol", t && t[0]), n.setVisual("toSymbol", t && t[1]), n.setVisual("fromSymbolSize", r && r[0]), n.setVisual("toSymbolSize", r && r[1]);
    function i(a, o) {
      var s = a.getItemModel(o), l = CT(s.getShallow("symbol", !0)), u = CT(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 Vhe(e) {
  e.registerChartView(khe), e.registerSeriesModel(Fhe), e.registerLayout(tX), e.registerVisual(Ghe);
}
var Hhe = 256, Uhe = (
  /** @class */
  (function() {
    function e() {
      this.blurSize = 30, this.pointSize = 20, this.maxOpacity = 1, this.minOpacity = 0, this._gradientPixels = {
        inRange: null,
        outOfRange: null
      };
      var t = ja.createCanvas();
      this.canvas = t;
    }
    return e.prototype.update = function(t, r, n, i, a, o) {
      var s = this._getBrush(), l = this._getGradient(a, "inRange"), u = this._getGradient(a, "outOfRange"), f = this.pointSize + this.blurSize, c = this.canvas, h = c.getContext("2d"), v = t.length;
      c.width = r, c.height = n;
      for (var d = 0; d < v; ++d) {
        var g = t[d], y = g[0], x = g[1], S = g[2], T = i(S);
        h.globalAlpha = T, h.drawImage(s, y - f, x - f);
      }
      if (!c.width || !c.height)
        return c;
      for (var C = h.getImageData(0, 0, c.width, c.height), A = C.data, M = 0, E = A.length, P = this.minOpacity, R = this.maxOpacity, O = R - P; M < E; ) {
        var T = A[M + 3] / 256, N = Math.floor(T * (Hhe - 1)) * 4;
        if (T > 0) {
          var G = o(T) ? l : u;
          T > 0 && (T = T * O + P), A[M++] = G[N], A[M++] = G[N + 1], A[M++] = G[N + 2], A[M++] = G[N + 3] * T * 256;
        } else
          M += 4;
      }
      return h.putImageData(C, 0, 0), c;
    }, e.prototype._getBrush = function() {
      var t = this._brushCanvas || (this._brushCanvas = ja.createCanvas()), r = this.pointSize + this.blurSize, n = r * 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 = fe.color.neutral99, i.beginPath(), i.arc(-r, r, this.pointSize, 0, Math.PI * 2, !0), i.closePath(), i.fill(), t;
    }, e.prototype._getGradient = function(t, r) {
      for (var n = this._gradientPixels, i = n[r] || (n[r] = new Uint8ClampedArray(256 * 4)), a = [0, 0, 0, 0], o = 0, s = 0; s < 256; s++)
        t[r](s / 255, !0, a), i[o++] = a[0], i[o++] = a[1], i[o++] = a[2], i[o++] = a[3];
      return i;
    }, e;
  })()
);
function Whe(e, t, r) {
  var n = e[1] - e[0];
  t = Ce(t, function(o) {
    return {
      interval: [(o.interval[0] - e[0]) / n, (o.interval[1] - e[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 && r[s];
  };
}
function Xhe(e, t) {
  var r = e[1] - e[0];
  return t = [(t[0] - e[0]) / r, (t[1] - e[0]) / r], function(n) {
    return n >= t[0] && n <= t[1];
  };
}
function k4(e) {
  var t = e.dimensions;
  return t[0] === "lng" && t[1] === "lat";
}
var Yhe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.render = function(r, n, i) {
      var a;
      n.eachComponent("visualMap", function(s) {
        s.eachTargetSeries(function(l) {
          l === r && (a = s);
        });
      }), this._progressiveEls = null, this.group.removeAll();
      var o = r.coordinateSystem;
      o.type === "cartesian2d" || o.type === "calendar" || o.type === "matrix" ? this._renderOnGridLike(r, i, 0, r.getData().count()) : k4(o) && this._renderOnGeo(o, r, a, i);
    }, t.prototype.incrementalPrepareRender = function(r, n, i) {
      this.group.removeAll();
    }, t.prototype.incrementalRender = function(r, n, i, a) {
      var o = n.coordinateSystem;
      o && (k4(o) ? this.render(n, i, a) : (this._progressiveEls = [], this._renderOnGridLike(n, a, r.start, r.end, !0)));
    }, t.prototype.eachRendered = function(r) {
      rh(this._progressiveEls || this.group, r);
    }, t.prototype._renderOnGridLike = function(r, n, i, a, o) {
      var s = r.coordinateSystem, l = qc(s, "cartesian2d"), u = qc(s, "matrix"), f, c, h, v;
      if (l) {
        var d = s.getAxis("x"), g = s.getAxis("y");
        f = d.getBandWidth() + 0.5, c = g.getBandWidth() + 0.5, h = d.scale.getExtent(), v = g.scale.getExtent();
      }
      for (var y = this.group, x = r.getData(), S = r.getModel(["emphasis", "itemStyle"]).getItemStyle(), T = r.getModel(["blur", "itemStyle"]).getItemStyle(), C = r.getModel(["select", "itemStyle"]).getItemStyle(), A = r.get(["itemStyle", "borderRadius"]), M = Wn(r), E = r.getModel("emphasis"), P = E.get("focus"), R = E.get("blurScope"), O = E.get("disabled"), N = l || u ? [x.mapDimension("x"), x.mapDimension("y"), x.mapDimension("value")] : [x.mapDimension("time"), x.mapDimension("value")], G = i; G < a; G++) {
        var z = void 0, H = x.getItemVisual(G, "style");
        if (l) {
          var W = x.get(N[0], G), Z = x.get(N[1], G);
          if (isNaN(x.get(N[2], G)) || isNaN(W) || isNaN(Z) || W < h[0] || W > h[1] || Z < v[0] || Z > v[1])
            continue;
          var ee = s.dataToPoint([W, Z]);
          z = new Mt({
            shape: {
              x: ee[0] - f / 2,
              y: ee[1] - c / 2,
              width: f,
              height: c
            },
            style: H
          });
        } else if (u) {
          var V = s.dataToLayout([x.get(N[0], G), x.get(N[1], G)]).rect;
          if (Gi(V.x))
            continue;
          z = new Mt({
            z2: 1,
            shape: V,
            style: H
          });
        } else {
          if (isNaN(x.get(N[1], G)))
            continue;
          var Q = s.dataToLayout([x.get(N[0], G)]), V = Q.contentRect || Q.rect;
          if (Gi(V.x) || Gi(V.y))
            continue;
          z = new Mt({
            z2: 1,
            shape: V,
            style: H
          });
        }
        if (x.hasItemOption) {
          var q = x.getItemModel(G), X = q.getModel("emphasis");
          S = X.getModel("itemStyle").getItemStyle(), T = q.getModel(["blur", "itemStyle"]).getItemStyle(), C = q.getModel(["select", "itemStyle"]).getItemStyle(), A = q.get(["itemStyle", "borderRadius"]), P = X.get("focus"), R = X.get("blurScope"), O = X.get("disabled"), M = Wn(q);
        }
        z.shape.r = A;
        var K = r.getRawValue(G), ue = "-";
        K && K[2] != null && (ue = K[2] + ""), si(z, M, {
          labelFetcher: r,
          labelDataIndex: G,
          defaultOpacity: H.opacity,
          defaultText: ue
        }), z.ensureState("emphasis").style = S, z.ensureState("blur").style = T, z.ensureState("select").style = C, Hr(z, P, R, O), z.incremental = o, o && (z.states.emphasis.hoverLayer = !0), y.add(z), x.setItemGraphicEl(G, z), this._progressiveEls && this._progressiveEls.push(z);
      }
    }, t.prototype._renderOnGeo = function(r, n, i, a) {
      var o = i.targetVisuals.inRange, s = i.targetVisuals.outOfRange, l = n.getData(), u = this._hmLayer || this._hmLayer || new Uhe();
      u.blurSize = n.get("blurSize"), u.pointSize = n.get("pointSize"), u.minOpacity = n.get("minOpacity"), u.maxOpacity = n.get("maxOpacity");
      var f = r.getViewRect().clone(), c = r.getRoamTransform();
      f.applyTransform(c);
      var h = Math.max(f.x, 0), v = Math.max(f.y, 0), d = Math.min(f.width + f.x, a.getWidth()), g = Math.min(f.height + f.y, a.getHeight()), y = d - h, x = g - v, S = [l.mapDimension("lng"), l.mapDimension("lat"), l.mapDimension("value")], T = l.mapArray(S, function(E, P, R) {
        var O = r.dataToPoint([E, P]);
        return O[0] -= h, O[1] -= v, O.push(R), O;
      }), C = i.getExtent(), A = i.type === "visualMap.continuous" ? Xhe(C, i.option.range) : Whe(C, i.getPieceList(), i.option.selected);
      u.update(T, y, x, o.color.getNormalizer(), {
        inRange: o.color.getColorMapper(),
        outOfRange: s.color.getColorMapper()
      }, A);
      var M = new Xn({
        style: {
          width: y,
          height: x,
          x: h,
          y: v,
          image: u.canvas
        },
        silent: !0
      });
      this.group.add(M);
    }, t.type = "heatmap", t;
  })(Ut)
), Zhe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.getInitialData = function(r, n) {
      return ou(null, this, {
        generateCoord: "value"
      });
    }, t.prototype.preventIncremental = function() {
      var r = ny.get(this.get("coordinateSystem"));
      if (r && r.dimensions)
        return r.dimensions[0] === "lng" && r.dimensions[1] === "lat";
    }, t.type = "series.heatmap", t.dependencies = ["grid", "geo", "calendar", "matrix"], 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: fe.color.primary
        }
      }
    }, t;
  })(Yt)
);
function $he(e) {
  e.registerChartView(Yhe), e.registerSeriesModel(Zhe);
}
var qhe = ["itemStyle", "borderWidth"], B4 = [{
  xy: "x",
  wh: "width",
  index: 0,
  posDesc: ["left", "right"]
}, {
  xy: "y",
  wh: "height",
  index: 1,
  posDesc: ["top", "bottom"]
}], hD = new Qs(), jhe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.render = function(r, n, i) {
      var a = this.group, o = r.getData(), s = this._data, l = r.coordinateSystem, u = l.getBaseAxis(), f = u.isHorizontal(), c = l.master.getRect(), h = {
        ecSize: {
          width: i.getWidth(),
          height: i.getHeight()
        },
        seriesModel: r,
        coordSys: l,
        coordSysExtent: [[c.x, c.x + c.width], [c.y, c.y + c.height]],
        isHorizontal: f,
        valueDim: B4[+f],
        categoryDim: B4[1 - +f]
      };
      o.diff(s).add(function(d) {
        if (o.hasValue(d)) {
          var g = F4(o, d), y = z4(o, d, g, h), x = G4(o, h, y);
          o.setItemGraphicEl(d, x), a.add(x), H4(x, h, y);
        }
      }).update(function(d, g) {
        var y = s.getItemGraphicEl(g);
        if (!o.hasValue(d)) {
          a.remove(y);
          return;
        }
        var x = F4(o, d), S = z4(o, d, x, h), T = sX(o, S);
        y && T !== y.__pictorialShapeStr && (a.remove(y), o.setItemGraphicEl(d, null), y = null), y ? nve(y, h, S) : y = G4(o, h, S, !0), o.setItemGraphicEl(d, y), y.__pictorialSymbolMeta = S, a.add(y), H4(y, h, S);
      }).remove(function(d) {
        var g = s.getItemGraphicEl(d);
        g && V4(s, d, g.__pictorialSymbolMeta.animationModel, g);
      }).execute();
      var v = r.get("clip", !0) ? Bx(r.coordinateSystem, !1, r) : null;
      return v ? a.setClipPath(v) : a.removeClipPath(), this._data = o, this.group;
    }, t.prototype.remove = function(r, n) {
      var i = this.group, a = this._data;
      r.get("animation") ? a && a.eachItemGraphicEl(function(o) {
        V4(a, pt(o).dataIndex, r, o);
      }) : i.removeAll();
    }, t.type = "pictorialBar", t;
  })(Ut)
);
function z4(e, t, r, n) {
  var i = e.getItemLayout(t), a = r.get("symbolRepeat"), o = r.get("symbolClip"), s = r.get("symbolPosition") || "start", l = r.get("symbolRotate"), u = (l || 0) * Math.PI / 180 || 0, f = r.get("symbolPatternSize") || 2, c = r.isAnimationEnabled(), h = {
    dataIndex: t,
    layout: i,
    itemModel: r,
    symbolType: e.getItemVisual(t, "symbol") || "circle",
    style: e.getItemVisual(t, "style"),
    symbolClip: o,
    symbolRepeat: a,
    symbolRepeatDirection: r.get("symbolRepeatDirection"),
    symbolPatternSize: f,
    rotation: u,
    animationModel: c ? r : null,
    hoverScale: c && r.get(["emphasis", "scale"]),
    z2: r.getShallow("z", !0) || 0
  };
  Khe(r, a, i, n, h), Qhe(e, t, i, a, o, h.boundingLength, h.pxSign, f, n, h), Jhe(r, h.symbolScale, u, n, h);
  var v = h.symbolSize, d = Fd(r.get("symbolOffset"), v);
  return eve(r, v, i, a, o, d, s, h.valueLineWidth, h.boundingLength, h.repeatCutLength, n, h), h;
}
function Khe(e, t, r, n, i) {
  var a = n.valueDim, o = e.get("symbolBoundingData"), s = n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()), l = s.toGlobalCoord(s.dataToCoord(0)), u = 1 - +(r[a.wh] <= 0), f;
  if (Se(o)) {
    var c = [vD(s, o[0]) - l, vD(s, o[1]) - l];
    c[1] < c[0] && c.reverse(), f = c[u];
  } else o != null ? f = vD(s, o) - l : t ? f = n.coordSysExtent[a.index][u] - l : f = r[a.wh];
  i.boundingLength = f, t && (i.repeatCutLength = r[a.wh]);
  var h = a.xy === "x", v = s.inverse;
  i.pxSign = h && !v || !h && v ? f >= 0 ? 1 : -1 : f > 0 ? 1 : -1;
}
function vD(e, t) {
  return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)));
}
function Qhe(e, t, r, n, i, a, o, s, l, u) {
  var f = l.valueDim, c = l.categoryDim, h = Math.abs(r[c.wh]), v = e.getItemVisual(t, "symbolSize"), d;
  Se(v) ? d = v.slice() : v == null ? d = ["100%", "100%"] : d = [v, v], d[c.index] = Be(d[c.index], h), d[f.index] = Be(d[f.index], n ? h : Math.abs(a)), u.symbolSize = d;
  var g = u.symbolScale = [d[0] / s, d[1] / s];
  g[f.index] *= (l.isHorizontal ? -1 : 1) * o;
}
function Jhe(e, t, r, n, i) {
  var a = e.get(qhe) || 0;
  a && (hD.attr({
    scaleX: t[0],
    scaleY: t[1],
    rotation: r
  }), hD.updateTransform(), a /= hD.getLineScale(), a *= t[n.valueDim.index]), i.valueLineWidth = a || 0;
}
function eve(e, t, r, n, i, a, o, s, l, u, f, c) {
  var h = f.categoryDim, v = f.valueDim, d = c.pxSign, g = Math.max(t[v.index] + s, 0), y = g;
  if (n) {
    var x = Math.abs(l), S = Ti(e.get("symbolMargin"), "15%") + "", T = !1;
    S.lastIndexOf("!") === S.length - 1 && (T = !0, S = S.slice(0, S.length - 1));
    var C = Be(S, t[v.index]), A = Math.max(g + C * 2, 0), M = T ? 0 : C * 2, E = mR(n), P = E ? n : U4((x + M) / A), R = x - P * g;
    C = R / 2 / (T ? P : Math.max(P - 1, 1)), A = g + C * 2, M = T ? 0 : C * 2, !E && n !== "fixed" && (P = u ? U4((Math.abs(u) + M) / A) : 0), y = P * A - M, c.repeatTimes = P, c.symbolMargin = C;
  }
  var O = d * (y / 2), N = c.pathPosition = [];
  N[h.index] = r[h.wh] / 2, N[v.index] = o === "start" ? O : o === "end" ? l - O : l / 2, a && (N[0] += a[0], N[1] += a[1]);
  var G = c.bundlePosition = [];
  G[h.index] = r[h.xy], G[v.index] = r[v.xy];
  var z = c.barRectShape = xe({}, r);
  z[v.wh] = d * Math.max(Math.abs(r[v.wh]), Math.abs(N[v.index] + O)), z[h.wh] = r[h.wh];
  var H = c.clipShape = {};
  H[h.xy] = -r[h.xy], H[h.wh] = f.ecSize[h.wh], H[v.xy] = 0, H[v.wh] = r[v.wh];
}
function rX(e) {
  var t = e.symbolPatternSize, r = en(
    // Consider texture img, make a big size.
    e.symbolType,
    -t / 2,
    -t / 2,
    t,
    t
  );
  return r.attr({
    culling: !0
  }), r.type !== "image" && r.setStyle({
    strokeNoScale: !0
  }), r;
}
function nX(e, t, r, n) {
  var i = e.__pictorialBundle, a = r.symbolSize, o = r.valueLineWidth, s = r.pathPosition, l = t.valueDim, u = r.repeatTimes || 0, f = 0, c = a[t.valueDim.index] + o + r.symbolMargin * 2;
  for (dN(e, function(g) {
    g.__pictorialAnimationIndex = f, g.__pictorialRepeatTimes = u, f < u ? mm(g, null, d(f), r, n) : mm(g, null, {
      scaleX: 0,
      scaleY: 0
    }, r, n, function() {
      i.remove(g);
    }), f++;
  }); f < u; f++) {
    var h = rX(r);
    h.__pictorialAnimationIndex = f, h.__pictorialRepeatTimes = u, i.add(h);
    var v = d(f);
    mm(h, {
      x: v.x,
      y: v.y,
      scaleX: 0,
      scaleY: 0
    }, {
      scaleX: v.scaleX,
      scaleY: v.scaleY,
      rotation: v.rotation
    }, r, n);
  }
  function d(g) {
    var y = s.slice(), x = r.pxSign, S = g;
    return (r.symbolRepeatDirection === "start" ? x > 0 : x < 0) && (S = u - 1 - g), y[l.index] = c * (S - u / 2 + 0.5) + s[l.index], {
      x: y[0],
      y: y[1],
      scaleX: r.symbolScale[0],
      scaleY: r.symbolScale[1],
      rotation: r.rotation
    };
  }
}
function iX(e, t, r, n) {
  var i = e.__pictorialBundle, a = e.__pictorialMainPath;
  a ? mm(a, null, {
    x: r.pathPosition[0],
    y: r.pathPosition[1],
    scaleX: r.symbolScale[0],
    scaleY: r.symbolScale[1],
    rotation: r.rotation
  }, r, n) : (a = e.__pictorialMainPath = rX(r), i.add(a), mm(a, {
    x: r.pathPosition[0],
    y: r.pathPosition[1],
    scaleX: 0,
    scaleY: 0,
    rotation: r.rotation
  }, {
    scaleX: r.symbolScale[0],
    scaleY: r.symbolScale[1]
  }, r, n));
}
function aX(e, t, r) {
  var n = xe({}, t.barRectShape), i = e.__pictorialBarRect;
  i ? mm(i, null, {
    shape: n
  }, t, r) : (i = e.__pictorialBarRect = new Mt({
    z2: 2,
    shape: n,
    silent: !0,
    style: {
      stroke: "transparent",
      fill: "transparent",
      lineWidth: 0
    }
  }), i.disableMorphing = !0, e.add(i));
}
function oX(e, t, r, n) {
  if (r.symbolClip) {
    var i = e.__pictorialClipPath, a = xe({}, r.clipShape), o = t.valueDim, s = r.animationModel, l = r.dataIndex;
    if (i)
      Wt(i, {
        shape: a
      }, s, l);
    else {
      a[o.wh] = 0, i = new Mt({
        shape: a
      }), e.__pictorialBundle.setClipPath(i), e.__pictorialClipPath = i;
      var u = {};
      u[o.wh] = r.clipShape[o.wh], kd[n ? "updateProps" : "initProps"](i, {
        shape: u
      }, s, l);
    }
  }
}
function F4(e, t) {
  var r = e.getItemModel(t);
  return r.getAnimationDelayParams = tve, r.isAnimationEnabled = rve, r;
}
function tve(e) {
  return {
    index: e.__pictorialAnimationIndex,
    count: e.__pictorialRepeatTimes
  };
}
function rve() {
  return this.parentModel.isAnimationEnabled() && !!this.getShallow("animation");
}
function G4(e, t, r, n) {
  var i = new rt(), a = new rt();
  return i.add(a), i.__pictorialBundle = a, a.x = r.bundlePosition[0], a.y = r.bundlePosition[1], r.symbolRepeat ? nX(i, t, r) : iX(i, t, r), aX(i, r, n), oX(i, t, r, n), i.__pictorialShapeStr = sX(e, r), i.__pictorialSymbolMeta = r, i;
}
function nve(e, t, r) {
  var n = r.animationModel, i = r.dataIndex, a = e.__pictorialBundle;
  Wt(a, {
    x: r.bundlePosition[0],
    y: r.bundlePosition[1]
  }, n, i), r.symbolRepeat ? nX(e, t, r, !0) : iX(e, t, r, !0), aX(e, r, !0), oX(e, t, r, !0);
}
function V4(e, t, r, n) {
  var i = n.__pictorialBarRect;
  i && i.removeTextContent();
  var a = [];
  dN(n, function(o) {
    a.push(o);
  }), n.__pictorialMainPath && a.push(n.__pictorialMainPath), n.__pictorialClipPath && (r = null), F(a, function(o) {
    Zc(o, {
      scaleX: 0,
      scaleY: 0
    }, r, t, function() {
      n.parent && n.parent.remove(n);
    });
  }), e.setItemGraphicEl(t, null);
}
function sX(e, t) {
  return [e.getItemVisual(t.dataIndex, "symbol") || "none", !!t.symbolRepeat, !!t.symbolClip].join(":");
}
function dN(e, t, r) {
  F(e.__pictorialBundle.children(), function(n) {
    n !== e.__pictorialBarRect && t.call(r, n);
  });
}
function mm(e, t, r, n, i, a) {
  t && e.attr(t), n.symbolClip && !i ? r && e.attr(r) : r && kd[i ? "updateProps" : "initProps"](e, r, n.animationModel, n.dataIndex, a);
}
function H4(e, t, r) {
  var n = r.dataIndex, i = r.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"), f = a.get("focus"), c = a.get("blurScope"), h = a.get("scale");
  dN(e, function(g) {
    if (g instanceof Xn) {
      var y = g.style;
      g.useStyle(xe({
        // TODO other properties like dx, dy ?
        image: y.image,
        x: y.x,
        y: y.y,
        width: y.width,
        height: y.height
      }, r.style));
    } else
      g.useStyle(r.style);
    var x = g.ensureState("emphasis");
    x.style = o, h && (x.scaleX = g.scaleX * 1.1, x.scaleY = g.scaleY * 1.1), g.ensureState("blur").style = s, g.ensureState("select").style = l, u && (g.cursor = u), g.z2 = r.z2;
  });
  var v = t.valueDim.posDesc[+(r.boundingLength > 0)], d = e.__pictorialBarRect;
  d.ignoreClip = !0, si(d, Wn(i), {
    labelFetcher: t.seriesModel,
    labelDataIndex: n,
    defaultText: Em(t.seriesModel.getData(), n),
    inheritColor: r.style.fill,
    defaultOpacity: r.style.opacity,
    defaultOutsidePosition: v
  }), Hr(e, f, c, a.get("disabled"));
}
function U4(e) {
  var t = Math.round(e);
  return Math.abs(e - t) < 1e-4 ? t : Math.ceil(e);
}
var ive = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.hasSymbolVisual = !0, r.defaultSymbol = "roundRect", r;
    }
    return t.prototype.getInitialData = function(r) {
      return r.stack = null, e.prototype.getInitialData.apply(this, arguments);
    }, t.type = "series.pictorialBar", t.dependencies = ["grid"], t.defaultOption = nh(K1.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: fe.color.primary
        }
      }
    }), t;
  })(K1)
);
function ave(e) {
  e.registerChartView(jhe), e.registerSeriesModel(ive), e.registerLayout(e.PRIORITY.VISUAL.LAYOUT, St(w6, "pictorialBar")), e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, T6("pictorialBar"));
}
var ove = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r._layers = [], r;
    }
    return t.prototype.render = function(r, n, i) {
      var a = r.getData(), o = this, s = this.group, l = r.getLayerSeries(), u = a.getLayout("layoutInfo"), f = u.rect, c = u.boundaryGap;
      s.x = 0, s.y = f.y + c[0];
      function h(y) {
        return y.name;
      }
      var v = new _f(this._layersSeries || [], l, h, h), d = [];
      v.add(Ge(g, this, "add")).update(Ge(g, this, "update")).remove(Ge(g, this, "remove")).execute();
      function g(y, x, S) {
        var T = o._layers;
        if (y === "remove") {
          s.remove(T[x]);
          return;
        }
        for (var C = [], A = [], M, E = l[x].indices, P = 0; P < E.length; P++) {
          var R = a.getItemLayout(E[P]), O = R.x, N = R.y0, G = R.y;
          C.push(O, N), A.push(O, N + G), M = a.getItemVisual(E[P], "style");
        }
        var z, H = a.getItemLayout(E[0]), W = r.getModel("label"), Z = W.get("margin"), ee = r.getModel("emphasis");
        if (y === "add") {
          var V = d[x] = new rt();
          z = new m9({
            shape: {
              points: C,
              stackedOnPoints: A,
              smooth: 0.4,
              stackedOnSmooth: 0.4,
              smoothConstraint: !1
            },
            z2: 0
          }), V.add(z), s.add(V), r.isAnimationEnabled() && z.setClipPath(sve(z.getBoundingRect(), r, function() {
            z.removeClipPath();
          }));
        } else {
          var V = T[S];
          z = V.childAt(0), s.add(V), d[x] = V, Wt(z, {
            shape: {
              points: C,
              stackedOnPoints: A
            }
          }, r), vs(z);
        }
        si(z, Wn(r), {
          labelDataIndex: E[P - 1],
          defaultText: a.getName(E[P - 1]),
          inheritColor: M.fill
        }, {
          normal: {
            verticalAlign: "middle"
            // align: 'right'
          }
        }), z.setTextConfig({
          position: null,
          local: !0
        });
        var Q = z.getTextContent();
        Q && (Q.x = H.x - Z, Q.y = H.y0 + H.y / 2), z.useStyle(M), a.setItemGraphicEl(x, z), Un(z, r), Hr(z, ee.get("focus"), ee.get("blurScope"), ee.get("disabled"));
      }
      this._layersSeries = l, this._layers = d;
    }, t.type = "themeRiver", t;
  })(Ut)
);
function sve(e, t, r) {
  var n = new Mt({
    shape: {
      x: e.x - 10,
      y: e.y - 10,
      width: 0,
      height: e.height + 20
    }
  });
  return Ir(n, {
    shape: {
      x: e.x - 50,
      width: e.width + 100,
      height: e.height + 20
    }
  }, t, r), n;
}
var dD = 2, lve = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.init = function(r) {
      e.prototype.init.apply(this, arguments), this.legendVisualProvider = new hy(Ge(this.getData, this), Ge(this.getRawData, this));
    }, t.prototype.fixData = function(r) {
      var n = r.length, i = {}, a = QE(r, 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, f = 0; f < o[l].dataList.length; ++f) {
          var c = o[l].dataList[f][0] + "";
          i[c] = l;
        }
        for (var c in i)
          i.hasOwnProperty(c) && i[c] !== l && (i[c] = l, r[n] = [c, 0, u], n++);
      }
      return r;
    }, t.prototype.getInitialData = function(r, n) {
      for (var i = this.getReferringComponents("singleAxis", an).models[0], a = i.get("type"), o = nr(r.data, function(d) {
        return d[2] !== void 0;
      }), s = this.fixData(o || []), l = [], u = this.nameMap = Je(), f = 0, c = 0; c < s.length; ++c)
        l.push(s[c][dD]), u.get(s[c][dD]) || (u.set(s[c][dD], f), f++);
      var h = sy(s, {
        coordDimensions: ["single"],
        dimensionsDefine: [{
          name: "time",
          type: pb(a)
        }, {
          name: "value",
          type: "float"
        }, {
          name: "name",
          type: "ordinal"
        }],
        encodeDefine: {
          single: 0,
          value: 1,
          itemName: 2
        }
      }).dimensions, v = new zr(h, this);
      return v.initData(s), v;
    }, t.prototype.getLayerSeries = function() {
      for (var r = this.getData(), n = r.count(), i = [], a = 0; a < n; ++a)
        i[a] = a;
      var o = r.mapDimension("single"), s = QE(i, function(u) {
        return r.get("name", u);
      }), l = [];
      return s.buckets.each(function(u, f) {
        u.sort(function(c, h) {
          return r.get(o, c) - r.get(o, h);
        }), l.push({
          name: f,
          indices: u
        });
      }), l;
    }, t.prototype.getAxisTooltipData = function(r, n, i) {
      Se(r) || (r = r ? [r] : []);
      for (var a = this.getData(), o = this.getLayerSeries(), s = [], l = o.length, u, f = 0; f < l; ++f) {
        for (var c = Number.MAX_VALUE, h = -1, v = o[f].indices.length, d = 0; d < v; ++d) {
          var g = a.get(r[0], o[f].indices[d]), y = Math.abs(g - n);
          y <= c && (u = g, c = y, h = o[f].indices[d]);
        }
        s.push(h);
      }
      return {
        dataIndices: s,
        nestestValue: u
      };
    }, t.prototype.formatTooltip = function(r, n, i) {
      var a = this.getData(), o = a.getName(r), s = a.get(a.mapDimension("value"), r);
      return Rn("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;
  })(Yt)
);
function uve(e, t) {
  e.eachSeriesByType("themeRiver", function(r) {
    var n = r.getData(), i = r.coordinateSystem, a = {}, o = i.getRect();
    a.rect = o;
    var s = r.get("boundaryGap"), l = i.getAxis();
    if (a.boundaryGap = s, l.orient === "horizontal") {
      s[0] = Be(s[0], o.height), s[1] = Be(s[1], o.height);
      var u = o.height - s[0] - s[1];
      W4(n, r, u);
    } else {
      s[0] = Be(s[0], o.width), s[1] = Be(s[1], o.width);
      var f = o.width - s[0] - s[1];
      W4(n, r, f);
    }
    n.setLayout("layoutInfo", a);
  });
}
function W4(e, t, r) {
  if (e.count())
    for (var n = t.coordinateSystem, i = t.getLayerSeries(), a = e.mapDimension("single"), o = e.mapDimension("value"), s = Ce(i, function(y) {
      return Ce(y.indices, function(x) {
        var S = n.dataToPoint(e.get(a, x));
        return S[1] = e.get(o, x), S;
      });
    }), l = fve(s), u = l.y0, f = r / l.max, c = i.length, h = i[0].indices.length, v, d = 0; d < h; ++d) {
      v = u[d] * f, e.setItemLayout(i[0].indices[d], {
        layerIndex: 0,
        x: s[0][d][0],
        y0: v,
        y: s[0][d][1] * f
      });
      for (var g = 1; g < c; ++g)
        v += s[g - 1][d][1] * f, e.setItemLayout(i[g].indices[d], {
          layerIndex: g,
          x: s[g][d][0],
          y0: v,
          y: s[g][d][1] * f
        });
    }
}
function fve(e) {
  for (var t = e.length, r = e[0].length, n = [], i = [], a = 0, o = 0; o < r; ++o) {
    for (var s = 0, l = 0; l < t; ++l)
      s += e[l][o][1];
    s > a && (a = s), n.push(s);
  }
  for (var u = 0; u < r; ++u)
    i[u] = (a - n[u]) / 2;
  a = 0;
  for (var f = 0; f < r; ++f) {
    var c = n[f] + i[f];
    c > a && (a = c);
  }
  return {
    y0: i,
    max: a
  };
}
function cve(e) {
  e.registerChartView(ove), e.registerSeriesModel(lve), e.registerLayout(uve), e.registerProcessor(fy("themeRiver"));
}
var hve = 2, vve = 4, X4 = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r, n, i, a) {
      var o = e.call(this) || this;
      o.z2 = hve, o.textConfig = {
        inside: !0
      }, pt(o).seriesIndex = n.seriesIndex;
      var s = new Rt({
        z2: vve,
        silent: r.getModel().get(["label", "silent"])
      });
      return o.setTextContent(s), o.updateData(!0, r, n, i, a), o;
    }
    return t.prototype.updateData = function(r, n, i, a, o) {
      this.node = n, n.piece = this, i = i || this._seriesModel, a = a || this._ecModel;
      var s = this;
      pt(s).dataIndex = n.dataIndex;
      var l = n.getModel(), u = l.getModel("emphasis"), f = n.getLayout(), c = xe({}, f);
      c.label = null;
      var h = n.getVisual("style");
      h.lineJoin = "bevel";
      var v = n.getVisual("decal");
      v && (h.decal = Am(v, o));
      var d = Yl(l.getModel("itemStyle"), c, !0);
      xe(c, d), F(Ta, function(S) {
        var T = s.ensureState(S), C = l.getModel([S, "itemStyle"]);
        T.style = C.getItemStyle();
        var A = Yl(C, c);
        A && (T.shape = A);
      }), r ? (s.setShape(c), s.shape.r = f.r0, Ir(s, {
        shape: {
          r: f.r
        }
      }, i, n.dataIndex)) : (Wt(s, {
        shape: c
      }, i), vs(s)), s.useStyle(h), this._updateLabel(i);
      var g = l.getShallow("cursor");
      g && s.attr("cursor", g), this._seriesModel = i || this._seriesModel, this._ecModel = a || this._ecModel;
      var y = u.get("focus"), x = y === "relative" ? _m(n.getAncestorsIndices(), n.getDescendantIndices()) : y === "ancestor" ? n.getAncestorsIndices() : y === "descendant" ? n.getDescendantIndices() : y;
      Hr(this, x, u.get("blurScope"), u.get("disabled"));
    }, t.prototype._updateLabel = function(r) {
      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), f = Math.sin(l), c = this, h = c.getTextContent(), v = this.node.dataIndex, d = a.get("minAngle") / 180 * Math.PI, g = a.get("show") && !(d != null && Math.abs(s) < d);
      h.ignore = !g, F(k1, function(x) {
        var S = x === "normal" ? i.getModel("label") : i.getModel([x, "label"]), T = x === "normal", C = T ? h : h.ensureState(x), A = r.getFormattedLabel(v, x);
        T && (A = A || n.node.name), C.style = gr(S, {}, null, x !== "normal", !0), A && (C.style.text = A);
        var M = S.get("show");
        M != null && !T && (C.ignore = !M);
        var E = y(S, "position"), P = T ? c : c.states[x], R = P.style.fill;
        P.textConfig = {
          outsideFill: S.get("color") === "inherit" ? R : null,
          inside: E !== "outside"
        };
        var O, N = y(S, "distance") || 0, G = y(S, "align"), z = y(S, "rotate"), H = Math.PI * 0.5, W = Math.PI * 1.5, Z = So(z === "tangential" ? Math.PI / 2 - l : l), ee = Z > H && !wm(Z - H) && Z < W;
        E === "outside" ? (O = o.r + N, G = ee ? "right" : "left") : !G || G === "center" ? (s === 2 * Math.PI && o.r0 === 0 ? O = 0 : O = (o.r + o.r0) / 2, G = "center") : G === "left" ? (O = o.r0 + N, G = ee ? "right" : "left") : G === "right" && (O = o.r - N, G = ee ? "left" : "right"), C.style.align = G, C.style.verticalAlign = y(S, "verticalAlign") || "middle", C.x = O * u + o.cx, C.y = O * f + o.cy;
        var V = 0;
        z === "radial" ? V = So(-l) + (ee ? Math.PI : 0) : z === "tangential" ? V = So(Math.PI / 2 - l) + (ee ? Math.PI : 0) : Xt(z) && (V = z * Math.PI / 180), C.rotation = So(V);
      });
      function y(x, S) {
        var T = x.get(S);
        return T ?? a.get(S);
      }
      h.dirtyStyle();
    }, t;
  })(Ui)
), vI = "sunburstRootToNode", Y4 = "sunburstHighlight", dve = "sunburstUnhighlight";
function pve(e) {
  e.registerAction({
    type: vI,
    update: "updateView"
  }, function(t, r) {
    r.eachComponent({
      mainType: "series",
      subType: "sunburst",
      query: t
    }, n);
    function n(i, a) {
      var o = J1(t, [vI], i);
      if (o) {
        var s = i.getViewRoot();
        s && (t.direction = KO(s, o.node) ? "rollUp" : "drillDown"), i.resetViewRoot(o.node);
      }
    }
  }), e.registerAction({
    type: Y4,
    update: "none"
  }, function(t, r, n) {
    t = xe({}, t), r.eachComponent({
      mainType: "series",
      subType: "sunburst",
      query: t
    }, i);
    function i(a) {
      var o = J1(t, [Y4], a);
      o && (t.dataIndex = o.node.dataIndex);
    }
    n.dispatchAction(xe(t, {
      type: "highlight"
    }));
  }), e.registerAction({
    type: dve,
    update: "updateView"
  }, function(t, r, n) {
    t = xe({}, t), n.dispatchAction(xe(t, {
      type: "downplay"
    }));
  });
}
var gve = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.render = function(r, n, i, a) {
      var o = this;
      this.seriesModel = r, this.api = i, this.ecModel = n;
      var s = r.getData(), l = s.tree.root, u = r.getViewRoot(), f = this.group, c = r.get("renderLabelForZeroData"), h = [];
      u.eachNode(function(S) {
        h.push(S);
      });
      var v = this._oldChildren || [];
      d(h, v), x(l, u), this._initEvents(), this._oldChildren = h;
      function d(S, T) {
        if (S.length === 0 && T.length === 0)
          return;
        new _f(T, S, C, C).add(A).update(A).remove(St(A, null)).execute();
        function C(M) {
          return M.getId();
        }
        function A(M, E) {
          var P = M == null ? null : S[M], R = E == null ? null : T[E];
          g(P, R);
        }
      }
      function g(S, T) {
        if (!c && S && !S.getValue() && (S = null), S !== l && T !== l) {
          if (T && T.piece)
            S ? (T.piece.updateData(!1, S, r, n, i), s.setItemGraphicEl(S.dataIndex, T.piece)) : y(T);
          else if (S) {
            var C = new X4(S, r, n, i);
            f.add(C), s.setItemGraphicEl(S.dataIndex, C);
          }
        }
      }
      function y(S) {
        S && S.piece && (f.remove(S.piece), S.piece = null);
      }
      function x(S, T) {
        T.depth > 0 ? (o.virtualPiece ? o.virtualPiece.updateData(!1, S, r, n, i) : (o.virtualPiece = new X4(S, r, n, i), f.add(o.virtualPiece)), T.piece.off("click"), o.virtualPiece.on("click", function(C) {
          o._rootToNode(T.parentNode);
        })) : o.virtualPiece && (f.remove(o.virtualPiece), o.virtualPiece = null);
      }
    }, t.prototype._initEvents = function() {
      var r = this;
      this.group.off("click"), this.group.on("click", function(n) {
        var i = !1, a = r.seriesModel.getViewRoot();
        a.eachNode(function(o) {
          if (!i && o.piece && o.piece === n.target) {
            var s = o.getModel().get("nodeClick");
            if (s === "rootToNode")
              r._rootToNode(o);
            else if (s === "link") {
              var l = o.getModel(), u = l.get("link");
              if (u) {
                var f = l.get("target", !0) || "_blank";
                ib(u, f);
              }
            }
            i = !0;
          }
        });
      });
    }, t.prototype._rootToNode = function(r) {
      r !== this.seriesModel.getViewRoot() && this.api.dispatchAction({
        type: vI,
        from: this.uid,
        seriesId: this.seriesModel.id,
        targetNode: r
      });
    }, t.prototype.containPoint = function(r, n) {
      var i = n.getData(), a = i.getItemLayout(0);
      if (a) {
        var o = r[0] - a.cx, s = r[1] - a.cy, l = Math.sqrt(o * o + s * s);
        return l <= a.r && l >= a.r0;
      }
    }, t.type = "sunburst", t;
  })(Ut)
), mve = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.ignoreStyleOnData = !0, r;
    }
    return t.prototype.getInitialData = function(r, n) {
      var i = {
        name: r.name,
        children: r.data
      };
      lX(i);
      var a = this._levelModels = Ce(r.levels || [], function(l) {
        return new It(l, this, n);
      }, this), o = jO.createTree(i, this, s);
      function s(l) {
        l.wrapMethod("getItemModel", function(u, f) {
          var c = o.getNodeByDataIndex(f), h = a[c.depth];
          return h && (u.parentModel = h), u;
        });
      }
      return o.data;
    }, t.prototype.optionUpdated = function() {
      this.resetViewRoot();
    }, t.prototype.getDataParams = function(r) {
      var n = e.prototype.getDataParams.apply(this, arguments), i = this.getData().tree.getNodeByDataIndex(r);
      return n.treePathInfo = ZC(i, this), n;
    }, t.prototype.getLevelModel = function(r) {
      return this._levelModels && this._levelModels[r.depth];
    }, t.prototype.getViewRoot = function() {
      return this._viewRoot;
    }, t.prototype.resetViewRoot = function(r) {
      r ? this._viewRoot = r : r = this._viewRoot;
      var n = this.getRawData().tree.root;
      (!r || r !== n && !n.contains(r)) && (this._viewRoot = n);
    }, t.prototype.enableAriaDecal = function() {
      c7(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;
  })(Yt)
);
function lX(e) {
  var t = 0;
  F(e.children, function(n) {
    lX(n);
    var i = n.value;
    Se(i) && (i = i[0]), t += i;
  });
  var r = e.value;
  Se(r) && (r = r[0]), (r == null || isNaN(r)) && (r = t), r < 0 && (r = 0), Se(e.value) ? e.value[0] = r : e.value = r;
}
var Z4 = Math.PI / 180;
function yve(e, t, r) {
  t.eachSeriesByType(e, function(n) {
    var i = n.get("center"), a = n.get("radius");
    Se(a) || (a = [0, a]), Se(i) || (i = [i, i]);
    var o = r.getWidth(), s = r.getHeight(), l = Math.min(o, s), u = Be(i[0], o), f = Be(i[1], s), c = Be(a[0], l / 2), h = Be(a[1], l / 2), v = -n.get("startAngle") * Z4, d = n.get("minAngle") * Z4, g = n.getData().tree.root, y = n.getViewRoot(), x = y.depth, S = n.get("sort");
    S != null && uX(y, S);
    var T = 0;
    F(y.children, function(Z) {
      !isNaN(Z.getValue()) && T++;
    });
    var C = y.getValue(), A = Math.PI / (C || T) * 2, M = y.depth > 0, E = y.height - (M ? -1 : 1), P = (h - c) / (E || 1), R = n.get("clockwise"), O = n.get("stillShowZeroSum"), N = R ? 1 : -1, G = function(Z, ee) {
      if (Z) {
        var V = ee;
        if (Z !== g) {
          var Q = Z.getValue(), q = C === 0 && O ? A : Q * A;
          q < d && (q = d), V = ee + N * q;
          var X = Z.depth - x - (M ? -1 : 1), K = c + P * X, ue = c + P * (X + 1), oe = n.getLevelModel(Z);
          if (oe) {
            var te = oe.get("r0", !0), pe = oe.get("r", !0), me = oe.get("radius", !0);
            me != null && (te = me[0], pe = me[1]), te != null && (K = Be(te, l / 2)), pe != null && (ue = Be(pe, l / 2));
          }
          Z.setLayout({
            angle: q,
            startAngle: ee,
            endAngle: V,
            clockwise: R,
            cx: u,
            cy: f,
            r0: K,
            r: ue
          });
        }
        if (Z.children && Z.children.length) {
          var de = 0;
          F(Z.children, function(ve) {
            de += G(ve, ee + de);
          });
        }
        return V - ee;
      }
    };
    if (M) {
      var z = c, H = c + P, W = Math.PI * 2;
      g.setLayout({
        angle: W,
        startAngle: v,
        endAngle: v + W,
        clockwise: R,
        cx: u,
        cy: f,
        r0: z,
        r: H
      });
    }
    G(y, v);
  });
}
function uX(e, t) {
  var r = e.children || [];
  e.children = _ve(r, t), r.length && F(e.children, function(n) {
    uX(n, t);
  });
}
function _ve(e, t) {
  if (nt(t)) {
    var r = Ce(e, 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 r.sort(function(i, a) {
      return t(i.params, a.params);
    }), Ce(r, function(i) {
      return e[i.index];
    });
  } else {
    var n = t === "asc";
    return e.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 xve(e) {
  var t = {};
  function r(n, i, a) {
    if (n.depth === 0)
      return fe.color.neutral50;
    for (var o = n; o && o.depth > 1; )
      o = o.parentNode;
    var s = i.getColorFromPalette(o.name || o.dataIndex + "", t);
    return n.depth > 1 && Fe(s) && (s = _d(s, (n.depth - 1) / (a - 1) * 0.5)), s;
  }
  e.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 = r(o, n, a.root.height));
      var u = i.ensureUniqueItemVisual(o.dataIndex, "style");
      xe(u, l);
    });
  });
}
function Sve(e) {
  e.registerChartView(gve), e.registerSeriesModel(mve), e.registerLayout(St(yve, "sunburst")), e.registerProcessor(St(fy, "sunburst")), e.registerVisual(xve), pve(e);
}
var $4 = {
  color: "fill",
  borderColor: "stroke"
}, wve = {
  symbol: 1,
  symbolSize: 1,
  symbolKeepAspect: 1,
  legendIcon: 1,
  visualMeta: 1,
  liftZ: 1,
  decal: 1
}, cf = Bt(), Tve = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.optionUpdated = function() {
      this.currentZLevel = this.get("zlevel", !0), this.currentZ = this.get("z", !0);
    }, t.prototype.getInitialData = function(r, n) {
      return ou(null, this);
    }, t.prototype.getDataParams = function(r, n, i) {
      var a = e.prototype.getDataParams.call(this, r, n);
      return i && (a.info = cf(i).info), a;
    }, t.type = "series.custom", t.dependencies = ["grid", "polar", "geo", "singleAxis", "calendar", "matrix"], 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;
  })(Yt)
);
function bve(e, t) {
  return t = t || [0, 0], Ce(["x", "y"], function(r, n) {
    var i = this.getAxis(r), a = t[n], o = e[n] / 2;
    return i.type === "category" ? i.getBandWidth() : Math.abs(i.dataToCoord(a - o) - i.dataToCoord(a + o));
  }, this);
}
function Cve(e) {
  var t = e.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(r) {
        return e.dataToPoint(r);
      },
      size: Ge(bve, e)
    }
  };
}
function Ave(e, t) {
  return t = t || [0, 0], Ce([0, 1], function(r) {
    var n = t[r], i = e[r] / 2, a = [], o = [];
    return a[r] = n - i, o[r] = n + i, a[1 - r] = o[1 - r] = t[1 - r], Math.abs(this.dataToPoint(a)[r] - this.dataToPoint(o)[r]);
  }, this);
}
function Mve(e) {
  var t = e.getBoundingRect();
  return {
    coordSys: {
      type: "geo",
      x: t.x,
      y: t.y,
      width: t.width,
      height: t.height,
      zoom: e.getZoom()
    },
    api: {
      coord: function(r) {
        return e.dataToPoint(r);
      },
      size: Ge(Ave, e)
    }
  };
}
function Lve(e, t) {
  var r = this.getAxis(), n = t instanceof Array ? t[0] : t, i = (e instanceof Array ? e[0] : e) / 2;
  return r.type === "category" ? r.getBandWidth() : Math.abs(r.dataToCoord(n - i) - r.dataToCoord(n + i));
}
function Dve(e) {
  var t = e.getRect();
  return {
    coordSys: {
      type: "singleAxis",
      x: t.x,
      y: t.y,
      width: t.width,
      height: t.height
    },
    api: {
      coord: function(r) {
        return e.dataToPoint(r);
      },
      size: Ge(Lve, e)
    }
  };
}
function Eve(e, t) {
  return t = t || [0, 0], Ce(["Radius", "Angle"], function(r, n) {
    var i = "get" + r + "Axis", a = this[i](), o = t[n], s = e[n] / 2, l = a.type === "category" ? a.getBandWidth() : Math.abs(a.dataToCoord(o - s) - a.dataToCoord(o + s));
    return r === "Angle" && (l = l * Math.PI / 180), l;
  }, this);
}
function Pve(e) {
  var t = e.getRadiusAxis(), r = e.getAngleAxis(), n = t.getExtent();
  return n[0] > n[1] && n.reverse(), {
    coordSys: {
      type: "polar",
      cx: e.cx,
      cy: e.cy,
      r: n[1],
      r0: n[0]
    },
    api: {
      coord: function(i) {
        var a = t.dataToRadius(i[0]), o = r.dataToAngle(i[1]), s = e.coordToPoint([a, o]);
        return s.push(a, o * Math.PI / 180), s;
      },
      size: Ge(Eve, e)
    }
  };
}
function Ive(e) {
  var t = e.getRect(), r = e.getRangeInfo();
  return {
    coordSys: {
      type: "calendar",
      x: t.x,
      y: t.y,
      width: t.width,
      height: t.height,
      cellWidth: e.getCellWidth(),
      cellHeight: e.getCellHeight(),
      rangeInfo: {
        start: r.start,
        end: r.end,
        weeks: r.weeks,
        dayCount: r.allDay
      }
    },
    api: {
      coord: function(n, i) {
        return e.dataToPoint(n, i);
      },
      layout: function(n, i) {
        return e.dataToLayout(n, i);
      }
    }
  };
}
function Rve(e) {
  var t = e.getRect();
  return {
    coordSys: {
      type: "matrix",
      x: t.x,
      y: t.y,
      width: t.width,
      height: t.height
    },
    api: {
      coord: function(r, n) {
        return e.dataToPoint(r, n);
      },
      layout: function(r, n) {
        return e.dataToLayout(r, n);
      }
    }
  };
}
function fX(e, t, r, n) {
  return e && (e.legacy || e.legacy !== !1 && !r && !n && t !== "tspan" && (t === "text" || qe(e, "text")));
}
function cX(e, t, r) {
  var n = e, i, a, o;
  if (t === "text")
    o = n;
  else {
    o = {}, qe(n, "text") && (o.text = n.text), qe(n, "rich") && (o.rich = n.rich), qe(n, "textFill") && (o.fill = n.textFill), qe(n, "textStroke") && (o.stroke = n.textStroke), qe(n, "fontFamily") && (o.fontFamily = n.fontFamily), qe(n, "fontSize") && (o.fontSize = n.fontSize), qe(n, "fontStyle") && (o.fontStyle = n.fontStyle), qe(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 = qe(n, "textPosition");
    r ? i.position = s ? n.textPosition : "inside" : s && (i.position = n.textPosition), qe(n, "textPosition") && (i.position = n.textPosition), qe(n, "textOffset") && (i.offset = n.textOffset), qe(n, "textRotation") && (i.rotation = n.textRotation), qe(n, "textDistance") && (i.distance = n.textDistance);
  }
  return q4(o, e), F(o.rich, function(l) {
    q4(l, l);
  }), {
    textConfig: i,
    textContent: a
  };
}
function q4(e, t) {
  t && (t.font = t.textFont || t.font, qe(t, "textStrokeWidth") && (e.lineWidth = t.textStrokeWidth), qe(t, "textAlign") && (e.align = t.textAlign), qe(t, "textVerticalAlign") && (e.verticalAlign = t.textVerticalAlign), qe(t, "textLineHeight") && (e.lineHeight = t.textLineHeight), qe(t, "textWidth") && (e.width = t.textWidth), qe(t, "textHeight") && (e.height = t.textHeight), qe(t, "textBackgroundColor") && (e.backgroundColor = t.textBackgroundColor), qe(t, "textPadding") && (e.padding = t.textPadding), qe(t, "textBorderColor") && (e.borderColor = t.textBorderColor), qe(t, "textBorderWidth") && (e.borderWidth = t.textBorderWidth), qe(t, "textBorderRadius") && (e.borderRadius = t.textBorderRadius), qe(t, "textBoxShadowColor") && (e.shadowColor = t.textBoxShadowColor), qe(t, "textBoxShadowBlur") && (e.shadowBlur = t.textBoxShadowBlur), qe(t, "textBoxShadowOffsetX") && (e.shadowOffsetX = t.textBoxShadowOffsetX), qe(t, "textBoxShadowOffsetY") && (e.shadowOffsetY = t.textBoxShadowOffsetY));
}
function j4(e, t, r) {
  var n = e;
  n.textPosition = n.textPosition || r.position || "inside", r.offset != null && (n.textOffset = r.offset), r.rotation != null && (n.textRotation = r.rotation), r.distance != null && (n.textDistance = r.distance);
  var i = n.textPosition.indexOf("inside") >= 0, a = e.fill || fe.color.neutral99;
  K4(n, t);
  var o = n.textFill == null;
  return i ? o && (n.textFill = r.insideFill || fe.color.neutral00, !n.textStroke && r.insideStroke && (n.textStroke = r.insideStroke), !n.textStroke && (n.textStroke = a), n.textStrokeWidth == null && (n.textStrokeWidth = 2)) : (o && (n.textFill = e.fill || r.outsideFill || fe.color.neutral00), !n.textStroke && r.outsideStroke && (n.textStroke = r.outsideStroke)), n.text = t.text, n.rich = t.rich, F(t.rich, function(s) {
    K4(s, s);
  }), n;
}
function K4(e, t) {
  t && (qe(t, "fill") && (e.textFill = t.fill), qe(t, "stroke") && (e.textStroke = t.fill), qe(t, "lineWidth") && (e.textStrokeWidth = t.lineWidth), qe(t, "font") && (e.font = t.font), qe(t, "fontStyle") && (e.fontStyle = t.fontStyle), qe(t, "fontWeight") && (e.fontWeight = t.fontWeight), qe(t, "fontSize") && (e.fontSize = t.fontSize), qe(t, "fontFamily") && (e.fontFamily = t.fontFamily), qe(t, "align") && (e.textAlign = t.align), qe(t, "verticalAlign") && (e.textVerticalAlign = t.verticalAlign), qe(t, "lineHeight") && (e.textLineHeight = t.lineHeight), qe(t, "width") && (e.textWidth = t.width), qe(t, "height") && (e.textHeight = t.height), qe(t, "backgroundColor") && (e.textBackgroundColor = t.backgroundColor), qe(t, "padding") && (e.textPadding = t.padding), qe(t, "borderColor") && (e.textBorderColor = t.borderColor), qe(t, "borderWidth") && (e.textBorderWidth = t.borderWidth), qe(t, "borderRadius") && (e.textBorderRadius = t.borderRadius), qe(t, "shadowColor") && (e.textBoxShadowColor = t.shadowColor), qe(t, "shadowBlur") && (e.textBoxShadowBlur = t.shadowBlur), qe(t, "shadowOffsetX") && (e.textBoxShadowOffsetX = t.shadowOffsetX), qe(t, "shadowOffsetY") && (e.textBoxShadowOffsetY = t.shadowOffsetY), qe(t, "textShadowColor") && (e.textShadowColor = t.textShadowColor), qe(t, "textShadowBlur") && (e.textShadowBlur = t.textShadowBlur), qe(t, "textShadowOffsetX") && (e.textShadowOffsetX = t.textShadowOffsetX), qe(t, "textShadowOffsetY") && (e.textShadowOffsetY = t.textShadowOffsetY));
}
var hX = {
  position: ["x", "y"],
  scale: ["scaleX", "scaleY"],
  origin: ["originX", "originY"]
}, Q4 = Ht(hX);
bo(eu, function(e, t) {
  return e[t] = 1, e;
}, {});
eu.join(", ");
var Rb = ["", "style", "shape", "extra"], Om = Bt();
function pN(e, t, r, n, i) {
  var a = e + "Animation", o = Qm(e, n, i) || {}, s = Om(t).userDuring;
  return o.duration > 0 && (o.during = s ? Ge(zve, {
    el: t,
    userDuring: s
  }) : null, o.setToFinal = !0, o.scope = e), xe(o, r[a]), o;
}
function M2(e, t, r, n) {
  n = n || {};
  var i = n.dataIndex, a = n.isInit, o = n.clearStyle, s = r.isAnimationEnabled(), l = Om(e), u = t.style;
  l.userDuring = t.during;
  var f = {}, c = {};
  if (Gve(e, t, c), e.type === "compound")
    for (var h = e.shape.paths, v = t.shape.paths, d = 0; d < v.length; d++) {
      var g = v[d];
      pD("shape", g, h[d]);
    }
  else
    pD("shape", t, c), pD("extra", t, c);
  if (!a && s && (Fve(e, t, f), J4("shape", e, t, f), J4("extra", e, t, f), Vve(e, t, u, f)), c.style = u, Ove(e, c, o), kve(e, t), s)
    if (a) {
      var y = {};
      F(Rb, function(S) {
        var T = S ? t[S] : t;
        T && T.enterFrom && (S && (y[S] = y[S] || {}), xe(S ? y[S] : y, T.enterFrom));
      });
      var x = pN("enter", e, t, r, i);
      x.duration > 0 && e.animateFrom(y, x);
    } else
      Nve(e, t, i || 0, r, f);
  vX(e, t), u ? e.dirty() : e.markRedraw();
}
function vX(e, t) {
  for (var r = Om(e).leaveToProps, n = 0; n < Rb.length; n++) {
    var i = Rb[n], a = i ? t[i] : t;
    a && a.leaveTo && (r || (r = Om(e).leaveToProps = {}), i && (r[i] = r[i] || {}), xe(i ? r[i] : r, a.leaveTo));
  }
}
function jC(e, t, r, n) {
  if (e) {
    var i = e.parent, a = Om(e).leaveToProps;
    if (a) {
      var o = pN("update", e, t, r, 0);
      o.done = function() {
        i && i.remove(e);
      }, e.animateTo(a, o);
    } else
      i && i.remove(e);
  }
}
function gd(e) {
  return e === "all";
}
function Ove(e, t, r) {
  var n = t.style;
  if (!e.isGroup && n) {
    if (r) {
      e.useStyle({});
      for (var i = e.animators, a = 0; a < i.length; a++) {
        var o = i[a];
        o.targetName === "style" && o.changeTarget(e.style);
      }
    }
    e.setStyle(n);
  }
  t && (t.style = null, t && e.attr(t), t.style = n);
}
function Nve(e, t, r, n, i) {
  if (i) {
    var a = pN("update", e, t, n, r);
    a.duration > 0 && e.animateFrom(i, a);
  }
}
function kve(e, t) {
  qe(t, "silent") && (e.silent = t.silent), qe(t, "ignore") && (e.ignore = t.ignore), e instanceof hs && qe(t, "invisible") && (e.invisible = t.invisible), e instanceof zt && qe(t, "autoBatch") && (e.autoBatch = t.autoBatch);
}
var Ol = {}, Bve = {
  // Usually other props do not need to be changed in animation during.
  setTransform: function(e, t) {
    return Ol.el[e] = t, this;
  },
  getTransform: function(e) {
    return Ol.el[e];
  },
  setShape: function(e, t) {
    var r = Ol.el, n = r.shape || (r.shape = {});
    return n[e] = t, r.dirtyShape && r.dirtyShape(), this;
  },
  getShape: function(e) {
    var t = Ol.el.shape;
    if (t)
      return t[e];
  },
  setStyle: function(e, t) {
    var r = Ol.el, n = r.style;
    return n && (n[e] = t, r.dirtyStyle && r.dirtyStyle()), this;
  },
  getStyle: function(e) {
    var t = Ol.el.style;
    if (t)
      return t[e];
  },
  setExtra: function(e, t) {
    var r = Ol.el.extra || (Ol.el.extra = {});
    return r[e] = t, this;
  },
  getExtra: function(e) {
    var t = Ol.el.extra;
    if (t)
      return t[e];
  }
};
function zve() {
  var e = this, t = e.el;
  if (t) {
    var r = Om(t).userDuring, n = e.userDuring;
    if (r !== n) {
      e.el = e.userDuring = null;
      return;
    }
    Ol.el = t, n(Bve);
  }
}
function J4(e, t, r, n) {
  var i = r[e];
  if (i) {
    var a = t[e], o;
    if (a) {
      var s = r.transition, l = i.transition;
      if (l)
        if (!o && (o = n[e] = {}), gd(l))
          xe(o, a);
        else
          for (var u = Mr(l), f = 0; f < u.length; f++) {
            var c = u[f], h = a[c];
            o[c] = h;
          }
      else if (gd(s) || Tt(s, e) >= 0) {
        !o && (o = n[e] = {});
        for (var v = Ht(a), f = 0; f < v.length; f++) {
          var c = v[f], h = a[c];
          Hve(i[c], h) && (o[c] = h);
        }
      }
    }
  }
}
function pD(e, t, r) {
  var n = t[e];
  if (n)
    for (var i = r[e] = {}, a = Ht(n), o = 0; o < a.length; o++) {
      var s = a[o];
      i[s] = h1(n[s]);
    }
}
function Fve(e, t, r) {
  for (var n = t.transition, i = gd(n) ? eu : Mr(n || []), a = 0; a < i.length; a++) {
    var o = i[a];
    if (!(o === "style" || o === "shape" || o === "extra")) {
      var s = e[o];
      r[o] = s;
    }
  }
}
function Gve(e, t, r) {
  for (var n = 0; n < Q4.length; n++) {
    var i = Q4[n], a = hX[i], o = t[i];
    o && (r[a[0]] = o[0], r[a[1]] = o[1]);
  }
  for (var n = 0; n < eu.length; n++) {
    var s = eu[n];
    t[s] != null && (r[s] = t[s]);
  }
}
function Vve(e, t, r, n) {
  if (r) {
    var i = e.style, a;
    if (i) {
      var o = r.transition, s = t.transition;
      if (o && !gd(o)) {
        var l = Mr(o);
        !a && (a = n.style = {});
        for (var u = 0; u < l.length; u++) {
          var f = l[u], c = i[f];
          a[f] = c;
        }
      } else if (e.getAnimationStyleProps && (gd(s) || gd(o) || Tt(s, "style") >= 0)) {
        var h = e.getAnimationStyleProps(), v = h ? h.style : null;
        if (v) {
          !a && (a = n.style = {});
          for (var d = Ht(r), u = 0; u < d.length; u++) {
            var f = d[u];
            if (v[f]) {
              var c = i[f];
              a[f] = c;
            }
          }
        }
      }
    }
  }
}
function Hve(e, t) {
  return Vi(e) ? e !== t : e != null && isFinite(e);
}
var dX = Bt(), Uve = ["percent", "easing", "shape", "style", "extra"];
function pX(e) {
  e.stopAnimation("keyframe"), e.attr(dX(e));
}
function Ob(e, t, r) {
  if (!(!r.isAnimationEnabled() || !t)) {
    if (Se(t)) {
      F(t, function(s) {
        Ob(e, s, r);
      });
      return;
    }
    var n = t.keyframes, i = t.duration;
    if (r && i == null) {
      var a = Qm("enter", r, 0);
      i = a && a.duration;
    }
    if (!(!n || !i)) {
      var o = dX(e);
      F(Rb, function(s) {
        if (!(s && !e[s])) {
          var l;
          n.sort(function(u, f) {
            return u.percent - f.percent;
          }), F(n, function(u) {
            var f = e.animators, c = s ? u[s] : u;
            if (c) {
              var h = Ht(c);
              if (s || (h = nr(h, function(g) {
                return Tt(Uve, g) < 0;
              })), !!h.length) {
                l || (l = e.animate(s, t.loop, !0), l.scope = "keyframe");
                for (var v = 0; v < f.length; v++)
                  f[v] !== l && f[v].targetName === l.targetName && f[v].stopTracks(h);
                s && (o[s] = o[s] || {});
                var d = s ? o[s] : o;
                F(h, function(g) {
                  d[g] = ((s ? e[s] : e) || {})[g];
                }), l.whenWithKeys(i * u.percent, c, h, u.easing);
              }
            }
          }), l && l.delay(t.delay || 0).duration(i).start(t.easing);
        }
      });
    }
  }
}
var hf = "emphasis", Nc = "normal", gN = "blur", mN = "select", Qc = [Nc, hf, gN, mN], gD = {
  normal: ["itemStyle"],
  emphasis: [hf, "itemStyle"],
  blur: [gN, "itemStyle"],
  select: [mN, "itemStyle"]
}, mD = {
  normal: ["label"],
  emphasis: [hf, "label"],
  blur: [gN, "label"],
  select: [mN, "label"]
}, Wve = ["x", "y"], Xve = "e\0\0", Zo = {
  normal: {},
  emphasis: {},
  blur: {},
  select: {}
}, Yve = {
  cartesian2d: Cve,
  geo: Mve,
  single: Dve,
  polar: Pve,
  calendar: Ive,
  matrix: Rve
};
function dI(e) {
  return e instanceof zt;
}
function pI(e) {
  return e instanceof hs;
}
function Zve(e, t) {
  t.copyTransform(e), pI(t) && pI(e) && (t.setStyle(e.style), t.z = e.z, t.z2 = e.z2, t.zlevel = e.zlevel, t.invisible = e.invisible, t.ignore = e.ignore, dI(t) && dI(e) && t.setShape(e.shape));
}
var $ve = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.render = function(r, n, i, a) {
      this._progressiveEls = null;
      var o = this._data, s = r.getData(), l = this.group, u = eF(r, s, n, i);
      o || l.removeAll(), s.diff(o).add(function(c) {
        yD(i, null, c, u(c, a), r, l, s);
      }).remove(function(c) {
        var h = o.getItemGraphicEl(c);
        h && jC(h, cf(h).option, r);
      }).update(function(c, h) {
        var v = o.getItemGraphicEl(h);
        yD(i, v, c, u(c, a), r, l, s);
      }).execute();
      var f = r.get("clip", !0) ? Bx(r.coordinateSystem, !1, r) : null;
      f ? l.setClipPath(f) : l.removeClipPath(), this._data = s;
    }, t.prototype.incrementalPrepareRender = function(r, n, i) {
      this.group.removeAll(), this._data = null;
    }, t.prototype.incrementalRender = function(r, n, i, a, o) {
      var s = n.getData(), l = eF(n, s, i, a), u = this._progressiveEls = [];
      function f(v) {
        v.isGroup || (v.incremental = !0, v.ensureState("emphasis").hoverLayer = !0);
      }
      for (var c = r.start; c < r.end; c++) {
        var h = yD(null, null, c, l(c, o), n, this.group, s);
        h && (h.traverse(f), u.push(h));
      }
    }, t.prototype.eachRendered = function(r) {
      rh(this._progressiveEls || this.group, r);
    }, t.prototype.filterForExposedEvent = function(r, 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;
  })(Ut)
);
function yN(e) {
  var t = e.type, r;
  if (t === "path") {
    var n = e.shape, i = n.width != null && n.height != null ? {
      x: n.x || 0,
      y: n.y || 0,
      width: n.width,
      height: n.height
    } : null, a = yX(n);
    r = $c(a, null, i, n.layout || "center"), cf(r).customPathData = a;
  } else if (t === "image")
    r = new Xn({}), cf(r).customImagePath = e.style.image;
  else if (t === "text")
    r = new Rt({});
  else if (t === "group")
    r = new rt();
  else if (t === "compoundPath") {
    var n = e.shape;
    if (!n || !n.paths) {
      var o = "";
      or(o);
    }
    var s = Ce(n.paths, function(f) {
      if (f.type === "path")
        return $c(f.shape.pathData, f, null);
      var c = z1(f.type);
      if (!c) {
        var h = "";
        or(h);
      }
      return new c();
    });
    r = new Km({
      shape: {
        paths: s
      }
    });
  } else {
    var l = z1(t);
    if (!l) {
      var o = "";
      or(o);
    }
    r = new l();
  }
  return cf(r).customGraphicType = t, r.name = e.name, r.z2EmphasisLift = 1, r.z2SelectLift = 1, r;
}
function _N(e, t, r, n, i, a, o) {
  pX(t);
  var s = i && i.normal.cfg;
  s && t.setTextConfig(s), n && n.transition == null && (n.transition = Wve);
  var l = n && n.style;
  if (l) {
    if (t.type === "text") {
      var u = l;
      qe(u, "textFill") && (u.fill = u.textFill), qe(u, "textStroke") && (u.stroke = u.textStroke);
    }
    var f = void 0, c = dI(t) ? l.decal : null;
    e && c && (c.dirty = !0, f = Am(c, e)), l.__decalPattern = f;
  }
  if (pI(t) && l) {
    var f = l.__decalPattern;
    f && (l.decal = f);
  }
  M2(t, n, a, {
    dataIndex: r,
    isInit: o,
    clearStyle: !0
  }), Ob(t, n.keyframeAnimation, a);
}
function gX(e, t, r, n, i) {
  var a = t.isGroup ? null : t, o = i && i[e].cfg;
  if (a) {
    var s = a.ensureState(e);
    if (n === !1) {
      var l = a.getState(e);
      l && (l.style = null);
    } else
      s.style = n || null;
    o && (s.textConfig = o), Td(a);
  }
}
function qve(e, t, r) {
  if (!e.isGroup) {
    var n = e, i = r.currentZ, a = r.currentZLevel;
    n.z = i, n.zlevel = a;
    var o = t.z2;
    o != null && (n.z2 = o || 0);
    for (var s = 0; s < Qc.length; s++)
      jve(n, t, Qc[s]);
  }
}
function jve(e, t, r) {
  var n = r === Nc, i = n ? t : Nb(t, r), a = i ? i.z2 : null, o;
  a != null && (o = n ? e : e.ensureState(r), o.z2 = a || 0);
}
function eF(e, t, r, n) {
  var i = e.get("renderItem");
  if (typeof i == "string") {
    var a = ine(i);
    a && (i = a);
  }
  var o = e.coordinateSystem, s = {};
  o && (s = o.prepareCustoms ? o.prepareCustoms(o) : Yve[o.type](o));
  for (var l = tt({
    getWidth: n.getWidth,
    getHeight: n.getHeight,
    getZr: n.getZr,
    getDevicePixelRatio: n.getDevicePixelRatio,
    value: A,
    style: E,
    ordinalRawValue: M,
    styleEmphasis: P,
    visual: N,
    barLayout: G,
    currentSeriesIndices: z,
    font: H
  }, s.api || {}), u = {
    // 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: e.id,
    seriesName: e.name,
    seriesIndex: e.seriesIndex,
    coordSys: s.coordSys,
    dataInsideLength: t.count(),
    encode: Kve(e.getData()),
    itemPayload: e.get("itemPayload") || {}
  }, f, c, h = {}, v = {}, d = {}, g = {}, y = 0; y < Qc.length; y++) {
    var x = Qc[y];
    d[x] = e.getModel(gD[x]), g[x] = e.getModel(mD[x]);
  }
  function S(W) {
    return W === f ? c || (c = t.getItemModel(W)) : t.getItemModel(W);
  }
  function T(W, Z) {
    return t.hasItemOption ? W === f ? h[Z] || (h[Z] = S(W).getModel(gD[Z])) : S(W).getModel(gD[Z]) : d[Z];
  }
  function C(W, Z) {
    return t.hasItemOption ? W === f ? v[Z] || (v[Z] = S(W).getModel(mD[Z])) : S(W).getModel(mD[Z]) : g[Z];
  }
  return function(W, Z) {
    return f = W, c = null, h = {}, v = {}, i && i(tt({
      dataIndexInside: W,
      dataIndex: t.getRawIndex(W),
      // Can be used for optimization when zoom or roam.
      actionType: Z ? Z.type : null
    }, u), l);
  };
  function A(W, Z) {
    return Z == null && (Z = f), t.getStore().get(t.getDimensionIndex(W || 0), Z);
  }
  function M(W, Z) {
    Z == null && (Z = f), W = W || 0;
    var ee = t.getDimensionInfo(W);
    if (!ee) {
      var V = t.getDimensionIndex(W);
      return V >= 0 ? t.getStore().get(V, Z) : void 0;
    }
    var Q = t.get(ee.name, Z), q = ee && ee.ordinalMeta;
    return q ? q.categories[Q] : Q;
  }
  function E(W, Z) {
    Z == null && (Z = f);
    var ee = t.getItemVisual(Z, "style"), V = ee && ee.fill, Q = ee && ee.opacity, q = T(Z, Nc).getItemStyle();
    V != null && (q.fill = V), Q != null && (q.opacity = Q);
    var X = {
      inheritColor: Fe(V) ? V : fe.color.neutral99
    }, K = C(Z, Nc), ue = gr(K, null, X, !1, !0);
    ue.text = K.getShallow("show") ? et(e.getFormattedLabel(Z, Nc), Em(t, Z)) : null;
    var oe = tb(K, X, !1);
    return O(W, q), q = j4(q, ue, oe), W && R(q, W), q.legacy = !0, q;
  }
  function P(W, Z) {
    Z == null && (Z = f);
    var ee = T(Z, hf).getItemStyle(), V = C(Z, hf), Q = gr(V, null, null, !0, !0);
    Q.text = V.getShallow("show") ? $a(e.getFormattedLabel(Z, hf), e.getFormattedLabel(Z, Nc), Em(t, Z)) : null;
    var q = tb(V, null, !0);
    return O(W, ee), ee = j4(ee, Q, q), W && R(ee, W), ee.legacy = !0, ee;
  }
  function R(W, Z) {
    for (var ee in Z)
      qe(Z, ee) && (W[ee] = Z[ee]);
  }
  function O(W, Z) {
    W && (W.textFill && (Z.textFill = W.textFill), W.textPosition && (Z.textPosition = W.textPosition));
  }
  function N(W, Z) {
    if (Z == null && (Z = f), qe($4, W)) {
      var ee = t.getItemVisual(Z, "style");
      return ee ? ee[$4[W]] : null;
    }
    if (qe(wve, W))
      return t.getItemVisual(Z, W);
  }
  function G(W) {
    if (o.type === "cartesian2d") {
      var Z = o.getBaseAxis();
      return iie(tt({
        axis: Z
      }, W));
    }
  }
  function z() {
    return r.getCurrentSeriesIndices();
  }
  function H(W) {
    return zR(W, r);
  }
}
function Kve(e) {
  var t = {};
  return F(e.dimensions, function(r) {
    var n = e.getDimensionInfo(r);
    if (!n.isExtraCoord) {
      var i = n.coordDim, a = t[i] = t[i] || [];
      a[n.coordDimIndex] = e.getDimensionIndex(r);
    }
  }), t;
}
function yD(e, t, r, n, i, a, o) {
  if (!n) {
    a.remove(t);
    return;
  }
  var s = xN(e, t, r, n, i, a);
  return s && o.setItemGraphicEl(r, s), s && Hr(s, n.focus, n.blurScope, n.emphasisDisabled), s;
}
function xN(e, t, r, n, i, a) {
  var o = -1, s = t;
  t && mX(t, n, i) && (o = Tt(a.childrenRef(), t), t = null);
  var l = !t, u = t;
  u ? u.clearStates() : (u = yN(n), s && Zve(s, u)), n.morph === !1 ? u.disableMorphing = !0 : u.disableMorphing && (u.disableMorphing = !1), n.tooltipDisabled && (u.tooltipDisabled = !0), Zo.normal.cfg = Zo.normal.conOpt = Zo.emphasis.cfg = Zo.emphasis.conOpt = Zo.blur.cfg = Zo.blur.conOpt = Zo.select.cfg = Zo.select.conOpt = null, Zo.isLegacy = !1, Jve(u, r, n, i, l, Zo), Qve(u, r, n, i, l), _N(e, u, r, n, Zo, i, l), qe(n, "info") && (cf(u).info = n.info);
  for (var f = 0; f < Qc.length; f++) {
    var c = Qc[f];
    if (c !== Nc) {
      var h = Nb(n, c), v = SN(n, h, c);
      gX(c, u, h, v, Zo);
    }
  }
  return qve(u, n, i), n.type === "group" && ede(e, u, r, n, i), o >= 0 ? a.replaceAt(u, o) : a.add(u), u;
}
function mX(e, t, r) {
  var n = cf(e), 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.
    r.isUniversalTransitionEnabled() || i != null && i !== n.customGraphicType || i === "path" && ide(a) && yX(a) !== n.customPathData || i === "image" && qe(o, "image") && o.image !== n.customImagePath
  );
}
function Qve(e, t, r, n, i) {
  var a = r.clipPath;
  if (a === !1)
    e && e.getClipPath() && e.removeClipPath();
  else if (a) {
    var o = e.getClipPath();
    o && mX(o, a, n) && (o = null), o || (o = yN(a), e.setClipPath(o)), _N(null, o, t, a, null, n, i);
  }
}
function Jve(e, t, r, n, i, a) {
  if (!(e.isGroup || e.type === "compoundPath")) {
    tF(r, null, a), tF(r, hf, 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 f = e.getTextContent();
      if (o === !1)
        f && e.removeTextContent();
      else {
        o = a.normal.conOpt = o || {
          type: "text"
        }, f ? f.clearStates() : (f = yN(o), e.setTextContent(f)), _N(null, f, t, o, null, n, i);
        for (var c = o && o.style, h = 0; h < Qc.length; h++) {
          var v = Qc[h];
          if (v !== Nc) {
            var d = a[v].conOpt;
            gX(v, f, d, SN(o, d, v), null);
          }
        }
        c ? f.dirty() : f.markRedraw();
      }
    }
  }
}
function tF(e, t, r) {
  var n = t ? Nb(e, t) : e, i = t ? SN(e, n, hf) : e.style, a = e.type, o = n ? n.textConfig : null, s = e.textContent, l = s ? t ? Nb(s, t) : s : null;
  if (i && // Because emphasis style has little info to detect legacy,
  // if normal is legacy, emphasis is trade as legacy.
  (r.isLegacy || fX(i, a, !!o, !!l))) {
    r.isLegacy = !0;
    var u = cX(i, a, !t);
    !o && u.textConfig && (o = u.textConfig), !l && u.textContent && (l = u.textContent);
  }
  if (!t && l) {
    var f = l;
    !f.type && (f.type = "text");
  }
  var c = t ? r[t] : r.normal;
  c.cfg = o, c.conOpt = l;
}
function Nb(e, t) {
  return t ? e ? e[t] : null : e;
}
function SN(e, t, r) {
  var n = t && t.style;
  return n == null && r === hf && e && (n = e.styleEmphasis), n;
}
function ede(e, t, r, 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) {
      rde({
        api: e,
        oldChildren: t.children() || [],
        newChildren: a || [],
        dataIndex: r,
        seriesModel: i,
        group: t
      });
      return;
    }
    u && t.removeAll();
    for (var f = 0; f < o; f++) {
      var c = a[f], h = t.childAt(f);
      c ? (c.ignore == null && (c.ignore = !1), xN(e, h, r, c, i, t)) : h.ignore = !0;
    }
    for (var v = t.childCount() - 1; v >= f; v--) {
      var d = t.childAt(v);
      tde(t, d, i);
    }
  }
}
function tde(e, t, r) {
  t && jC(t, cf(e).option, r);
}
function rde(e) {
  new _f(e.oldChildren, e.newChildren, rF, rF, e).add(nF).update(nF).remove(nde).execute();
}
function rF(e, t) {
  var r = e && e.name;
  return r ?? Xve + t;
}
function nF(e, t) {
  var r = this.context, n = e != null ? r.newChildren[e] : null, i = t != null ? r.oldChildren[t] : null;
  xN(r.api, i, r.dataIndex, n, r.seriesModel, r.group);
}
function nde(e) {
  var t = this.context, r = t.oldChildren[e];
  r && jC(r, cf(r).option, t.seriesModel);
}
function yX(e) {
  return e && (e.pathData || e.d);
}
function ide(e) {
  return e && (qe(e, "pathData") || qe(e, "d"));
}
function ade(e) {
  e.registerChartView($ve), e.registerSeriesModel(Tve);
}
var Qv = Bt(), iF = it, _D = Ge, wN = (
  /** @class */
  (function() {
    function e() {
      this._dragging = !1, this.animationThreshold = 15;
    }
    return e.prototype.render = function(t, r, n, i) {
      var a = r.get("value"), o = r.get("status");
      if (this._axisModel = t, this._axisPointerModel = r, 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, r, n);
        var f = u.graphicKey;
        f !== this._lastGraphicKey && this.clear(n), this._lastGraphicKey = f;
        var c = this._moveAnimation = this.determineAnimation(t, r);
        if (!s)
          s = this._group = new rt(), this.createPointerEl(s, u, t, r), this.createLabelEl(s, u, t, r), n.getZr().add(s);
        else {
          var h = St(aF, r, c);
          this.updatePointerEl(s, u, h), this.updateLabelEl(s, u, h, r);
        }
        sF(s, r, !0), this._renderHandle(a);
      }
    }, e.prototype.remove = function(t) {
      this.clear(t);
    }, e.prototype.dispose = function(t) {
      this.clear(t);
    }, e.prototype.determineAnimation = function(t, r) {
      var n = r.get("animation"), i = t.axis, a = i.type === "category", o = r.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 = HO(t).seriesDataCount, u = i.getExtent();
          return Math.abs(u[0] - u[1]) / l > s;
        }
        return !1;
      }
      return n === !0;
    }, e.prototype.makeElOption = function(t, r, n, i, a) {
    }, e.prototype.createPointerEl = function(t, r, n, i) {
      var a = r.pointer;
      if (a) {
        var o = Qv(t).pointerEl = new kd[a.type](iF(r.pointer));
        t.add(o);
      }
    }, e.prototype.createLabelEl = function(t, r, n, i) {
      if (r.label) {
        var a = Qv(t).labelEl = new Rt(iF(r.label));
        t.add(a), oF(a, i);
      }
    }, e.prototype.updatePointerEl = function(t, r, n) {
      var i = Qv(t).pointerEl;
      i && r.pointer && (i.setStyle(r.pointer.style), n(i, {
        shape: r.pointer.shape
      }));
    }, e.prototype.updateLabelEl = function(t, r, n, i) {
      var a = Qv(t).labelEl;
      a && (a.setStyle(r.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: r.label.x,
        y: r.label.y
      }), oF(a, i));
    }, e.prototype._renderHandle = function(t) {
      if (!(this._dragging || !this.updateHandleTransform)) {
        var r = this._axisPointerModel, n = this._api.getZr(), i = this._handle, a = r.getModel("handle"), o = r.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 = Jm(a.get("icon"), {
          cursor: "move",
          draggable: !0,
          onmousemove: function(u) {
            gf(u.event);
          },
          onmousedown: _D(this._onHandleDragMove, this, 0, 0),
          drift: _D(this._onHandleDragMove, this),
          ondragend: _D(this._onHandleDragEnd, this)
        }), n.add(i)), sF(i, r, !1), i.setStyle(a.getItemStyle(null, ["color", "borderColor", "borderWidth", "opacity", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY"]));
        var l = a.get("size");
        Se(l) || (l = [l, l]), i.scaleX = l[0] / 2, i.scaleY = l[1] / 2, ay(this, "_doDispatchAxisPointer", a.get("throttle") || 0, "fixRate"), this._moveHandleToValue(t, s);
      }
    }, e.prototype._moveHandleToValue = function(t, r) {
      aF(this._axisPointerModel, !r && this._moveAnimation, this._handle, xD(this.getHandleTransform(t, this._axisModel, this._axisPointerModel)));
    }, e.prototype._onHandleDragMove = function(t, r) {
      var n = this._handle;
      if (n) {
        this._dragging = !0;
        var i = this.updateHandleTransform(xD(n), [t, r], this._axisModel, this._axisPointerModel);
        this._payloadInfo = i, n.stopAnimation(), n.attr(xD(i)), Qv(n).lastProp = null, this._doDispatchAxisPointer();
      }
    }, e.prototype._doDispatchAxisPointer = function() {
      var t = this._handle;
      if (t) {
        var r = this._payloadInfo, n = this._axisModel;
        this._api.dispatchAction({
          type: "updateAxisPointer",
          x: r.cursorPoint[0],
          y: r.cursorPoint[1],
          tooltipOption: r.tooltipOption,
          axesInfo: [{
            axisDim: n.axis.dim,
            axisIndex: n.componentIndex
          }]
        });
      }
    }, e.prototype._onHandleDragEnd = function() {
      this._dragging = !1;
      var t = this._handle;
      if (t) {
        var r = this._axisPointerModel.get("value");
        this._moveHandleToValue(r), this._api.dispatchAction({
          type: "hideTip"
        });
      }
    }, e.prototype.clear = function(t) {
      this._lastValue = null, this._lastStatus = null;
      var r = t.getZr(), n = this._group, i = this._handle;
      r && n && (this._lastGraphicKey = null, n && r.remove(n), i && r.remove(i), this._group = null, this._handle = null, this._payloadInfo = null), U1(this, "_doDispatchAxisPointer");
    }, e.prototype.doClear = function() {
    }, e.prototype.buildLabel = function(t, r, n) {
      return n = n || 0, {
        x: t[n],
        y: t[1 - n],
        width: r[n],
        height: r[1 - n]
      };
    }, e;
  })()
);
function aF(e, t, r, n) {
  _X(Qv(r).lastProp, n) || (Qv(r).lastProp = n, t ? Wt(r, n, e) : (r.stopAnimation(), r.attr(n)));
}
function _X(e, t) {
  if (ot(e) && ot(t)) {
    var r = !0;
    return F(t, function(n, i) {
      r = r && _X(e[i], n);
    }), !!r;
  } else
    return e === t;
}
function oF(e, t) {
  e[t.get(["label", "show"]) ? "show" : "hide"]();
}
function xD(e) {
  return {
    x: e.x || 0,
    y: e.y || 0,
    rotation: e.rotation || 0
  };
}
function sF(e, t, r) {
  var n = t.get("z"), i = t.get("zlevel");
  e && e.traverse(function(a) {
    a.type !== "group" && (n != null && (a.z = n), i != null && (a.zlevel = i), a.silent = r);
  });
}
function TN(e) {
  var t = e.get("type"), r = e.getModel(t + "Style"), n;
  return t === "line" ? (n = r.getLineStyle(), n.fill = null) : t === "shadow" && (n = r.getAreaStyle(), n.stroke = null), n;
}
function xX(e, t, r, n, i) {
  var a = r.get("value"), o = SX(a, t.axis, t.ecModel, r.get("seriesDataIndices"), {
    precision: r.get(["label", "precision"]),
    formatter: r.get(["label", "formatter"])
  }), s = r.getModel("label"), l = ry(s.get("padding") || 0), u = s.getFont(), f = pC(o, u), c = i.position, h = f.width + l[1] + l[3], v = f.height + l[0] + l[2], d = i.align;
  d === "right" && (c[0] -= h), d === "center" && (c[0] -= h / 2);
  var g = i.verticalAlign;
  g === "bottom" && (c[1] -= v), g === "middle" && (c[1] -= v / 2), ode(c, h, v, n);
  var y = s.get("backgroundColor");
  (!y || y === "auto") && (y = t.get(["axisLine", "lineStyle", "color"])), e.label = {
    // shape: {x: 0, y: 0, width: width, height: height, r: labelModel.get('borderRadius')},
    x: c[0],
    y: c[1],
    style: gr(s, {
      text: o,
      font: u,
      fill: s.getTextColor(),
      padding: l,
      backgroundColor: y
    }),
    // Label should be over axisPointer.
    z2: 10
  };
}
function ode(e, t, r, n) {
  var i = n.getWidth(), a = n.getHeight();
  e[0] = Math.min(e[0] + t, i) - t, e[1] = Math.min(e[1] + r, a) - r, e[0] = Math.max(e[0], 0), e[1] = Math.max(e[1], 0);
}
function SX(e, t, r, n, i) {
  e = t.scale.parse(e);
  var a = t.scale.getLabel({
    value: e
  }, {
    // 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: gb(t, {
        value: e
      }),
      axisDimension: t.dim,
      axisIndex: t.index,
      seriesData: []
    };
    F(n, function(l) {
      var u = r.getSeriesByIndex(l.seriesIndex), f = l.dataIndexInside, c = u && u.getDataParams(f);
      c && s.seriesData.push(c);
    }), Fe(o) ? a = o.replace("{value}", a) : nt(o) && (a = o(s));
  }
  return a;
}
function bN(e, t, r) {
  var n = ii();
  return Tf(n, n, r.rotation), Zs(n, n, r.position), Ws([e.dataToCoord(t), (r.labelOffset || 0) + (r.labelDirection || 1) * (r.labelMargin || 0)], n);
}
function wX(e, t, r, n, i, a) {
  var o = xa.innerTextLayout(r.rotation, 0, r.labelDirection);
  r.labelMargin = i.get(["label", "margin"]), xX(t, n, i, a, {
    position: bN(n.axis, e, r),
    align: o.textAlign,
    verticalAlign: o.textVerticalAlign
  });
}
function CN(e, t, r) {
  return r = r || 0, {
    x1: e[r],
    y1: e[1 - r],
    x2: t[r],
    y2: t[1 - r]
  };
}
function TX(e, t, r) {
  return r = r || 0, {
    x: e[r],
    y: e[1 - r],
    width: t[r],
    height: t[1 - r]
  };
}
function lF(e, t, r, n, i, a) {
  return {
    cx: e,
    cy: t,
    r0: r,
    r: n,
    startAngle: i,
    endAngle: a,
    clockwise: !0
  };
}
var sde = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      return e !== null && e.apply(this, arguments) || this;
    }
    return t.prototype.makeElOption = function(r, n, i, a, o) {
      var s = i.axis, l = s.grid, u = a.get("type"), f = uF(l, s).getOtherAxis(s).getGlobalExtent(), c = s.toGlobalCoord(s.dataToCoord(n, !0));
      if (u && u !== "none") {
        var h = TN(a), v = lde[u](s, c, f);
        v.style = h, r.graphicKey = v.type, r.pointer = v;
      }
      var d = Ab(l.getRect(), i);
      wX(n, r, d, i, a, o);
    }, t.prototype.getHandleTransform = function(r, n, i) {
      var a = Ab(n.axis.grid.getRect(), n, {
        labelInside: !1
      });
      a.labelMargin = i.get(["handle", "margin"]);
      var o = bN(n.axis, r, a);
      return {
        x: o[0],
        y: o[1],
        rotation: a.rotation + (a.labelDirection < 0 ? Math.PI : 0)
      };
    }, t.prototype.updateHandleTransform = function(r, n, i, a) {
      var o = i.axis, s = o.grid, l = o.getGlobalExtent(!0), u = uF(s, o).getOtherAxis(o).getGlobalExtent(), f = o.dim === "x" ? 0 : 1, c = [r.x, r.y];
      c[f] += n[f], c[f] = Math.min(l[1], c[f]), c[f] = Math.max(l[0], c[f]);
      var h = (u[1] + u[0]) / 2, v = [h, h];
      v[f] = c[f];
      var d = [{
        verticalAlign: "middle"
      }, {
        align: "center"
      }];
      return {
        x: c[0],
        y: c[1],
        rotation: r.rotation,
        cursorPoint: v,
        tooltipOption: d[f]
      };
    }, t;
  })(wN)
);
function uF(e, t) {
  var r = {};
  return r[t.dim + "AxisIndex"] = t.index, e.getCartesian(r);
}
var lde = {
  line: function(e, t, r) {
    var n = CN([t, r[0]], [t, r[1]], fF(e));
    return {
      type: "Line",
      subPixelOptimize: !0,
      shape: n
    };
  },
  shadow: function(e, t, r) {
    var n = Math.max(1, e.getBandWidth()), i = r[1] - r[0];
    return {
      type: "Rect",
      shape: TX([t - n / 2, r[0]], [n, i], fF(e))
    };
  }
};
function fF(e) {
  return e.dim === "x" ? 0 : 1;
}
var ude = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    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: fe.color.border,
        width: 1,
        type: "dashed"
      },
      shadowStyle: {
        color: fe.color.shadowTint
      },
      label: {
        show: !0,
        formatter: null,
        precision: "auto",
        margin: 3,
        color: fe.color.neutral00,
        padding: [5, 7, 5, 7],
        backgroundColor: fe.color.accent60,
        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: fe.color.accent40,
        // For mobile performance
        throttle: 40
      }
    }, t;
  })(At)
), sf = Bt(), fde = F;
function bX(e, t, r) {
  if (!Gt.node) {
    var n = t.getZr();
    sf(n).records || (sf(n).records = {}), cde(n, t);
    var i = sf(n).records[e] || (sf(n).records[e] = {});
    i.handler = r;
  }
}
function cde(e, t) {
  if (sf(e).initialized)
    return;
  sf(e).initialized = !0, r("click", St(cF, "click")), r("mousemove", St(cF, "mousemove")), r("globalout", vde);
  function r(n, i) {
    e.on(n, function(a) {
      var o = dde(t);
      fde(sf(e).records, function(s) {
        s && i(s, a, o.dispatchAction);
      }), hde(o.pendings, t);
    });
  }
}
function hde(e, t) {
  var r = e.showTip.length, n = e.hideTip.length, i;
  r ? i = e.showTip[r - 1] : n && (i = e.hideTip[n - 1]), i && (i.dispatchAction = null, t.dispatchAction(i));
}
function vde(e, t, r) {
  e.handler("leave", null, r);
}
function cF(e, t, r, n) {
  t.handler(e, r, n);
}
function dde(e) {
  var t = {
    showTip: [],
    hideTip: []
  }, r = function(n) {
    var i = t[n.type];
    i ? i.push(n) : (n.dispatchAction = r, e.dispatchAction(n));
  };
  return {
    dispatchAction: r,
    pendings: t
  };
}
function gI(e, t) {
  if (!Gt.node) {
    var r = t.getZr(), n = (sf(r).records || {})[e];
    n && (sf(r).records[e] = null);
  }
}
var pde = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.render = function(r, n, i) {
      var a = n.getComponent("tooltip"), o = r.get("triggerOn") || a && a.get("triggerOn") || "mousemove|click";
      bX("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(r, n) {
      gI("axisPointer", n);
    }, t.prototype.dispose = function(r, n) {
      gI("axisPointer", n);
    }, t.type = "axisPointer", t;
  })(fr)
);
function CX(e, t) {
  var r = [], n = e.seriesIndex, i;
  if (n == null || !(i = t.getSeriesByIndex(n)))
    return {
      point: []
    };
  var a = i.getData(), o = Sd(a, e);
  if (o == null || o < 0 || Se(o))
    return {
      point: []
    };
  var s = a.getItemGraphicEl(o), l = i.coordinateSystem;
  if (i.getTooltipPosition)
    r = i.getTooltipPosition(o) || [];
  else if (l && l.dataToPoint)
    if (e.isStacked) {
      var u = l.getBaseAxis(), f = l.getOtherAxis(u), c = f.dim, h = u.dim, v = c === "x" || c === "radius" ? 1 : 0, d = a.mapDimension(h), g = [];
      g[v] = a.get(d, o), g[1 - v] = a.get(a.getCalculationInfo("stackResultDimension"), o), r = l.dataToPoint(g) || [];
    } else
      r = l.dataToPoint(a.getValues(Ce(l.dimensions, function(x) {
        return a.mapDimension(x);
      }), o)) || [];
  else if (s) {
    var y = s.getBoundingRect().clone();
    y.applyTransform(s.transform), r = [y.x + y.width / 2, y.y + y.height / 2];
  }
  return {
    point: r,
    el: s
  };
}
var hF = Bt();
function gde(e, t, r) {
  var n = e.currTrigger, i = [e.x, e.y], a = e, o = e.dispatchAction || Ge(r.dispatchAction, r), s = t.getComponent("axisPointer").coordSysAxesInfo;
  if (s) {
    L2(i) && (i = CX({
      seriesIndex: a.seriesIndex,
      // Do not use dataIndexInside from other ec instance.
      // FIXME: auto detect it?
      dataIndex: a.dataIndex
    }, t).point);
    var l = L2(i), u = a.axesInfo, f = s.axesInfo, c = n === "leave" || L2(i), h = {}, v = {}, d = {
      list: [],
      map: {}
    }, g = {
      showPointer: St(yde, v),
      showTooltip: St(_de, d)
    };
    F(s.coordSysMap, function(x, S) {
      var T = l || x.containPoint(i);
      F(s.coordSysAxesInfo[S], function(C, A) {
        var M = C.axis, E = Tde(u, C);
        if (!c && T && (!u || E)) {
          var P = E && E.value;
          P == null && !l && (P = M.pointToData(i)), P != null && vF(C, P, g, !1, h);
        }
      });
    });
    var y = {};
    return F(f, function(x, S) {
      var T = x.linkGroup;
      T && !v[S] && F(T.axesInfo, function(C, A) {
        var M = v[A];
        if (C !== x && M) {
          var E = M.value;
          T.mapper && (E = x.axis.scale.parse(T.mapper(E, dF(C), dF(x)))), y[x.key] = E;
        }
      });
    }), F(y, function(x, S) {
      vF(f[S], x, g, !0, h);
    }), xde(v, f, h), Sde(d, i, e, o), wde(f, o, r), h;
  }
}
function vF(e, t, r, n, i) {
  var a = e.axis;
  if (!(a.scale.isBlank() || !a.containData(t))) {
    if (!e.involveSeries) {
      r.showPointer(e, t);
      return;
    }
    var o = mde(t, e), s = o.payloadBatch, l = o.snapToValue;
    s[0] && i.seriesIndex == null && xe(i, s[0]), !n && e.snap && a.containData(l) && l != null && (t = l), r.showPointer(e, t, s), r.showTooltip(e, o, l);
  }
}
function mde(e, t) {
  var r = t.axis, n = r.dim, i = e, a = [], o = Number.MAX_VALUE, s = -1;
  return F(t.seriesModels, function(l, u) {
    var f = l.getData().mapDimensionsAll(n), c, h;
    if (l.getAxisTooltipData) {
      var v = l.getAxisTooltipData(f, e, r);
      h = v.dataIndices, c = v.nestestValue;
    } else {
      if (h = l.indicesOfNearest(
        n,
        f[0],
        e,
        // Add a threshold to avoid find the wrong dataIndex
        // when data length is not same.
        // false,
        r.type === "category" ? 0.5 : null
      ), !h.length)
        return;
      c = l.getData().get(f[0], h[0]);
    }
    if (!(c == null || !isFinite(c))) {
      var d = e - c, g = Math.abs(d);
      g <= o && ((g < o || d >= 0 && s < 0) && (o = g, s = d, i = c, a.length = 0), F(h, function(y) {
        a.push({
          seriesIndex: l.seriesIndex,
          dataIndexInside: y,
          dataIndex: l.getData().getRawIndex(y)
        });
      }));
    }
  }), {
    payloadBatch: a,
    snapToValue: i
  };
}
function yde(e, t, r, n) {
  e[t.key] = {
    value: r,
    payloadBatch: n
  };
}
function _de(e, t, r, n) {
  var i = r.payloadBatch, a = t.axis, o = a.model, s = t.axisPointerModel;
  if (!(!t.triggerTooltip || !i.length)) {
    var l = t.coordSys.model, u = Q1(l), f = e.map[u];
    f || (f = e.map[u] = {
      coordSysId: l.id,
      coordSysIndex: l.componentIndex,
      coordSysType: l.type,
      coordSysMainType: l.mainType,
      dataByAxis: []
    }, e.list.push(f)), f.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 xde(e, t, r) {
  var n = r.axesInfo = [];
  F(t, function(i, a) {
    var o = i.axisPointerModel.option, s = e[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 Sde(e, t, r, n) {
  if (L2(t) || !e.list.length) {
    n({
      type: "hideTip"
    });
    return;
  }
  var i = ((e.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {};
  n({
    type: "showTip",
    escapeConnect: !0,
    x: t[0],
    y: t[1],
    tooltipOption: r.tooltipOption,
    position: r.position,
    dataIndexInside: i.dataIndexInside,
    dataIndex: i.dataIndex,
    seriesIndex: i.seriesIndex,
    dataByCoordSys: e.list
  });
}
function wde(e, t, r) {
  var n = r.getZr(), i = "axisPointerLastHighlights", a = hF(n)[i] || {}, o = hF(n)[i] = {};
  F(e, function(u, f) {
    var c = u.axisPointerModel.option;
    c.status === "show" && u.triggerEmphasis && F(c.seriesDataIndices, function(h) {
      var v = h.seriesIndex + " | " + h.dataIndex;
      o[v] = h;
    });
  });
  var s = [], l = [];
  F(a, function(u, f) {
    !o[f] && l.push(u);
  }), F(o, function(u, f) {
    !a[f] && s.push(u);
  }), l.length && r.dispatchAction({
    type: "downplay",
    escapeConnect: !0,
    // Not blur others when highlight in axisPointer.
    notBlur: !0,
    batch: l
  }), s.length && r.dispatchAction({
    type: "highlight",
    escapeConnect: !0,
    // Not blur others when highlight in axisPointer.
    notBlur: !0,
    batch: s
  });
}
function Tde(e, t) {
  for (var r = 0; r < (e || []).length; r++) {
    var n = e[r];
    if (t.axis.dim === n.axisDim && t.axis.model.componentIndex === n.axisIndex)
      return n;
  }
}
function dF(e) {
  var t = e.axis.model, r = {}, n = r.axisDim = e.axis.dim;
  return r.axisIndex = r[n + "AxisIndex"] = t.componentIndex, r.axisName = r[n + "AxisName"] = t.name, r.axisId = r[n + "AxisId"] = t.id, r;
}
function L2(e) {
  return !e || e[0] == null || isNaN(e[0]) || e[1] == null || isNaN(e[1]);
}
function Gx(e) {
  Gd.registerAxisPointerClass("CartesianAxisPointer", sde), e.registerComponentModel(ude), e.registerComponentView(pde), e.registerPreprocessor(function(t) {
    if (t) {
      (!t.axisPointer || t.axisPointer.length === 0) && (t.axisPointer = {});
      var r = t.axisPointer.link;
      r && !Se(r) && (t.axisPointer.link = [r]);
    }
  }), e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC, function(t, r) {
    t.getComponent("axisPointer").coordSysAxesInfo = Ase(t, r);
  }), e.registerAction({
    type: "updateAxisPointer",
    event: "updateAxisPointer",
    update: ":updateAxisPointer"
  }, gde);
}
function bde(e) {
  ft($9), ft(Gx);
}
var Cde = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      return e !== null && e.apply(this, arguments) || this;
    }
    return t.prototype.makeElOption = function(r, n, i, a, o) {
      var s = i.axis;
      s.dim === "angle" && (this.animationThreshold = Math.PI / 18);
      var l = s.polar, u = l.getOtherAxis(s), f = u.getExtent(), c = s.dataToCoord(n), h = a.get("type");
      if (h && h !== "none") {
        var v = TN(a), d = Mde[h](s, l, c, f);
        d.style = v, r.graphicKey = d.type, r.pointer = d;
      }
      var g = a.get(["label", "margin"]), y = Ade(n, i, a, l, g);
      xX(r, i, a, o, y);
    }, t;
  })(wN)
);
function Ade(e, t, r, n, i) {
  var a = t.axis, o = a.dataToCoord(e), s = n.getAngleAxis().getExtent()[0];
  s = s / 180 * Math.PI;
  var l = n.getRadiusAxis().getExtent(), u, f, c;
  if (a.dim === "radius") {
    var h = ii();
    Tf(h, h, s), Zs(h, h, [n.cx, n.cy]), u = Ws([o, -i], h);
    var v = t.getModel("axisLabel").get("rotate") || 0, d = xa.innerTextLayout(s, v * Math.PI / 180, -1);
    f = d.textAlign, c = d.textVerticalAlign;
  } else {
    var g = l[1];
    u = n.coordToPoint([g + i, o]);
    var y = n.cx, x = n.cy;
    f = Math.abs(u[0] - y) / g < 0.3 ? "center" : u[0] > y ? "left" : "right", c = Math.abs(u[1] - x) / g < 0.3 ? "middle" : u[1] > x ? "top" : "bottom";
  }
  return {
    position: u,
    align: f,
    verticalAlign: c
  };
}
var Mde = {
  line: function(e, t, r, n) {
    return e.dim === "angle" ? {
      type: "Line",
      shape: CN(t.coordToPoint([n[0], r]), t.coordToPoint([n[1], r]))
    } : {
      type: "Circle",
      shape: {
        cx: t.cx,
        cy: t.cy,
        r
      }
    };
  },
  shadow: function(e, t, r, n) {
    var i = Math.max(1, e.getBandWidth()), a = Math.PI / 180;
    return e.dim === "angle" ? {
      type: "Sector",
      shape: lF(
        t.cx,
        t.cy,
        n[0],
        n[1],
        // In ECharts y is negative if angle is positive
        (-r - i / 2) * a,
        (-r + i / 2) * a
      )
    } : {
      type: "Sector",
      shape: lF(t.cx, t.cy, r - i / 2, r + i / 2, 0, Math.PI * 2)
    };
  }
}, Lde = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.findAxisModel = function(r) {
      var n, i = this.ecModel;
      return i.eachComponent(r, 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;
  })(At)
), AN = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      return e !== null && e.apply(this, arguments) || this;
    }
    return t.prototype.getCoordSysModel = function() {
      return this.getReferringComponents("polar", an).models[0];
    }, t.type = "polarAxis", t;
  })(At)
);
cn(AN, uy);
var Dde = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.type = "angleAxis", t;
  })(AN)
), Ede = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.type = "radiusAxis", t;
  })(AN)
), MN = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r, n) {
      return e.call(this, "radius", r, n) || this;
    }
    return t.prototype.pointToData = function(r, n) {
      return this.polar.pointToData(r, n)[this.dim === "radius" ? 0 : 1];
    }, t;
  })(ra)
);
MN.prototype.dataToRadius = ra.prototype.dataToCoord;
MN.prototype.radiusToData = ra.prototype.coordToData;
var Pde = Bt(), LN = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r, n) {
      return e.call(this, "angle", r, n || [0, 360]) || this;
    }
    return t.prototype.pointToData = function(r, n) {
      return this.polar.pointToData(r, n)[this.dim === "radius" ? 0 : 1];
    }, t.prototype.calculateCategoryInterval = function() {
      var r = this, n = r.getLabelModel(), i = r.scale, a = i.getExtent(), o = i.count();
      if (a[1] - a[0] < 1)
        return 0;
      var s = a[0], l = r.dataToCoord(s + 1) - r.dataToCoord(s), u = Math.abs(l), f = pC(s == null ? "" : s + "", n.getFont(), "center", "top"), c = Math.max(f.height, 7), h = c / u;
      isNaN(h) && (h = 1 / 0);
      var v = Math.max(0, Math.floor(h)), d = Pde(r.model), g = d.lastAutoInterval, y = d.lastTickCount;
      return g != null && y != null && Math.abs(g - v) <= 1 && Math.abs(y - o) <= 1 && g > v ? v = g : (d.lastTickCount = o, d.lastAutoInterval = v), v;
    }, t;
  })(ra)
);
LN.prototype.dataToAngle = ra.prototype.dataToCoord;
LN.prototype.angleToData = ra.prototype.coordToData;
var AX = ["radius", "angle"], Ide = (
  /** @class */
  (function() {
    function e(t) {
      this.dimensions = AX, this.type = "polar", this.cx = 0, this.cy = 0, this._radiusAxis = new MN(), this._angleAxis = new LN(), this.axisPointerEnabled = !0, this.name = t || "", this._radiusAxis.polar = this._angleAxis.polar = this;
    }
    return e.prototype.containPoint = function(t) {
      var r = this.pointToCoord(t);
      return this._radiusAxis.contain(r[0]) && this._angleAxis.contain(r[1]);
    }, e.prototype.containData = function(t) {
      return this._radiusAxis.containData(t[0]) && this._angleAxis.containData(t[1]);
    }, e.prototype.getAxis = function(t) {
      var r = "_" + t + "Axis";
      return this[r];
    }, e.prototype.getAxes = function() {
      return [this._radiusAxis, this._angleAxis];
    }, e.prototype.getAxesByScale = function(t) {
      var r = [], n = this._angleAxis, i = this._radiusAxis;
      return n.scale.type === t && r.push(n), i.scale.type === t && r.push(i), r;
    }, e.prototype.getAngleAxis = function() {
      return this._angleAxis;
    }, e.prototype.getRadiusAxis = function() {
      return this._radiusAxis;
    }, e.prototype.getOtherAxis = function(t) {
      var r = this._angleAxis;
      return t === r ? this._radiusAxis : r;
    }, e.prototype.getBaseAxis = function() {
      return this.getAxesByScale("ordinal")[0] || this.getAxesByScale("time")[0] || this.getAngleAxis();
    }, e.prototype.getTooltipAxes = function(t) {
      var r = t != null && t !== "auto" ? this.getAxis(t) : this.getBaseAxis();
      return {
        baseAxes: [r],
        otherAxes: [this.getOtherAxis(r)]
      };
    }, e.prototype.dataToPoint = function(t, r, n) {
      return this.coordToPoint([this._radiusAxis.dataToRadius(t[0], r), this._angleAxis.dataToAngle(t[1], r)], n);
    }, e.prototype.pointToData = function(t, r, n) {
      n = n || [];
      var i = this.pointToCoord(t);
      return n[0] = this._radiusAxis.radiusToData(i[0], r), n[1] = this._angleAxis.angleToData(i[1], r), n;
    }, e.prototype.pointToCoord = function(t) {
      var r = 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(r * r + n * n);
      r /= l, n /= l;
      for (var u = Math.atan2(-n, r) / Math.PI * 180, f = u < o ? 1 : -1; u < o || u > s; )
        u += f * 360;
      return [l, u];
    }, e.prototype.coordToPoint = function(t, r) {
      r = r || [];
      var n = t[0], i = t[1] / 180 * Math.PI;
      return r[0] = Math.cos(i) * n + this.cx, r[1] = -Math.sin(i) * n + this.cy, r;
    }, e.prototype.getArea = function() {
      var t = this.getAngleAxis(), r = this.getRadiusAxis(), n = r.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, f = l - this.cy, c = u * u + f * f, h = this.r, v = this.r0;
          return h !== v && c - o <= h * h && c + o >= v * v;
        },
        // As the bounding box
        x: this.cx - n[1],
        y: this.cy - n[1],
        width: n[1] * 2,
        height: n[1] * 2
      };
    }, e.prototype.convertToPixel = function(t, r, n) {
      var i = pF(r);
      return i === this ? this.dataToPoint(n) : null;
    }, e.prototype.convertFromPixel = function(t, r, n) {
      var i = pF(r);
      return i === this ? this.pointToData(n) : null;
    }, e;
  })()
);
function pF(e) {
  var t = e.seriesModel, r = e.polarModel;
  return r && r.coordinateSystem || t && t.coordinateSystem;
}
function Rde(e, t, r) {
  var n = t.get("center"), i = Yn(t, r).refContainer;
  e.cx = Be(n[0], i.width) + i.x, e.cy = Be(n[1], i.height) + i.y;
  var a = e.getRadiusAxis(), o = Math.min(i.width, i.height) / 2, s = t.get("radius");
  s == null ? s = [0, "100%"] : Se(s) || (s = [0, s]);
  var l = [Be(s[0], o), Be(s[1], o)];
  a.inverse ? a.setExtent(l[1], l[0]) : a.setExtent(l[0], l[1]);
}
function Ode(e, t) {
  var r = this, n = r.getAngleAxis(), i = r.getRadiusAxis();
  if (n.scale.setExtent(1 / 0, -1 / 0), i.scale.setExtent(1 / 0, -1 / 0), e.eachSeries(function(s) {
    if (s.coordinateSystem === r) {
      var l = s.getData();
      F(mb(l, "radius"), function(u) {
        i.scale.unionExtentFromData(l, u);
      }), F(mb(l, "angle"), function(u) {
        n.scale.unionExtentFromData(l, u);
      });
    }
  }), Md(n.scale, n.model), Md(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 Nde(e) {
  return e.mainType === "angleAxis";
}
function gF(e, t) {
  var r;
  if (e.type = t.get("type"), e.scale = Ox(t), e.onBand = t.get("boundaryGap") && e.type === "category", e.inverse = t.get("inverse"), Nde(t)) {
    e.inverse = e.inverse !== t.get("clockwise");
    var n = t.get("startAngle"), i = (r = t.get("endAngle")) !== null && r !== void 0 ? r : n + (e.inverse ? -360 : 360);
    e.setExtent(n, i);
  }
  t.axis = e, e.model = t;
}
var kde = {
  dimensions: AX,
  create: function(e, t) {
    var r = [];
    return e.eachComponent("polar", function(n, i) {
      var a = new Ide(i + "");
      a.update = Ode;
      var o = a.getRadiusAxis(), s = a.getAngleAxis(), l = n.findAxisModel("radiusAxis"), u = n.findAxisModel("angleAxis");
      gF(o, l), gF(s, u), Rde(a, n, t), r.push(a), n.coordinateSystem = a, a.model = n;
    }), e.eachSeries(function(n) {
      if (n.get("coordinateSystem") === "polar") {
        var i = n.getReferringComponents("polar", an).models[0];
        n.coordinateSystem = i.coordinateSystem;
      }
    }), r;
  }
}, Bde = ["axisLine", "axisLabel", "axisTick", "minorTick", "splitLine", "minorSplitLine", "splitArea"];
function AT(e, t, r) {
  t[1] > t[0] && (t = t.slice().reverse());
  var n = e.coordToPoint([t[0], r]), i = e.coordToPoint([t[1], r]);
  return {
    x1: n[0],
    y1: n[1],
    x2: i[0],
    y2: i[1]
  };
}
function MT(e) {
  var t = e.getRadiusAxis();
  return t.inverse ? 0 : 1;
}
function mF(e) {
  var t = e[0], r = e[e.length - 1];
  t && r && Math.abs(Math.abs(t.coord - r.coord) - 360) < 1e-4 && e.pop();
}
var zde = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.axisPointerClass = "PolarAxisPointer", r;
    }
    return t.prototype.render = function(r, n) {
      if (this.group.removeAll(), !!r.get("show")) {
        var i = r.axis, a = i.polar, o = a.getRadiusAxis().getExtent(), s = i.getTicksCoords({
          breakTicks: "none"
        }), l = i.getMinorTicksCoords(), u = Ce(i.getViewLabels(), function(f) {
          f = it(f);
          var c = i.scale, h = c.type === "ordinal" ? c.getRawOrdinalNumber(f.tickValue) : f.tickValue;
          return f.coord = i.dataToCoord(h), f;
        });
        mF(u), mF(s), F(Bde, function(f) {
          r.get([f, "show"]) && (!i.scale.isBlank() || f === "axisLine") && Fde[f](this.group, r, a, s, l, o, u);
        }, this);
      }
    }, t.type = "angleAxis", t;
  })(Gd)
), Fde = {
  axisLine: function(e, t, r, n, i, a) {
    var o = t.getModel(["axisLine", "lineStyle"]), s = r.getAngleAxis(), l = Math.PI / 180, u = s.getExtent(), f = MT(r), c = f ? 0 : 1, h, v = Math.abs(u[1] - u[0]) === 360 ? "Circle" : "Arc";
    a[c] === 0 ? h = new kd[v]({
      shape: {
        cx: r.cx,
        cy: r.cy,
        r: a[f],
        startAngle: -u[0] * l,
        endAngle: -u[1] * l,
        clockwise: s.inverse
      },
      style: o.getLineStyle(),
      z2: 1,
      silent: !0
    }) : h = new qm({
      shape: {
        cx: r.cx,
        cy: r.cy,
        r: a[f],
        r0: a[c]
      },
      style: o.getLineStyle(),
      z2: 1,
      silent: !0
    }), h.style.fill = null, e.add(h);
  },
  axisTick: function(e, t, r, n, i, a) {
    var o = t.getModel("axisTick"), s = (o.get("inside") ? -1 : 1) * o.get("length"), l = a[MT(r)], u = Ce(n, function(f) {
      return new wn({
        shape: AT(r, [l, l + s], f.coord)
      });
    });
    e.add(yo(u, {
      style: tt(o.getModel("lineStyle").getLineStyle(), {
        stroke: t.get(["axisLine", "lineStyle", "color"])
      })
    }));
  },
  minorTick: function(e, t, r, 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[MT(r)], f = [], c = 0; c < i.length; c++)
        for (var h = 0; h < i[c].length; h++)
          f.push(new wn({
            shape: AT(r, [u, u + l], i[c][h].coord)
          }));
      e.add(yo(f, {
        style: tt(s.getModel("lineStyle").getLineStyle(), tt(o.getLineStyle(), {
          stroke: t.get(["axisLine", "lineStyle", "color"])
        }))
      }));
    }
  },
  axisLabel: function(e, t, r, n, i, a, o) {
    var s = t.getCategories(!0), l = t.getModel("axisLabel"), u = l.get("margin"), f = t.get("triggerEvent");
    F(o, function(c, h) {
      var v = l, d = c.tickValue, g = a[MT(r)], y = r.coordToPoint([g + u, c.coord]), x = r.cx, S = r.cy, T = Math.abs(y[0] - x) / g < 0.3 ? "center" : y[0] > x ? "left" : "right", C = Math.abs(y[1] - S) / g < 0.3 ? "middle" : y[1] > S ? "top" : "bottom";
      if (s && s[d]) {
        var A = s[d];
        ot(A) && A.textStyle && (v = new It(A.textStyle, l, l.ecModel));
      }
      var M = new Rt({
        silent: xa.isLabelSilent(t),
        style: gr(v, {
          x: y[0],
          y: y[1],
          fill: v.getTextColor() || t.get(["axisLine", "lineStyle", "color"]),
          text: c.formattedLabel,
          align: T,
          verticalAlign: C
        })
      });
      if (e.add(M), Cf({
        el: M,
        componentModel: t,
        itemName: c.formattedLabel,
        formatterParamsExtra: {
          isTruncated: function() {
            return M.isTruncated;
          },
          value: c.rawLabel,
          tickIndex: h
        }
      }), f) {
        var E = xa.makeAxisEventDataBase(t);
        E.targetType = "axisLabel", E.value = c.rawLabel, pt(M).eventData = E;
      }
    }, this);
  },
  splitLine: function(e, t, r, 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 f = [], c = 0; c < n.length; c++) {
      var h = u++ % l.length;
      f[h] = f[h] || [], f[h].push(new wn({
        shape: AT(r, a, n[c].coord)
      }));
    }
    for (var c = 0; c < f.length; c++)
      e.add(yo(f[c], {
        style: tt({
          stroke: l[c % l.length]
        }, s.getLineStyle()),
        silent: !0,
        z: t.get("z")
      }));
  },
  minorSplitLine: function(e, t, r, 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 f = 0; f < i[u].length; f++)
          l.push(new wn({
            shape: AT(r, a, i[u][f].coord)
          }));
      e.add(yo(l, {
        style: s.getLineStyle(),
        silent: !0,
        z: t.get("z")
      }));
    }
  },
  splitArea: function(e, t, r, 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 f = [], c = Math.PI / 180, h = -n[0].coord * c, v = Math.min(a[0], a[1]), d = Math.max(a[0], a[1]), g = t.get("clockwise"), y = 1, x = n.length; y <= x; y++) {
        var S = y === x ? n[0].coord : n[y].coord, T = u++ % l.length;
        f[T] = f[T] || [], f[T].push(new Ui({
          shape: {
            cx: r.cx,
            cy: r.cy,
            r0: v,
            r: d,
            startAngle: h,
            endAngle: -S * c,
            clockwise: g
          },
          silent: !0
        })), h = -S * c;
      }
      for (var y = 0; y < f.length; y++)
        e.add(yo(f[y], {
          style: tt({
            fill: l[y % l.length]
          }, s.getAreaStyle()),
          silent: !0
        }));
    }
  }
}, Gde = ["splitLine", "splitArea", "minorSplitLine"], Vde = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.axisPointerClass = "PolarAxisPointer", r;
    }
    return t.prototype.render = function(r, n, i) {
      if (this.group.removeAll(), !!r.get("show")) {
        var a = this._axisGroup, o = this._axisGroup = new rt();
        this.group.add(o);
        var s = r.axis, l = s.polar, u = l.getAngleAxis(), f = s.getTicksCoords(), c = s.getMinorTicksCoords(), h = u.getExtent()[0], v = s.getExtent(), d = Ude(l, r, h), g = new xa(r, i, d);
        g.build(), o.add(g.group), Lx(a, o, r), F(Gde, function(y) {
          r.get([y, "show"]) && !s.scale.isBlank() && Hde[y](this.group, r, l, h, v, f, c);
        }, this);
      }
    }, t.type = "radiusAxis", t;
  })(Gd)
), Hde = {
  splitLine: function(e, t, r, n, i, a) {
    var o = t.getModel("splitLine"), s = o.getModel("lineStyle"), l = s.get("color"), u = 0, f = r.getAngleAxis(), c = Math.PI / 180, h = f.getExtent(), v = Math.abs(h[1] - h[0]) === 360 ? "Circle" : "Arc";
    l = l instanceof Array ? l : [l];
    for (var d = [], g = 0; g < a.length; g++) {
      var y = u++ % l.length;
      d[y] = d[y] || [], d[y].push(new kd[v]({
        shape: {
          cx: r.cx,
          cy: r.cy,
          // ensure circle radius >= 0
          r: Math.max(a[g].coord, 0),
          startAngle: -h[0] * c,
          endAngle: -h[1] * c,
          clockwise: f.inverse
        }
      }));
    }
    for (var g = 0; g < d.length; g++)
      e.add(yo(d[g], {
        style: tt({
          stroke: l[g % l.length],
          fill: null
        }, s.getLineStyle()),
        silent: !0
      }));
  },
  minorSplitLine: function(e, t, r, n, i, a, o) {
    if (o.length) {
      for (var s = t.getModel("minorSplitLine"), l = s.getModel("lineStyle"), u = [], f = 0; f < o.length; f++)
        for (var c = 0; c < o[f].length; c++)
          u.push(new Qs({
            shape: {
              cx: r.cx,
              cy: r.cy,
              r: o[f][c].coord
            }
          }));
      e.add(yo(u, {
        style: tt({
          fill: null
        }, l.getLineStyle()),
        silent: !0
      }));
    }
  },
  splitArea: function(e, t, r, 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 f = [], c = a[0].coord, h = 1; h < a.length; h++) {
        var v = u++ % l.length;
        f[v] = f[v] || [], f[v].push(new Ui({
          shape: {
            cx: r.cx,
            cy: r.cy,
            r0: c,
            r: a[h].coord,
            startAngle: 0,
            endAngle: Math.PI * 2
          },
          silent: !0
        })), c = a[h].coord;
      }
      for (var h = 0; h < f.length; h++)
        e.add(yo(f[h], {
          style: tt({
            fill: l[h % l.length]
          }, s.getAreaStyle()),
          silent: !0
        }));
    }
  }
};
function Ude(e, t, r) {
  return {
    position: [e.cx, e.cy],
    rotation: r / 180 * Math.PI,
    labelDirection: -1,
    tickDirection: -1,
    nameDirection: 1,
    labelRotate: t.getModel("axisLabel").get("rotate"),
    // Over splitLine and splitArea
    z2: 1
  };
}
function MX(e) {
  return e.get("stack") || "__ec_stack_" + e.seriesIndex;
}
function LX(e, t) {
  return t.dim + e.model.componentIndex;
}
function Wde(e, t, r) {
  var n = {}, i = Xde(nr(t.getSeriesByType(e), function(a) {
    return !t.isSeriesFiltered(a) && a.coordinateSystem && a.coordinateSystem.type === "polar";
  }));
  t.eachSeriesByType(e, function(a) {
    if (a.coordinateSystem.type === "polar") {
      var o = a.getData(), s = a.coordinateSystem, l = s.getBaseAxis(), u = LX(s, l), f = MX(a), c = i[u][f], h = c.offset, v = c.width, d = s.getOtherAxis(l), g = a.coordinateSystem.cx, y = a.coordinateSystem.cy, x = a.get("barMinHeight") || 0, S = a.get("barMinAngle") || 0;
      n[f] = n[f] || [];
      for (var T = o.mapDimension(d.dim), C = o.mapDimension(l.dim), A = xf(
        o,
        T
        /* , baseDim */
      ), M = l.dim !== "radius" || !a.get("roundCap", !0), E = d.model, P = E.get("startValue"), R = d.dataToCoord(P || 0), O = 0, N = o.count(); O < N; O++) {
        var G = o.get(T, O), z = o.get(C, O), H = G >= 0 ? "p" : "n", W = R;
        A && (n[f][z] || (n[f][z] = {
          p: R,
          n: R
          // Negative stack
        }), W = n[f][z][H]);
        var Z = void 0, ee = void 0, V = void 0, Q = void 0;
        if (d.dim === "radius") {
          var q = d.dataToCoord(G) - R, X = l.dataToCoord(z);
          Math.abs(q) < x && (q = (q < 0 ? -1 : 1) * x), Z = W, ee = W + q, V = X - h, Q = V - v, A && (n[f][z][H] = ee);
        } else {
          var K = d.dataToCoord(G, M) - R, ue = l.dataToCoord(z);
          Math.abs(K) < S && (K = (K < 0 ? -1 : 1) * S), Z = ue + h, ee = Z + v, V = W, Q = W + K, A && (n[f][z][H] = Q);
        }
        o.setItemLayout(O, {
          cx: g,
          cy: y,
          r0: Z,
          r: ee,
          // Consider that positive angle is anti-clockwise,
          // while positive radian of sector is clockwise
          startAngle: -V * Math.PI / 180,
          endAngle: -Q * 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: V >= Q
        });
      }
    }
  });
}
function Xde(e) {
  var t = {};
  F(e, function(n, i) {
    var a = n.getData(), o = n.coordinateSystem, s = o.getBaseAxis(), l = LX(o, s), u = s.getExtent(), f = s.type === "category" ? s.getBandWidth() : Math.abs(u[1] - u[0]) / a.count(), c = t[l] || {
      bandWidth: f,
      remainedWidth: f,
      autoWidthCount: 0,
      categoryGap: "20%",
      gap: "30%",
      stacks: {}
    }, h = c.stacks;
    t[l] = c;
    var v = MX(n);
    h[v] || c.autoWidthCount++, h[v] = h[v] || {
      width: 0,
      maxWidth: 0
    };
    var d = Be(n.get("barWidth"), f), g = Be(n.get("barMaxWidth"), f), y = n.get("barGap"), x = n.get("barCategoryGap");
    d && !h[v].width && (d = Math.min(c.remainedWidth, d), h[v].width = d, c.remainedWidth -= d), g && (h[v].maxWidth = g), y != null && (c.gap = y), x != null && (c.categoryGap = x);
  });
  var r = {};
  return F(t, function(n, i) {
    r[i] = {};
    var a = n.stacks, o = n.bandWidth, s = Be(n.categoryGap, o), l = Be(n.gap, 1), u = n.remainedWidth, f = n.autoWidthCount, c = (u - s) / (f + (f - 1) * l);
    c = Math.max(c, 0), F(a, function(g, y) {
      var x = g.maxWidth;
      x && x < c && (x = Math.min(x, u), g.width && (x = Math.min(x, g.width)), u -= x, g.width = x, f--);
    }), c = (u - s) / (f + (f - 1) * l), c = Math.max(c, 0);
    var h = 0, v;
    F(a, function(g, y) {
      g.width || (g.width = c), v = g, h += g.width * (1 + l);
    }), v && (h -= v.width * l);
    var d = -h / 2;
    F(a, function(g, y) {
      r[i][y] = r[i][y] || {
        offset: d,
        width: g.width
      }, d += g.width * (1 + l);
    });
  }), r;
}
var Yde = {
  startAngle: 90,
  clockwise: !0,
  splitNumber: 12,
  axisLabel: {
    rotate: 0
  }
}, Zde = {
  splitNumber: 5
}, $de = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.type = "polar", t;
  })(fr)
);
function qde(e) {
  ft(Gx), Gd.registerAxisPointerClass("PolarAxisPointer", Cde), e.registerCoordinateSystem("polar", kde), e.registerComponentModel(Lde), e.registerComponentView($de), Pm(e, "angle", Dde, Yde), Pm(e, "radius", Ede, Zde), e.registerComponentView(zde), e.registerComponentView(Vde), e.registerLayout(St(Wde, "bar"));
}
function mI(e, t) {
  t = t || {};
  var r = e.coordinateSystem, n = e.axis, i = {}, a = n.position, o = n.orient, s = r.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 f = {
    horizontal: 0,
    vertical: 1
  };
  i.rotation = Math.PI / 2 * f[o];
  var c = {
    top: -1,
    bottom: 1,
    right: 1,
    left: -1
  };
  i.labelDirection = i.tickDirection = i.nameDirection = c[a], e.get(["axisTick", "inside"]) && (i.tickDirection = -i.tickDirection), Ti(t.labelInside, e.get(["axisLabel", "inside"])) && (i.labelDirection = -i.labelDirection);
  var h = e.get(["axisLabel", "rotate"]);
  return i.labelRotate = a === "top" ? -h : h, i.z2 = 1, i;
}
var jde = ["splitArea", "splitLine", "breakArea"], Kde = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.axisPointerClass = "SingleAxisPointer", r;
    }
    return t.prototype.render = function(r, n, i, a) {
      var o = this.group;
      o.removeAll();
      var s = this._axisGroup;
      this._axisGroup = new rt();
      var l = mI(r), u = new xa(r, i, l);
      u.build(), o.add(this._axisGroup), o.add(u.group), F(jde, function(f) {
        r.get([f, "show"]) && Qde[f](this, this.group, this._axisGroup, r, i);
      }, this), Lx(s, this._axisGroup, r), e.prototype.render.call(this, r, n, i, a);
    }, t.prototype.remove = function() {
      X9(this);
    }, t.type = "singleAxis", t;
  })(Gd)
), Qde = {
  splitLine: function(e, t, r, n, i) {
    var a = n.axis;
    if (!a.scale.isBlank()) {
      var o = n.getModel("splitLine"), s = o.getModel("lineStyle"), l = s.get("color");
      l = l instanceof Array ? l : [l];
      for (var u = s.get("width"), f = n.coordinateSystem.getRect(), c = a.isHorizontal(), h = [], v = 0, d = a.getTicksCoords({
        tickModel: o,
        breakTicks: "none",
        pruneByBreak: "preserve_extent_bound"
      }), g = [], y = [], x = 0; x < d.length; ++x) {
        var S = a.toGlobalCoord(d[x].coord);
        c ? (g[0] = S, g[1] = f.y, y[0] = S, y[1] = f.y + f.height) : (g[0] = f.x, g[1] = S, y[0] = f.x + f.width, y[1] = S);
        var T = new wn({
          shape: {
            x1: g[0],
            y1: g[1],
            x2: y[0],
            y2: y[1]
          },
          silent: !0
        });
        bm(T.shape, u);
        var C = v++ % l.length;
        h[C] = h[C] || [], h[C].push(T);
      }
      for (var A = s.getLineStyle(["color"]), x = 0; x < h.length; ++x)
        t.add(yo(h[x], {
          style: tt({
            stroke: l[x % l.length]
          }, A),
          silent: !0
        }));
    }
  },
  splitArea: function(e, t, r, n, i) {
    W9(e, r, n, n);
  },
  breakArea: function(e, t, r, n, i) {
    var a = Fx(), o = n.axis.scale;
    a && o.type !== "ordinal" && a.rectCoordBuildBreakAxis(t, e, n, n.coordinateSystem.getRect(), i);
  }
}, D2 = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    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
        }
      },
      jitter: 0,
      jitterOverlap: !0,
      jitterMargin: 2
    }, t;
  })(At)
);
cn(D2, uy.prototype);
var Jde = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r, n, i, a, o) {
      var s = e.call(this, r, n, i) || this;
      return s.type = a || "value", s.position = o || "bottom", s;
    }
    return t.prototype.isHorizontal = function() {
      var r = this.position;
      return r === "top" || r === "bottom";
    }, t.prototype.pointToData = function(r, n) {
      return this.coordinateSystem.pointToData(r)[0];
    }, t;
  })(ra)
), DX = ["single"], epe = (
  /** @class */
  (function() {
    function e(t, r, n) {
      this.type = "single", this.dimension = "single", this.dimensions = DX, this.axisPointerEnabled = !0, this.model = t, this._init(t, r, n);
    }
    return e.prototype._init = function(t, r, n) {
      var i = this.dimension, a = new Jde(i, Ox(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;
    }, e.prototype.update = function(t, r) {
      t.eachSeries(function(n) {
        if (n.coordinateSystem === this) {
          var i = n.getData();
          F(i.mapDimensionsAll(this.dimension), function(a) {
            this._axis.scale.unionExtentFromData(i, a);
          }, this), Md(this._axis.scale, this._axis.model);
        }
      }, this);
    }, e.prototype.resize = function(t, r) {
      var n = Yn(t, r).refContainer;
      this._rect = Tr(t.getBoxLayoutParams(), n), this._adjustAxis();
    }, e.prototype.getRect = function() {
      return this._rect;
    }, e.prototype._adjustAxis = function() {
      var t = this._rect, r = this._axis, n = r.isHorizontal(), i = n ? [0, t.width] : [0, t.height], a = r.inverse ? 1 : 0;
      r.setExtent(i[a], i[1 - a]), this._updateAxisTransform(r, n ? t.x : t.y);
    }, e.prototype._updateAxisTransform = function(t, r) {
      var n = t.getExtent(), i = n[0] + n[1], a = t.isHorizontal();
      t.toGlobalCoord = a ? function(o) {
        return o + r;
      } : function(o) {
        return i - o + r;
      }, t.toLocalCoord = a ? function(o) {
        return o - r;
      } : function(o) {
        return i - o + r;
      };
    }, e.prototype.getAxis = function() {
      return this._axis;
    }, e.prototype.getBaseAxis = function() {
      return this._axis;
    }, e.prototype.getAxes = function() {
      return [this._axis];
    }, e.prototype.getTooltipAxes = function() {
      return {
        baseAxes: [this.getAxis()],
        // Empty otherAxes
        otherAxes: []
      };
    }, e.prototype.containPoint = function(t) {
      var r = this.getRect(), n = this.getAxis(), i = n.orient;
      return i === "horizontal" ? n.contain(n.toLocalCoord(t[0])) && t[1] >= r.y && t[1] <= r.y + r.height : n.contain(n.toLocalCoord(t[1])) && t[0] >= r.y && t[0] <= r.y + r.height;
    }, e.prototype.pointToData = function(t, r, n) {
      n = n || [];
      var i = this.getAxis();
      return n[0] = i.coordToData(i.toLocalCoord(t[i.orient === "horizontal" ? 0 : 1])), n;
    }, e.prototype.dataToPoint = function(t, r, n) {
      var i = this.getAxis(), a = this.getRect();
      n = n || [];
      var o = i.orient === "horizontal" ? 0 : 1;
      return t instanceof Array && (t = t[0]), n[o] = i.toGlobalCoord(i.dataToCoord(+t)), n[1 - o] = o === 0 ? a.y + a.height / 2 : a.x + a.width / 2, n;
    }, e.prototype.convertToPixel = function(t, r, n) {
      var i = yF(r);
      return i === this ? this.dataToPoint(n) : null;
    }, e.prototype.convertFromPixel = function(t, r, n) {
      var i = yF(r);
      return i === this ? this.pointToData(n) : null;
    }, e;
  })()
);
function yF(e) {
  var t = e.seriesModel, r = e.singleAxisModel;
  return r && r.coordinateSystem || t && t.coordinateSystem;
}
function tpe(e, t) {
  var r = [];
  return e.eachComponent("singleAxis", function(n, i) {
    var a = new epe(n, e, t);
    a.name = "single_" + i, a.resize(n, t), n.coordinateSystem = a, r.push(a);
  }), e.eachSeries(function(n) {
    if (n.get("coordinateSystem") === "singleAxis") {
      var i = n.getReferringComponents("singleAxis", an).models[0];
      n.coordinateSystem = i && i.coordinateSystem;
    }
  }), r;
}
var rpe = {
  create: tpe,
  dimensions: DX
}, _F = ["x", "y"], npe = ["width", "height"], ipe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      return e !== null && e.apply(this, arguments) || this;
    }
    return t.prototype.makeElOption = function(r, n, i, a, o) {
      var s = i.axis, l = s.coordinateSystem, u = SD(l, 1 - kb(s)), f = l.dataToPoint(n)[0], c = a.get("type");
      if (c && c !== "none") {
        var h = TN(a), v = ape[c](s, f, u);
        v.style = h, r.graphicKey = v.type, r.pointer = v;
      }
      var d = mI(i);
      wX(n, r, d, i, a, o);
    }, t.prototype.getHandleTransform = function(r, n, i) {
      var a = mI(n, {
        labelInside: !1
      });
      a.labelMargin = i.get(["handle", "margin"]);
      var o = bN(n.axis, r, a);
      return {
        x: o[0],
        y: o[1],
        rotation: a.rotation + (a.labelDirection < 0 ? Math.PI : 0)
      };
    }, t.prototype.updateHandleTransform = function(r, n, i, a) {
      var o = i.axis, s = o.coordinateSystem, l = kb(o), u = SD(s, l), f = [r.x, r.y];
      f[l] += n[l], f[l] = Math.min(u[1], f[l]), f[l] = Math.max(u[0], f[l]);
      var c = SD(s, 1 - l), h = (c[1] + c[0]) / 2, v = [h, h];
      return v[l] = f[l], {
        x: f[0],
        y: f[1],
        rotation: r.rotation,
        cursorPoint: v,
        tooltipOption: {
          verticalAlign: "middle"
        }
      };
    }, t;
  })(wN)
), ape = {
  line: function(e, t, r) {
    var n = CN([t, r[0]], [t, r[1]], kb(e));
    return {
      type: "Line",
      subPixelOptimize: !0,
      shape: n
    };
  },
  shadow: function(e, t, r) {
    var n = e.getBandWidth(), i = r[1] - r[0];
    return {
      type: "Rect",
      shape: TX([t - n / 2, r[0]], [n, i], kb(e))
    };
  }
};
function kb(e) {
  return e.isHorizontal() ? 0 : 1;
}
function SD(e, t) {
  var r = e.getRect();
  return [r[_F[t]], r[_F[t]] + r[npe[t]]];
}
var ope = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.type = "single", t;
  })(fr)
);
function spe(e) {
  ft(Gx), Gd.registerAxisPointerClass("SingleAxisPointer", ipe), e.registerComponentView(ope), e.registerComponentView(Kde), e.registerComponentModel(D2), Pm(e, "single", D2, D2.defaultOption), e.registerCoordinateSystem("single", rpe);
}
var lpe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.init = function(r, n, i) {
      var a = Bd(r);
      e.prototype.init.apply(this, arguments), xF(r, a);
    }, t.prototype.mergeOption = function(r) {
      e.prototype.mergeOption.apply(this, arguments), xF(this.option, r);
    }, t.prototype.getCellSize = function() {
      return this.option.cellSize;
    }, t.type = "calendar", t.layoutMode = "box", t.defaultOption = {
      // zlevel: 0,
      // TODO: theoretically, the z of the calendar should be lower
      // than series, but we don't want the series to be displayed
      // on top of the borders like month split line. To align with
      // the effect of previous versions, we set the z to 2 for now
      // until better solution is found.
      z: 2,
      left: 80,
      top: 60,
      cellSize: 20,
      // horizontal vertical
      orient: "horizontal",
      // month separate line style
      splitLine: {
        show: !0,
        lineStyle: {
          color: fe.color.axisLine,
          width: 1,
          type: "solid"
        }
      },
      // rect style  temporarily unused emphasis
      itemStyle: {
        color: fe.color.neutral00,
        borderWidth: 1,
        borderColor: fe.color.neutral10
      },
      // week text style
      dayLabel: {
        show: !0,
        firstDay: 0,
        // start end
        position: "start",
        margin: fe.size.s,
        color: fe.color.secondary
      },
      // month text style
      monthLabel: {
        show: !0,
        // start end
        position: "start",
        margin: fe.size.s,
        // center or left
        align: "center",
        formatter: null,
        color: fe.color.secondary
      },
      // year text style
      yearLabel: {
        show: !0,
        // top bottom left right
        position: null,
        margin: fe.size.xl,
        formatter: null,
        color: fe.color.quaternary,
        fontFamily: "sans-serif",
        fontWeight: "bolder",
        fontSize: 20
      }
    }, t;
  })(At)
);
function xF(e, t) {
  var r = e.cellSize, n;
  Se(r) ? n = r : n = e.cellSize = [r, r], n.length === 1 && (n[1] = n[0]);
  var i = Ce([0, 1], function(a) {
    return Xee(t, a) && (n[a] = "auto"), n[a] != null && n[a] !== "auto";
  });
  nu(e, t, {
    type: "box",
    ignoreSize: i
  });
}
var upe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.render = function(r, n, i) {
      var a = this.group;
      a.removeAll();
      var o = r.coordinateSystem, s = o.getRangeInfo(), l = o.getOrient(), u = n.getLocaleModel();
      this._renderDayRect(r, s, a), this._renderLines(r, s, l, a), this._renderYearText(r, s, l, a), this._renderMonthText(r, u, l, a), this._renderWeekText(r, u, s, l, a);
    }, t.prototype._renderDayRect = function(r, n, i) {
      for (var a = r.coordinateSystem, o = r.getModel("itemStyle").getItemStyle(), s = a.getCellWidth(), l = a.getCellHeight(), u = n.start.time; u <= n.end.time; u = a.getNextNDay(u, 1).time) {
        var f = a.dataToCalendarLayout([u], !1).tl, c = new Mt({
          shape: {
            x: f[0],
            y: f[1],
            width: s,
            height: l
          },
          cursor: "default",
          style: o
        });
        i.add(c);
      }
    }, t.prototype._renderLines = function(r, n, i, a) {
      var o = this, s = r.coordinateSystem, l = r.getModel(["splitLine", "lineStyle"]).getLineStyle(), u = r.get(["splitLine", "show"]), f = l.lineWidth;
      this._tlpoints = [], this._blpoints = [], this._firstDayOfMonth = [], this._firstDayPoints = [];
      for (var c = n.start, h = 0; c.time <= n.end.time; h++) {
        d(c.formatedDate), h === 0 && (c = s.getDateInfo(n.start.y + "-" + n.start.m));
        var v = c.date;
        v.setMonth(v.getMonth() + 1), c = s.getDateInfo(v);
      }
      d(s.getNextNDay(n.end.time, 1).formatedDate);
      function d(g) {
        o._firstDayOfMonth.push(s.getDateInfo(g)), o._firstDayPoints.push(s.dataToCalendarLayout([g], !1).tl);
        var y = o._getLinePointsOfOneWeek(r, g, i);
        o._tlpoints.push(y[0]), o._blpoints.push(y[y.length - 1]), u && o._drawSplitline(y, l, a);
      }
      u && this._drawSplitline(o._getEdgesPoints(o._tlpoints, f, i), l, a), u && this._drawSplitline(o._getEdgesPoints(o._blpoints, f, i), l, a);
    }, t.prototype._getEdgesPoints = function(r, n, i) {
      var a = [r[0].slice(), r[r.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(r, n, i) {
      var a = new Ci({
        z2: 20,
        shape: {
          points: r
        },
        style: n
      });
      i.add(a);
    }, t.prototype._getLinePointsOfOneWeek = function(r, n, i) {
      for (var a = r.coordinateSystem, o = a.getDateInfo(n), s = [], l = 0; l < 7; l++) {
        var u = a.getNextNDay(o.time, l), f = a.dataToCalendarLayout([u.time], !1);
        s[2 * u.day] = f.tl, s[2 * u.day + 1] = f[i === "horizontal" ? "bl" : "tr"];
      }
      return s;
    }, t.prototype._formatterLabel = function(r, n) {
      return Fe(r) && r ? Gee(r, n) : nt(r) ? r(n) : n.nameMap;
    }, t.prototype._yearTextPositionControl = function(r, 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 f = 0;
      return (a === "left" || a === "right") && (f = Math.PI / 2), {
        rotation: f,
        x: s,
        y: l,
        style: {
          align: u[0],
          verticalAlign: u[1]
        }
      };
    }, t.prototype._renderYearText = function(r, n, i, a) {
      var o = r.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]], f = (u[0][0] + u[1][0]) / 2, c = (u[0][1] + u[1][1]) / 2, h = i === "horizontal" ? 0 : 1, v = {
          top: [f, u[h][1]],
          bottom: [f, u[1 - h][1]],
          left: [u[1 - h][0], c],
          right: [u[h][0], c]
        }, d = n.start.y;
        +n.end.y > +n.start.y && (d = d + "-" + n.end.y);
        var g = o.get("formatter"), y = {
          start: n.start.y,
          end: n.end.y,
          nameMap: d
        }, x = this._formatterLabel(g, y), S = new Rt({
          z2: 30,
          style: gr(o, {
            text: x
          }),
          silent: o.get("silent")
        });
        S.attr(this._yearTextPositionControl(S, v[l], i, l, s)), a.add(S);
      }
    }, t.prototype._monthTextPositionControl = function(r, n, i, a, o) {
      var s = "left", l = "top", u = r[0], f = r[1];
      return i === "horizontal" ? (f = f + o, n && (s = "center"), a === "start" && (l = "bottom")) : (u = u + o, n && (l = "middle"), a === "start" && (s = "right")), {
        x: u,
        y: f,
        align: s,
        verticalAlign: l
      };
    }, t.prototype._renderMonthText = function(r, n, i, a) {
      var o = r.getModel("monthLabel");
      if (o.get("show")) {
        var s = o.get("nameMap"), l = o.get("margin"), u = o.get("position"), f = o.get("align"), c = [this._tlpoints, this._blpoints];
        (!s || Fe(s)) && (s && (n = vP(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 = f === "center", g = o.get("silent"), y = 0; y < c[h].length - 1; y++) {
          var x = c[h][y].slice(), S = this._firstDayOfMonth[y];
          if (d) {
            var T = this._firstDayPoints[y];
            x[v] = (T[v] + c[0][y + 1][v]) / 2;
          }
          var C = o.get("formatter"), A = s[+S.m - 1], M = {
            yyyy: S.y,
            yy: (S.y + "").slice(2),
            MM: S.m,
            M: +S.m,
            nameMap: A
          }, E = this._formatterLabel(C, M), P = new Rt({
            z2: 30,
            style: xe(gr(o, {
              text: E
            }), this._monthTextPositionControl(x, d, i, u, l)),
            silent: g
          });
          a.add(P);
        }
      }
    }, t.prototype._weekTextPositionControl = function(r, n, i, a, o) {
      var s = "center", l = "middle", u = r[0], f = r[1], c = i === "start";
      return n === "horizontal" ? (u = u + a + (c ? 1 : -1) * o[0] / 2, s = c ? "right" : "left") : (f = f + a + (c ? 1 : -1) * o[1] / 2, l = c ? "bottom" : "top"), {
        x: u,
        y: f,
        align: s,
        verticalAlign: l
      };
    }, t.prototype._renderWeekText = function(r, n, i, a, o) {
      var s = r.getModel("dayLabel");
      if (s.get("show")) {
        var l = r.coordinateSystem, u = s.get("position"), f = s.get("nameMap"), c = s.get("margin"), h = l.getFirstDayOfWeek();
        if (!f || Fe(f)) {
          f && (n = vP(f) || n);
          var v = n.get(["time", "dayOfWeekShort"]);
          f = v || Ce(n.get(["time", "dayOfWeekAbbr"]), function(M) {
            return M[0];
          });
        }
        var d = l.getNextNDay(i.end.time, 7 - i.lweek).time, g = [l.getCellWidth(), l.getCellHeight()];
        c = Be(c, Math.min(g[1], g[0])), u === "start" && (d = l.getNextNDay(i.start.time, -(7 + i.fweek)).time, c = -c);
        for (var y = s.get("silent"), x = 0; x < 7; x++) {
          var S = l.getNextNDay(d, x), T = l.dataToCalendarLayout([S.time], !1).center, C = x;
          C = Math.abs((x + h) % 7);
          var A = new Rt({
            z2: 30,
            style: xe(gr(s, {
              text: f[C]
            }), this._weekTextPositionControl(T, a, u, c, g)),
            silent: y
          });
          o.add(A);
        }
      }
    }, t.type = "calendar", t;
  })(fr)
), wD = 864e5, fpe = (
  /** @class */
  (function() {
    function e(t, r, n) {
      this.type = "calendar", this.dimensions = e.dimensions, this.getDimensionsInfo = e.getDimensionsInfo, this._model = t, this._update(r, n);
    }
    return e.getDimensionsInfo = function() {
      return [{
        name: "time",
        type: "time"
      }, "value"];
    }, e.prototype.getRangeInfo = function() {
      return this._rangeInfo;
    }, e.prototype.getModel = function() {
      return this._model;
    }, e.prototype.getRect = function() {
      return this._rect;
    }, e.prototype.getCellWidth = function() {
      return this._sw;
    }, e.prototype.getCellHeight = function() {
      return this._sh;
    }, e.prototype.getOrient = function() {
      return this._orient;
    }, e.prototype.getFirstDayOfWeek = function() {
      return this._firstDayOfWeek;
    }, e.prototype.getDateInfo = function(t) {
      t = Ks(t);
      var r = 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: r + "",
        m: i,
        d: o,
        day: s,
        time: t.getTime(),
        formatedDate: r + "-" + i + "-" + o,
        date: t
      };
    }, e.prototype.getNextNDay = function(t, r) {
      return r = r || 0, r === 0 ? this.getDateInfo(t) : (t = new Date(this.getDateInfo(t).time), t.setDate(t.getDate() + r), this.getDateInfo(t));
    }, e.prototype._update = function(t, r) {
      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];
      F([0, 1], function(c) {
        f(a, c) && (o[i[c]] = a[c] * s[c]);
      });
      var l = {
        width: r.getWidth(),
        height: r.getHeight()
      }, u = this._rect = Tr(o, l);
      F([0, 1], function(c) {
        f(a, c) || (a[c] = u[i[c]] / s[c]);
      });
      function f(c, h) {
        return c[h] != null && c[h] !== "auto";
      }
      this._sw = a[0], this._sh = a[1];
    }, e.prototype.dataToPoint = function(t, r, n) {
      n = n || [], Se(t) && (t = t[0]), r == null && (r = !0);
      var i = this.getDateInfo(t), a = this._rangeInfo, o = i.formatedDate;
      if (r && !(i.time >= a.start.time && i.time < a.end.time + wD))
        return n[0] = n[1] = NaN, n;
      var s = i.day, l = this._getRangeInfo([a.start.time, o]).nthWeek;
      return this._orient === "vertical" ? (n[0] = this._rect.x + s * this._sw + this._sw / 2, n[1] = this._rect.y + l * this._sh + this._sh / 2) : (n[0] = this._rect.x + l * this._sw + this._sw / 2, n[1] = this._rect.y + s * this._sh + this._sh / 2), n;
    }, e.prototype.pointToData = function(t) {
      var r = this.pointToDate(t);
      return r && r.time;
    }, e.prototype.dataToLayout = function(t, r, n) {
      n = n || {};
      var i = n.rect = n.rect || {}, a = n.contentRect = n.contentRect || {}, o = this.dataToPoint(t, r);
      return i.x = o[0] - this._sw / 2, i.y = o[1] - this._sh / 2, i.width = this._sw, i.height = this._sh, st.copy(a, i), bd(a, this._lineWidth / 2, !0, !0), n;
    }, e.prototype.dataToCalendarLayout = function(t, r) {
      var n = this.dataToPoint(t, r);
      return {
        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]
      };
    }, e.prototype.pointToDate = function(t) {
      var r = 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, r - 1, i) : this._getDateByWeeksAndDay(r, n - 1, i);
    }, e.prototype.convertToPixel = function(t, r, n) {
      var i = TD(r);
      return i === this ? i.dataToPoint(n) : null;
    }, e.prototype.convertToLayout = function(t, r, n) {
      var i = TD(r);
      return i === this ? i.dataToLayout(n) : null;
    }, e.prototype.convertFromPixel = function(t, r, n) {
      var i = TD(r);
      return i === this ? i.pointToData(n) : null;
    }, e.prototype.containPoint = function(t) {
      return console.warn("Not implemented."), !1;
    }, e.prototype._initRangeOption = function() {
      var t = this._model.get("range"), r;
      if (Se(t) && t.length === 1 && (t = t[0]), Se(t))
        r = t;
      else {
        var n = t.toString();
        if (/^\d{4}$/.test(n) && (r = [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);
          r = [i.formatedDate, o.formatedDate];
        }
        /^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(n) && (r = [n, n]);
      }
      if (!r)
        return t;
      var s = this._getRangeInfo(r);
      return s.start.time > s.end.time && r.reverse(), r;
    }, e.prototype._getRangeInfo = function(t) {
      var r = [this.getDateInfo(t[0]), this.getDateInfo(t[1])], n;
      r[0].time > r[1].time && (n = !0, r.reverse());
      var i = Math.floor(r[1].time / wD) - Math.floor(r[0].time / wD) + 1, a = new Date(r[0].time), o = a.getDate(), s = r[1].date.getDate();
      a.setDate(o + i - 1);
      var l = a.getDate();
      if (l !== s)
        for (var u = a.getTime() - r[1].time > 0 ? 1 : -1; (l = a.getDate()) !== s && (a.getTime() - r[1].time) * u > 0; )
          i -= u, a.setDate(l - u);
      var f = Math.floor((i + r[0].day + 6) / 7), c = n ? -f + 1 : f - 1;
      return n && r.reverse(), {
        range: [r[0].formatedDate, r[1].formatedDate],
        start: r[0],
        end: r[1],
        allDay: i,
        weeks: f,
        // From 0.
        nthWeek: c,
        fweek: r[0].day,
        lweek: r[1].day
      };
    }, e.prototype._getDateByWeeksAndDay = function(t, r, n) {
      var i = this._getRangeInfo(n);
      if (t > i.weeks || t === 0 && r < i.fweek || t === i.weeks && r > i.lweek)
        return null;
      var a = (t - 1) * 7 - i.fweek + r, o = new Date(i.start.time);
      return o.setDate(+i.start.d + a), this.getDateInfo(o);
    }, e.create = function(t, r) {
      var n = [];
      return t.eachComponent("calendar", function(i) {
        var a = new e(i, t, r);
        n.push(a), i.coordinateSystem = a;
      }), t.eachComponent(function(i, a) {
        Ex({
          targetModel: a,
          coordSysType: "calendar",
          coordSysProvider: ZW
        });
      }), n;
    }, e.dimensions = ["time", "value"], e;
  })()
);
function TD(e) {
  var t = e.calendarModel, r = e.seriesModel, n = t ? t.coordinateSystem : r ? r.coordinateSystem : null;
  return n;
}
function cpe(e) {
  e.registerComponentModel(lpe), e.registerComponentView(upe), e.registerCoordinateSystem("calendar", fpe);
}
var tf = {
  level: 1,
  leaf: 2,
  nonLeaf: 3
}, vf = {
  // No clamp, be falsy, equals to null/undefined. It means if the input part is
  // null/undefined/NaN/outOfBoundary, the result part is NaN, rather than clamp to
  // the boundary of the matrix.
  none: 0,
  // Clamp, where null/undefined/NaN/outOfBoundary can be used to cover the entire row/column.
  all: 1,
  body: 2,
  corner: 3
};
function yI(e, t, r) {
  var n = t[_t[r]].getCell(e);
  return !n && Xt(e) && e < 0 && (n = t[_t[1 - r]].getUnitLayoutInfo(r, Math.round(e))), n;
}
function EX(e) {
  var t = e || [];
  return t[0] = t[0] || [], t[1] = t[1] || [], t[0][0] = t[0][1] = t[1][0] = t[1][1] = NaN, t;
}
function PX(e, t, r, n, i) {
  SF(e[0], t, i, r, n, 0), SF(e[1], t, i, r, n, 1);
}
function SF(e, t, r, n, i, a) {
  e[0] = 1 / 0, e[1] = -1 / 0;
  var o = n[a], s = Se(o) ? o : [o], l = s.length, u = !!r;
  if (l >= 1 ? (wF(e, t, s, u, i, a, 0), l > 1 && wF(e, t, s, u, i, a, l - 1)) : e[0] = e[1] = NaN, u) {
    var f = -i[_t[1 - a]].getLocatorCount(a), c = i[_t[a]].getLocatorCount(a) - 1;
    r === vf.body ? f = Sn(0, f) : r === vf.corner && (c = To(-1, c)), c < f && (f = c = NaN), Gi(e[0]) && (e[0] = f), Gi(e[1]) && (e[1] = c), e[0] = Sn(To(e[0], c), f), e[1] = Sn(To(e[1], c), f);
  }
}
function wF(e, t, r, n, i, a, o) {
  var s = yI(r[o], i, a);
  if (!s) {
    e[0] = e[1] = NaN;
    return;
  }
  var l = s.id[_t[a]], u = l, f = ppe(s);
  f && (u += f.span[_t[a]] - 1), e[0] = To(e[0], l, u), e[1] = Sn(e[1], l, u);
}
function LT(e, t) {
  return Gi(e[t][0]) || Gi(e[t][1]);
}
function TF(e, t, r, n) {
  t = t || hpe;
  for (var i = 0; i < n; i++)
    t[i] = !1;
  for (; ; ) {
    for (var a = !1, i = 0; i < n; i++) {
      var o = r[i];
      !t[i] && o.cellMergeOwner && vpe(e, o.locatorRange) && (t[i] = !0, a = !0);
    }
    if (!a)
      break;
  }
}
var hpe = [];
function vpe(e, t) {
  return !bF(e[0], t[0]) || !bF(e[1], t[1]) ? !1 : (e[0][0] = To(e[0][0], t[0][0]), e[0][1] = Sn(e[0][1], t[0][1]), e[1][0] = To(e[1][0], t[1][0]), e[1][1] = Sn(e[1][1], t[1][1]), !0);
}
function bF(e, t) {
  return e[1] >= t[0] && e[0] <= t[1];
}
function CF(e, t) {
  e.id.set(t[0][0], t[1][0]), e.span.set(t[0][1] - e.id.x + 1, t[1][1] - e.id.y + 1);
}
function dpe(e, t) {
  e[0][0] = t[0][0], e[0][1] = t[0][1], e[1][0] = t[1][0], e[1][1] = t[1][1];
}
function AF(e, t, r, n) {
  var i = yI(t[n][0], r, n), a = yI(t[n][1], r, n);
  e[_t[n]] = e[In[n]] = NaN, i && a && (e[_t[n]] = i.xy, e[In[n]] = a.xy + a.wh - i.xy);
}
function x_(e, t, r, n) {
  return e[_t[t]] = r, e[_t[1 - t]] = n, e;
}
function ppe(e) {
  return e && (e.type === tf.leaf || e.type === tf.nonLeaf) ? e : null;
}
function Bb() {
  return {
    x: NaN,
    y: NaN,
    width: NaN,
    height: NaN
  };
}
var MF = (
  /** @class */
  (function() {
    function e(t, r) {
      this._cells = [], this._levels = [], this.dim = t, this.dimIdx = t === "x" ? 0 : 1, this._model = r, this._uniqueValueGen = gpe(t);
      var n = r.get("data", !0);
      n != null && !Se(n) && (n = []), n ? this._initByDimModelData(n) : this._initBySeriesData();
    }
    return e.prototype._initByDimModelData = function(t) {
      var r = this, n = r._cells, i = r._levels, a = [], o = 0;
      r._leavesCount = s(t, 0, 0), l();
      return;
      function s(u, f, c) {
        var h = 0;
        return u && F(u, function(v, d) {
          var g;
          Fe(v) ? g = {
            value: v
          } : ot(v) ? (g = v, v.value != null && !Fe(v.value) && (g = {
            value: null
          })) : g = {
            value: null
          };
          var y = {
            type: tf.nonLeaf,
            ordinal: NaN,
            level: c,
            firstLeafLocator: f,
            id: new ht(),
            span: x_(new ht(), r.dimIdx, 1, 1),
            option: g,
            xy: NaN,
            wh: NaN,
            dim: r,
            rect: Bb()
          };
          o++, (a[f] || (a[f] = [])).push(y), i[c] || (i[c] = {
            type: tf.level,
            xy: NaN,
            wh: NaN,
            option: null,
            id: new ht(),
            dim: r
          });
          var x = s(g.children, f, c + 1), S = Math.max(1, x);
          y.span[_t[r.dimIdx]] = S, h += S, f += S;
        }), h;
      }
      function l() {
        for (var u = []; n.length < o; )
          for (var f = 0; f < a.length; f++) {
            var c = a[f].pop();
            if (c) {
              c.ordinal = u.length;
              var h = c.option.value;
              u.push(h), n.push(c), r._uniqueValueGen.calcDupBase(h);
            }
          }
        r._uniqueValueGen.ensureValueUnique(u, n);
        var v = r._ordinalMeta = new Mm({
          categories: u,
          needCollect: !1,
          deduplication: !1
        });
        r._scale = new Lm({
          ordinalMeta: v
        });
        for (var d = 0; d < r._leavesCount; d++) {
          var g = r._cells[d];
          g.type = tf.leaf, g.span[_t[1 - r.dimIdx]] = r._levels.length - g.level;
        }
        r._initCellsId(), r._initLevelIdOptions();
      }
    }, e.prototype._initBySeriesData = function() {
      var t = this;
      t._leavesCount = 0, t._levels = [{
        type: tf.level,
        xy: NaN,
        wh: NaN,
        option: null,
        id: new ht(),
        dim: t
      }], t._initLevelIdOptions();
      var r = t._ordinalMeta = new Mm({
        needCollect: !0,
        deduplication: !0,
        onCollect: function(n, i) {
          var a = t._cells[i] = {
            type: tf.leaf,
            ordinal: i,
            level: 0,
            firstLeafLocator: i,
            id: new ht(),
            span: x_(new ht(), t.dimIdx, 1, 1),
            // Theoretically `value` is from `dataset` or `series.data`, so it may be any type.
            // Do not restrict this case for user's convenience, and here simply convert it to
            // string for display.
            option: {
              value: n + ""
            },
            xy: NaN,
            wh: NaN,
            dim: t,
            rect: Bb()
          };
          t._leavesCount++, t._setCellId(a);
        }
      });
      t._scale = new Lm({
        ordinalMeta: r
      });
    }, e.prototype._setCellId = function(t) {
      var r = this._levels.length, n = this.dimIdx;
      x_(t.id, n, t.firstLeafLocator, t.level - r);
    }, e.prototype._initCellsId = function() {
      var t = this._levels.length, r = this.dimIdx;
      F(this._cells, function(n) {
        x_(n.id, r, n.firstLeafLocator, n.level - t);
      });
    }, e.prototype._initLevelIdOptions = function() {
      var t = this._levels.length, r = this.dimIdx, n = this._model.get("levels", !0);
      n = Se(n) ? n : [], F(this._levels, function(i, a) {
        x_(i.id, r, 0, a - t), i.option = n[a];
      });
    }, e.prototype.shouldShow = function() {
      return !!this._model.getShallow("show", !0);
    }, e.prototype.resetLayoutIterator = function(t, r, n, i) {
      if (t = t || new Vc(), r === this.dimIdx) {
        var a = this._leavesCount, o = n != null ? Math.max(0, n) : 0;
        i = i != null ? Math.min(i, a) : a, t.reset(this._cells, o, o + i);
      } else {
        var a = this._levels.length, o = n != null ? Math.max(0, n + a) : 0;
        i = i != null ? Math.min(i, a) : a, t.reset(this._levels, o, o + i);
      }
      return t;
    }, e.prototype.resetCellIterator = function(t) {
      return (t || new Vc()).reset(this._cells, 0);
    }, e.prototype.resetLevelIterator = function(t) {
      return (t || new Vc()).reset(this._levels, 0);
    }, e.prototype.getLayout = function(t, r, n) {
      var i = this.getUnitLayoutInfo(r, n);
      t[_t[r]] = i ? i.xy : NaN, t[In[r]] = i ? i.wh : NaN;
    }, e.prototype.getUnitLayoutInfo = function(t, r) {
      return t === this.dimIdx ? r < this._leavesCount ? this._cells[r] : void 0 : this._levels[r + this._levels.length];
    }, e.prototype.getCell = function(t) {
      var r = this._scale.parse(t);
      return Gi(r) ? void 0 : this._cells[r];
    }, e.prototype.getLocatorCount = function(t) {
      return t === this.dimIdx ? this._leavesCount : this._levels.length;
    }, e.prototype.getOrdinalMeta = function() {
      return this._ordinalMeta;
    }, e;
  })()
);
function gpe(e) {
  var t = e.toUpperCase(), r = new RegExp("^" + t + "([0-9]+)$"), n = 0;
  function i(s) {
    var l;
    s != null && (l = s.match(r)) && (n = Sn(n, +l[1] + 1));
  }
  function a() {
    return "" + t + n++;
  }
  function o(s, l) {
    for (var u = Je(), f = 0; f < s.length; f++) {
      var c = s[f];
      (c == null || u.get(c) != null) && (s[f] = c = a(), l[f].option = tt({
        value: c
      }, l[f].option)), u.set(c, !0);
    }
  }
  return {
    calcDupBase: i,
    ensureValueUnique: o
  };
}
var LF = (
  /** @class */
  (function() {
    function e(t, r, n) {
      this._model = r, this._dims = n, this._kind = t, this._cellMergeOwnerList = [];
    }
    return e.prototype._ensureCellMap = function() {
      var t = this, r = t._cellMap;
      return r || (r = t._cellMap = Je(), n()), r;
      function n() {
        var a = [], o = t._model.getShallow("data");
        o && !Se(o) && (o = null), F(o, function(d, g) {
          if (!(!ot(d) || !Se(d.coord))) {
            var y = EX([]), x = null;
            if (PX(y, x, d.coord, t._dims, d.coordClamp ? vf[t._kind] : vf.none), !(LT(y, 0) || LT(y, 1))) {
              var S = d && d.mergeCells, T = {
                id: new ht(),
                span: new ht(),
                locatorRange: y,
                option: d,
                cellMergeOwner: S
              };
              CF(T, y), a.push(T);
            }
          }
        });
        for (var s = [], l = 0; l < a.length; l++) {
          var u = a[l];
          if (u.cellMergeOwner) {
            var f = u.locatorRange;
            TF(f, s, a, l);
            for (var c = 0; c < l; c++)
              s[c] && (a[c].cellMergeOwner = !1);
            if (f[0][0] !== u.id.x || f[1][0] !== u.id.y) {
              u.cellMergeOwner = !1;
              var h = xe({}, u.option);
              h.coord = null;
              var v = {
                id: new ht(),
                span: new ht(),
                locatorRange: f,
                option: h,
                cellMergeOwner: !0
              };
              CF(v, f), a.push(v);
            }
          }
        }
        F(a, function(d) {
          var g = i(d.id.x, d.id.y);
          if (d.cellMergeOwner && (g.cellMergeOwner = !0, g.span = d.span, g.locatorRange = d.locatorRange, g.spanRect = Bb(), t._cellMergeOwnerList.push(g)), !(!d.cellMergeOwner && !d.option))
            for (var y = 0; y < d.span.y; y++)
              for (var x = 0; x < d.span.x; x++) {
                var S = i(d.id.x + x, d.id.y + y);
                S.option = d.option, d.cellMergeOwner && (S.inSpanOf = g);
              }
        });
      }
      function i(a, o) {
        var s = DF(a, o), l = r.get(s);
        return l || (l = r.set(s, {
          id: new ht(a, o),
          option: null,
          inSpanOf: null,
          span: null,
          spanRect: null,
          locatorRange: null,
          cellMergeOwner: !1
        })), l;
      }
    }, e.prototype.getCell = function(t) {
      return this._ensureCellMap().get(DF(t[0], t[1]));
    }, e.prototype.travelExistingCells = function(t) {
      this._ensureCellMap().each(t);
    }, e.prototype.expandRangeByCellMerge = function(t) {
      if (!LT(t, 0) && !LT(t, 1) && t[0][0] === t[0][1] && t[1][0] === t[1][1]) {
        bD[0] = t[0][0], bD[1] = t[1][0];
        var r = this.getCell(bD), n = r && r.inSpanOf;
        if (n) {
          dpe(t, n.locatorRange);
          return;
        }
      }
      var i = this._cellMergeOwnerList;
      TF(t, null, i, i.length);
    }, e;
  })()
), bD = [];
function DF(e, t) {
  return e + "|" + t;
}
var DN = {
  show: !0,
  color: fe.color.secondary,
  // overflow: 'truncate',
  overflow: "break",
  lineOverflow: "truncate",
  padding: [2, 3, 2, 3],
  // Prefer to use `padding`, rather than distance.
  distance: 0
};
function EN(e) {
  return {
    color: "none",
    borderWidth: 1,
    borderColor: e ? "none" : fe.color.borderTint
  };
}
var EF = {
  show: !0,
  label: DN,
  itemStyle: EN(!1),
  silent: void 0,
  dividerLineStyle: {
    width: 1,
    color: fe.color.border
  }
}, mpe = {
  label: DN,
  itemStyle: EN(!1),
  silent: void 0
}, ype = {
  label: DN,
  itemStyle: EN(!0),
  silent: void 0
}, _pe = {
  // As a most basic coord sys, `z` should be lower than
  // other series and coord sys, such as, grid.
  z: -50,
  left: "10%",
  top: "10%",
  right: "10%",
  bottom: "10%",
  x: EF,
  y: EF,
  body: mpe,
  corner: ype,
  backgroundStyle: {
    color: "none",
    borderColor: fe.color.axisLine,
    borderWidth: 1
  }
}, xpe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.optionUpdated = function() {
      var r = this._dimModels = {
        // Do not use matrixModel as the parent model, for preventing from cascade-fetching options to it.
        x: new PF(this.get("x", !0) || {}),
        y: new PF(this.get("y", !0) || {})
      };
      r.x.option.type = r.y.option.type = "category";
      var n = r.x.dim = new MF("x", r.x), i = r.y.dim = new MF("y", r.y), a = {
        x: n,
        y: i
      };
      this._body = new LF("body", new It(this.getShallow("body")), a), this._corner = new LF("corner", new It(this.getShallow("corner")), a);
    }, t.prototype.getDimensionModel = function(r) {
      return this._dimModels[r];
    }, t.prototype.getBody = function() {
      return this._body;
    }, t.prototype.getCorner = function() {
      return this._corner;
    }, t.type = "matrix", t.layoutMode = "box", t.defaultOption = _pe, t;
  })(At)
), PF = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      return e !== null && e.apply(this, arguments) || this;
    }
    return t.prototype.getOrdinalMeta = function() {
      return this.dim.getOrdinalMeta();
    }, t;
  })(It)
), DT = Math.round, Spe = 0, wpe = 99, Tpe = {
  normal: 25,
  special: 100
}, bpe = {
  normal: 50,
  special: 125
}, Cpe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.render = function(r, n) {
      this.group.removeAll();
      var i = this.group, a = r.coordinateSystem, o = a.getRect(), s = r.getDimensionModel("x"), l = r.getDimensionModel("y"), u = s.dim, f = l.dim;
      Ape(i, r, n), Mpe(i, r, u, f, n);
      var c = r.getShallow("borderZ2", !0), h = et(c, wpe), v = h - 1, d = r.getModel("backgroundStyle").getItemStyle(["borderWidth"]);
      d.lineWidth = 0;
      var g = r.getModel("backgroundStyle").getItemStyle(["color", "decal", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY"]);
      g.fill = "none";
      var y = _I(o.clone(), d, Spe), x = _I(o.clone(), g, h);
      y.silent = !0, x.silent = !0, i.add(y), i.add(x);
      var S = u.getUnitLayoutInfo(0, 0), T = f.getUnitLayoutInfo(1, 0);
      S && T && (u.shouldShow() && i.add(IF({
        x1: o.x,
        y1: T.xy,
        x2: o.x + o.width,
        y2: T.xy
      }, s.getModel("dividerLineStyle").getLineStyle(), v)), f.shouldShow() && i.add(IF({
        x1: S.xy,
        y1: o.y,
        x2: S.xy,
        y2: o.y + o.height
      }, l.getModel("dividerLineStyle").getLineStyle(), v)));
    }, t.type = "matrix", t;
  })(fr)
);
function Ape(e, t, r) {
  n(0), n(1);
  function n(i) {
    var a = t.getDimensionModel(_t[i]), o = a.dim;
    if (o.shouldShow())
      for (var s = a.getModel("itemStyle"), l = a.getModel("label"), u = t.getShallow("tooltip", !0), f = [], c = o.resetCellIterator(); c.next(); ) {
        var h = c.item, v = {};
        st.copy(v, h.rect), hC(f, h.id.x, h.id.y), IX(f, t, e, r, h.option, s, l, a, v, h.option.value, bpe, u);
      }
  }
}
function Mpe(e, t, r, n, i) {
  a("body", t.getBody(), r, n), r.shouldShow() && n.shouldShow() && a("corner", t.getCorner(), n, r);
  function a(o, s, l, u) {
    var f = new It(t.getShallow(o, !0)), c = f.getModel("itemStyle"), h = f.getModel("label"), v = new Vc(), d = new Vc(), g = [], y = t.getShallow("tooltip", !0);
    for (u.resetLayoutIterator(d, 1); d.next(); )
      for (l.resetLayoutIterator(v, 0); v.next(); ) {
        var x = v.item, S = d.item;
        hC(g, x.id.x, S.id.y);
        var T = s.getCell(g);
        if (!(T && T.inSpanOf && T.inSpanOf !== T)) {
          var C = {};
          T && T.span ? st.copy(C, T.spanRect) : (x.dim.getLayout(C, 0, g[0]), S.dim.getLayout(C, 1, g[1]));
          var A = T ? T.option : null;
          IX(g, t, e, i, A, c, h, f, C, A ? A.value : null, Tpe, y);
        }
      }
  }
}
function IX(e, t, r, n, i, a, o, s, l, u, f, c) {
  var h;
  ET.option = i ? i.itemStyle : null, ET.parentModel = a, Ng.option = i, Ng.parentModel = s;
  var v = et(Ng.getShallow("z2"), i && i.itemStyle ? f.special : f.normal), d = c && c.show, g = _I(l, ET.getItemStyle(), v);
  r.add(g);
  var y = Ng.get("cursor");
  y != null && g.attr("cursor", y);
  var x;
  if (u != null) {
    var S = u + "";
    if (kg.option = i ? i.label : null, kg.parentModel = o, kg.ecModel = n, si(
      g,
      // Currently do not support other states (`emphasis`, `select`, `blur`)
      {
        normal: kg
      },
      {
        defaultText: S,
        autoOverflowArea: !0,
        // By default based on boundingRect. But boundingRect contains borderWidth,
        // and borderWidth is half outside the cell. Thus specific `layoutRect` explicitly.
        layoutRect: it(g.shape)
      }
    ), x = g.getTextContent(), x) {
      x.z2 = v + 1;
      var T = x.style;
      if (T && T.overflow && T.overflow !== "none" && T.lineOverflow) {
        var C = {};
        st.copy(C, l), bd(C, (((h = g.style) === null || h === void 0 ? void 0 : h.lineWidth) || 0) / 2, !0, !0), g.updateInnerText(), x.getLocalTransform(PT), cs(PT, PT), st.applyTransform(C, C, PT), x.setClipPath(new Mt({
          shape: C
        }));
      }
    }
    Cf({
      el: g,
      componentModel: t,
      itemName: S,
      itemTooltipOption: c,
      formatterParamsExtra: {
        xyLocator: e.slice()
      }
    });
  }
  if (x) {
    var A = kg.get("silent");
    A == null && (A = !d), x.silent = A, x.ignoreHostSilent = !0;
  }
  var M = Ng.get("silent");
  M == null && (M = // If no background color in cell, set `rect.silent: false` will cause that only
  // the border response to mouse hovering, which is probably weird.
  !g.style || g.style.fill === "none" || !g.style.fill), g.silent = M, BM(Ng), BM(ET), BM(kg);
}
var Ng = new It(), ET = new It(), kg = new It(), PT = [];
function _I(e, t, r) {
  var n = t.lineWidth;
  if (n) {
    var i = e.x + e.width, a = e.y + e.height;
    e.x = wo(e.x, n, !0), e.y = wo(e.y, n, !0), e.width = wo(i, n, !0) - e.x, e.height = wo(a, n, !0) - e.y;
  }
  return new Mt({
    shape: e,
    style: t,
    z2: r
  });
}
function IF(e, t, r) {
  var n = t.lineWidth;
  return n && (DT(e.x1 * 2) === DT(e.x2 * 2) && (e.x1 = e.x2 = wo(e.x1, n, !0)), DT(e.y1 * 2) === DT(e.y2 * 2) && (e.y1 = e.y2 = wo(e.y1, n, !0))), new wn({
    shape: e,
    style: t,
    silent: !0,
    z2: r
  });
}
var Lpe = (
  /** @class */
  (function() {
    function e(t, r, n) {
      this.dimensions = e.dimensions, this.type = "matrix", this._model = t;
      var i = this._dimModels = {
        x: t.getDimensionModel("x"),
        y: t.getDimensionModel("y")
      };
      this._dims = {
        x: i.x.dim,
        y: i.y.dim
      }, this._resize(t, n);
    }
    return e.getDimensionsInfo = function() {
      return [{
        name: "x",
        type: "ordinal"
      }, {
        name: "y",
        type: "ordinal"
      }, {
        name: "value"
      }];
    }, e.create = function(t, r) {
      var n = [];
      return t.eachComponent("matrix", function(i) {
        var a = new e(i, t, r);
        n.push(a), i.coordinateSystem = a;
      }), t.eachComponent(function(i, a) {
        Ex({
          targetModel: a,
          coordSysType: "matrix",
          coordSysProvider: ZW
        });
      }), n;
    }, e.prototype.getRect = function() {
      return this._rect;
    }, e.prototype._resize = function(t, r) {
      var n = this._dims, i = this._dimModels, a = this._rect = Tr(t.getBoxLayoutParams(), {
        width: r.getWidth(),
        height: r.getHeight()
      });
      RF(i, n, a, 0), RF(i, n, a, 1), OF(0, n), OF(1, n), NF(this._model.getBody(), n), NF(this._model.getCorner(), n);
    }, e.prototype.dataToPoint = function(t, r, n) {
      return n = n || [], this.dataToLayout(t, r, S_), n[0] = S_.rect.x + S_.rect.width / 2, n[1] = S_.rect.y + S_.rect.height / 2, n;
    }, e.prototype.dataToLayout = function(t, r, n) {
      var i = this._dims;
      n = n || {};
      var a = n.rect = n.rect || {};
      a.x = a.y = a.width = a.height = NaN;
      var o = n.matrixXYLocatorRange = EX(n.matrixXYLocatorRange);
      return Se(t) && (PX(o, null, t, i, et(r && r.clamp, vf.none)), (!r || !r.ignoreMergeCells) && ((!r || r.clamp !== vf.corner) && this._model.getBody().expandRangeByCellMerge(o), (!r || r.clamp !== vf.body) && this._model.getCorner().expandRangeByCellMerge(o)), AF(a, o, i, 0), AF(a, o, i, 1)), n;
    }, e.prototype.pointToData = function(t, r, n) {
      var i = this._dims;
      return kF(Il, 0, i, t, r && r.clamp), kF(Il, 1, i, t, r && r.clamp), n = n || [], n[0] = n[1] = NaN, Il.y === Fi.inCorner && Il.x === Fi.inBody ? BF(Il, n, 0, i) : Il.x === Fi.inCorner && Il.y === Fi.inBody ? BF(Il, n, 1, i) : (zF(Il, n, 0, i), zF(Il, n, 1, i)), n;
    }, e.prototype.convertToPixel = function(t, r, n, i) {
      var a = AD(r);
      return a === this ? a.dataToPoint(n, i) : void 0;
    }, e.prototype.convertToLayout = function(t, r, n, i) {
      var a = AD(r);
      return a === this ? a.dataToLayout(n, i) : void 0;
    }, e.prototype.convertFromPixel = function(t, r, n, i) {
      var a = AD(r);
      return a === this ? a.pointToData(n, i) : void 0;
    }, e.prototype.containPoint = function(t) {
      return this._rect.contain(t[0], t[1]);
    }, e.dimensions = ["x", "y", "value"], e;
  })()
), S_ = {
  rect: Bb()
}, IT = new Vc(), CD = new Vc();
function RF(e, t, r, n) {
  for (var i = 1 - n, a = t[_t[n]], o = t[_t[i]], s = o.shouldShow(), l = a.resetCellIterator(); l.next(); )
    l.item.wh = l.item.xy = NaN;
  for (var u = o.resetLayoutIterator(null, n); u.next(); )
    u.item.wh = u.item.xy = NaN;
  for (var f = r[In[n]], c = a.getLocatorCount(n) + o.getLocatorCount(n), h = new It(), v = o.resetLevelIterator(); v.next(); )
    h.option = v.item.option, h.parentModel = e[_t[i]], y(v.item, s ? h.get("levelSize") : 0);
  for (var d = new It(), g = a.resetCellIterator(); g.next(); )
    g.item.type === tf.leaf && (d.option = g.item.option, d.parentModel = void 0, y(g.item, d.get("size")));
  function y(E, P) {
    var R = Dpe(P, n, r);
    Gi(R) || (E.wh = xI(R, f), f = xI(f - E.wh), c--);
  }
  var x = c ? f / c : 0, S = !c && f >= 1, T = r[_t[n]], C = a.getLocatorCount(n) - 1, A = new Vc();
  for (o.resetLayoutIterator(A, n); A.next(); )
    M(A.item);
  for (a.resetLayoutIterator(A, n); A.next(); )
    M(A.item);
  function M(E) {
    Gi(E.wh) && (E.wh = x), E.xy = T, E.id[_t[n]] === C && !S && (E.wh = r[_t[n]] + r[In[n]] - E.xy), T += E.wh;
  }
}
function OF(e, t) {
  for (var r = t[_t[e]].resetCellIterator(); r.next(); ) {
    var n = r.item;
    zb(n.rect, e, n.id, n.span, t), zb(n.rect, 1 - e, n.id, n.span, t), n.type === tf.nonLeaf && (n.xy = n.rect[_t[e]], n.wh = n.rect[In[e]]);
  }
}
function NF(e, t) {
  e.travelExistingCells(function(r) {
    var n = r.span;
    if (n) {
      var i = r.spanRect, a = r.id;
      zb(i, 0, a, n, t), zb(i, 1, a, n, t);
    }
  });
}
function zb(e, t, r, n, i) {
  e[In[t]] = 0;
  var a = r[_t[t]], o = a < 0 ? i[_t[1 - t]] : i[_t[t]], s = o.getUnitLayoutInfo(t, r[_t[t]]);
  if (e[_t[t]] = s.xy, e[In[t]] = s.wh, n[_t[t]] > 1) {
    var l = o.getUnitLayoutInfo(t, r[_t[t]] + n[_t[t]] - 1);
    e[In[t]] = l.xy + l.wh - s.xy;
  }
}
function Dpe(e, t, r) {
  var n = j2(e, r[In[t]]);
  return xI(n, r[In[t]]);
}
function xI(e, t) {
  return Math.max(Math.min(e, et(t, 1 / 0)), 0);
}
function AD(e) {
  var t = e.matrixModel, r = e.seriesModel, n = t ? t.coordinateSystem : r ? r.coordinateSystem : null;
  return n;
}
var Fi = {
  inBody: 1,
  inCorner: 2,
  outside: 3
}, Il = {
  x: null,
  y: null,
  point: []
};
function kF(e, t, r, n, i) {
  var a = r[_t[t]], o = r[_t[1 - t]], s = a.getUnitLayoutInfo(t, a.getLocatorCount(t) - 1), l = a.getUnitLayoutInfo(t, 0), u = o.getUnitLayoutInfo(t, -o.getLocatorCount(t)), f = o.shouldShow() ? o.getUnitLayoutInfo(t, -1) : null, c = e.point[t] = n[t];
  if (!l && !f) {
    e[_t[t]] = Fi.outside;
    return;
  }
  if (i === vf.body) {
    l ? (e[_t[t]] = Fi.inBody, c = To(s.xy + s.wh, Sn(l.xy, c)), e.point[t] = c) : e[_t[t]] = Fi.outside;
    return;
  } else if (i === vf.corner) {
    f ? (e[_t[t]] = Fi.inCorner, c = To(f.xy + f.wh, Sn(u.xy, c)), e.point[t] = c) : e[_t[t]] = Fi.outside;
    return;
  }
  var h = l ? l.xy : f ? f.xy + f.wh : NaN, v = u ? u.xy : h, d = s ? s.xy + s.wh : h;
  if (c < v) {
    if (!i) {
      e[_t[t]] = Fi.outside;
      return;
    }
    c = v;
  } else if (c > d) {
    if (!i) {
      e[_t[t]] = Fi.outside;
      return;
    }
    c = d;
  }
  e.point[t] = c, e[_t[t]] = h <= c && c <= d ? Fi.inBody : v <= c && c <= h ? Fi.inCorner : Fi.outside;
}
function BF(e, t, r, n) {
  var i = 1 - r;
  if (e[_t[r]] !== Fi.outside)
    for (n[_t[r]].resetCellIterator(CD); CD.next(); ) {
      var a = CD.item;
      if (FF(e.point[r], a.rect, r) && FF(e.point[i], a.rect, i)) {
        t[r] = a.ordinal, t[i] = a.id[_t[i]];
        return;
      }
    }
}
function zF(e, t, r, n) {
  if (e[_t[r]] !== Fi.outside) {
    var i = e[_t[r]] === Fi.inCorner ? n[_t[1 - r]] : n[_t[r]];
    for (i.resetLayoutIterator(IT, r); IT.next(); )
      if (Epe(e.point[r], IT.item)) {
        t[r] = IT.item.id[_t[r]];
        return;
      }
  }
}
function Epe(e, t) {
  return t.xy <= e && e <= t.xy + t.wh;
}
function FF(e, t, r) {
  return t[_t[r]] <= e && e <= t[_t[r]] + t[In[r]];
}
function Ppe(e) {
  e.registerComponentModel(xpe), e.registerComponentView(Cpe), e.registerCoordinateSystem("matrix", Lpe);
}
function Ipe(e, t) {
  var r = e.existing;
  if (t.id = e.keyInfo.id, !t.type && r && (t.type = r.type), t.parentId == null) {
    var n = t.parentOption;
    n ? t.parentId = n.id : r && (t.parentId = r.parentId);
  }
  t.parentOption = null;
}
function GF(e, t) {
  var r;
  return F(t, function(n) {
    e[n] != null && e[n] !== "auto" && (r = !0);
  }), r;
}
function Rpe(e, t, r) {
  var n = xe({}, r), i = e[t], a = r.$action || "merge";
  a === "merge" ? i ? (je(i, n, !0), nu(i, n, {
    ignoreSize: !0
  }), QW(r, i), RT(r, i), RT(r, i, "shape"), RT(r, i, "style"), RT(r, i, "extra"), r.clipPath = i.clipPath) : e[t] = n : a === "replace" ? e[t] = n : a === "remove" && i && (e[t] = null);
}
var RX = ["transition", "enterFrom", "leaveTo"], Ope = RX.concat(["enterAnimation", "updateAnimation", "leaveAnimation"]);
function RT(e, t, r) {
  if (r && (!e[r] && t[r] && (e[r] = {}), e = e[r], t = t[r]), !(!e || !t))
    for (var n = r ? RX : Ope, i = 0; i < n.length; i++) {
      var a = n[i];
      e[a] == null && t[a] != null && (e[a] = t[a]);
    }
}
function Npe(e, t) {
  if (e && (e.hv = t.hv = [
    // Rigid body, don't care about `width`.
    GF(t, ["left", "right"]),
    // Rigid body, don't care about `height`.
    GF(t, ["top", "bottom"])
  ], e.type === "group")) {
    var r = e, n = t;
    r.width == null && (r.width = n.width = 0), r.height == null && (r.height = n.height = 0);
  }
}
var kpe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.preventAutoZ = !0, r;
    }
    return t.prototype.mergeOption = function(r, n) {
      var i = this.option.elements;
      this.option.elements = null, e.prototype.mergeOption.call(this, r, n), this.option.elements = i;
    }, t.prototype.optionUpdated = function(r, n) {
      var i = this.option, a = (n ? i : r).elements, o = i.elements = n ? [] : i.elements, s = [];
      this._flatten(a, s, null);
      var l = HU(o, s, "normalMerge"), u = this._elOptionsToUpdate = [];
      F(l, function(f, c) {
        var h = f.newOption;
        h && (u.push(h), Ipe(f, h), Rpe(o, c, h), Npe(o[c], h));
      }, this), i.elements = nr(o, function(f) {
        return f && delete f.$action, f != null;
      });
    }, t.prototype._flatten = function(r, n, i) {
      F(r, 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 r = this._elOptionsToUpdate;
      return this._elOptionsToUpdate = null, r;
    }, t.type = "graphic", t.defaultOption = {
      elements: []
      // parentId: null
    }, t;
  })(At)
), VF = {
  // Reserved but not supported in graphic component.
  path: null,
  compoundPath: null,
  // Supported in graphic component.
  group: rt,
  image: Xn,
  text: Rt
}, es = Bt(), Bpe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.init = function() {
      this._elMap = Je();
    }, t.prototype.render = function(r, n, i) {
      r !== this._lastGraphicModel && this._clear(), this._lastGraphicModel = r, this._updateElements(r), this._relocate(r, i);
    }, t.prototype._updateElements = function(r) {
      var n = r.useElOptionsToUpdate();
      if (n) {
        var i = this._elMap, a = this.group, o = r.get("z"), s = r.get("zlevel");
        F(n, function(l) {
          var u = Gn(l.id, null), f = u != null ? i.get(u) : null, c = Gn(l.parentId, null), h = c != null ? i.get(c) : 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 g = l.textContent, y = l.textConfig;
          if (d && fX(d, v, !!y, !!g)) {
            var x = cX(d, v, !0);
            !y && x.textConfig && (y = l.textConfig = x.textConfig), !g && x.textContent && (g = x.textContent);
          }
          var S = zpe(l), T = l.$action || "merge", C = T === "merge", A = T === "replace";
          if (C) {
            var M = !f, E = f;
            M ? E = HF(u, h, l.type, i) : (E && (es(E).isNew = !1), pX(E)), E && (M2(E, S, r, {
              isInit: M
            }), UF(E, l, o, s));
          } else if (A) {
            E2(f, l, i, r);
            var P = HF(u, h, l.type, i);
            P && (M2(P, S, r, {
              isInit: !0
            }), UF(P, l, o, s));
          } else T === "remove" && (vX(f, l), E2(f, l, i, r));
          var R = i.get(u);
          if (R && g)
            if (C) {
              var O = R.getTextContent();
              O ? O.attr(g) : R.setTextContent(new Rt(g));
            } else A && R.setTextContent(new Rt(g));
          if (R) {
            var N = l.clipPath;
            if (N) {
              var G = N.type, z = void 0, M = !1;
              if (C) {
                var H = R.getClipPath();
                M = !H || es(H).type !== G, z = M ? SI(G) : H;
              } else A && (M = !0, z = SI(G));
              R.setClipPath(z), M2(z, N, r, {
                isInit: M
              }), Ob(z, N.keyframeAnimation, r);
            }
            var W = es(R);
            R.setTextConfig(y), W.option = l, Fpe(R, r, l), Cf({
              el: R,
              componentModel: r,
              itemName: R.name,
              itemTooltipOption: l.tooltip
            }), Ob(R, l.keyframeAnimation, r);
          }
        });
      }
    }, t.prototype._relocate = function(r, n) {
      for (var i = r.option.elements, a = this.group, o = this._elMap, s = n.getWidth(), l = n.getHeight(), u = ["x", "y"], f = 0; f < i.length; f++) {
        var c = i[f], h = Gn(c.id, null), v = h != null ? o.get(h) : null;
        if (!(!v || !v.isGroup)) {
          var d = v.parent, g = d === a, y = es(v), x = es(d);
          y.width = Be(y.option.width, g ? s : x.width) || 0, y.height = Be(y.option.height, g ? l : x.height) || 0;
        }
      }
      for (var f = i.length - 1; f >= 0; f--) {
        var c = i[f], h = Gn(c.id, null), v = h != null ? o.get(h) : null;
        if (v) {
          var d = v.parent, x = es(d), S = d === a ? {
            width: s,
            height: l
          } : {
            width: x.width,
            height: x.height
          }, T = {}, C = PC(v, c, S, null, {
            hv: c.hv,
            boundingMode: c.bounding
          }, T);
          if (!es(v).isNew && C) {
            for (var A = c.transition, M = {}, E = 0; E < u.length; E++) {
              var P = u[E], R = T[P];
              A && (gd(A) || Tt(A, P) >= 0) ? M[P] = R : v[P] = R;
            }
            Wt(v, M, r, 0);
          } else
            v.attr(T);
        }
      }
    }, t.prototype._clear = function() {
      var r = this, n = this._elMap;
      n.each(function(i) {
        E2(i, es(i).option, n, r._lastGraphicModel);
      }), this._elMap = Je();
    }, t.prototype.dispose = function() {
      this._clear();
    }, t.type = "graphic", t;
  })(fr)
);
function SI(e) {
  var t = qe(VF, e) ? VF[e] : z1(e), r = new t({});
  return es(r).type = e, r;
}
function HF(e, t, r, n) {
  var i = SI(r);
  return t.add(i), n.set(e, i), es(i).id = e, es(i).isNew = !0, i;
}
function E2(e, t, r, n) {
  var i = e && e.parent;
  i && (e.type === "group" && e.traverse(function(a) {
    E2(a, t, r, n);
  }), jC(e, t, n), r.removeKey(es(e).id));
}
function UF(e, t, r, n) {
  e.isGroup || F([
    ["cursor", hs.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", r || 0],
    // z2 must not be null/undefined, otherwise sort error may occur.
    ["z2", 0]
  ], function(i) {
    var a = i[0];
    qe(t, a) ? e[a] = et(t[a], i[1]) : e[a] == null && (e[a] = i[1]);
  }), F(Ht(t), function(i) {
    if (i.indexOf("on") === 0) {
      var a = t[i];
      e[i] = nt(a) ? a : null;
    }
  }), qe(t, "draggable") && (e.draggable = t.draggable), t.name != null && (e.name = t.name), t.id != null && (e.id = t.id);
}
function zpe(e) {
  return e = xe({}, e), F(["id", "parentId", "$action", "hv", "bounding", "textContent", "clipPath"].concat($W), function(t) {
    delete e[t];
  }), e;
}
function Fpe(e, t, r) {
  var n = pt(e).eventData;
  !e.silent && !e.ignore && !n && (n = pt(e).eventData = {
    componentType: "graphic",
    componentIndex: t.componentIndex,
    name: e.name
  }), n && (n.info = r.info);
}
function Gpe(e) {
  e.registerComponentModel(kpe), e.registerComponentView(Bpe), e.registerPreprocessor(function(t) {
    var r = t.graphic;
    Se(r) ? !r[0] || !r[0].elements ? t.graphic = [{
      elements: r
    }] : t.graphic = [t.graphic[0]] : r && !r.elements && (t.graphic = [{
      elements: [r]
    }]);
  });
}
var WF = ["x", "y", "radius", "angle", "single"], Vpe = ["cartesian2d", "polar", "singleAxis"];
function Hpe(e) {
  var t = e.get("coordinateSystem");
  return Tt(Vpe, t) >= 0;
}
function kc(e) {
  return e + "Axis";
}
function Upe(e, t) {
  var r = Je(), n = [], i = Je();
  e.eachComponent({
    mainType: "dataZoom",
    query: t
  }, function(f) {
    i.get(f.uid) || s(f);
  });
  var a;
  do
    a = !1, e.eachComponent("dataZoom", o);
  while (a);
  function o(f) {
    !i.get(f.uid) && l(f) && (s(f), a = !0);
  }
  function s(f) {
    i.set(f.uid, !0), n.push(f), u(f);
  }
  function l(f) {
    var c = !1;
    return f.eachTargetAxis(function(h, v) {
      var d = r.get(h);
      d && d[v] && (c = !0);
    }), c;
  }
  function u(f) {
    f.eachTargetAxis(function(c, h) {
      (r.get(c) || r.set(c, []))[h] = !0;
    });
  }
  return n;
}
function OX(e) {
  var t = e.ecModel, r = {
    infoList: [],
    infoMap: Je()
  };
  return e.eachTargetAxis(function(n, i) {
    var a = t.getComponent(kc(n), i);
    if (a) {
      var o = a.getCoordSysModel();
      if (o) {
        var s = o.uid, l = r.infoMap.get(s);
        l || (l = {
          model: o,
          axisModels: []
        }, r.infoList.push(l), r.infoMap.set(s, l)), l.axisModels.push(a);
      }
    }
  }), r;
}
var MD = (
  /** @class */
  (function() {
    function e() {
      this.indexList = [], this.indexMap = [];
    }
    return e.prototype.add = function(t) {
      this.indexMap[t] || (this.indexList.push(t), this.indexMap[t] = !0);
    }, e;
  })()
), ix = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r._autoThrottle = !0, r._noTarget = !0, r._rangePropMode = ["percent", "percent"], r;
    }
    return t.prototype.init = function(r, n, i) {
      var a = XF(r);
      this.settledOption = a, this.mergeDefaultAndTheme(r, i), this._doInit(a);
    }, t.prototype.mergeOption = function(r) {
      var n = XF(r);
      je(this.option, r, !0), je(this.settledOption, n, !0), this._doInit(n);
    }, t.prototype._doInit = function(r) {
      var n = this.option;
      this._setDefaultThrottle(r), this._updateRangeUse(r);
      var i = this.settledOption;
      F([["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 r = this.get("orient", !0), n = this._targetAxisInfoMap = Je(), i = this._fillSpecifiedTargetAxis(n);
      i ? this._orient = r || this._makeAutoOrientByTargetAxis() : (this._orient = r || "horizontal", this._fillAutoTargetAxisByOrient(n, this._orient)), this._noTarget = !0, n.each(function(a) {
        a.indexList.length && (this._noTarget = !1);
      }, this);
    }, t.prototype._fillSpecifiedTargetAxis = function(r) {
      var n = !1;
      return F(WF, function(i) {
        var a = this.getReferringComponents(kc(i), bQ);
        if (a.specified) {
          n = !0;
          var o = new MD();
          F(a.models, function(s) {
            o.add(s.componentIndex);
          }), r.set(i, o);
        }
      }, this), n;
    }, t.prototype._fillAutoTargetAxisByOrient = function(r, 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(f) {
            return f.get("orient", !0) === n;
          }
        });
        l(s, "single");
      }
      function l(u, f) {
        var c = u[0];
        if (c) {
          var h = new MD();
          if (h.add(c.componentIndex), r.set(f, h), a = !1, f === "x" || f === "y") {
            var v = c.getReferringComponents("grid", an).models[0];
            v && F(u, function(d) {
              c.componentIndex !== d.componentIndex && v === d.getReferringComponents("grid", an).models[0] && h.add(d.componentIndex);
            });
          }
        }
      }
      a && F(WF, function(u) {
        if (a) {
          var f = i.findComponents({
            mainType: kc(u),
            filter: function(h) {
              return h.get("type", !0) === "category";
            }
          });
          if (f[0]) {
            var c = new MD();
            c.add(f[0].componentIndex), r.set(u, c), a = !1;
          }
        }
      }, this);
    }, t.prototype._makeAutoOrientByTargetAxis = function() {
      var r;
      return this.eachTargetAxis(function(n) {
        !r && (r = n);
      }, this), r === "y" ? "vertical" : "horizontal";
    }, t.prototype._setDefaultThrottle = function(r) {
      if (r.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(r) {
      var n = this._rangePropMode, i = this.get("rangeMode");
      F([["start", "startValue"], ["end", "endValue"]], function(a, o) {
        var s = r[a[0]] != null, l = r[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 r;
      return this.eachTargetAxis(function(n, i) {
        r == null && (r = this.ecModel.getComponent(kc(n), i));
      }, this), r;
    }, t.prototype.eachTargetAxis = function(r, n) {
      this._targetAxisInfoMap.each(function(i, a) {
        F(i.indexList, function(o) {
          r.call(n, a, o);
        });
      });
    }, t.prototype.getAxisProxy = function(r, n) {
      var i = this.getAxisModel(r, n);
      if (i)
        return i.__dzAxisProxy;
    }, t.prototype.getAxisModel = function(r, n) {
      var i = this._targetAxisInfoMap.get(r);
      if (i && i.indexMap[n])
        return this.ecModel.getComponent(kc(r), n);
    }, t.prototype.setRawRange = function(r) {
      var n = this.option, i = this.settledOption;
      F([["start", "startValue"], ["end", "endValue"]], function(a) {
        (r[a[0]] != null || r[a[1]] != null) && (n[a[0]] = i[a[0]] = r[a[0]], n[a[1]] = i[a[1]] = r[a[1]]);
      }, this), this._updateRangeUse(r);
    }, t.prototype.setCalculatedRange = function(r) {
      var n = this.option;
      F(["start", "startValue", "end", "endValue"], function(i) {
        n[i] = r[i];
      });
    }, t.prototype.getPercentRange = function() {
      var r = this.findRepresentativeAxisProxy();
      if (r)
        return r.getDataPercentWindow();
    }, t.prototype.getValueRange = function(r, n) {
      if (r == null && n == null) {
        var i = this.findRepresentativeAxisProxy();
        if (i)
          return i.getDataValueWindow();
      } else
        return this.getAxisProxy(r, n).getDataValueWindow();
    }, t.prototype.findRepresentativeAxisProxy = function(r) {
      if (r)
        return r.__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;
  })(At)
);
function XF(e) {
  var t = {};
  return F(["start", "end", "startValue", "endValue", "throttle"], function(r) {
    e.hasOwnProperty(r) && (t[r] = e[r]);
  }), t;
}
var Wpe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.type = "dataZoom.select", t;
  })(ix)
), PN = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.render = function(r, n, i, a) {
      this.dataZoomModel = r, this.ecModel = n, this.api = i;
    }, t.type = "dataZoom", t;
  })(fr)
), Xpe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.type = "dataZoom.select", t;
  })(PN)
), tm = F, YF = xo, Ype = (
  /** @class */
  (function() {
    function e(t, r, n, i) {
      this._dimName = t, this._axisIndex = r, this.ecModel = i, this._dataZoomModel = n;
    }
    return e.prototype.hostedBy = function(t) {
      return this._dataZoomModel === t;
    }, e.prototype.getDataValueWindow = function() {
      return this._valueWindow.slice();
    }, e.prototype.getDataPercentWindow = function() {
      return this._percentWindow.slice();
    }, e.prototype.getTargetSeriesModels = function() {
      var t = [];
      return this.ecModel.eachSeries(function(r) {
        if (Hpe(r)) {
          var n = kc(this._dimName), i = r.getReferringComponents(n, an).models[0];
          i && this._axisIndex === i.componentIndex && t.push(r);
        }
      }, this), t;
    }, e.prototype.getAxisModel = function() {
      return this.ecModel.getComponent(this._dimName + "Axis", this._axisIndex);
    }, e.prototype.getMinMaxSpan = function() {
      return it(this._minMaxSpan);
    }, e.prototype.calculateDataWindow = function(t) {
      var r = this._dataExtent, n = this.getAxisModel(), i = n.axis.scale, a = this._dataZoomModel.getRangePropMode(), o = [0, 100], s = [], l = [], u;
      tm(["start", "end"], function(h, v) {
        var d = t[h], g = t[h + "Value"];
        a[v] === "percent" ? (d == null && (d = o[v]), g = i.parse(er(d, o, r))) : (u = !0, g = g == null ? r[v] : i.parse(g), d = er(g, r, o)), l[v] = g == null || isNaN(g) ? r[v] : g, s[v] = d == null || isNaN(d) ? o[v] : d;
      }), YF(l), YF(s);
      var f = this._minMaxSpan;
      u ? c(l, s, r, o, !1) : c(s, l, o, r, !0);
      function c(h, v, d, g, y) {
        var x = y ? "Span" : "ValueSpan";
        jc(0, h, d, "all", f["min" + x], f["max" + x]);
        for (var S = 0; S < 2; S++)
          v[S] = er(h[S], d, g, !0), y && (v[S] = i.parse(v[S]));
      }
      return {
        valueWindow: l,
        percentWindow: s
      };
    }, e.prototype.reset = function(t) {
      if (t === this._dataZoomModel) {
        var r = this.getTargetSeriesModels();
        this._dataExtent = Zpe(this, this._dimName, r), this._updateMinMaxSpan();
        var n = this.calculateDataWindow(t.settledOption);
        this._valueWindow = n.valueWindow, this._percentWindow = n.percentWindow, this._setAxisModel();
      }
    }, e.prototype.filterData = function(t, r) {
      if (t !== this._dataZoomModel)
        return;
      var n = this._dimName, i = this.getTargetSeriesModels(), a = t.get("filterMode"), o = this._valueWindow;
      if (a === "none")
        return;
      tm(i, function(l) {
        var u = l.getData(), f = u.mapDimensionsAll(n);
        if (f.length) {
          if (a === "weakFilter") {
            var c = u.getStore(), h = Ce(f, function(v) {
              return u.getDimensionIndex(v);
            }, u);
            u.filterSelf(function(v) {
              for (var d, g, y, x = 0; x < f.length; x++) {
                var S = c.get(h[x], v), T = !isNaN(S), C = S < o[0], A = S > o[1];
                if (T && !C && !A)
                  return !0;
                T && (y = !0), C && (d = !0), A && (g = !0);
              }
              return y && d && g;
            });
          } else
            tm(f, function(v) {
              if (a === "empty")
                l.setData(u = u.map(v, function(g) {
                  return s(g) ? g : NaN;
                }));
              else {
                var d = {};
                d[v] = o, u.selectRange(d);
              }
            });
          tm(f, function(v) {
            u.setApproximateExtent(o, v);
          });
        }
      });
      function s(l) {
        return l >= o[0] && l <= o[1];
      }
    }, e.prototype._updateMinMaxSpan = function() {
      var t = this._minMaxSpan = {}, r = this._dataZoomModel, n = this._dataExtent;
      tm(["min", "max"], function(i) {
        var a = r.get(i + "Span"), o = r.get(i + "ValueSpan");
        o != null && (o = this.getAxisModel().axis.scale.parse(o)), o != null ? a = er(n[0] + o, n, [0, 100], !0) : a != null && (o = er(a, [0, 100], n, !0) - n[0]), t[i + "Span"] = a, t[i + "ValueSpan"] = o;
      }, this);
    }, e.prototype._setAxisModel = function() {
      var t = this.getAxisModel(), r = this._percentWindow, n = this._valueWindow;
      if (r) {
        var i = dR(n, [0, 500]);
        i = Math.min(i, 20);
        var a = t.axis.scale.rawExtentInfo;
        r[0] !== 0 && a.setDeterminedMinMax("min", +n[0].toFixed(i)), r[1] !== 100 && a.setDeterminedMinMax("max", +n[1].toFixed(i)), a.freeze();
      }
    }, e;
  })()
);
function Zpe(e, t, r) {
  var n = [1 / 0, -1 / 0];
  tm(r, function(o) {
    Tie(n, o.getData(), t);
  });
  var i = e.getAxisModel(), a = L6(i.axis.scale, i, n).calculate();
  return [a.min, a.max];
}
var $pe = {
  // `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(e) {
    function t(i) {
      e.eachComponent("dataZoom", function(a) {
        a.eachTargetAxis(function(o, s) {
          var l = e.getComponent(kc(o), s);
          i(o, s, l, a);
        });
      });
    }
    t(function(i, a, o, s) {
      o.__dzAxisProxy = null;
    });
    var r = [];
    t(function(i, a, o, s) {
      o.__dzAxisProxy || (o.__dzAxisProxy = new Ype(i, a, s, e), r.push(o.__dzAxisProxy));
    });
    var n = Je();
    return F(r, function(i) {
      F(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(e, t) {
    e.eachComponent("dataZoom", function(r) {
      r.eachTargetAxis(function(n, i) {
        r.getAxisProxy(n, i).reset(r);
      }), r.eachTargetAxis(function(n, i) {
        r.getAxisProxy(n, i).filterData(r, t);
      });
    }), e.eachComponent("dataZoom", function(r) {
      var n = r.findRepresentativeAxisProxy();
      if (n) {
        var i = n.getDataPercentWindow(), a = n.getDataValueWindow();
        r.setCalculatedRange({
          start: i[0],
          end: i[1],
          startValue: a[0],
          endValue: a[1]
        });
      }
    });
  }
};
function qpe(e) {
  e.registerAction("dataZoom", function(t, r) {
    var n = Upe(r, t);
    F(n, function(i) {
      i.setRawRange({
        start: t.start,
        end: t.end,
        startValue: t.startValue,
        endValue: t.endValue
      });
    });
  });
}
var ZF = !1;
function IN(e) {
  ZF || (ZF = !0, e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER, $pe), qpe(e), e.registerSubTypeDefaulter("dataZoom", function() {
    return "slider";
  }));
}
function jpe(e) {
  e.registerComponentModel(Wpe), e.registerComponentView(Xpe), IN(e);
}
var rs = (
  /** @class */
  /* @__PURE__ */ (function() {
    function e() {
    }
    return e;
  })()
), NX = {};
function rm(e, t) {
  NX[e] = t;
}
function kX(e) {
  return NX[e];
}
var Kpe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.optionUpdated = function() {
      e.prototype.optionUpdated.apply(this, arguments);
      var r = this.ecModel;
      F(this.option.feature, function(n, i) {
        var a = kX(i);
        a && (a.getDefaultOption && (a.defaultOption = a.getDefaultOption(r)), je(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: fe.color.border,
      borderRadius: 0,
      borderWidth: 0,
      padding: fe.size.m,
      itemSize: 15,
      itemGap: fe.size.s,
      showTitle: !0,
      iconStyle: {
        borderColor: fe.color.accent50,
        color: "none"
      },
      emphasis: {
        iconStyle: {
          borderColor: fe.color.accent50
        }
      },
      // textStyle: {},
      // feature
      tooltip: {
        show: !1,
        position: "bottom"
      }
    }, t;
  })(At)
);
function BX(e, t) {
  var r = ry(t.get("padding")), n = t.getItemStyle(["color", "opacity"]);
  n.fill = t.get("backgroundColor");
  var i = new Mt({
    shape: {
      x: e.x - r[3],
      y: e.y - r[0],
      width: e.width + r[1] + r[3],
      height: e.height + r[0] + r[2],
      r: t.get("borderRadius")
    },
    style: n,
    silent: !0,
    z2: -1
  });
  return i;
}
var Qpe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      return e !== null && e.apply(this, arguments) || this;
    }
    return t.prototype.render = function(r, n, i, a) {
      var o = this.group;
      if (o.removeAll(), !r.get("show"))
        return;
      var s = +r.get("itemSize"), l = r.get("orient") === "vertical", u = r.get("feature") || {}, f = this._features || (this._features = {}), c = [];
      F(u, function(S, T) {
        c.push(T);
      }), new _f(this._featureNames || [], c).add(h).update(h).remove(St(h, null)).execute(), this._featureNames = c;
      function h(S, T) {
        var C = c[S], A = c[T], M = u[C], E = new It(M, r, r.ecModel), P;
        if (a && a.newTitle != null && a.featureName === C && (M.title = a.newTitle), C && !A) {
          if (Jpe(C))
            P = {
              onclick: E.option.onclick,
              featureName: C
            };
          else {
            var R = kX(C);
            if (!R)
              return;
            P = new R();
          }
          f[C] = P;
        } else if (P = f[A], !P)
          return;
        P.uid = ty("toolbox-feature"), P.model = E, P.ecModel = n, P.api = i;
        var O = P instanceof rs;
        if (!C && A) {
          O && P.dispose && P.dispose(n, i);
          return;
        }
        if (!E.get("show") || O && P.unusable) {
          O && P.remove && P.remove(n, i);
          return;
        }
        v(E, P, C), E.setIconStatus = function(N, G) {
          var z = this.option, H = this.iconPaths;
          z.iconStatus = z.iconStatus || {}, z.iconStatus[N] = G, H[N] && (G === "emphasis" ? mf : yf)(H[N]);
        }, P instanceof rs && P.render && P.render(E, n, i, a);
      }
      function v(S, T, C) {
        var A = S.getModel("iconStyle"), M = S.getModel(["emphasis", "iconStyle"]), E = T instanceof rs && T.getIcons ? T.getIcons() : S.get("icon"), P = S.get("title") || {}, R, O;
        Fe(E) ? (R = {}, R[C] = E) : R = E, Fe(P) ? (O = {}, O[C] = P) : O = P;
        var N = S.iconPaths = {};
        F(R, function(G, z) {
          var H = Jm(G, {}, {
            x: -s / 2,
            y: -s / 2,
            width: s,
            height: s
          });
          H.setStyle(A.getItemStyle());
          var W = H.ensureState("emphasis");
          W.style = M.getItemStyle();
          var Z = new Rt({
            style: {
              text: O[z],
              align: M.get("textAlign"),
              borderRadius: M.get("textBorderRadius"),
              padding: M.get("textPadding"),
              fill: null,
              font: zR({
                fontStyle: M.get("textFontStyle"),
                fontFamily: M.get("textFontFamily"),
                fontSize: M.get("textFontSize"),
                fontWeight: M.get("textFontWeight")
              }, n)
            },
            ignore: !0
          });
          H.setTextContent(Z), Cf({
            el: H,
            componentModel: r,
            itemName: z,
            formatterParamsExtra: {
              title: O[z]
            }
          }), H.__title = O[z], H.on("mouseover", function() {
            var ee = M.getItemStyle(), V = l ? r.get("right") == null && r.get("left") !== "right" ? "right" : "left" : r.get("bottom") == null && r.get("top") !== "bottom" ? "bottom" : "top";
            Z.setStyle({
              fill: M.get("textFill") || ee.fill || ee.stroke || fe.color.neutral99,
              backgroundColor: M.get("textBackgroundColor")
            }), H.setTextConfig({
              position: M.get("textPosition") || V
            }), Z.ignore = !r.get("showTitle"), i.enterEmphasis(this);
          }).on("mouseout", function() {
            S.get(["iconStatus", z]) !== "emphasis" && i.leaveEmphasis(this), Z.hide();
          }), (S.get(["iconStatus", z]) === "emphasis" ? mf : yf)(H), o.add(H), H.on("click", Ge(T.onclick, T, n, i, z)), N[z] = H;
        });
      }
      var d = Yn(r, i).refContainer, g = r.getBoxLayoutParams(), y = r.get("padding"), x = Tr(g, d, y);
      vd(r.get("orient"), o, r.get("itemGap"), x.width, x.height), PC(o, g, d, y), o.add(BX(o.getBoundingRect(), r)), l || o.eachChild(function(S) {
        var T = S.__title, C = S.ensureState("emphasis"), A = C.textConfig || (C.textConfig = {}), M = S.getTextContent(), E = M && M.ensureState("emphasis");
        if (E && !nt(E) && T) {
          var P = E.style || (E.style = {}), R = pC(T, Rt.makeFont(P)), O = S.x + o.x, N = S.y + o.y + s, G = !1;
          N + R.height > i.getHeight() && (A.position = "top", G = !0);
          var z = G ? -5 - R.height : s + 10;
          O + R.width / 2 > i.getWidth() ? (A.position = ["100%", z], P.align = "right") : O - R.width / 2 < 0 && (A.position = [0, z], P.align = "left");
        }
      });
    }, t.prototype.updateView = function(r, n, i, a) {
      F(this._features, function(o) {
        o instanceof rs && o.updateView && o.updateView(o.model, n, i, a);
      });
    }, t.prototype.remove = function(r, n) {
      F(this._features, function(i) {
        i instanceof rs && i.remove && i.remove(r, n);
      }), this.group.removeAll();
    }, t.prototype.dispose = function(r, n) {
      F(this._features, function(i) {
        i instanceof rs && i.dispose && i.dispose(r, n);
      });
    }, t.type = "toolbox", t;
  })(fr)
);
function Jpe(e) {
  return e.indexOf("my") === 0;
}
var ege = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      return e !== null && e.apply(this, arguments) || this;
    }
    return t.prototype.onclick = function(r, n) {
      var i = this.model, a = i.get("name") || r.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) || r.get("backgroundColor") || fe.color.neutral00,
        connectedBackgroundColor: i.get("connectedBackgroundColor"),
        excludeComponents: i.get("excludeComponents"),
        pixelRatio: i.get("pixelRatio")
      }), u = Gt.browser;
      if (typeof MouseEvent == "function" && (u.newEdge || !u.ie && !u.edge)) {
        var f = document.createElement("a");
        f.download = a + "." + s, f.target = "_blank", f.href = l;
        var c = new MouseEvent("click", {
          // some micro front-end framework， window maybe is a Proxy
          view: document.defaultView,
          bubbles: !0,
          cancelable: !1
        });
        f.dispatchEvent(c);
      } 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 g = a + "." + s;
        if (window.navigator.msSaveOrOpenBlob) {
          for (var y = d.length, x = new Uint8Array(y); y--; )
            x[y] = d.charCodeAt(y);
          var S = new Blob([x]);
          window.navigator.msSaveOrOpenBlob(S, g);
        } else {
          var T = document.createElement("iframe");
          document.body.appendChild(T);
          var C = T.contentWindow, A = C.document;
          A.open("image/svg+xml", "replace"), A.write(d), A.close(), C.focus(), A.execCommand("SaveAs", !0, g), document.body.removeChild(T);
        }
      } else {
        var M = i.get("lang"), E = '<body style="margin:0;"><img src="' + l + '" style="max-width:100%;" title="' + (M && M[0] || "") + '" /></body>', P = window.open();
        P.document.write(E), P.document.title = a;
      }
    }, t.getDefaultOption = function(r) {
      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: r.getLocaleModel().get(["toolbox", "saveAsImage", "title"]),
        type: "png",
        // Default use option.backgroundColor
        // backgroundColor: '#fff',
        connectedBackgroundColor: fe.color.neutral00,
        name: "",
        excludeComponents: ["toolbox"],
        // use current pixel ratio of device by default
        // pixelRatio: 1,
        lang: r.getLocaleModel().get(["toolbox", "saveAsImage", "lang"])
      };
      return n;
    }, t;
  })(rs)
), $F = "__ec_magicType_stack__", tge = [["line", "bar"], ["stack"]], rge = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      return e !== null && e.apply(this, arguments) || this;
    }
    return t.prototype.getIcons = function() {
      var r = this.model, n = r.get("icon"), i = {};
      return F(r.get("type"), function(a) {
        n[a] && (i[a] = n[a]);
      }), i;
    }, t.getDefaultOption = function(r) {
      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: r.getLocaleModel().get(["toolbox", "magicType", "title"]),
        option: {},
        seriesIndex: {}
      };
      return n;
    }, t.prototype.onclick = function(r, n, i) {
      var a = this.model, o = a.get(["seriesIndex", i]);
      if (qF[i]) {
        var s = {
          series: []
        }, l = function(c) {
          var h = c.subType, v = c.id, d = qF[i](h, v, c, a);
          d && (tt(d, c.option), s.series.push(d));
          var g = c.coordinateSystem;
          if (g && g.type === "cartesian2d" && (i === "line" || i === "bar")) {
            var y = g.getAxesByScale("ordinal")[0];
            if (y) {
              var x = y.dim, S = x + "Axis", T = c.getReferringComponents(S, an).models[0], C = T.componentIndex;
              s[S] = s[S] || [];
              for (var A = 0; A <= C; A++)
                s[S][C] = s[S][C] || {};
              s[S][C].boundaryGap = i === "bar";
            }
          }
        };
        F(tge, function(c) {
          Tt(c, i) >= 0 && F(c, function(h) {
            a.setIconStatus(h, "normal");
          });
        }), a.setIconStatus(i, "emphasis"), r.eachComponent({
          mainType: "series",
          query: o == null ? null : {
            seriesIndex: o
          }
        }, l);
        var u, f = i;
        i === "stack" && (u = je({
          stack: a.option.title.tiled,
          tiled: a.option.title.stack
        }, a.option.title), a.get(["iconStatus", i]) !== "emphasis" && (f = "tiled")), n.dispatchAction({
          type: "changeMagicType",
          currentType: f,
          newOption: s,
          newTitle: u,
          featureName: "magicType"
        });
      }
    }, t;
  })(rs)
), qF = {
  line: function(e, t, r, n) {
    if (e === "bar")
      return je({
        id: t,
        type: "line",
        // Preserve data related option
        data: r.get("data"),
        stack: r.get("stack"),
        markPoint: r.get("markPoint"),
        markLine: r.get("markLine")
      }, n.get(["option", "line"]) || {}, !0);
  },
  bar: function(e, t, r, n) {
    if (e === "line")
      return je({
        id: t,
        type: "bar",
        // Preserve data related option
        data: r.get("data"),
        stack: r.get("stack"),
        markPoint: r.get("markPoint"),
        markLine: r.get("markLine")
      }, n.get(["option", "bar"]) || {}, !0);
  },
  stack: function(e, t, r, n) {
    var i = r.get("stack") === $F;
    if (e === "line" || e === "bar")
      return n.setIconStatus("stack", i ? "normal" : "emphasis"), je({
        id: t,
        stack: i ? "" : $F
      }, n.get(["option", "stack"]) || {}, !0);
  }
};
el({
  type: "changeMagicType",
  event: "magicTypeChanged",
  update: "prepareAndUpdate"
}, function(e, t) {
  t.mergeOption(e.newOption);
});
var KC = new Array(60).join("-"), Nm = "	";
function nge(e) {
  var t = {}, r = [], n = [];
  return e.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
        r.push(i);
    } else
      r.push(i);
  }), {
    seriesGroupByCategoryAxis: t,
    other: r,
    meta: n
  };
}
function ige(e) {
  var t = [];
  return F(e, function(r, n) {
    var i = r.categoryAxis, a = r.valueAxis, o = a.dim, s = [" "].concat(Ce(r.series, function(v) {
      return v.name;
    })), l = [i.model.getCategories()];
    F(r.series, function(v) {
      var d = v.getRawData();
      l.push(v.getRawData().mapArray(d.mapDimension(o), function(g) {
        return g;
      }));
    });
    for (var u = [s.join(Nm)], f = 0; f < l[0].length; f++) {
      for (var c = [], h = 0; h < l.length; h++)
        c.push(l[h][f]);
      u.push(c.join(Nm));
    }
    t.push(u.join(`
`));
  }), t.join(`

` + KC + `

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

` + KC + `

`);
}
function oge(e) {
  var t = nge(e);
  return {
    value: nr([ige(t.seriesGroupByCategoryAxis), age(t.other)], function(r) {
      return !!r.replace(/[\n\t\s]/g, "");
    }).join(`

` + KC + `

`),
    meta: t.meta
  };
}
function Fb(e) {
  return e.replace(/^\s\s*/, "").replace(/\s\s*$/, "");
}
function sge(e) {
  var t = e.slice(0, e.indexOf(`
`));
  if (t.indexOf(Nm) >= 0)
    return !0;
}
var wI = new RegExp("[" + Nm + "]+", "g");
function lge(e) {
  for (var t = e.split(/\n+/g), r = Fb(t.shift()).split(wI), n = [], i = Ce(r, function(l) {
    return {
      name: l,
      data: []
    };
  }), a = 0; a < t.length; a++) {
    var o = Fb(t[a]).split(wI);
    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 uge(e) {
  for (var t = e.split(/\n+/g), r = Fb(t.shift()), n = [], i = 0; i < t.length; i++) {
    var a = Fb(t[i]);
    if (a) {
      var o = a.split(wI), 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 f = 0; f < o.length; f++)
        l.push(+o[f]);
      l.length === 1 && (u ? n[i].value = l[0] : n[i] = l[0]);
    }
  }
  return {
    name: r,
    data: n
  };
}
function fge(e, t) {
  var r = e.split(new RegExp(`
*` + KC + `
*`, "g")), n = {
    series: []
  };
  return F(r, function(i, a) {
    if (sge(i)) {
      var o = lge(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 = uge(i);
      n.series.push(o);
    }
  }), n;
}
var cge = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      return e !== null && e.apply(this, arguments) || this;
    }
    return t.prototype.onclick = function(r, 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") || fe.color.neutral00;
      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"), f = document.createElement("textarea");
      u.style.cssText = "overflow:auto";
      var c = a.get("optionToContent"), h = a.get("contentToOption"), v = oge(r);
      if (nt(c)) {
        var d = c(n.getOption());
        Fe(d) ? u.innerHTML = d : yd(d) && u.appendChild(d);
      } else {
        f.readOnly = a.get("readOnly");
        var g = f.style;
        g.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", g.color = a.get("textColor"), g.borderColor = a.get("textareaBorderColor"), g.backgroundColor = a.get("textareaColor"), f.value = v.value, u.appendChild(f);
      }
      var y = v.meta, x = document.createElement("div");
      x.style.cssText = "position:absolute;bottom:5px;left:0;right:0";
      var S = "float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px", T = document.createElement("div"), C = document.createElement("div");
      S += ";background-color:" + a.get("buttonColor"), S += ";color:" + a.get("buttonTextColor");
      var A = this;
      function M() {
        i.removeChild(o), A._dom = null;
      }
      OE(T, "click", M), OE(C, "click", function() {
        if (h == null && c != null || h != null && c == null) {
          M();
          return;
        }
        var E;
        try {
          nt(h) ? E = h(u, n.getOption()) : E = fge(f.value, y);
        } catch (P) {
          throw M(), new Error("Data view format error " + P);
        }
        E && n.dispatchAction({
          type: "changeDataView",
          newOption: E
        }), M();
      }), T.innerHTML = l[1], C.innerHTML = l[2], C.style.cssText = T.style.cssText = S, !a.get("readOnly") && x.appendChild(C), x.appendChild(T), o.appendChild(s), o.appendChild(u), o.appendChild(x), u.style.height = i.clientHeight - 80 + "px", i.appendChild(o), this._dom = o;
    }, t.prototype.remove = function(r, n) {
      this._dom && n.getDom().removeChild(this._dom);
    }, t.prototype.dispose = function(r, n) {
      this.remove(r, n);
    }, t.getDefaultOption = function(r) {
      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: r.getLocaleModel().get(["toolbox", "dataView", "title"]),
        lang: r.getLocaleModel().get(["toolbox", "dataView", "lang"]),
        backgroundColor: fe.color.background,
        textColor: fe.color.primary,
        textareaColor: fe.color.background,
        textareaBorderColor: fe.color.border,
        buttonColor: fe.color.accent50,
        buttonTextColor: fe.color.neutral00
      };
      return n;
    }, t;
  })(rs)
);
function hge(e, t) {
  return Ce(e, function(r, n) {
    var i = t && t[n];
    if (ot(i) && !Se(i)) {
      var a = ot(r) && !Se(r);
      a || (r = {
        value: r
      });
      var o = i.name != null && r.name == null;
      return r = tt(r, i), o && delete r.name, r;
    } else
      return r;
  });
}
el({
  type: "changeDataView",
  event: "dataViewChanged",
  update: "prepareAndUpdate"
}, function(e, t) {
  var r = [];
  F(e.newOption.series, function(n) {
    var i = t.getSeriesByName(n.name)[0];
    if (!i)
      r.push(xe({
        // Default is scatter
        type: "scatter"
      }, n));
    else {
      var a = i.get("data");
      r.push({
        name: n.name,
        data: hge(n.data, a)
      });
    }
  }), t.mergeOption(tt({
    series: r
  }, e.newOption));
});
var zX = F, FX = Bt();
function vge(e, t) {
  var r = RN(e);
  zX(t, function(n, i) {
    for (var a = r.length - 1; a >= 0; a--) {
      var o = r[a];
      if (o[i])
        break;
    }
    if (a < 0) {
      var s = e.queryComponents({
        mainType: "dataZoom",
        subType: "select",
        id: i
      })[0];
      if (s) {
        var l = s.getPercentRange();
        r[0][i] = {
          dataZoomId: i,
          start: l[0],
          end: l[1]
        };
      }
    }
  }), r.push(t);
}
function dge(e) {
  var t = RN(e), r = t[t.length - 1];
  t.length > 1 && t.pop();
  var n = {};
  return zX(r, function(i, a) {
    for (var o = t.length - 1; o >= 0; o--)
      if (i = t[o][a], i) {
        n[a] = i;
        break;
      }
  }), n;
}
function pge(e) {
  FX(e).snapshots = null;
}
function gge(e) {
  return RN(e).length;
}
function RN(e) {
  var t = FX(e);
  return t.snapshots || (t.snapshots = [{}]), t.snapshots;
}
var mge = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      return e !== null && e.apply(this, arguments) || this;
    }
    return t.prototype.onclick = function(r, n) {
      pge(r), n.dispatchAction({
        type: "restore",
        from: this.uid
      });
    }, t.getDefaultOption = function(r) {
      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: r.getLocaleModel().get(["toolbox", "restore", "title"])
      };
      return n;
    }, t;
  })(rs)
);
el({
  type: "restore",
  event: "restore",
  update: "prepareAndUpdate"
}, function(e, t) {
  t.resetOption("recreate");
});
var yge = ["grid", "xAxis", "yAxis", "geo", "graph", "polar", "radiusAxis", "angleAxis", "bmap"], ON = (
  /** @class */
  (function() {
    function e(t, r, n) {
      var i = this;
      this._targetInfoList = [];
      var a = jF(r, t);
      F(_ge, function(o, s) {
        (!n || !n.include || Tt(n.include, s) >= 0) && o(a, i._targetInfoList);
      });
    }
    return e.prototype.setOutputRanges = function(t, r) {
      return this.matchOutputRanges(t, r, function(n, i, a) {
        if ((n.coordRanges || (n.coordRanges = [])).push(i), !n.coordRange) {
          n.coordRange = i;
          var o = LD[n.brushType](0, a, i);
          n.__rangeOffset = {
            offset: eG[n.brushType](o.values, n.range, [1, 1]),
            xyMinMax: o.xyMinMax
          };
        }
      }), t;
    }, e.prototype.matchOutputRanges = function(t, r, n) {
      F(t, function(i) {
        var a = this.findTargetInfo(i, r);
        a && a !== !0 && F(a.coordSyses, function(o) {
          var s = LD[i.brushType](1, o, i.range, !0);
          n(i, s.values, o, r);
        });
      }, this);
    }, e.prototype.setInputRanges = function(t, r) {
      F(t, function(n) {
        var i = this.findTargetInfo(n, r);
        if (n.range = n.range || [], i && i !== !0) {
          n.panelId = i.panelId;
          var a = LD[n.brushType](0, i.coordSys, n.coordRange), o = n.__rangeOffset;
          n.range = o ? eG[n.brushType](a.values, o.offset, xge(a.xyMinMax, o.xyMinMax)) : a.values;
        }
      }, this);
    }, e.prototype.makePanelOpts = function(t, r) {
      return Ce(this._targetInfoList, function(n) {
        var i = n.getPanelRect();
        return {
          panelId: n.panelId,
          defaultBrushType: r ? r(n) : null,
          clipPath: W7(i),
          isTargetByCursor: Y7(i, t, n.coordSysModel),
          getLinearBrushOtherExtent: X7(i)
        };
      });
    }, e.prototype.controlSeries = function(t, r, n) {
      var i = this.findTargetInfo(t, n);
      return i === !0 || i && Tt(i.coordSyses, r.coordinateSystem) >= 0;
    }, e.prototype.findTargetInfo = function(t, r) {
      for (var n = this._targetInfoList, i = jF(r, 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 < KF.length; l++)
            if (KF[l](i, o))
              return o;
      }
      return !0;
    }, e;
  })()
);
function TI(e) {
  return e[0] > e[1] && e.reverse(), e;
}
function jF(e, t) {
  return dm(e, t, {
    includeMainTypes: yge
  });
}
var _ge = {
  grid: function(e, t) {
    var r = e.xAxisModels, n = e.yAxisModels, i = e.gridModels, a = Je(), o = {}, s = {};
    !r && !n && !i || (F(r, function(l) {
      var u = l.axis.grid.model;
      a.set(u.id, u), o[u.id] = !0;
    }), F(n, function(l) {
      var u = l.axis.grid.model;
      a.set(u.id, u), s[u.id] = !0;
    }), F(i, function(l) {
      a.set(l.id, l), o[l.id] = !0, s[l.id] = !0;
    }), a.each(function(l) {
      var u = l.coordinateSystem, f = [];
      F(u.getCartesians(), function(c, h) {
        (Tt(r, c.getAxis("x").model) >= 0 || Tt(n, c.getAxis("y").model) >= 0) && f.push(c);
      }), t.push({
        panelId: "grid--" + l.id,
        gridModel: l,
        coordSysModel: l,
        // Use the first one as the representitive coordSys.
        coordSys: f[0],
        coordSyses: f,
        getPanelRect: QF.grid,
        xAxisDeclared: o[l.id],
        yAxisDeclared: s[l.id]
      });
    }));
  },
  geo: function(e, t) {
    F(e.geoModels, function(r) {
      var n = r.coordinateSystem;
      t.push({
        panelId: "geo--" + r.id,
        geoModel: r,
        coordSysModel: r,
        coordSys: n,
        coordSyses: [n],
        getPanelRect: QF.geo
      });
    });
  }
}, KF = [
  // grid
  function(e, t) {
    var r = e.xAxisModel, n = e.yAxisModel, i = e.gridModel;
    return !i && r && (i = r.axis.grid.model), !i && n && (i = n.axis.grid.model), i && i === t.gridModel;
  },
  // geo
  function(e, t) {
    var r = e.geoModel;
    return r && r === t.geoModel;
  }
], QF = {
  grid: function() {
    return this.coordSys.master.getRect().clone();
  },
  geo: function() {
    var e = this.coordSys, t = e.getBoundingRect().clone();
    return t.applyTransform(Hc(e)), t;
  }
}, LD = {
  lineX: St(JF, 0),
  lineY: St(JF, 1),
  rect: function(e, t, r, n) {
    var i = e ? t.pointToData([r[0][0], r[1][0]], n) : t.dataToPoint([r[0][0], r[1][0]], n), a = e ? t.pointToData([r[0][1], r[1][1]], n) : t.dataToPoint([r[0][1], r[1][1]], n), o = [TI([i[0], a[0]]), TI([i[1], a[1]])];
    return {
      values: o,
      xyMinMax: o
    };
  },
  polygon: function(e, t, r, n) {
    var i = [[1 / 0, -1 / 0], [1 / 0, -1 / 0]], a = Ce(r, function(o) {
      var s = e ? 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 JF(e, t, r, n) {
  var i = r.getAxis(["x", "y"][e]), a = TI(Ce([0, 1], function(s) {
    return t ? i.coordToData(i.toLocalCoord(n[s]), !0) : i.toGlobalCoord(i.dataToCoord(n[s]));
  })), o = [];
  return o[e] = a, o[1 - e] = [NaN, NaN], {
    values: a,
    xyMinMax: o
  };
}
var eG = {
  lineX: St(tG, 0),
  lineY: St(tG, 1),
  rect: function(e, t, r) {
    return [[e[0][0] - r[0] * t[0][0], e[0][1] - r[0] * t[0][1]], [e[1][0] - r[1] * t[1][0], e[1][1] - r[1] * t[1][1]]];
  },
  polygon: function(e, t, r) {
    return Ce(e, function(n, i) {
      return [n[0] - r[0] * t[i][0], n[1] - r[1] * t[i][1]];
    });
  }
};
function tG(e, t, r, n) {
  return [t[0] - n[e] * r[0], t[1] - n[e] * r[1]];
}
function xge(e, t) {
  var r = rG(e), n = rG(t), i = [r[0] / n[0], r[1] / n[1]];
  return isNaN(i[0]) && (i[0] = 1), isNaN(i[1]) && (i[1] = 1), i;
}
function rG(e) {
  return e ? [e[0][1] - e[0][0], e[1][1] - e[1][0]] : [NaN, NaN];
}
var bI = F, Sge = _Q("toolbox-dataZoom_"), wge = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      return e !== null && e.apply(this, arguments) || this;
    }
    return t.prototype.render = function(r, n, i, a) {
      this._brushController || (this._brushController = new aN(i.getZr()), this._brushController.on("brush", Ge(this._onBrush, this)).mount()), Cge(r, n, this, a, i), bge(r, n);
    }, t.prototype.onclick = function(r, n, i) {
      Tge[i].call(this);
    }, t.prototype.remove = function(r, n) {
      this._brushController && this._brushController.unmount();
    }, t.prototype.dispose = function(r, n) {
      this._brushController && this._brushController.dispose();
    }, t.prototype._onBrush = function(r) {
      var n = r.areas;
      if (!r.isEnd || !n.length)
        return;
      var i = {}, a = this.ecModel;
      this._brushController.updateCovers([]);
      var o = new ON(NN(this.model), a, {
        include: ["grid"]
      });
      o.matchOutputRanges(n, a, function(u, f, c) {
        if (c.type === "cartesian2d") {
          var h = u.brushType;
          h === "rect" ? (s("x", c, f[0]), s("y", c, f[1])) : s({
            lineX: "x",
            lineY: "y"
          }[h], c, f);
        }
      }), vge(a, i), this._dispatchZoomAction(i);
      function s(u, f, c) {
        var h = f.getAxis(u), v = h.model, d = l(u, v, a), g = d.findRepresentativeAxisProxy(v).getMinMaxSpan();
        (g.minValueSpan != null || g.maxValueSpan != null) && (c = jc(0, c.slice(), h.scale.getExtent(), 0, g.minValueSpan, g.maxValueSpan)), d && (i[d.id] = {
          dataZoomId: d.id,
          startValue: c[0],
          endValue: c[1]
        });
      }
      function l(u, f, c) {
        var h;
        return c.eachComponent({
          mainType: "dataZoom",
          subType: "select"
        }, function(v) {
          var d = v.getAxisModel(u, f.componentIndex);
          d && (h = v);
        }), h;
      }
    }, t.prototype._dispatchZoomAction = function(r) {
      var n = [];
      bI(r, function(i, a) {
        n.push(it(i));
      }), n.length && this.api.dispatchAction({
        type: "dataZoom",
        from: this.uid,
        batch: n
      });
    }, t.getDefaultOption = function(r) {
      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: r.getLocaleModel().get(["toolbox", "dataZoom", "title"]),
        brushStyle: {
          borderWidth: 0,
          color: fe.color.backgroundTint
        }
      };
      return n;
    }, t;
  })(rs)
), Tge = {
  zoom: function() {
    var e = !this._isZoomActive;
    this.api.dispatchAction({
      type: "takeGlobalCursor",
      key: "dataZoomSelect",
      dataZoomSelectActive: e
    });
  },
  back: function() {
    this._dispatchZoomAction(dge(this.ecModel));
  }
};
function NN(e) {
  var t = {
    xAxisIndex: e.get("xAxisIndex", !0),
    yAxisIndex: e.get("yAxisIndex", !0),
    xAxisId: e.get("xAxisId", !0),
    yAxisId: e.get("yAxisId", !0)
  };
  return t.xAxisIndex == null && t.xAxisId == null && (t.xAxisIndex = "all"), t.yAxisIndex == null && t.yAxisId == null && (t.yAxisIndex = "all"), t;
}
function bge(e, t) {
  e.setIconStatus("back", gge(t) > 1 ? "emphasis" : "normal");
}
function Cge(e, t, r, n, i) {
  var a = r._isZoomActive;
  n && n.type === "takeGlobalCursor" && (a = n.key === "dataZoomSelect" ? n.dataZoomSelectActive : !1), r._isZoomActive = a, e.setIconStatus("zoom", a ? "emphasis" : "normal");
  var o = new ON(NN(e), t, {
    include: ["grid"]
  }), s = o.makePanelOpts(i, function(l) {
    return l.xAxisDeclared && !l.yAxisDeclared ? "lineX" : !l.xAxisDeclared && l.yAxisDeclared ? "lineY" : "rect";
  });
  r._brushController.setPanels(s).enableBrush(a && s.length ? {
    brushType: "auto",
    brushStyle: e.getModel("brushStyle").getItemStyle()
  } : !1);
}
Qee("dataZoom", function(e) {
  var t = e.getComponent("toolbox", 0), r = ["feature", "dataZoom"];
  if (!t || t.get(r) == null)
    return;
  var n = t.getModel(r), i = [], a = NN(n), o = dm(e, a);
  bI(o.xAxisModels, function(l) {
    return s(l, "xAxis", "xAxisIndex");
  }), bI(o.yAxisModels, function(l) {
    return s(l, "yAxis", "yAxisIndex");
  });
  function s(l, u, f) {
    var c = l.componentIndex, h = {
      type: "select",
      $fromToolbox: !0,
      // Default to be filter
      filterMode: n.get("filterMode", !0) || "filter",
      // Id for merge mapping.
      id: Sge + u + c
    };
    h[f] = c, i.push(h);
  }
  return i;
});
function Age(e) {
  e.registerComponentModel(Kpe), e.registerComponentView(Qpe), rm("saveAsImage", ege), rm("magicType", rge), rm("dataView", cge), rm("dataZoom", wge), rm("restore", mge), ft(jpe);
}
var Mge = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    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,
      renderMode: "auto",
      // whether restraint content inside viewRect.
      // If renderMode: 'richText', default true.
      // If renderMode: 'html', defaults to `false` (for backward compat).
      confine: null,
      showDelay: 0,
      hideDelay: 100,
      // Animation transition time, unit is second
      transitionDuration: 0.4,
      displayTransition: !0,
      enterable: !1,
      backgroundColor: fe.color.neutral00,
      // 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,
      defaultBorderColor: fe.color.border,
      // 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: fe.color.borderShade,
          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: fe.color.tertiary,
        fontSize: 14
      }
    }, t;
  })(At)
);
function GX(e) {
  var t = e.get("confine");
  return t != null ? !!t : e.get("renderMode") === "richText";
}
function VX(e) {
  if (Gt.domSupported) {
    for (var t = document.documentElement.style, r = 0, n = e.length; r < n; r++)
      if (e[r] in t)
        return e[r];
  }
}
var HX = VX(["transform", "webkitTransform", "OTransform", "MozTransform", "msTransform"]), Lge = VX(["webkitTransition", "transition", "OTransition", "MozTransition", "msTransition"]);
function UX(e, t) {
  if (!e)
    return t;
  t = jR(t, !0);
  var r = e.indexOf(t);
  return e = r === -1 ? t : "-" + e.slice(0, r) + "-" + t, e.toLowerCase();
}
function Dge(e, t) {
  var r = e.currentStyle || document.defaultView && document.defaultView.getComputedStyle(e);
  return r ? r[t] : null;
}
var Ege = UX(Lge, "transition"), kN = UX(HX, "transform"), Pge = "position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;" + (Gt.transform3dSupported ? "will-change:transform;" : "");
function Ige(e) {
  return e = e === "left" ? "right" : e === "right" ? "left" : e === "top" ? "bottom" : "top", e;
}
function Rge(e, t, r) {
  if (!Fe(r) || r === "inside")
    return "";
  var n = e.get("backgroundColor"), i = e.get("borderWidth");
  t = Ad(t);
  var a = Ige(r), o = Math.max(Math.round(i) * 1.5, 6), s = "", l = kN + ":", u;
  Tt(["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 f = u * Math.PI / 180, c = o + i, h = c * Math.abs(Math.cos(f)) + c * Math.abs(Math.sin(f)), v = Math.round(((h - Math.SQRT2 * i) / 2 + Math.SQRT2 * i - (h - c) / 2) * 100) / 100;
  s += ";" + a + ":-" + v + "px";
  var d = t + " solid " + i + "px;", g = ["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="' + g.join("") + '"></div>';
}
function Oge(e, t, r) {
  var n = "cubic-bezier(0.23,1,0.32,1)", i = "", a = "";
  return r && (i = " " + e / 2 + "s " + n, a = "opacity" + i + ",visibility" + i), t || (i = " " + e + "s " + n, a += (a.length ? "," : "") + (Gt.transformSupported ? "" + kN + i : ",left" + i + ",top" + i)), Ege + ":" + a;
}
function nG(e, t, r) {
  var n = e.toFixed(0) + "px", i = t.toFixed(0) + "px";
  if (!Gt.transformSupported)
    return r ? "top:" + i + ";left:" + n + ";" : [["top", i], ["left", n]];
  var a = Gt.transform3dSupported, o = "translate" + (a ? "3d" : "") + "(" + n + "," + i + (a ? ",0" : "") + ")";
  return r ? "top:0;left:0;" + kN + ":" + o + ";" : [["top", 0], ["left", 0], [HX, o]];
}
function Nge(e) {
  var t = [], r = e.get("fontSize"), n = e.getTextColor();
  n && t.push("color:" + n), t.push("font:" + e.getFont());
  var i = et(e.get("lineHeight"), Math.round(r * 3 / 2));
  r && t.push("line-height:" + i + "px");
  var a = e.get("textShadowColor"), o = e.get("textShadowBlur") || 0, s = e.get("textShadowOffsetX") || 0, l = e.get("textShadowOffsetY") || 0;
  return a && o && t.push("text-shadow:" + s + "px " + l + "px " + o + "px " + a), F(["decoration", "align"], function(u) {
    var f = e.get(u);
    f && t.push("text-" + u + ":" + f);
  }), t.join(";");
}
function kge(e, t, r, n) {
  var i = [], a = e.get("transitionDuration"), o = e.get("backgroundColor"), s = e.get("shadowBlur"), l = e.get("shadowColor"), u = e.get("shadowOffsetX"), f = e.get("shadowOffsetY"), c = e.getModel("textStyle"), h = E8(e, "html"), v = u + "px " + f + "px " + s + "px " + l;
  return i.push("box-shadow:" + v), t && a > 0 && i.push(Oge(a, r, n)), o && i.push("background-color:" + o), F(["width", "color", "radius"], function(d) {
    var g = "border-" + d, y = jR(g), x = e.get(y);
    x != null && i.push(g + ":" + x + (d === "color" ? "" : "px"));
  }), i.push(Nge(c)), h != null && i.push("padding:" + ry(h).join("px ") + "px"), i.join(";") + ";";
}
function iG(e, t, r, n, i) {
  var a = t && t.painter;
  if (r) {
    var o = a && a.getViewportRoot();
    o && zj(e, o, r, n, i);
  } else {
    e[0] = n, e[1] = i;
    var s = a && a.getViewportRootOffset();
    s && (e[0] += s.offsetLeft, e[1] += s.offsetTop);
  }
  e[2] = e[0] / t.getWidth(), e[3] = e[1] / t.getHeight();
}
var Bge = (
  /** @class */
  (function() {
    function e(t, r) {
      if (this._show = !1, this._styleCoord = [0, 0, 0, 0], this._enterable = !0, this._alwaysShowContent = !1, this._firstShow = !0, this._longHide = !0, Gt.wxa)
        return null;
      var n = document.createElement("div");
      n.domBelongToZr = !0, this.el = n;
      var i = this._zr = t.getZr(), a = r.appendTo, o = a && (Fe(a) ? document.querySelector(a) : yd(a) ? a : nt(a) && a(t.getDom()));
      iG(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, f = i.painter.getViewportRoot();
          Ko(f, l, !0), u.dispatch("mousemove", l);
        }
      }, n.onmouseleave = function() {
        s._inContent = !1, s._enterable && s._show && s.hideLater(s._hideDelay);
      };
    }
    return e.prototype.update = function(t) {
      if (!this._container) {
        var r = this._api.getDom(), n = Dge(r, "position"), i = r.style;
        i.position !== "absolute" && n !== "absolute" && (i.position = "relative");
      }
      var a = t.get("alwaysShowContent");
      a && this._moveIfResized(), this._alwaysShowContent = a, this._enableDisplayTransition = t.get("displayTransition") && t.get("transitionDuration") > 0, this.el.className = t.get("className") || "";
    }, e.prototype.show = function(t, r) {
      clearTimeout(this._hideTimeout), clearTimeout(this._longHideTimeout);
      var n = this.el, i = n.style, a = this._styleCoord;
      n.innerHTML ? i.cssText = Pge + kge(t, !this._firstShow, this._longHide, this._enableDisplayTransition) + nG(a[0], a[1], !0) + ("border-color:" + Ad(r) + ";") + (t.get("extraCssText") || "") + (";pointer-events:" + (this._enterable ? "auto" : "none")) : i.display = "none", this._show = !0, this._firstShow = !1, this._longHide = !1;
    }, e.prototype.setContent = function(t, r, n, i, a) {
      var o = this.el;
      if (t == null) {
        o.innerHTML = "";
        return;
      }
      var s = "";
      if (Fe(a) && n.get("trigger") === "item" && !GX(n) && (s = Rge(n, i, a)), Fe(t))
        o.innerHTML = t + s;
      else if (t) {
        o.innerHTML = "", Se(t) || (t = [t]);
        for (var l = 0; l < t.length; l++)
          yd(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);
        }
      }
    }, e.prototype.setEnterable = function(t) {
      this._enterable = t;
    }, e.prototype.getSize = function() {
      var t = this.el;
      return t ? [t.offsetWidth, t.offsetHeight] : [0, 0];
    }, e.prototype.moveTo = function(t, r) {
      if (this.el) {
        var n = this._styleCoord;
        if (iG(n, this._zr, this._container, t, r), n[0] != null && n[1] != null) {
          var i = this.el.style, a = nG(n[0], n[1]);
          F(a, function(o) {
            i[o[0]] = o[1];
          });
        }
      }
    }, e.prototype._moveIfResized = function() {
      var t = this._styleCoord[2], r = this._styleCoord[3];
      this.moveTo(t * this._zr.getWidth(), r * this._zr.getHeight());
    }, e.prototype.hide = function() {
      var t = this, r = this.el.style;
      this._enableDisplayTransition ? (r.visibility = "hidden", r.opacity = "0") : r.display = "none", Gt.transform3dSupported && (r.willChange = ""), this._show = !1, this._longHideTimeout = setTimeout(function() {
        return t._longHide = !0;
      }, 500);
    }, e.prototype.hideLater = function(t) {
      this._show && !(this._inContent && this._enterable) && !this._alwaysShowContent && (t ? (this._hideDelay = t, this._show = !1, this._hideTimeout = setTimeout(Ge(this.hide, this), t)) : this.hide());
    }, e.prototype.isShow = function() {
      return this._show;
    }, e.prototype.dispose = function() {
      clearTimeout(this._hideTimeout), clearTimeout(this._longHideTimeout);
      var t = this._zr;
      Fj(t && t.painter && t.painter.getViewportRoot(), this._container);
      var r = this.el;
      if (r) {
        r.onmouseenter = r.onmousemove = r.onmouseleave = null;
        var n = r.parentNode;
        n && n.removeChild(r);
      }
      this.el = this._container = null;
    }, e;
  })()
), zge = (
  /** @class */
  (function() {
    function e(t) {
      this._show = !1, this._styleCoord = [0, 0, 0, 0], this._alwaysShowContent = !1, this._enterable = !0, this._zr = t.getZr(), oG(this._styleCoord, this._zr, t.getWidth() / 2, t.getHeight() / 2);
    }
    return e.prototype.update = function(t) {
      var r = t.get("alwaysShowContent");
      r && this._moveIfResized(), this._alwaysShowContent = r;
    }, e.prototype.show = function() {
      this._hideTimeout && clearTimeout(this._hideTimeout), this.el.show(), this._show = !0;
    }, e.prototype.setContent = function(t, r, n, i, a) {
      var o = this;
      ot(t) && or(""), this.el && this._zr.remove(this.el);
      var s = n.getModel("textStyle");
      this.el = new Rt({
        style: {
          rich: r.richTextStyles,
          text: t,
          lineHeight: 22,
          borderWidth: 1,
          borderColor: i,
          textShadowColor: s.get("textShadowColor"),
          fill: n.get(["textStyle", "color"]),
          padding: E8(n, "richText"),
          verticalAlign: "top",
          align: "left"
        },
        z: n.get("z")
      }), F(["backgroundColor", "borderRadius", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY"], function(u) {
        o.el.style[u] = n.get(u);
      }), F(["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;
      });
    }, e.prototype.setEnterable = function(t) {
      this._enterable = t;
    }, e.prototype.getSize = function() {
      var t = this.el, r = this.el.getBoundingRect(), n = aG(t.style);
      return [r.width + n.left + n.right, r.height + n.top + n.bottom];
    }, e.prototype.moveTo = function(t, r) {
      var n = this.el;
      if (n) {
        var i = this._styleCoord;
        oG(i, this._zr, t, r), t = i[0], r = i[1];
        var a = n.style, o = Mc(a.borderWidth || 0), s = aG(a);
        n.x = t + o + s.left, n.y = r + o + s.top, n.markRedraw();
      }
    }, e.prototype._moveIfResized = function() {
      var t = this._styleCoord[2], r = this._styleCoord[3];
      this.moveTo(t * this._zr.getWidth(), r * this._zr.getHeight());
    }, e.prototype.hide = function() {
      this.el && this.el.hide(), this._show = !1;
    }, e.prototype.hideLater = function(t) {
      this._show && !(this._inContent && this._enterable) && !this._alwaysShowContent && (t ? (this._hideDelay = t, this._show = !1, this._hideTimeout = setTimeout(Ge(this.hide, this), t)) : this.hide());
    }, e.prototype.isShow = function() {
      return this._show;
    }, e.prototype.dispose = function() {
      this._zr.remove(this.el);
    }, e;
  })()
);
function Mc(e) {
  return Math.max(0, e);
}
function aG(e) {
  var t = Mc(e.shadowBlur || 0), r = Mc(e.shadowOffsetX || 0), n = Mc(e.shadowOffsetY || 0);
  return {
    left: Mc(t - r),
    right: Mc(t + r),
    top: Mc(t - n),
    bottom: Mc(t + n)
  };
}
function oG(e, t, r, n) {
  e[0] = r, e[1] = n, e[2] = e[0] / t.getWidth(), e[3] = e[1] / t.getHeight();
}
var Fge = new Mt({
  shape: {
    x: -1,
    y: -1,
    width: 2,
    height: 2
  }
}), Gge = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.init = function(r, n) {
      if (!(Gt.node || !n.getDom())) {
        var i = r.getComponent("tooltip"), a = this._renderMode = AQ(i.get("renderMode"));
        this._tooltipContent = a === "richText" ? new zge(n) : new Bge(n, {
          appendTo: i.get("appendToBody", !0) ? "body" : i.get("appendTo", !0)
        });
      }
    }, t.prototype.render = function(r, n, i) {
      if (!(Gt.node || !i.getDom())) {
        this.group.removeAll(), this._tooltipModel = r, this._ecModel = n, this._api = i;
        var a = this._tooltipContent;
        a.update(r), a.setEnterable(r.get("enterable")), this._initGlobalListener(), this._keepShow(), this._renderMode !== "richText" && r.get("transitionDuration") ? ay(this, "_updatePosition", 50, "fixRate") : U1(this, "_updatePosition");
      }
    }, t.prototype._initGlobalListener = function() {
      var r = this._tooltipModel, n = r.get("triggerOn");
      bX("itemTooltip", this._api, Ge(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 r = this._tooltipModel, n = this._ecModel, i = this._api, a = r.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(r, n, i, {
            x: o._lastX,
            y: o._lastY,
            dataByCoordSys: o._lastDataByCoordSys
          });
        });
      }
    }, t.prototype.manuallyShowTip = function(r, n, i, a) {
      if (!(a.from === this.uid || Gt.node || !i.getDom())) {
        var o = sG(a, i);
        this._ticket = "";
        var s = a.dataByCoordSys, l = Wge(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 f = Fge;
          f.x = a.x, f.y = a.y, f.update(), pt(f).tooltipConfig = {
            name: null,
            option: a.tooltip
          }, this._tryShow({
            offsetX: a.x,
            offsetY: a.y,
            target: f
          }, 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(r, n, i, a))
            return;
          var c = CX(a, n), h = c.point[0], v = c.point[1];
          h != null && v != null && this._tryShow({
            offsetX: h,
            offsetY: v,
            target: c.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(r, 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(sG(a, i));
    }, t.prototype._manuallyAxisShowTip = function(r, 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 f = u.getData(), c = w_([f.getItemModel(s), u, (u.coordinateSystem || {}).model], this._tooltipModel);
          if (c.get("trigger") === "axis")
            return i.dispatchAction({
              type: "updateAxisPointer",
              seriesIndex: o,
              dataIndex: s,
              position: a.position
            }), !0;
        }
      }
    }, t.prototype._tryShow = function(r, n) {
      var i = r.target, a = this._tooltipModel;
      if (a) {
        this._lastX = r.offsetX, this._lastY = r.offsetY;
        var o = r.dataByCoordSys;
        if (o && o.length)
          this._showAxisTooltip(o, r);
        else if (i) {
          var s = pt(i);
          if (s.ssrType === "legend")
            return;
          this._lastDataByCoordSys = null;
          var l, u;
          id(i, function(f) {
            if (f.tooltipDisabled)
              return l = u = null, !0;
            l || u || (pt(f).dataIndex != null ? l = f : pt(f).tooltipConfig != null && (u = f));
          }, !0), l ? this._showSeriesItemTooltip(r, l, n) : u ? this._showComponentItemTooltip(r, u, n) : this._hide(n);
        } else
          this._lastDataByCoordSys = null, this._hide(n);
      }
    }, t.prototype._showOrMove = function(r, n) {
      var i = r.get("showDelay");
      n = Ge(n, this), clearTimeout(this._showTimout), i > 0 ? this._showTimout = setTimeout(n, i) : n();
    }, t.prototype._showAxisTooltip = function(r, n) {
      var i = this._ecModel, a = this._tooltipModel, o = [n.offsetX, n.offsetY], s = w_([n.tooltipOption], a), l = this._renderMode, u = [], f = Rn("section", {
        blocks: [],
        noHeader: !0
      }), c = [], h = new uL();
      F(r, function(S) {
        F(S.dataByAxis, function(T) {
          var C = i.getComponent(T.axisDim + "Axis", T.axisIndex), A = T.value;
          if (!(!C || A == null)) {
            var M = SX(A, C.axis, i, T.seriesDataIndices, T.valueLabelOpt), E = Rn("section", {
              header: M,
              noHeader: !_o(M),
              sortBlocks: !0,
              blocks: []
            });
            f.blocks.push(E), F(T.seriesDataIndices, function(P) {
              var R = i.getSeriesByIndex(P.seriesIndex), O = P.dataIndexInside, N = R.getDataParams(O);
              if (!(N.dataIndex < 0)) {
                N.axisDim = T.axisDim, N.axisIndex = T.axisIndex, N.axisType = T.axisType, N.axisId = T.axisId, N.axisValue = gb(C.axis, {
                  value: A
                }), N.axisValueLabel = M, N.marker = h.makeTooltipMarker("item", Ad(N.color), l);
                var G = TB(R.formatTooltip(O, !0, null)), z = G.frag;
                if (z) {
                  var H = w_([R], a).get("valueFormatter");
                  E.blocks.push(H ? xe({
                    valueFormatter: H
                  }, z) : z);
                }
                G.text && c.push(G.text), u.push(N);
              }
            });
          }
        });
      }), f.blocks.reverse(), c.reverse();
      var v = n.position, d = s.get("order"), g = DB(f, h, l, d, i.get("useUTC"), s.get("textStyle"));
      g && c.unshift(g);
      var y = l === "richText" ? `

` : "<br/>", x = c.join(y);
      this._showOrMove(s, function() {
        this._updateContentNotChangedOnAxis(r, u) ? this._updatePosition(s, v, o[0], o[1], this._tooltipContent, u) : this._showTooltipContent(s, x, u, Math.random() + "", o[0], o[1], v, null, h);
      });
    }, t.prototype._showSeriesItemTooltip = function(r, n, i) {
      var a = this._ecModel, o = pt(n), s = o.seriesIndex, l = a.getSeriesByIndex(s), u = o.dataModel || l, f = o.dataIndex, c = o.dataType, h = u.getData(c), v = this._renderMode, d = r.positionDefault, g = w_([h.getItemModel(f), u, l && (l.coordinateSystem || {}).model], this._tooltipModel, d ? {
        position: d
      } : null), y = g.get("trigger");
      if (!(y != null && y !== "item")) {
        var x = u.getDataParams(f, c), S = new uL();
        x.marker = S.makeTooltipMarker("item", Ad(x.color), v);
        var T = TB(u.formatTooltip(f, !1, c)), C = g.get("order"), A = g.get("valueFormatter"), M = T.frag, E = M ? DB(A ? xe({
          valueFormatter: A
        }, M) : M, S, v, C, a.get("useUTC"), g.get("textStyle")) : T.text, P = "item_" + u.name + "_" + f;
        this._showOrMove(g, function() {
          this._showTooltipContent(g, E, x, P, r.offsetX, r.offsetY, r.position, r.target, S);
        }), i({
          type: "showTip",
          dataIndexInside: f,
          dataIndex: h.getRawIndex(f),
          seriesIndex: s,
          from: this.uid
        });
      }
    }, t.prototype._showComponentItemTooltip = function(r, n, i) {
      var a = this._renderMode === "html", o = pt(n), s = o.tooltipConfig, l = s.option || {}, u = l.encodeHTMLContent;
      if (Fe(l)) {
        var f = l;
        l = {
          content: f,
          // Fixed formatter
          formatter: f
        }, u = !0;
      }
      u && a && l.content && (l = it(l), l.content = _n(l.content));
      var c = [l], h = this._ecModel.getComponent(o.componentMainType, o.componentIndex);
      h && c.push(h), c.push({
        formatter: l.content
      });
      var v = r.positionDefault, d = w_(c, this._tooltipModel, v ? {
        position: v
      } : null), g = d.get("content"), y = Math.random() + "", x = new uL();
      this._showOrMove(d, function() {
        var S = it(d.get("formatterParams") || {});
        this._showTooltipContent(d, g, S, y, r.offsetX, r.offsetY, r.position, n, x);
      }), i({
        type: "showTip",
        from: this.uid
      });
    }, t.prototype._showTooltipContent = function(r, n, i, a, o, s, l, u, f) {
      if (this._ticket = "", !(!r.get("showContent") || !r.get("show"))) {
        var c = this._tooltipContent;
        c.setEnterable(r.get("enterable"));
        var h = r.get("formatter");
        l = l || r.get("position");
        var v = n, d = this._getNearestPoint([o, s], i, r.get("trigger"), r.get("borderColor"), r.get("defaultBorderColor", !0)), g = d.color;
        if (h)
          if (Fe(h)) {
            var y = r.ecModel.get("useUTC"), x = Se(i) ? i[0] : i, S = x && x.axisType && x.axisType.indexOf("time") >= 0;
            v = h, S && (v = Dx(x.axisValue, v, y)), v = EC(v, i, !0);
          } else if (nt(h)) {
            var T = Ge(function(C, A) {
              C === this._ticket && (c.setContent(A, f, r, g, l), this._updatePosition(r, l, o, s, c, i, u));
            }, this);
            this._ticket = a, v = h(i, a, T);
          } else
            v = h;
        c.setContent(v, f, r, g, l), c.show(r, g), this._updatePosition(r, l, o, s, c, i, u);
      }
    }, t.prototype._getNearestPoint = function(r, n, i, a, o) {
      if (i === "axis" || Se(n))
        return {
          color: a || o
        };
      if (!Se(n))
        return {
          color: a || n.color || n.borderColor
        };
    }, t.prototype._updatePosition = function(r, n, i, a, o, s, l) {
      var u = this._api.getWidth(), f = this._api.getHeight();
      n = n || r.get("position");
      var c = o.getSize(), h = r.get("align"), v = r.get("verticalAlign"), d = l && l.getBoundingRect().clone();
      if (l && d.applyTransform(l.transform), nt(n) && (n = n([i, a], s, o.el, d, {
        viewSize: [u, f],
        contentSize: c.slice()
      })), Se(n))
        i = Be(n[0], u), a = Be(n[1], f);
      else if (ot(n)) {
        var g = n;
        g.width = c[0], g.height = c[1];
        var y = Tr(g, {
          width: u,
          height: f
        });
        i = y.x, a = y.y, h = null, v = null;
      } else if (Fe(n) && l) {
        var x = Uge(n, d, c, r.get("borderWidth"));
        i = x[0], a = x[1];
      } else {
        var x = Vge(i, a, o, u, f, h ? null : 20, v ? null : 20);
        i = x[0], a = x[1];
      }
      if (h && (i -= lG(h) ? c[0] / 2 : h === "right" ? c[0] : 0), v && (a -= lG(v) ? c[1] / 2 : v === "bottom" ? c[1] : 0), GX(r)) {
        var x = Hge(i, a, o, u, f);
        i = x[0], a = x[1];
      }
      o.moveTo(i, a);
    }, t.prototype._updateContentNotChangedOnAxis = function(r, n) {
      var i = this._lastDataByCoordSys, a = this._cbParamsList, o = !!i && i.length === r.length;
      return o && F(i, function(s, l) {
        var u = s.dataByAxis || [], f = r[l] || {}, c = f.dataByAxis || [];
        o = o && u.length === c.length, o && F(u, function(h, v) {
          var d = c[v] || {}, g = h.seriesDataIndices || [], y = d.seriesDataIndices || [];
          o = o && h.value === d.value && h.axisType === d.axisType && h.axisId === d.axisId && g.length === y.length, o && F(g, function(x, S) {
            var T = y[S];
            o = o && x.seriesIndex === T.seriesIndex && x.dataIndex === T.dataIndex;
          }), a && F(h.seriesDataIndices, function(x) {
            var S = x.seriesIndex, T = n[S], C = a[S];
            T && C && C.data !== T.data && (o = !1);
          });
        });
      }), this._lastDataByCoordSys = r, this._cbParamsList = n, !!o;
    }, t.prototype._hide = function(r) {
      this._lastDataByCoordSys = null, r({
        type: "hideTip",
        from: this.uid
      });
    }, t.prototype.dispose = function(r, n) {
      Gt.node || !n.getDom() || (U1(this, "_updatePosition"), this._tooltipContent.dispose(), gI("itemTooltip", n));
    }, t.type = "tooltip", t;
  })(fr)
);
function w_(e, t, r) {
  var n = t.ecModel, i;
  r ? (i = new It(r, n, n), i = new It(t.option, i, n)) : i = t;
  for (var a = e.length - 1; a >= 0; a--) {
    var o = e[a];
    o && (o instanceof It && (o = o.get("tooltip", !0)), Fe(o) && (o = {
      formatter: o
    }), o && (i = new It(o, i, n)));
  }
  return i;
}
function sG(e, t) {
  return e.dispatchAction || Ge(t.dispatchAction, t);
}
function Vge(e, t, r, n, i, a, o) {
  var s = r.getSize(), l = s[0], u = s[1];
  return a != null && (e + l + a + 2 > n ? e -= l + a : e += a), o != null && (t + u + o > i ? t -= u + o : t += o), [e, t];
}
function Hge(e, t, r, n, i) {
  var a = r.getSize(), o = a[0], s = a[1];
  return e = Math.min(e + o, n) - o, t = Math.min(t + s, i) - s, e = Math.max(e, 0), t = Math.max(t, 0), [e, t];
}
function Uge(e, t, r, n) {
  var i = r[0], a = r[1], o = Math.ceil(Math.SQRT2 * n) + 8, s = 0, l = 0, u = t.width, f = t.height;
  switch (e) {
    case "inside":
      s = t.x + u / 2 - i / 2, l = t.y + f / 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 + f + o;
      break;
    case "left":
      s = t.x - i - o, l = t.y + f / 2 - a / 2;
      break;
    case "right":
      s = t.x + u + o, l = t.y + f / 2 - a / 2;
  }
  return [s, l];
}
function lG(e) {
  return e === "center" || e === "middle";
}
function Wge(e, t, r) {
  var n = _R(e).queryOptionMap, i = n.keys()[0];
  if (!(!i || i === "series")) {
    var a = Zm(t, i, n.get(i), {
      useDefault: !1,
      enableAll: !1,
      enableNone: !1
    }), o = a.models[0];
    if (o) {
      var s = r.getViewOfComponentModel(o), l;
      if (s.group.traverse(function(u) {
        var f = pt(u).tooltipConfig;
        if (f && f.name === e.name)
          return l = u, !0;
      }), l)
        return {
          componentMainType: i,
          componentIndex: o.componentIndex,
          el: l
        };
    }
  }
}
function Xge(e) {
  ft(Gx), e.registerComponentModel(Mge), e.registerComponentView(Gge), e.registerAction({
    type: "showTip",
    event: "showTip",
    update: "tooltip:manuallyShowTip"
  }, un), e.registerAction({
    type: "hideTip",
    event: "hideTip",
    update: "tooltip:manuallyHideTip"
  }, un);
}
var Yge = ["rect", "polygon", "keep", "clear"];
function Zge(e, t) {
  var r = Mr(e ? e.brush : []);
  if (r.length) {
    var n = [];
    F(r, function(l) {
      var u = l.hasOwnProperty("toolbox") ? l.toolbox : [];
      u instanceof Array && (n = n.concat(u));
    });
    var i = e && e.toolbox;
    Se(i) && (i = i[0]), i || (i = {
      feature: {}
    }, e.toolbox = [i]);
    var a = i.feature || (i.feature = {}), o = a.brush || (a.brush = {}), s = o.type || (o.type = []);
    s.push.apply(s, n), $ge(s), t && !s.length && s.push.apply(s, Yge);
  }
}
function $ge(e) {
  var t = {};
  F(e, function(r) {
    t[r] = 1;
  }), e.length = 0, F(t, function(r, n) {
    e.push(n);
  });
}
var uG = F;
function fG(e) {
  if (e) {
    for (var t in e)
      if (e.hasOwnProperty(t))
        return !0;
  }
}
function CI(e, t, r) {
  var n = {};
  return uG(t, function(a) {
    var o = n[a] = i();
    uG(e[a], function(s, l) {
      if (ai.isValidType(l)) {
        var u = {
          type: l,
          visual: s
        };
        r && r(u, a), o[l] = new ai(u), l === "opacity" && (u = it(u), u.type = "colorAlpha", o.__hidden.__alphaForOpacity = new ai(u));
      }
    });
  }), n;
  function i() {
    var a = function() {
    };
    a.prototype.__hidden = a.prototype;
    var o = new a();
    return o;
  }
}
function WX(e, t, r) {
  var n;
  F(r, function(i) {
    t.hasOwnProperty(i) && fG(t[i]) && (n = !0);
  }), n && F(r, function(i) {
    t.hasOwnProperty(i) && fG(t[i]) ? e[i] = it(t[i]) : delete e[i];
  });
}
function qge(e, t, r, n, i, a) {
  var o = {};
  F(e, function(c) {
    var h = ai.prepareVisualTypes(t[c]);
    o[c] = h;
  });
  var s;
  function l(c) {
    return sO(r, s, c);
  }
  function u(c, h) {
    G8(r, s, c, h);
  }
  r.each(f);
  function f(c, h) {
    s = c;
    var v = r.getRawDataItem(s);
    if (!(v && v.visualMap === !1))
      for (var d = n.call(i, c), g = t[d], y = o[d], x = 0, S = y.length; x < S; x++) {
        var T = y[x];
        g[T] && g[T].applyVisual(c, l, u);
      }
  }
}
function jge(e, t, r, n) {
  var i = {};
  return F(e, function(a) {
    var o = ai.prepareVisualTypes(t[a]);
    i[a] = o;
  }), {
    progress: function(o, s) {
      var l;
      n != null && (l = s.getDimensionIndex(n));
      function u(A) {
        return sO(s, c, A);
      }
      function f(A, M) {
        G8(s, c, A, M);
      }
      for (var c, h = s.getStore(); (c = o.next()) != null; ) {
        var v = s.getRawDataItem(c);
        if (!(v && v.visualMap === !1))
          for (var d = n != null ? h.get(l, c) : c, g = r(d), y = t[g], x = i[g], S = 0, T = x.length; S < T; S++) {
            var C = x[S];
            y[C] && y[C].applyVisual(d, u, f);
          }
      }
    }
  };
}
function Kge(e) {
  var t = e.brushType, r = {
    point: function(n) {
      return cG[t].point(n, r, e);
    },
    rect: function(n) {
      return cG[t].rect(n, r, e);
    }
  };
  return r;
}
var cG = {
  lineX: hG(0),
  lineY: hG(1),
  rect: {
    point: function(e, t, r) {
      return e && r.boundingRect.contain(e[0], e[1]);
    },
    rect: function(e, t, r) {
      return e && r.boundingRect.intersect(e);
    }
  },
  polygon: {
    point: function(e, t, r) {
      return e && r.boundingRect.contain(e[0], e[1]) && jv(r.range, e[0], e[1]);
    },
    rect: function(e, t, r) {
      var n = r.range;
      if (!e || n.length <= 1)
        return !1;
      var i = e.x, a = e.y, o = e.width, s = e.height, l = n[0];
      if (jv(n, i, a) || jv(n, i + o, a) || jv(n, i, a + s) || jv(n, i + o, a + s) || st.create(e).contain(l[0], l[1]) || W_(i, a, i + o, a, n) || W_(i, a, i, a + s, n) || W_(i + o, a, i + o, a + s, n) || W_(i, a + s, i + o, a + s, n))
        return !0;
    }
  }
};
function hG(e) {
  var t = ["x", "y"], r = ["width", "height"];
  return {
    point: function(n, i, a) {
      if (n) {
        var o = a.range, s = n[e];
        return T_(s, o);
      }
    },
    rect: function(n, i, a) {
      if (n) {
        var o = a.range, s = [n[t[e]], n[t[e]] + n[r[e]]];
        return s[1] < s[0] && s.reverse(), T_(s[0], o) || T_(s[1], o) || T_(o[0], s) || T_(o[1], s);
      }
    }
  };
}
function T_(e, t) {
  return t[0] <= e && e <= t[1];
}
var vG = ["inBrush", "outOfBrush"], DD = "__ecBrushSelect", AI = "__ecInBrushSelectEvent";
function XX(e) {
  e.eachComponent({
    mainType: "brush"
  }, function(t) {
    var r = t.brushTargetManager = new ON(t.option, e);
    r.setInputRanges(t.areas, e);
  });
}
function Qge(e, t, r) {
  var n = [], i, a;
  e.eachComponent({
    mainType: "brush"
  }, function(o) {
    r && r.type === "takeGlobalCursor" && o.setBrushOption(r.key === "brush" ? r.brushOption : {
      brushType: !1
    });
  }), XX(e), e.eachComponent({
    mainType: "brush"
  }, function(o, s) {
    var l = {
      brushId: o.id,
      brushIndex: s,
      brushName: o.name,
      areas: it(o.areas),
      selected: []
    };
    n.push(l);
    var u = o.option, f = u.brushLink, c = [], h = [], v = [], d = !1;
    s || (i = u.throttleType, a = u.throttleDelay);
    var g = Ce(o.areas, function(A) {
      var M = rme[A.brushType], E = tt({
        boundingRect: M ? M(A) : void 0
      }, A);
      return E.selectors = Kge(E), E;
    }), y = CI(o.option, vG, function(A) {
      A.mappingMethod = "fixed";
    });
    Se(f) && F(f, function(A) {
      c[A] = 1;
    });
    function x(A) {
      return f === "all" || !!c[A];
    }
    function S(A) {
      return !!A.length;
    }
    e.eachSeries(function(A, M) {
      var E = v[M] = [];
      A.subType === "parallel" ? T(A, M) : C(A, M, E);
    });
    function T(A, M) {
      var E = A.coordinateSystem;
      d = d || E.hasAxisBrushed(), x(M) && E.eachActiveState(A.getData(), function(P, R) {
        P === "active" && (h[R] = 1);
      });
    }
    function C(A, M, E) {
      if (!(!A.brushSelector || tme(o, M)) && (F(g, function(R) {
        o.brushTargetManager.controlSeries(R, A, e) && E.push(R), d = d || S(E);
      }), x(M) && S(E))) {
        var P = A.getData();
        P.each(function(R) {
          dG(A, E, P, R) && (h[R] = 1);
        });
      }
    }
    e.eachSeries(function(A, M) {
      var E = {
        seriesId: A.id,
        seriesIndex: M,
        seriesName: A.name,
        dataIndex: []
      };
      l.selected.push(E);
      var P = v[M], R = A.getData(), O = x(M) ? function(N) {
        return h[N] ? (E.dataIndex.push(R.getRawIndex(N)), "inBrush") : "outOfBrush";
      } : function(N) {
        return dG(A, P, R, N) ? (E.dataIndex.push(R.getRawIndex(N)), "inBrush") : "outOfBrush";
      };
      (x(M) ? d : S(P)) && qge(vG, y, R, O);
    });
  }), Jge(t, i, a, n, r);
}
function Jge(e, t, r, n, i) {
  if (i) {
    var a = e.getZr();
    if (!a[AI]) {
      a[DD] || (a[DD] = eme);
      var o = ay(a, DD, r, t);
      o(e, n);
    }
  }
}
function eme(e, t) {
  if (!e.isDisposed()) {
    var r = e.getZr();
    r[AI] = !0, e.dispatchAction({
      type: "brushSelect",
      batch: t
    }), r[AI] = !1;
  }
}
function dG(e, t, r, n) {
  for (var i = 0, a = t.length; i < a; i++) {
    var o = t[i];
    if (e.brushSelector(n, r, o.selectors, o))
      return !0;
  }
}
function tme(e, t) {
  var r = e.option.seriesIndex;
  return r != null && r !== "all" && (Se(r) ? Tt(r, t) < 0 : t !== r);
}
var rme = {
  rect: function(e) {
    return pG(e.range);
  },
  polygon: function(e) {
    for (var t, r = e.range, n = 0, i = r.length; n < i; n++) {
      t = t || [[1 / 0, -1 / 0], [1 / 0, -1 / 0]];
      var a = r[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 && pG(t);
  }
};
function pG(e) {
  return new st(e[0][0], e[1][0], e[0][1] - e[0][0], e[1][1] - e[1][0]);
}
var nme = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.init = function(r, n) {
      this.ecModel = r, this.api = n, this.model, (this._brushController = new aN(n.getZr())).on("brush", Ge(this._onBrush, this)).mount();
    }, t.prototype.render = function(r, n, i, a) {
      this.model = r, this._updateController(r, n, i, a);
    }, t.prototype.updateTransform = function(r, n, i, a) {
      XX(n), this._updateController(r, n, i, a);
    }, t.prototype.updateVisual = function(r, n, i, a) {
      this.updateTransform(r, n, i, a);
    }, t.prototype.updateView = function(r, n, i, a) {
      this._updateController(r, n, i, a);
    }, t.prototype._updateController = function(r, n, i, a) {
      (!a || a.$from !== r.id) && this._brushController.setPanels(r.brushTargetManager.makePanelOpts(i)).enableBrush(r.brushOption).updateCovers(r.areas.slice());
    }, t.prototype.dispose = function() {
      this._brushController.dispose();
    }, t.prototype._onBrush = function(r) {
      var n = this.model.id, i = this.model.brushTargetManager.setOutputRanges(r.areas, this.ecModel);
      (!r.isEnd || r.removeOnClick) && this.api.dispatchAction({
        type: "brush",
        brushId: n,
        areas: it(i),
        $from: n
      }), r.isEnd && this.api.dispatchAction({
        type: "brushEnd",
        brushId: n,
        areas: it(i),
        $from: n
      });
    }, t.type = "brush", t;
  })(fr)
), ime = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.areas = [], r.brushOption = {}, r;
    }
    return t.prototype.optionUpdated = function(r, n) {
      var i = this.option;
      !n && WX(i, r, ["inBrush", "outOfBrush"]);
      var a = i.inBrush = i.inBrush || {};
      i.outOfBrush = i.outOfBrush || {
        color: this.option.defaultOutOfBrushColor
      }, a.hasOwnProperty("liftZ") || (a.liftZ = 5);
    }, t.prototype.setAreas = function(r) {
      r && (this.areas = Ce(r, function(n) {
        return gG(this.option, n);
      }, this));
    }, t.prototype.setBrushOption = function(r) {
      this.brushOption = gG(this.option, r), 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: fe.color.backgroundTint,
        borderColor: fe.color.borderTint
      },
      throttleType: "fixRate",
      throttleDelay: 0,
      removeOnClick: !0,
      z: 1e4,
      defaultOutOfBrushColor: fe.color.disabled
    }, t;
  })(At)
);
function gG(e, t) {
  return je({
    brushType: e.brushType,
    brushMode: e.brushMode,
    transformable: e.transformable,
    brushStyle: new It(e.brushStyle).getItemStyle(),
    removeOnClick: e.removeOnClick,
    z: e.z
  }, t, !0);
}
var ame = ["rect", "polygon", "lineX", "lineY", "keep", "clear"], ome = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      return e !== null && e.apply(this, arguments) || this;
    }
    return t.prototype.render = function(r, 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, F(r.get("type", !0), function(l) {
        r.setIconStatus(l, (l === "keep" ? o === "multiple" : l === "clear" ? s : l === a) ? "emphasis" : "normal");
      });
    }, t.prototype.updateView = function(r, n, i) {
      this.render(r, n, i);
    }, t.prototype.getIcons = function() {
      var r = this.model, n = r.get("icon", !0), i = {};
      return F(r.get("type", !0), function(a) {
        n[a] && (i[a] = n[a]);
      }), i;
    }, t.prototype.onclick = function(r, 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(r) {
      var n = {
        show: !0,
        type: ame.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: r.getLocaleModel().get(["toolbox", "brush", "title"])
      };
      return n;
    }, t;
  })(rs)
);
function sme(e) {
  e.registerComponentView(nme), e.registerComponentModel(ime), e.registerPreprocessor(Zge), e.registerVisual(e.PRIORITY.VISUAL.BRUSH, Qge), e.registerAction({
    type: "brush",
    event: "brush",
    update: "updateVisual"
  }, function(t, r) {
    r.eachComponent({
      mainType: "brush",
      query: t
    }, function(n) {
      n.setAreas(t.areas);
    });
  }), e.registerAction({
    type: "brushSelect",
    event: "brushSelected",
    update: "none"
  }, un), e.registerAction({
    type: "brushEnd",
    event: "brushEnd",
    update: "none"
  }, un), rm("brush", ome);
}
var lme = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.layoutMode = {
        type: "box",
        ignoreSize: !0
      }, r;
    }
    return t.type = "title", t.defaultOption = {
      // zlevel: 0,
      z: 6,
      show: !0,
      text: "",
      target: "blank",
      subtext: "",
      subtarget: "blank",
      left: "center",
      top: fe.size.m,
      backgroundColor: fe.color.transparent,
      borderColor: fe.color.primary,
      borderWidth: 0,
      padding: 5,
      itemGap: 10,
      textStyle: {
        fontSize: 18,
        fontWeight: "bold",
        color: fe.color.primary
      },
      subtextStyle: {
        fontSize: 12,
        color: fe.color.quaternary
      }
    }, t;
  })(At)
), ume = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.render = function(r, n, i) {
      if (this.group.removeAll(), !!r.get("show")) {
        var a = this.group, o = r.getModel("textStyle"), s = r.getModel("subtextStyle"), l = r.get("textAlign"), u = et(r.get("textBaseline"), r.get("textVerticalAlign")), f = new Rt({
          style: gr(o, {
            text: r.get("text"),
            fill: o.getTextColor()
          }, {
            disableBox: !0
          }),
          z2: 10
        }), c = f.getBoundingRect(), h = r.get("subtext"), v = new Rt({
          style: gr(s, {
            text: h,
            fill: s.getTextColor(),
            y: c.height + r.get("itemGap"),
            verticalAlign: "top"
          }, {
            disableBox: !0
          }),
          z2: 10
        }), d = r.get("link"), g = r.get("sublink"), y = r.get("triggerEvent", !0);
        f.silent = !d && !y, v.silent = !g && !y, d && f.on("click", function() {
          ib(d, "_" + r.get("target"));
        }), g && v.on("click", function() {
          ib(g, "_" + r.get("subtarget"));
        }), pt(f).eventData = pt(v).eventData = y ? {
          componentType: "title",
          componentIndex: r.componentIndex
        } : null, a.add(f), h && a.add(v);
        var x = a.getBoundingRect(), S = r.getBoxLayoutParams();
        S.width = x.width, S.height = x.height;
        var T = Yn(r, i), C = Tr(S, T.refContainer, r.get("padding"));
        l || (l = r.get("left") || r.get("right"), l === "middle" && (l = "center"), l === "right" ? C.x += C.width : l === "center" && (C.x += C.width / 2)), u || (u = r.get("top") || r.get("bottom"), u === "center" && (u = "middle"), u === "bottom" ? C.y += C.height : u === "middle" && (C.y += C.height / 2), u = u || "top"), a.x = C.x, a.y = C.y, a.markRedraw();
        var A = {
          align: l,
          verticalAlign: u
        };
        f.setStyle(A), v.setStyle(A), x = a.getBoundingRect();
        var M = C.margin, E = r.getItemStyle(["color", "opacity"]);
        E.fill = r.get("backgroundColor");
        var P = new Mt({
          shape: {
            x: x.x - M[3],
            y: x.y - M[0],
            width: x.width + M[1] + M[3],
            height: x.height + M[0] + M[2],
            r: r.get("borderRadius")
          },
          style: E,
          subPixelOptimize: !0,
          silent: !0
        });
        a.add(P);
      }
    }, t.type = "title", t;
  })(fr)
);
function fme(e) {
  e.registerComponentModel(lme), e.registerComponentView(ume);
}
var mG = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.layoutMode = "box", r;
    }
    return t.prototype.init = function(r, n, i) {
      this.mergeDefaultAndTheme(r, i), this._initData();
    }, t.prototype.mergeOption = function(r) {
      e.prototype.mergeOption.apply(this, arguments), this._initData();
    }, t.prototype.setCurrentIndex = function(r) {
      r == null && (r = this.option.currentIndex);
      var n = this._data.count();
      this.option.loop ? r = (r % n + n) % n : (r >= n && (r = n - 1), r < 0 && (r = 0)), this.option.currentIndex = r;
    }, t.prototype.getCurrentIndex = function() {
      return this.option.currentIndex;
    }, t.prototype.isIndexMax = function() {
      return this.getCurrentIndex() >= this._data.count() - 1;
    }, t.prototype.setPlayState = function(r) {
      this.option.autoPlay = !!r;
    }, t.prototype.getPlayState = function() {
      return !!this.option.autoPlay;
    }, t.prototype._initData = function() {
      var r = this.option, n = r.data || [], i = r.axisType, a = this._names = [], o;
      i === "category" ? (o = [], F(n, function(u, f) {
        var c = Gn(Ym(u), ""), h;
        ot(u) ? (h = it(u), h.value = f) : h = f, o.push(h), a.push(c);
      })) : o = n;
      var s = {
        category: "ordinal",
        time: "time",
        value: "number"
      }[i] || "number", l = this._data = new zr([{
        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: fe.size.m,
      controlPosition: "left",
      autoPlay: !1,
      rewind: !1,
      loop: !0,
      playInterval: 2e3,
      currentIndex: 0,
      itemStyle: {},
      label: {
        color: fe.color.secondary
      },
      data: []
    }, t;
  })(At)
), YX = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.type = "timeline.slider", t.defaultOption = nh(mG.defaultOption, {
      backgroundColor: "rgba(0,0,0,0)",
      borderColor: fe.color.border,
      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: fe.color.accent10
      },
      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: fe.color.tertiary
      },
      itemStyle: {
        color: fe.color.accent20,
        borderWidth: 0
      },
      checkpointStyle: {
        symbol: "circle",
        symbolSize: 15,
        color: fe.color.accent50,
        borderColor: fe.color.accent50,
        borderWidth: 0,
        shadowBlur: 0,
        shadowOffsetX: 0,
        shadowOffsetY: 0,
        shadowColor: "rgba(0, 0, 0, 0)",
        // 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://M15 0C23.2843 0 30 6.71573 30 15C30 23.2843 23.2843 30 15 30C6.71573 30 0 23.2843 0 15C0 6.71573 6.71573 0 15 0ZM15 3C8.37258 3 3 8.37258 3 15C3 21.6274 8.37258 27 15 27C21.6274 27 27 21.6274 27 15C27 8.37258 21.6274 3 15 3ZM11.5 10.6699C11.5 9.90014 12.3333 9.41887 13 9.80371L20.5 14.1338C21.1667 14.5187 21.1667 15.4813 20.5 15.8662L13 20.1963C12.3333 20.5811 11.5 20.0999 11.5 19.3301V10.6699Z",
        stopIcon: "path://M15 0C23.2843 0 30 6.71573 30 15C30 23.2843 23.2843 30 15 30C6.71573 30 0 23.2843 0 15C0 6.71573 6.71573 0 15 0ZM15 3C8.37258 3 3 8.37258 3 15C3 21.6274 8.37258 27 15 27C21.6274 27 27 21.6274 27 15C27 8.37258 21.6274 3 15 3ZM11.5 10C12.3284 10 13 10.6716 13 11.5V18.5C13 19.3284 12.3284 20 11.5 20C10.6716 20 10 19.3284 10 18.5V11.5C10 10.6716 10.6716 10 11.5 10ZM18.5 10C19.3284 10 20 10.6716 20 11.5V18.5C20 19.3284 19.3284 20 18.5 20C17.6716 20 17 19.3284 17 18.5V11.5C17 10.6716 17.6716 10 18.5 10Z",
        // eslint-disable-next-line max-len
        nextIcon: "path://M0.838834 18.7383C0.253048 18.1525 0.253048 17.2028 0.838834 16.617L7.55635 9.89949L0.838834 3.18198C0.253048 2.59619 0.253048 1.64645 0.838834 1.06066C1.42462 0.474874 2.37437 0.474874 2.96015 1.06066L10.7383 8.83883L10.8412 8.95277C11.2897 9.50267 11.2897 10.2963 10.8412 10.8462L10.7383 10.9602L2.96015 18.7383C2.37437 19.3241 1.42462 19.3241 0.838834 18.7383Z",
        // eslint-disable-next-line max-len
        prevIcon: "path://M10.9602 1.06066C11.5459 1.64645 11.5459 2.59619 10.9602 3.18198L4.24264 9.89949L10.9602 16.617C11.5459 17.2028 11.5459 18.1525 10.9602 18.7383C10.3744 19.3241 9.42462 19.3241 8.83883 18.7383L1.06066 10.9602L0.957771 10.8462C0.509245 10.2963 0.509245 9.50267 0.957771 8.95277L1.06066 8.83883L8.83883 1.06066C9.42462 0.474874 10.3744 0.474874 10.9602 1.06066Z",
        prevBtnSize: 18,
        nextBtnSize: 18,
        color: fe.color.accent50,
        borderColor: fe.color.accent50,
        borderWidth: 0
      },
      emphasis: {
        label: {
          show: !0,
          // 其余属性默认使用全局文本样式，详见TEXTSTYLE
          color: fe.color.accent60
        },
        itemStyle: {
          color: fe.color.accent60,
          borderColor: fe.color.accent60
        },
        controlStyle: {
          color: fe.color.accent70,
          borderColor: fe.color.accent70
        }
      },
      progress: {
        lineStyle: {
          color: fe.color.accent30
        },
        itemStyle: {
          color: fe.color.accent40
        }
      },
      data: []
    }), t;
  })(mG)
);
cn(YX, RC.prototype);
var cme = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.type = "timeline", t;
  })(fr)
), hme = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r, n, i, a) {
      var o = e.call(this, r, 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;
  })(ra)
), ED = Math.PI, yG = Bt(), vme = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.init = function(r, n) {
      this.api = n;
    }, t.prototype.render = function(r, n, i) {
      if (this.model = r, this.api = i, this.ecModel = n, this.group.removeAll(), r.get("show", !0)) {
        var a = this._layout(r, i), o = this._createGroup("_mainGroup"), s = this._createGroup("_labelGroup"), l = this._axis = this._createAxis(a, r);
        r.formatTooltip = function(u) {
          var f = l.scale.getLabel({
            value: u
          });
          return Rn("nameValue", {
            noName: !0,
            value: f
          });
        }, F(["AxisLine", "AxisTick", "Control", "CurrentPointer"], function(u) {
          this["_render" + u](a, o, l, r);
        }, this), this._renderAxisLabel(a, s, l, r), this._position(a, r);
      }
      this._doPlayStop(), this._updateTicksStatus();
    }, t.prototype.remove = function() {
      this._clearTimer(), this.group.removeAll();
    }, t.prototype.dispose = function() {
      this._clearTimer();
    }, t.prototype._layout = function(r, n) {
      var i = r.get(["label", "position"]), a = r.get("orient"), o = pme(r, 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 ? "+" : "-" : Fe(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"
      }, f = {
        horizontal: 0,
        vertical: ED / 2
      }, c = a === "vertical" ? o.height : o.width, h = r.getModel("controlStyle"), v = h.get("show", !0), d = v ? h.get("itemSize") : 0, g = v ? h.get("itemGap") : 0, y = d + g, x = r.get(["label", "rotate"]) || 0;
      x = x * ED / 180;
      var S, T, C, A = h.get("position", !0), M = v && h.get("showPlayBtn", !0), E = v && h.get("showPrevBtn", !0), P = v && h.get("showNextBtn", !0), R = 0, O = c;
      A === "left" || A === "bottom" ? (M && (S = [0, 0], R += y), E && (T = [R, 0], R += y), P && (C = [O - d, 0], O -= y)) : (M && (S = [O - d, 0], O -= y), E && (T = [0, 0], R += y), P && (C = [O - d, 0], O -= y));
      var N = [R, O];
      return r.get("inverse") && N.reverse(), {
        viewRect: o,
        mainLength: c,
        orient: a,
        rotation: f[a],
        labelRotation: x,
        labelPosOpt: s,
        labelAlign: r.get(["label", "align"]) || l[a],
        labelBaseline: r.get(["label", "verticalAlign"]) || r.get(["label", "baseline"]) || u[a],
        // Based on mainGroup.
        playPosition: S,
        prevBtnPosition: T,
        nextBtnPosition: C,
        axisExtent: N,
        controlSize: d,
        controlGap: g
      };
    }, t.prototype._position = function(r, n) {
      var i = this._mainGroup, a = this._labelGroup, o = r.viewRect;
      if (r.orient === "vertical") {
        var s = ii(), l = o.x, u = o.y + o.height;
        Zs(s, s, [-l, -u]), Tf(s, s, -ED / 2), Zs(s, s, [l, u]), o = o.clone(), o.applyTransform(s);
      }
      var f = S(o), c = S(i.getBoundingRect()), h = S(a.getBoundingRect()), v = [i.x, i.y], d = [a.x, a.y];
      d[0] = v[0] = f[0][0];
      var g = r.labelPosOpt;
      if (g == null || Fe(g)) {
        var y = g === "+" ? 0 : 1;
        T(v, c, f, 1, y), T(d, h, f, 1, 1 - y);
      } else {
        var y = g >= 0 ? 0 : 1;
        T(v, c, f, 1, y), d[1] = v[1] + g;
      }
      i.setPosition(v), a.setPosition(d), i.rotation = a.rotation = r.rotation, x(i), x(a);
      function x(C) {
        C.originX = f[0][0] - C.x, C.originY = f[1][0] - C.y;
      }
      function S(C) {
        return [[C.x, C.x + C.width], [C.y, C.y + C.height]];
      }
      function T(C, A, M, E, P) {
        C[E] += M[E][P] - A[E][P];
      }
    }, t.prototype._createAxis = function(r, n) {
      var i = n.getData(), a = n.get("axisType"), o = dme(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 hme("value", o, r.axisExtent, a);
      return l.model = n, l;
    }, t.prototype._createGroup = function(r) {
      var n = this[r] = new rt();
      return this.group.add(n), n;
    }, t.prototype._renderAxisLine = function(r, n, i, a) {
      var o = i.getExtent();
      if (a.get(["lineStyle", "show"])) {
        var s = new wn({
          shape: {
            x1: o[0],
            y1: 0,
            x2: o[1],
            y2: 0
          },
          style: xe({
            lineCap: "round"
          }, a.getModel("lineStyle").getLineStyle()),
          silent: !0,
          z2: 1
        });
        n.add(s);
        var l = this._progressLine = new wn({
          shape: {
            x1: o[0],
            x2: this._currentPointer ? this._currentPointer.x : o[0],
            y1: 0,
            y2: 0
          },
          style: tt({
            lineCap: "round",
            lineWidth: s.style.lineWidth
          }, a.getModel(["progress", "lineStyle"]).getLineStyle()),
          silent: !0,
          z2: 1
        });
        n.add(l);
      }
    }, t.prototype._renderAxisTick = function(r, n, i, a) {
      var o = this, s = a.getData(), l = i.scale.getTicks();
      this._tickSymbols = [], F(l, function(u) {
        var f = i.dataToCoord(u.value), c = s.getItemModel(u.value), h = c.getModel("itemStyle"), v = c.getModel(["emphasis", "itemStyle"]), d = c.getModel(["progress", "itemStyle"]), g = {
          x: f,
          y: 0,
          onclick: Ge(o._changeTimeline, o, u.value)
        }, y = _G(c, h, n, g);
        y.ensureState("emphasis").style = v.getItemStyle(), y.ensureState("progress").style = d.getItemStyle(), jl(y);
        var x = pt(y);
        c.get("tooltip") ? (x.dataIndex = u.value, x.dataModel = a) : x.dataIndex = x.dataModel = null, o._tickSymbols.push(y);
      });
    }, t.prototype._renderAxisLabel = function(r, n, i, a) {
      var o = this, s = i.getLabelModel();
      if (s.get("show")) {
        var l = a.getData(), u = i.getViewLabels();
        this._tickLabels = [], F(u, function(f) {
          var c = f.tickValue, h = l.getItemModel(c), v = h.getModel("label"), d = h.getModel(["emphasis", "label"]), g = h.getModel(["progress", "label"]), y = i.dataToCoord(f.tickValue), x = new Rt({
            x: y,
            y: 0,
            rotation: r.labelRotation - r.rotation,
            onclick: Ge(o._changeTimeline, o, c),
            silent: !1,
            style: gr(v, {
              text: f.formattedLabel,
              align: r.labelAlign,
              verticalAlign: r.labelBaseline
            })
          });
          x.ensureState("emphasis").style = gr(d), x.ensureState("progress").style = gr(g), n.add(x), jl(x), yG(x).dataIndex = c, o._tickLabels.push(x);
        });
      }
    }, t.prototype._renderControl = function(r, n, i, a) {
      var o = r.controlSize, s = r.rotation, l = a.getModel("controlStyle").getItemStyle(), u = a.getModel(["emphasis", "controlStyle"]).getItemStyle(), f = a.getPlayState(), c = a.get("inverse", !0);
      h(r.nextBtnPosition, "next", Ge(this._changeTimeline, this, c ? "-" : "+")), h(r.prevBtnPosition, "prev", Ge(this._changeTimeline, this, c ? "+" : "-")), h(r.playPosition, f ? "stop" : "play", Ge(this._handlePlayClick, this, !f), !0);
      function h(v, d, g, y) {
        if (v) {
          var x = $s(et(a.get(["controlStyle", d + "BtnSize"]), o), o), S = [0, -x / 2, x, x], T = gme(a, d + "Icon", S, {
            x: v[0],
            y: v[1],
            originX: o / 2,
            originY: 0,
            rotation: y ? -s : 0,
            rectHover: !0,
            style: l,
            onclick: g
          });
          T.ensureState("emphasis").style = u, n.add(T), jl(T);
        }
      }
    }, t.prototype._renderCurrentPointer = function(r, n, i, a) {
      var o = a.getData(), s = a.getCurrentIndex(), l = o.getItemModel(s).getModel("checkpointStyle"), u = this, f = {
        onCreate: function(c) {
          c.draggable = !0, c.drift = Ge(u._handlePointerDrag, u), c.ondragend = Ge(u._handlePointerDragend, u), xG(c, u._progressLine, s, i, a, !0);
        },
        onUpdate: function(c) {
          xG(c, u._progressLine, s, i, a);
        }
      };
      this._currentPointer = _G(l, l, this._mainGroup, {}, this._currentPointer, f);
    }, t.prototype._handlePlayClick = function(r) {
      this._clearTimer(), this.api.dispatchAction({
        type: "timelinePlayChange",
        playState: r,
        from: this.uid
      });
    }, t.prototype._handlePointerDrag = function(r, n, i) {
      this._clearTimer(), this._pointerChangeTimeline([i.offsetX, i.offsetY]);
    }, t.prototype._handlePointerDragend = function(r) {
      this._pointerChangeTimeline([r.offsetX, r.offsetY], !0);
    }, t.prototype._pointerChangeTimeline = function(r, n) {
      var i = this._toAxisCoord(r)[0], a = this._axis, o = xo(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 r = this;
      this._clearTimer(), this.model.getPlayState() && (this._timer = setTimeout(function() {
        var n = r.model;
        r._changeTimeline(n.getCurrentIndex() + (n.get("rewind", !0) ? -1 : 1));
      }, this.model.get("playInterval")));
    }, t.prototype._toAxisCoord = function(r) {
      var n = this._mainGroup.getLocalTransform();
      return Ws(r, n, !0);
    }, t.prototype._findNearestTick = function(r) {
      var n = this.model.getData(), i = 1 / 0, a, o = this._axis;
      return n.each(["value"], function(s, l) {
        var u = o.dataToCoord(s), f = Math.abs(u - r);
        f < i && (i = f, a = l);
      }), a;
    }, t.prototype._clearTimer = function() {
      this._timer && (clearTimeout(this._timer), this._timer = null);
    }, t.prototype._changeTimeline = function(r) {
      var n = this.model.getCurrentIndex();
      r === "+" ? r = n + 1 : r === "-" && (r = n - 1), this.api.dispatchAction({
        type: "timelineChange",
        currentIndex: r,
        from: this.uid
      });
    }, t.prototype._updateTicksStatus = function() {
      var r = 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 < r);
      if (i)
        for (var a = 0; a < i.length; a++)
          i && i[a] && i[a].toggleState("progress", yG(i[a]).dataIndex <= r);
    }, t.type = "timeline.slider", t;
  })(cme)
);
function dme(e, t) {
  if (t = t || e.get("type"), t)
    switch (t) {
      // Buildin scale
      case "category":
        return new Lm({
          ordinalMeta: e.getCategories(),
          extent: [1 / 0, -1 / 0]
        });
      case "time":
        return new CO({
          locale: e.ecModel.getLocaleModel(),
          useUTC: e.ecModel.get("useUTC")
        });
      default:
        return new Sf();
    }
}
function pme(e, t) {
  return Tr(e.getBoxLayoutParams(), Yn(e, t).refContainer, e.get("padding"));
}
function gme(e, t, r, n) {
  var i = n.style, a = Jm(e.get(["controlStyle", t]), n || {}, new st(r[0], r[1], r[2], r[3]));
  return i && a.setStyle(i), a;
}
function _G(e, t, r, n, i, a) {
  var o = t.get("color");
  if (i)
    i.setColor(o), r.add(i), a && a.onUpdate(i);
  else {
    var s = e.get("symbol");
    i = en(s, -1, -1, 2, 2, o), i.setStyle("strokeNoScale", !0), r.add(i), a && a.onCreate(i);
  }
  var l = t.getItemStyle(["color"]);
  i.setStyle(l), n = je({
    rectHover: !0,
    z2: 100
  }, n, !0);
  var u = oy(e.get("symbolSize"));
  n.scaleX = u[0] / 2, n.scaleY = u[1] / 2;
  var f = Fd(e.get("symbolOffset"), u);
  f && (n.x = (n.x || 0) + f[0], n.y = (n.y || 0) + f[1]);
  var c = e.get("symbolRotate");
  return n.rotation = (c || 0) * Math.PI / 180 || 0, i.attr(n), i.updateTransform(), i;
}
function xG(e, t, r, n, i, a) {
  if (!e.dragging) {
    var o = i.getModel("checkpointStyle"), s = n.dataToCoord(i.getData().get("value", r));
    if (a || !o.get("animation", !0))
      e.attr({
        x: s,
        y: 0
      }), t && t.attr({
        shape: {
          x2: s
        }
      });
    else {
      var l = {
        duration: o.get("animationDuration", !0),
        easing: o.get("animationEasing", !0)
      };
      e.stopAnimation(null, !0), e.animateTo({
        x: s,
        y: 0
      }, l), t && t.animateTo({
        shape: {
          x2: s
        }
      }, l);
    }
  }
}
function mme(e) {
  e.registerAction({
    type: "timelineChange",
    event: "timelineChanged",
    update: "prepareAndUpdate"
  }, function(t, r, n) {
    var i = r.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
    }))), r.resetOption("timeline", {
      replaceMerge: i.get("replaceMerge", !0)
    }), tt({
      currentIndex: i.option.currentIndex
    }, t);
  }), e.registerAction({
    type: "timelinePlayChange",
    event: "timelinePlayChanged",
    update: "update"
  }, function(t, r) {
    var n = r.getComponent("timeline");
    n && t.playState != null && n.setPlayState(t.playState);
  });
}
function yme(e) {
  var t = e && e.timeline;
  Se(t) || (t = t ? [t] : []), F(t, function(r) {
    r && _me(r);
  });
}
function _me(e) {
  var t = e.type, r = {
    number: "value",
    time: "time"
  };
  if (r[t] && (e.axisType = r[t], delete e.type), SG(e), Jv(e, "controlPosition")) {
    var n = e.controlStyle || (e.controlStyle = {});
    Jv(n, "position") || (n.position = e.controlPosition), n.position === "none" && !Jv(n, "show") && (n.show = !1, delete n.position), delete e.controlPosition;
  }
  F(e.data || [], function(i) {
    ot(i) && !Se(i) && (!Jv(i, "value") && Jv(i, "name") && (i.value = i.name), SG(i));
  });
}
function SG(e) {
  var t = e.itemStyle || (e.itemStyle = {}), r = t.emphasis || (t.emphasis = {}), n = e.label || e.label || {}, i = n.normal || (n.normal = {}), a = {
    normal: 1,
    emphasis: 1
  };
  F(n, function(o, s) {
    !a[s] && !Jv(i, s) && (i[s] = o);
  }), r.label && !Jv(n, "emphasis") && (n.emphasis = r.label, delete r.label);
}
function Jv(e, t) {
  return e.hasOwnProperty(t);
}
function xme(e) {
  e.registerComponentModel(YX), e.registerComponentView(vme), e.registerSubTypeDefaulter("timeline", function() {
    return "slider";
  }), mme(e), e.registerPreprocessor(yme);
}
function BN(e, t) {
  if (!e)
    return !1;
  for (var r = Se(e) ? e : [e], n = 0; n < r.length; n++)
    if (r[n] && r[n][t])
      return !0;
  return !1;
}
function OT(e) {
  xd(e, "label", ["show"]);
}
var NT = Bt(), au = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.createdBySelf = !1, r.preventAutoZ = !0, r;
    }
    return t.prototype.init = function(r, n, i) {
      this.mergeDefaultAndTheme(r, i), this._mergeOption(r, i, !1, !0);
    }, t.prototype.isAnimationEnabled = function() {
      if (Gt.node)
        return !1;
      var r = this.__hostSeries;
      return this.getShallow("animation") && r && r.isAnimationEnabled();
    }, t.prototype.mergeOption = function(r, n) {
      this._mergeOption(r, n, !1, !1);
    }, t.prototype._mergeOption = function(r, n, i, a) {
      var o = this.mainType;
      i || n.eachSeries(function(s) {
        var l = s.get(this.mainType, !0), u = NT(s)[o];
        if (!l || !l.data) {
          NT(s)[o] = null;
          return;
        }
        u ? u._mergeOption(l, n, !0) : (a && OT(l), F(l.data, function(f) {
          f instanceof Array ? (OT(f[0]), OT(f[1])) : OT(f);
        }), u = this.createMarkerModelFromSeries(l, this, n), xe(u, {
          mainType: this.mainType,
          // Use the same series index and name
          seriesIndex: s.seriesIndex,
          name: s.name,
          createdBySelf: !0
        }), u.__hostSeries = s), NT(s)[o] = u;
      }, this);
    }, t.prototype.formatTooltip = function(r, n, i) {
      var a = this.getData(), o = this.getRawValue(r), s = a.getName(r);
      return Rn("section", {
        header: this.name,
        blocks: [Rn("nameValue", {
          name: s,
          value: o,
          noName: !s,
          noValue: o == null
        })]
      });
    }, t.prototype.getData = function() {
      return this._data;
    }, t.prototype.setData = function(r) {
      this._data = r;
    }, t.prototype.getDataParams = function(r, n) {
      var i = RC.prototype.getDataParams.call(this, r, n), a = this.__hostSeries;
      return a && (i.seriesId = a.id, i.seriesName = a.name, i.seriesType = a.subType), i;
    }, t.getMarkerModelFromSeries = function(r, n) {
      return NT(r)[n];
    }, t.type = "marker", t.dependencies = ["series", "grid", "polar", "geo"], t;
  })(At)
);
cn(au, RC.prototype);
var Sme = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.createMarkerModelFromSeries = function(r, n, i) {
      return new t(r, 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;
  })(au)
);
function MI(e) {
  return !(isNaN(parseFloat(e.x)) && isNaN(parseFloat(e.y)));
}
function wme(e) {
  return !isNaN(parseFloat(e.x)) && !isNaN(parseFloat(e.y));
}
function kT(e, t, r, n, i, a, o) {
  var s = [], l = xf(
    t,
    i
    /* , otherDataDim */
  ), u = l ? t.getCalculationInfo("stackResultDimension") : i, f = Gb(t, u, e), c = t.hostModel, h = c.indicesOfNearest(r, u, f)[0];
  s[a] = t.get(n, h), s[o] = t.get(u, h);
  var v = t.get(i, h), d = Gs(t.get(i, h));
  return d = Math.min(d, 20), d >= 0 && (s[o] = +s[o].toFixed(d)), [s, v];
}
var BT = {
  min: St(kT, "min"),
  max: St(kT, "max"),
  average: St(kT, "average"),
  median: St(kT, "median")
};
function ax(e, t) {
  if (t) {
    var r = e.getData(), n = e.coordinateSystem, i = n && n.dimensions;
    if (!wme(t) && !Se(t.coord) && Se(i)) {
      var a = ZX(t, r, n, e);
      if (t = it(t), t.type && BT[t.type] && a.baseAxis && a.valueAxis) {
        var o = Tt(i, a.baseAxis.dim), s = Tt(i, a.valueAxis.dim), l = BT[t.type](r, a.valueAxis.dim, 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 || !Se(i)) {
      t.coord = [];
      var u = e.getBaseAxis();
      if (u && t.type && BT[t.type]) {
        var f = n.getOtherAxis(u);
        f && (t.value = Gb(r, r.mapDimension(f.dim), t.type));
      }
    } else
      for (var c = t.coord, h = 0; h < 2; h++)
        BT[c[h]] && (c[h] = Gb(r, r.mapDimension(i[h]), c[h]));
    return t;
  }
}
function ZX(e, t, r, n) {
  var i = {};
  return e.valueIndex != null || e.valueDim != null ? (i.valueDataDim = e.valueIndex != null ? t.getDimension(e.valueIndex) : e.valueDim, i.valueAxis = r.getAxis(Tme(n, i.valueDataDim)), i.baseAxis = r.getOtherAxis(i.valueAxis), i.baseDataDim = t.mapDimension(i.baseAxis.dim)) : (i.baseAxis = n.getBaseAxis(), i.valueAxis = r.getOtherAxis(i.baseAxis), i.baseDataDim = t.mapDimension(i.baseAxis.dim), i.valueDataDim = t.mapDimension(i.valueAxis.dim)), i;
}
function Tme(e, t) {
  var r = e.getData().getDimensionInfo(t);
  return r && r.coordDim;
}
function ox(e, t) {
  return e && e.containData && t.coord && !MI(t) ? e.containData(t.coord) : !0;
}
function bme(e, t, r) {
  return e && e.containZone && t.coord && r.coord && !MI(t) && !MI(r) ? e.containZone(t.coord, r.coord) : !0;
}
function $X(e, t) {
  return e ? function(r, n, i, a) {
    var o = a < 2 ? r.coord && r.coord[a] : r.value;
    return Wc(o, t[a]);
  } : function(r, n, i, a) {
    return Wc(r.value, t[a]);
  };
}
function Gb(e, t, r) {
  if (r === "average") {
    var n = 0, i = 0;
    return e.each(t, function(a, o) {
      isNaN(a) || (n += a, i++);
    }), n / i;
  } else return r === "median" ? e.getMedian(t) : e.getDataExtent(t)[r === "max" ? 1 : 0];
}
var PD = Bt(), zN = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.init = function() {
      this.markerGroupMap = Je();
    }, t.prototype.render = function(r, n, i) {
      var a = this, o = this.markerGroupMap;
      o.each(function(s) {
        PD(s).keep = !1;
      }), n.eachSeries(function(s) {
        var l = au.getMarkerModelFromSeries(s, a.type);
        l && a.renderSeries(s, l, n, i);
      }), o.each(function(s) {
        !PD(s).keep && a.group.remove(s.group);
      }), Cme(n, o, this.type);
    }, t.prototype.markKeep = function(r) {
      PD(r).keep = !0;
    }, t.prototype.toggleBlurSeries = function(r, n) {
      var i = this;
      F(r, function(a) {
        var o = au.getMarkerModelFromSeries(a, i.type);
        if (o) {
          var s = o.getData();
          s.eachItemGraphicEl(function(l) {
            l && (n ? lW(l) : MR(l));
          });
        }
      });
    }, t.type = "marker", t;
  })(fr)
);
function Cme(e, t, r) {
  e.eachSeries(function(n) {
    var i = au.getMarkerModelFromSeries(n, r), a = t.get(n.id);
    if (i && a && a.group) {
      var o = Cd(i), s = o.z, l = o.zlevel;
      LC(a.group, s, l);
    }
  });
}
function wG(e, t, r) {
  var n = t.coordinateSystem, i = r.getWidth(), a = r.getHeight(), o = n && n.getArea && n.getArea();
  e.each(function(s) {
    var l = e.getItemModel(s), u = l.get("relativeTo") === "coordinate", f = u ? o ? o.width : 0 : i, c = u ? o ? o.height : 0 : a, h = u && o ? o.x : 0, v = u && o ? o.y : 0, d, g = Be(l.get("x"), f) + h, y = Be(l.get("y"), c) + v;
    if (!isNaN(g) && !isNaN(y))
      d = [g, y];
    else if (t.getMarkerPosition)
      d = t.getMarkerPosition(e.getValues(e.dimensions, s));
    else if (n) {
      var x = e.get(n.dimensions[0], s), S = e.get(n.dimensions[1], s);
      d = n.dataToPoint([x, S]);
    }
    isNaN(g) || (d[0] = g), isNaN(y) || (d[1] = y), e.setItemLayout(s, d);
  });
}
var Ame = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.updateTransform = function(r, n, i) {
      n.eachSeries(function(a) {
        var o = au.getMarkerModelFromSeries(a, "markPoint");
        o && (wG(o.getData(), a, i), this.markerGroupMap.get(a.id).updateLayout());
      }, this);
    }, t.prototype.renderSeries = function(r, n, i, a) {
      var o = r.coordinateSystem, s = r.id, l = r.getData(), u = this.markerGroupMap, f = u.get(s) || u.set(s, new kx()), c = Mme(o, r, n);
      n.setData(c), wG(n.getData(), r, a), c.each(function(h) {
        var v = c.getItemModel(h), d = v.getShallow("symbol"), g = v.getShallow("symbolSize"), y = v.getShallow("symbolRotate"), x = v.getShallow("symbolOffset"), S = v.getShallow("symbolKeepAspect");
        if (nt(d) || nt(g) || nt(y) || nt(x)) {
          var T = n.getRawValue(h), C = n.getDataParams(h);
          nt(d) && (d = d(T, C)), nt(g) && (g = g(T, C)), nt(y) && (y = y(T, C)), nt(x) && (x = x(T, C));
        }
        var A = v.getModel("itemStyle").getItemStyle(), M = v.get("z2"), E = Px(l, "color");
        A.fill || (A.fill = E), c.setItemVisual(h, {
          z2: et(M, 0),
          symbol: d,
          symbolSize: g,
          symbolRotate: y,
          symbolOffset: x,
          symbolKeepAspect: S,
          style: A
        });
      }), f.updateData(c), this.group.add(f.group), c.eachItemGraphicEl(function(h) {
        h.traverse(function(v) {
          pt(v).dataModel = n;
        });
      }), this.markKeep(f), f.group.silent = n.get("silent") || r.get("silent");
    }, t.type = "markPoint", t;
  })(zN)
);
function Mme(e, t, r) {
  var n;
  e ? n = Ce(e && e.dimensions, function(s) {
    var l = t.getData().getDimensionInfo(t.getData().mapDimension(s)) || {};
    return xe(xe({}, l), {
      name: s,
      // DON'T use ordinalMeta to parse and collect ordinal.
      ordinalMeta: null
    });
  }) : n = [{
    name: "value",
    type: "float"
  }];
  var i = new zr(n, r), a = Ce(r.get("data"), St(ax, t));
  e && (a = nr(a, St(ox, e)));
  var o = $X(!!e, n);
  return i.initData(a, null, o), i;
}
function Lme(e) {
  e.registerComponentModel(Sme), e.registerComponentView(Ame), e.registerPreprocessor(function(t) {
    BN(t.series, "markPoint") && (t.markPoint = t.markPoint || {});
  });
}
var Dme = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.createMarkerModelFromSeries = function(r, n, i) {
      return new t(r, 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;
  })(au)
), zT = Bt(), Eme = function(e, t, r, n) {
  var i = e.getData(), a;
  if (Se(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 = Ti(n.yAxis, n.xAxis);
      else {
        var u = ZX(n, i, t, e);
        s = u.valueAxis;
        var f = wO(i, u.valueDataDim);
        l = Gb(i, f, o);
      }
      var c = s.dim === "x" ? 0 : 1, h = 1 - c, v = it(n), d = {
        coord: []
      };
      v.type = null, v.coord = [], v.coord[h] = -1 / 0, d.coord[h] = 1 / 0;
      var g = r.get("precision");
      g >= 0 && Xt(l) && (l = +l.toFixed(Math.min(g, 20))), v.coord[c] = d.coord[c] = l, a = [v, d, {
        type: o,
        valueIndex: n.valueIndex,
        // Force to use the value of calculated value.
        value: l
      }];
    } else
      a = [];
  }
  var y = [ax(e, a[0]), ax(e, a[1]), xe({}, a[2])];
  return y[2].type = y[2].type || null, je(y[2], y[0]), je(y[2], y[1]), y;
};
function Vb(e) {
  return !isNaN(e) && !isFinite(e);
}
function TG(e, t, r, n) {
  var i = 1 - e, a = n.dimensions[e];
  return Vb(t[i]) && Vb(r[i]) && t[e] === r[e] && n.getAxis(a).containData(t[e]);
}
function Pme(e, t) {
  if (e.type === "cartesian2d") {
    var r = t[0].coord, n = t[1].coord;
    if (r && n && (TG(1, r, n, e) || TG(0, r, n, e)))
      return !0;
  }
  return ox(e, t[0]) && ox(e, t[1]);
}
function ID(e, t, r, n, i) {
  var a = n.coordinateSystem, o = e.getItemModel(t), s, l = Be(o.get("x"), i.getWidth()), u = Be(o.get("y"), i.getHeight());
  if (!isNaN(l) && !isNaN(u))
    s = [l, u];
  else {
    if (n.getMarkerPosition)
      s = n.getMarkerPosition(e.getValues(e.dimensions, t));
    else {
      var f = a.dimensions, c = e.get(f[0], t), h = e.get(f[1], t);
      s = a.dataToPoint([c, h]);
    }
    if (qc(a, "cartesian2d")) {
      var v = a.getAxis("x"), d = a.getAxis("y"), f = a.dimensions;
      Vb(e.get(f[0], t)) ? s[0] = v.toGlobalCoord(v.getExtent()[r ? 0 : 1]) : Vb(e.get(f[1], t)) && (s[1] = d.toGlobalCoord(d.getExtent()[r ? 0 : 1]));
    }
    isNaN(l) || (s[0] = l), isNaN(u) || (s[1] = u);
  }
  e.setItemLayout(t, s);
}
var Ime = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.updateTransform = function(r, n, i) {
      n.eachSeries(function(a) {
        var o = au.getMarkerModelFromSeries(a, "markLine");
        if (o) {
          var s = o.getData(), l = zT(o).from, u = zT(o).to;
          l.each(function(f) {
            ID(l, f, !0, a, i), ID(u, f, !1, a, i);
          }), s.each(function(f) {
            s.setItemLayout(f, [l.getItemLayout(f), u.getItemLayout(f)]);
          }), this.markerGroupMap.get(a.id).updateLayout();
        }
      }, this);
    }, t.prototype.renderSeries = function(r, n, i, a) {
      var o = r.coordinateSystem, s = r.id, l = r.getData(), u = this.markerGroupMap, f = u.get(s) || u.set(s, new nN());
      this.group.add(f.group);
      var c = Rme(o, r, n), h = c.from, v = c.to, d = c.line;
      zT(n).from = h, zT(n).to = v, n.setData(d);
      var g = n.get("symbol"), y = n.get("symbolSize"), x = n.get("symbolRotate"), S = n.get("symbolOffset");
      Se(g) || (g = [g, g]), Se(y) || (y = [y, y]), Se(x) || (x = [x, x]), Se(S) || (S = [S, S]), c.from.each(function(C) {
        T(h, C, !0), T(v, C, !1);
      }), d.each(function(C) {
        var A = d.getItemModel(C), M = A.getModel("lineStyle").getLineStyle();
        d.setItemLayout(C, [h.getItemLayout(C), v.getItemLayout(C)]);
        var E = A.get("z2");
        M.stroke == null && (M.stroke = h.getItemVisual(C, "style").fill), d.setItemVisual(C, {
          z2: et(E, 0),
          fromSymbolKeepAspect: h.getItemVisual(C, "symbolKeepAspect"),
          fromSymbolOffset: h.getItemVisual(C, "symbolOffset"),
          fromSymbolRotate: h.getItemVisual(C, "symbolRotate"),
          fromSymbolSize: h.getItemVisual(C, "symbolSize"),
          fromSymbol: h.getItemVisual(C, "symbol"),
          toSymbolKeepAspect: v.getItemVisual(C, "symbolKeepAspect"),
          toSymbolOffset: v.getItemVisual(C, "symbolOffset"),
          toSymbolRotate: v.getItemVisual(C, "symbolRotate"),
          toSymbolSize: v.getItemVisual(C, "symbolSize"),
          toSymbol: v.getItemVisual(C, "symbol"),
          style: M
        });
      }), f.updateData(d), c.line.eachItemGraphicEl(function(C) {
        pt(C).dataModel = n, C.traverse(function(A) {
          pt(A).dataModel = n;
        });
      });
      function T(C, A, M) {
        var E = C.getItemModel(A);
        ID(C, A, M, r, a);
        var P = E.getModel("itemStyle").getItemStyle();
        P.fill == null && (P.fill = Px(l, "color")), C.setItemVisual(A, {
          symbolKeepAspect: E.get("symbolKeepAspect"),
          // `0` should be considered as a valid value, so use `retrieve2` instead of `||`
          symbolOffset: et(E.get("symbolOffset", !0), S[M ? 0 : 1]),
          symbolRotate: et(E.get("symbolRotate", !0), x[M ? 0 : 1]),
          // TODO: when 2d array is supported, it should ignore parent
          symbolSize: et(E.get("symbolSize"), y[M ? 0 : 1]),
          symbol: et(E.get("symbol", !0), g[M ? 0 : 1]),
          style: P
        });
      }
      this.markKeep(f), f.group.silent = n.get("silent") || r.get("silent");
    }, t.type = "markLine", t;
  })(zN)
);
function Rme(e, t, r) {
  var n;
  e ? n = Ce(e && e.dimensions, function(u) {
    var f = t.getData().getDimensionInfo(t.getData().mapDimension(u)) || {};
    return xe(xe({}, f), {
      name: u,
      // DON'T use ordinalMeta to parse and collect ordinal.
      ordinalMeta: null
    });
  }) : n = [{
    name: "value",
    type: "float"
  }];
  var i = new zr(n, r), a = new zr(n, r), o = new zr([], r), s = Ce(r.get("data"), St(Eme, t, e, r));
  e && (s = nr(s, St(Pme, e)));
  var l = $X(!!e, n);
  return i.initData(Ce(s, function(u) {
    return u[0];
  }), null, l), a.initData(Ce(s, function(u) {
    return u[1];
  }), null, l), o.initData(Ce(s, function(u) {
    return u[2];
  })), o.hasItemOption = !0, {
    from: i,
    to: a,
    line: o
  };
}
function Ome(e) {
  e.registerComponentModel(Dme), e.registerComponentView(Ime), e.registerPreprocessor(function(t) {
    BN(t.series, "markLine") && (t.markLine = t.markLine || {});
  });
}
var Nme = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.createMarkerModelFromSeries = function(r, n, i) {
      return new t(r, 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;
  })(au)
), FT = Bt(), kme = function(e, t, r, n) {
  var i = n[0], a = n[1];
  if (!(!i || !a)) {
    var o = ax(e, i), s = ax(e, a), l = o.coord, u = s.coord;
    l[0] = Ti(l[0], -1 / 0), l[1] = Ti(l[1], -1 / 0), u[0] = Ti(u[0], 1 / 0), u[1] = Ti(u[1], 1 / 0);
    var f = fC([{}, o, s]);
    return f.coord = [o.coord, s.coord], f.x0 = o.x, f.y0 = o.y, f.x1 = s.x, f.y1 = s.y, f;
  }
};
function Hb(e) {
  return !isNaN(e) && !isFinite(e);
}
function bG(e, t, r, n) {
  var i = 1 - e;
  return Hb(t[i]) && Hb(r[i]);
}
function Bme(e, t) {
  var r = t.coord[0], n = t.coord[1], i = {
    coord: r,
    x: t.x0,
    y: t.y0
  }, a = {
    coord: n,
    x: t.x1,
    y: t.y1
  };
  return qc(e, "cartesian2d") ? r && n && (bG(1, r, n) || bG(0, r, n)) ? !0 : bme(e, i, a) : ox(e, i) || ox(e, a);
}
function CG(e, t, r, n, i) {
  var a = n.coordinateSystem, o = e.getItemModel(t), s, l = Be(o.get(r[0]), i.getWidth()), u = Be(o.get(r[1]), i.getHeight());
  if (!isNaN(l) && !isNaN(u))
    s = [l, u];
  else {
    if (n.getMarkerPosition) {
      var f = e.getValues(["x0", "y0"], t), c = e.getValues(["x1", "y1"], t), h = a.clampData(f), v = a.clampData(c), d = [];
      r[0] === "x0" ? d[0] = h[0] > v[0] ? c[0] : f[0] : d[0] = h[0] > v[0] ? f[0] : c[0], r[1] === "y0" ? d[1] = h[1] > v[1] ? c[1] : f[1] : d[1] = h[1] > v[1] ? f[1] : c[1], s = n.getMarkerPosition(d, r, !0);
    } else {
      var g = e.get(r[0], t), y = e.get(r[1], t), x = [g, y];
      a.clampData && a.clampData(x, x), s = a.dataToPoint(x, !0);
    }
    if (qc(a, "cartesian2d")) {
      var S = a.getAxis("x"), T = a.getAxis("y"), g = e.get(r[0], t), y = e.get(r[1], t);
      Hb(g) ? s[0] = S.toGlobalCoord(S.getExtent()[r[0] === "x0" ? 0 : 1]) : Hb(y) && (s[1] = T.toGlobalCoord(T.getExtent()[r[1] === "y0" ? 0 : 1]));
    }
    isNaN(l) || (s[0] = l), isNaN(u) || (s[1] = u);
  }
  return s;
}
var AG = [["x0", "y0"], ["x1", "y0"], ["x1", "y1"], ["x0", "y1"]], zme = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.updateTransform = function(r, n, i) {
      n.eachSeries(function(a) {
        var o = au.getMarkerModelFromSeries(a, "markArea");
        if (o) {
          var s = o.getData();
          s.each(function(l) {
            var u = Ce(AG, function(c) {
              return CG(s, l, c, a, i);
            });
            s.setItemLayout(l, u);
            var f = s.getItemGraphicEl(l);
            f.setShape("points", u);
          });
        }
      }, this);
    }, t.prototype.renderSeries = function(r, n, i, a) {
      var o = r.coordinateSystem, s = r.id, l = r.getData(), u = this.markerGroupMap, f = u.get(s) || u.set(s, {
        group: new rt()
      });
      this.group.add(f.group), this.markKeep(f);
      var c = Fme(o, r, n);
      n.setData(c), c.each(function(h) {
        var v = Ce(AG, function(O) {
          return CG(c, h, O, r, a);
        }), d = o.getAxis("x").scale, g = o.getAxis("y").scale, y = d.getExtent(), x = g.getExtent(), S = [d.parse(c.get("x0", h)), d.parse(c.get("x1", h))], T = [g.parse(c.get("y0", h)), g.parse(c.get("y1", h))];
        xo(S), xo(T);
        var C = !(y[0] > S[1] || y[1] < S[0] || x[0] > T[1] || x[1] < T[0]), A = !C;
        c.setItemLayout(h, {
          points: v,
          allClipped: A
        });
        var M = c.getItemModel(h), E = M.getModel("itemStyle").getItemStyle(), P = M.get("z2"), R = Px(l, "color");
        E.fill || (E.fill = R, Fe(E.fill) && (E.fill = I1(E.fill, 0.4))), E.stroke || (E.stroke = R), c.setItemVisual(h, "style", E), c.setItemVisual(h, "z2", et(P, 0));
      }), c.diff(FT(f).data).add(function(h) {
        var v = c.getItemLayout(h), d = c.getItemVisual(h, "z2");
        if (!v.allClipped) {
          var g = new Wi({
            z2: et(d, 0),
            shape: {
              points: v.points
            }
          });
          c.setItemGraphicEl(h, g), f.group.add(g);
        }
      }).update(function(h, v) {
        var d = FT(f).data.getItemGraphicEl(v), g = c.getItemLayout(h), y = c.getItemVisual(h, "z2");
        g.allClipped ? d && f.group.remove(d) : (d ? Wt(d, {
          z2: et(y, 0),
          shape: {
            points: g.points
          }
        }, n, h) : d = new Wi({
          shape: {
            points: g.points
          }
        }), c.setItemGraphicEl(h, d), f.group.add(d));
      }).remove(function(h) {
        var v = FT(f).data.getItemGraphicEl(h);
        f.group.remove(v);
      }).execute(), c.eachItemGraphicEl(function(h, v) {
        var d = c.getItemModel(v), g = c.getItemVisual(v, "style");
        h.useStyle(c.getItemVisual(v, "style")), si(h, Wn(d), {
          labelFetcher: n,
          labelDataIndex: v,
          defaultText: c.getName(v) || "",
          inheritColor: Fe(g.fill) ? I1(g.fill, 1) : fe.color.neutral99
        }), Un(h, d), Hr(h, null, null, d.get(["emphasis", "disabled"])), pt(h).dataModel = n;
      }), FT(f).data = c, f.group.silent = n.get("silent") || r.get("silent");
    }, t.type = "markArea", t;
  })(zN)
);
function Fme(e, t, r) {
  var n, i, a = ["x0", "y0", "x1", "y1"];
  if (e) {
    var o = Ce(e && e.dimensions, function(u) {
      var f = t.getData(), c = f.getDimensionInfo(f.mapDimension(u)) || {};
      return xe(xe({}, c), {
        name: u,
        // DON'T use ordinalMeta to parse and collect ordinal.
        ordinalMeta: null
      });
    });
    i = Ce(a, function(u, f) {
      return {
        name: u,
        type: o[f % 2].type
      };
    }), n = new zr(i, r);
  } else
    i = [{
      name: "value",
      type: "float"
    }], n = new zr(i, r);
  var s = Ce(r.get("data"), St(kme, t, e, r));
  e && (s = nr(s, St(Bme, e)));
  var l = e ? function(u, f, c, h) {
    var v = u.coord[Math.floor(h / 2)][h % 2];
    return Wc(v, i[h]);
  } : function(u, f, c, h) {
    return Wc(u.value, i[h]);
  };
  return n.initData(s, null, l), n.hasItemOption = !0, n;
}
function Gme(e) {
  e.registerComponentModel(Nme), e.registerComponentView(zme), e.registerPreprocessor(function(t) {
    BN(t.series, "markArea") && (t.markArea = t.markArea || {});
  });
}
var Vme = function(e, t) {
  if (t === "all")
    return {
      type: "all",
      title: e.getLocaleModel().get(["legend", "selector", "all"])
    };
  if (t === "inverse")
    return {
      type: "inverse",
      title: e.getLocaleModel().get(["legend", "selector", "inverse"])
    };
}, LI = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.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
      }, r;
    }
    return t.prototype.init = function(r, n, i) {
      this.mergeDefaultAndTheme(r, i), r.selected = r.selected || {}, this._updateSelector(r);
    }, t.prototype.mergeOption = function(r, n) {
      e.prototype.mergeOption.call(this, r, n), this._updateSelector(r);
    }, t.prototype._updateSelector = function(r) {
      var n = r.selector, i = this.ecModel;
      n === !0 && (n = r.selector = ["all", "inverse"]), Se(n) && F(n, function(a, o) {
        Fe(a) && (a = {
          type: a
        }), n[o] = je(a, Vme(i, a.type));
      });
    }, t.prototype.optionUpdated = function() {
      this._updateData(this.ecModel);
      var r = this._data;
      if (r[0] && this.get("selectedMode") === "single") {
        for (var n = !1, i = 0; i < r.length; i++) {
          var a = r[i].get("name");
          if (this.isSelected(a)) {
            this.select(a), n = !0;
            break;
          }
        }
        !n && this.select(r[0].get("name"));
      }
    }, t.prototype._updateData = function(r) {
      var n = [], i = [];
      r.eachRawSeries(function(l) {
        var u = l.name;
        i.push(u);
        var f;
        if (l.legendVisualProvider) {
          var c = l.legendVisualProvider, h = c.getAllNames();
          r.isSeriesFiltered(l) || (i = i.concat(h)), h.length ? n = n.concat(h) : f = !0;
        } else
          f = !0;
        f && yR(l) && n.push(l.name);
      }), this._availableNames = i;
      var a = this.get("data") || n, o = Je(), s = Ce(a, function(l) {
        return (Fe(l) || Xt(l)) && (l = {
          name: l
        }), o.get(l.name) ? null : (o.set(l.name, !0), new It(l, this, this.ecModel));
      }, this);
      this._data = nr(s, function(l) {
        return !!l;
      });
    }, t.prototype.getData = function() {
      return this._data;
    }, t.prototype.select = function(r) {
      var n = this.option.selected, i = this.get("selectedMode");
      if (i === "single") {
        var a = this._data;
        F(a, function(o) {
          n[o.get("name")] = !1;
        });
      }
      n[r] = !0;
    }, t.prototype.unSelect = function(r) {
      this.get("selectedMode") !== "single" && (this.option.selected[r] = !1);
    }, t.prototype.toggleSelected = function(r) {
      var n = this.option.selected;
      n.hasOwnProperty(r) || (n[r] = !0), this[n[r] ? "unSelect" : "select"](r);
    }, t.prototype.allSelect = function() {
      var r = this._data, n = this.option.selected;
      F(r, function(i) {
        n[i.get("name", !0)] = !0;
      });
    }, t.prototype.inverseSelect = function() {
      var r = this._data, n = this.option.selected;
      F(r, function(i) {
        var a = i.get("name", !0);
        n.hasOwnProperty(a) || (n[a] = !0), n[a] = !n[a];
      });
    }, t.prototype.isSelected = function(r) {
      var n = this.option.selected;
      return !(n.hasOwnProperty(r) && !n[r]) && Tt(this._availableNames, r) >= 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: fe.size.m,
      align: "auto",
      backgroundColor: fe.color.transparent,
      borderColor: fe.color.border,
      borderRadius: 0,
      borderWidth: 0,
      padding: 5,
      itemGap: 8,
      itemWidth: 25,
      itemHeight: 14,
      symbolRotate: "inherit",
      symbolKeepAspect: !0,
      inactiveColor: fe.color.disabled,
      inactiveBorderColor: fe.color.disabled,
      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: fe.color.disabled,
        inactiveWidth: 2,
        opacity: "inherit",
        type: "inherit",
        cap: "inherit",
        join: "inherit",
        dashOffset: "inherit",
        miterLimit: "inherit"
      },
      textStyle: {
        color: fe.color.secondary
      },
      selectedMode: !0,
      selector: !1,
      selectorLabel: {
        show: !0,
        borderRadius: 10,
        padding: [3, 5, 3, 5],
        fontSize: 12,
        fontFamily: "sans-serif",
        color: fe.color.tertiary,
        borderWidth: 1,
        borderColor: fe.color.border
      },
      emphasis: {
        selectorLabel: {
          show: !0,
          color: fe.color.quaternary
        }
      },
      selectorPosition: "auto",
      selectorItemGap: 7,
      selectorButtonGap: 10,
      tooltip: {
        show: !1
      },
      triggerEvent: !1
    }, t;
  })(At)
), Bg = St, DI = F, GT = rt, qX = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.newlineDisabled = !1, r;
    }
    return t.prototype.init = function() {
      this.group.add(this._contentGroup = new GT()), this.group.add(this._selectorGroup = new GT()), this._isFirstRender = !0;
    }, t.prototype.getContentGroup = function() {
      return this._contentGroup;
    }, t.prototype.getSelectorGroup = function() {
      return this._selectorGroup;
    }, t.prototype.render = function(r, n, i) {
      var a = this._isFirstRender;
      if (this._isFirstRender = !1, this.resetInner(), !!r.get("show", !0)) {
        var o = r.get("align"), s = r.get("orient");
        (!o || o === "auto") && (o = r.get("left") === "right" && s === "vertical" ? "right" : "left");
        var l = r.get("selector", !0), u = r.get("selectorPosition", !0);
        l && (!u || u === "auto") && (u = s === "horizontal" ? "end" : "start"), this.renderInner(o, r, n, i, l, s, u);
        var f = Yn(r, i).refContainer, c = r.getBoxLayoutParams(), h = r.get("padding"), v = Tr(c, f, h), d = this.layoutInner(r, o, v, a, l, u), g = Tr(tt({
          width: d.width,
          height: d.height
        }, c), f, h);
        this.group.x = g.x - d.x, this.group.y = g.y - d.y, this.group.markRedraw(), this.group.add(this._backgroundEl = BX(
          d,
          // FXIME: most itemStyle options does not work in background because inherit is not handled yet.
          r
        ));
      }
    }, t.prototype.resetInner = function() {
      this.getContentGroup().removeAll(), this._backgroundEl && this.group.remove(this._backgroundEl), this.getSelectorGroup().removeAll();
    }, t.prototype.renderInner = function(r, n, i, a, o, s, l) {
      var u = this.getContentGroup(), f = Je(), c = n.get("selectedMode"), h = n.get("triggerEvent"), v = [];
      i.eachRawSeries(function(d) {
        !d.get("legendHoverLink") && v.push(d.id);
      }), DI(n.getData(), function(d, g) {
        var y = this, x = d.get("name");
        if (!this.newlineDisabled && (x === "" || x === `
`)) {
          var S = new GT();
          S.newline = !0, u.add(S);
          return;
        }
        var T = i.getSeriesByName(x)[0];
        if (!f.get(x))
          if (T) {
            var C = T.getData(), A = C.getVisual("legendLineStyle") || {}, M = C.getVisual("legendIcon"), E = C.getVisual("style"), P = this._createItem(T, x, g, d, n, r, A, E, M, c, a);
            P.on("click", Bg(MG, x, null, a, v)).on("mouseover", Bg(EI, T.name, null, a, v)).on("mouseout", Bg(PI, T.name, null, a, v)), i.ssr && P.eachChild(function(R) {
              var O = pt(R);
              O.seriesIndex = T.seriesIndex, O.dataIndex = g, O.ssrType = "legend";
            }), h && P.eachChild(function(R) {
              y.packEventData(R, n, T, g, x);
            }), f.set(x, !0);
          } else
            i.eachRawSeries(function(R) {
              var O = this;
              if (!f.get(x) && R.legendVisualProvider) {
                var N = R.legendVisualProvider;
                if (!N.containName(x))
                  return;
                var G = N.indexOfName(x), z = N.getItemVisual(G, "style"), H = N.getItemVisual(G, "legendIcon"), W = bi(z.fill);
                W && W[3] === 0 && (W[3] = 0.2, z = xe(xe({}, z), {
                  fill: os(W, "rgba")
                }));
                var Z = this._createItem(R, x, g, d, n, r, {}, z, H, c, a);
                Z.on("click", Bg(MG, null, x, a, v)).on("mouseover", Bg(EI, null, x, a, v)).on("mouseout", Bg(PI, null, x, a, v)), i.ssr && Z.eachChild(function(ee) {
                  var V = pt(ee);
                  V.seriesIndex = R.seriesIndex, V.dataIndex = g, V.ssrType = "legend";
                }), h && Z.eachChild(function(ee) {
                  O.packEventData(ee, n, R, g, x);
                }), f.set(x, !0);
              }
            }, this);
      }, this), o && this._createSelector(o, n, a, s, l);
    }, t.prototype.packEventData = function(r, n, i, a, o) {
      var s = {
        componentType: "legend",
        componentIndex: n.componentIndex,
        dataIndex: a,
        value: o,
        seriesIndex: i.seriesIndex
      };
      pt(r).eventData = s;
    }, t.prototype._createSelector = function(r, n, i, a, o) {
      var s = this.getSelectorGroup();
      DI(r, function(u) {
        var f = u.type, c = new Rt({
          style: {
            x: 0,
            y: 0,
            align: "center",
            verticalAlign: "middle"
          },
          onclick: function() {
            i.dispatchAction({
              type: f === "all" ? "legendAllSelect" : "legendInverseSelect",
              legendId: n.id
            });
          }
        });
        s.add(c);
        var h = n.getModel("selectorLabel"), v = n.getModel(["emphasis", "selectorLabel"]);
        si(c, {
          normal: h,
          emphasis: v
        }, {
          defaultText: u.title
        }), jl(c);
      });
    }, t.prototype._createItem = function(r, n, i, a, o, s, l, u, f, c, h) {
      var v = r.visualDrawType, d = o.get("itemWidth"), g = o.get("itemHeight"), y = o.isSelected(n), x = a.get("symbolRotate"), S = a.get("symbolKeepAspect"), T = a.get("icon");
      f = T || f || "roundRect";
      var C = Hme(f, a, l, u, v, y, h), A = new GT(), M = a.getModel("textStyle");
      if (nt(r.getLegendIcon) && (!T || T === "inherit"))
        A.add(r.getLegendIcon({
          itemWidth: d,
          itemHeight: g,
          icon: f,
          iconRotate: x,
          itemStyle: C.itemStyle,
          lineStyle: C.lineStyle,
          symbolKeepAspect: S
        }));
      else {
        var E = T === "inherit" && r.getData().getVisual("symbol") ? x === "inherit" ? r.getData().getVisual("symbolRotate") : x : 0;
        A.add(Ume({
          itemWidth: d,
          itemHeight: g,
          icon: f,
          iconRotate: E,
          itemStyle: C.itemStyle,
          symbolKeepAspect: S
        }));
      }
      var P = s === "left" ? d + 5 : -5, R = s, O = o.get("formatter"), N = n;
      Fe(O) && O ? N = O.replace("{name}", n ?? "") : nt(O) && (N = O(n));
      var G = y ? M.getTextColor() : a.get("inactiveColor");
      A.add(new Rt({
        style: gr(M, {
          text: N,
          x: P,
          y: g / 2,
          fill: G,
          align: R,
          verticalAlign: "middle"
        }, {
          inheritColor: G
        })
      }));
      var z = new Mt({
        shape: A.getBoundingRect(),
        style: {
          // Cannot use 'invisible' because SVG SSR will miss the node
          fill: "transparent"
        }
      }), H = a.getModel("tooltip");
      return H.get("show") && Cf({
        el: z,
        componentModel: o,
        itemName: n,
        itemTooltipOption: H.option
      }), A.add(z), A.eachChild(function(W) {
        W.silent = !0;
      }), z.silent = !c, this.getContentGroup().add(A), jl(A), A.__legendDataIndex = i, A;
    }, t.prototype.layoutInner = function(r, n, i, a, o, s) {
      var l = this.getContentGroup(), u = this.getSelectorGroup();
      vd(r.get("orient"), l, r.get("itemGap"), i.width, i.height);
      var f = l.getBoundingRect(), c = [-f.x, -f.y];
      if (u.markRedraw(), l.markRedraw(), o) {
        vd(
          // Buttons in selectorGroup always layout horizontally
          "horizontal",
          u,
          r.get("selectorItemGap", !0)
        );
        var h = u.getBoundingRect(), v = [-h.x, -h.y], d = r.get("selectorButtonGap", !0), g = r.getOrient().index, y = g === 0 ? "width" : "height", x = g === 0 ? "height" : "width", S = g === 0 ? "y" : "x";
        s === "end" ? v[g] += f[y] + d : c[g] += h[y] + d, v[1 - g] += f[x] / 2 - h[x] / 2, u.x = v[0], u.y = v[1], l.x = c[0], l.y = c[1];
        var T = {
          x: 0,
          y: 0
        };
        return T[y] = f[y] + d + h[y], T[x] = Math.max(f[x], h[x]), T[S] = Math.min(0, h[S] + v[1 - g]), T;
      } else
        return l.x = c[0], l.y = c[1], this.group.getBoundingRect();
    }, t.prototype.remove = function() {
      this.getContentGroup().removeAll(), this._isFirstRender = !0;
    }, t.type = "legend.plain", t;
  })(fr)
);
function Hme(e, t, r, n, i, a, o) {
  function s(y, x) {
    y.lineWidth === "auto" && (y.lineWidth = x.lineWidth > 0 ? 2 : 0), DI(y, function(S, T) {
      y[T] === "inherit" && (y[T] = x[T]);
    });
  }
  var l = t.getModel("itemStyle"), u = l.getItemStyle(), f = e.lastIndexOf("empty", 0) === 0 ? "fill" : "stroke", c = l.getShallow("decal");
  u.decal = !c || c === "inherit" ? n.decal : Am(c, o), u.fill === "inherit" && (u.fill = n[i]), u.stroke === "inherit" && (u.stroke = n[f]), u.opacity === "inherit" && (u.opacity = (i === "fill" ? n : r).opacity), s(u, n);
  var h = t.getModel("lineStyle"), v = h.getLineStyle();
  if (s(v, r), 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"), g = u[f];
    u.lineWidth = d === "auto" ? n.lineWidth > 0 && g ? 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 Ume(e) {
  var t = e.icon || "roundRect", r = en(t, 0, 0, e.itemWidth, e.itemHeight, e.itemStyle.fill, e.symbolKeepAspect);
  return r.setStyle(e.itemStyle), r.rotation = (e.iconRotate || 0) * Math.PI / 180, r.setOrigin([e.itemWidth / 2, e.itemHeight / 2]), t.indexOf("empty") > -1 && (r.style.stroke = r.style.fill, r.style.fill = fe.color.neutral00, r.style.lineWidth = 2), r;
}
function MG(e, t, r, n) {
  PI(e, t, r, n), r.dispatchAction({
    type: "legendToggleSelect",
    name: e ?? t
  }), EI(e, t, r, n);
}
function jX(e) {
  for (var t = e.getZr().storage.getDisplayList(), r, n = 0, i = t.length; n < i && !(r = t[n].states.emphasis); )
    n++;
  return r && r.hoverLayer;
}
function EI(e, t, r, n) {
  jX(r) || r.dispatchAction({
    type: "highlight",
    seriesName: e,
    name: t,
    excludeSeriesId: n
  });
}
function PI(e, t, r, n) {
  jX(r) || r.dispatchAction({
    type: "downplay",
    seriesName: e,
    name: t,
    excludeSeriesId: n
  });
}
function Wme(e) {
  var t = e.findComponents({
    mainType: "legend"
  });
  t && t.length && e.filterSeries(function(r) {
    for (var n = 0; n < t.length; n++)
      if (!t[n].isSelected(r.name))
        return !1;
    return !0;
  });
}
function b_(e, t, r) {
  var n = e === "allSelect" || e === "inverseSelect", i = {}, a = [];
  r.eachComponent({
    mainType: "legend",
    query: t
  }, function(s) {
    n ? s[e]() : s[e](t.name), LG(s, i), a.push(s.componentIndex);
  });
  var o = {};
  return r.eachComponent("legend", function(s) {
    F(i, function(l, u) {
      s[l ? "select" : "unSelect"](u);
    }), LG(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 LG(e, t) {
  var r = t || {};
  return F(e.getData(), function(n) {
    var i = n.get("name");
    if (!(i === `
` || i === "")) {
      var a = e.isSelected(i);
      qe(r, i) ? r[i] = r[i] && a : r[i] = a;
    }
  }), r;
}
function Xme(e) {
  e.registerAction("legendToggleSelect", "legendselectchanged", St(b_, "toggleSelected")), e.registerAction("legendAllSelect", "legendselectall", St(b_, "allSelect")), e.registerAction("legendInverseSelect", "legendinverseselect", St(b_, "inverseSelect")), e.registerAction("legendSelect", "legendselected", St(b_, "select")), e.registerAction("legendUnSelect", "legendunselected", St(b_, "unSelect"));
}
function KX(e) {
  e.registerComponentModel(LI), e.registerComponentView(qX), e.registerProcessor(e.PRIORITY.PROCESSOR.SERIES_FILTER, Wme), e.registerSubTypeDefaulter("legend", function() {
    return "plain";
  }), Xme(e);
}
var Yme = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.setScrollDataIndex = function(r) {
      this.option.scrollDataIndex = r;
    }, t.prototype.init = function(r, n, i) {
      var a = Bd(r);
      e.prototype.init.call(this, r, n, i), DG(this, r, a);
    }, t.prototype.mergeOption = function(r, n) {
      e.prototype.mergeOption.call(this, r, n), DG(this, this.option, r);
    }, t.type = "legend.scroll", t.defaultOption = nh(LI.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: fe.color.accent50,
      pageIconInactiveColor: fe.color.accent10,
      pageIconSize: 15,
      pageTextStyle: {
        color: fe.color.tertiary
      },
      animationDurationUpdate: 800
    }), t;
  })(LI)
);
function DG(e, t, r) {
  var n = e.getOrient(), i = [1, 1];
  i[n.index] = 0, nu(t, r, {
    type: "box",
    ignoreSize: !!i
  });
}
var EG = rt, RD = ["width", "height"], OD = ["x", "y"], Zme = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.newlineDisabled = !0, r._currentIndex = 0, r;
    }
    return t.prototype.init = function() {
      e.prototype.init.call(this), this.group.add(this._containerGroup = new EG()), this._containerGroup.add(this.getContentGroup()), this.group.add(this._controllerGroup = new EG());
    }, t.prototype.resetInner = function() {
      e.prototype.resetInner.call(this), this._controllerGroup.removeAll(), this._containerGroup.removeClipPath(), this._containerGroup.__rectSize = null;
    }, t.prototype.renderInner = function(r, n, i, a, o, s, l) {
      var u = this;
      e.prototype.renderInner.call(this, r, n, i, a, o, s, l);
      var f = this._controllerGroup, c = n.get("pageIconSize", !0), h = Se(c) ? c : [c, c];
      d("pagePrev", 0);
      var v = n.getModel("pageTextStyle");
      f.add(new Rt({
        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(g, y) {
        var x = g + "DataIndex", S = Jm(n.get("pageIcons", !0)[n.getOrient().name][y], {
          // Buttons will be created in each render, so we do not need
          // to worry about avoiding using legendModel kept in scope.
          onclick: Ge(u._pageGo, u, x, n, a)
        }, {
          x: -h[0] / 2,
          y: -h[1] / 2,
          width: h[0],
          height: h[1]
        });
        S.name = g, f.add(S);
      }
    }, t.prototype.layoutInner = function(r, n, i, a, o, s) {
      var l = this.getSelectorGroup(), u = r.getOrient().index, f = RD[u], c = OD[u], h = RD[1 - u], v = OD[1 - u];
      o && vd(
        // Buttons in selectorGroup always layout horizontally
        "horizontal",
        l,
        r.get("selectorItemGap", !0)
      );
      var d = r.get("selectorButtonGap", !0), g = l.getBoundingRect(), y = [-g.x, -g.y], x = it(i);
      o && (x[f] = i[f] - g[f] - d);
      var S = this._layoutContentAndController(r, a, x, u, f, h, v, c);
      if (o) {
        if (s === "end")
          y[u] += S[f] + d;
        else {
          var T = g[f] + d;
          y[u] -= T, S[c] -= T;
        }
        S[f] += g[f] + d, y[1 - u] += S[v] + S[h] / 2 - g[h] / 2, S[h] = Math.max(S[h], g[h]), S[v] = Math.min(S[v], g[v] + y[1 - u]), l.x = y[0], l.y = y[1], l.markRedraw();
      }
      return S;
    }, t.prototype._layoutContentAndController = function(r, n, i, a, o, s, l, u) {
      var f = this.getContentGroup(), c = this._containerGroup, h = this._controllerGroup;
      vd(r.get("orient"), f, r.get("itemGap"), a ? i.width : null, a ? null : i.height), vd(
        // Buttons in controller are layout always horizontally.
        "horizontal",
        h,
        r.get("pageButtonItemGap", !0)
      );
      var v = f.getBoundingRect(), d = h.getBoundingRect(), g = this._showController = v[o] > i[o], y = [-v.x, -v.y];
      n || (y[a] = f[u]);
      var x = [0, 0], S = [-d.x, -d.y], T = et(r.get("pageButtonGap", !0), r.get("itemGap", !0));
      if (g) {
        var C = r.get("pageButtonPosition", !0);
        C === "end" ? S[a] += i[o] - d[o] : x[a] += d[o] + T;
      }
      S[1 - a] += v[s] / 2 - d[s] / 2, f.setPosition(y), c.setPosition(x), h.setPosition(S);
      var A = {
        x: 0,
        y: 0
      };
      if (A[o] = g ? i[o] : v[o], A[s] = Math.max(v[s], d[s]), A[l] = Math.min(0, d[l] + S[1 - a]), c.__rectSize = i[o], g) {
        var M = {
          x: 0,
          y: 0
        };
        M[o] = Math.max(i[o] - d[o] - T, 0), M[s] = A[s], c.setClipPath(new Mt({
          shape: M
        })), c.__rectSize = M[o];
      } else
        h.eachChild(function(P) {
          P.attr({
            invisible: !0,
            silent: !0
          });
        });
      var E = this._getPageInfo(r);
      return E.pageIndex != null && Wt(
        f,
        {
          x: E.contentPosition[0],
          y: E.contentPosition[1]
        },
        // When switch from "show controller" to "not show controller", view should be
        // updated immediately without animation, otherwise causes weird effect.
        g ? r : null
      ), this._updatePageInfoView(r, E), A;
    }, t.prototype._pageGo = function(r, n, i) {
      var a = this._getPageInfo(n)[r];
      a != null && i.dispatchAction({
        type: "legendScroll",
        scrollDataIndex: a,
        legendId: n.id
      });
    }, t.prototype._updatePageInfoView = function(r, n) {
      var i = this._controllerGroup;
      F(["pagePrev", "pageNext"], function(f) {
        var c = f + "DataIndex", h = n[c] != null, v = i.childOfName(f);
        v && (v.setStyle("fill", h ? r.get("pageIconColor", !0) : r.get("pageIconInactiveColor", !0)), v.cursor = h ? "pointer" : "default");
      });
      var a = i.childOfName("pageText"), o = r.get("pageFormatter"), s = n.pageIndex, l = s != null ? s + 1 : 0, u = n.pageCount;
      a && o && a.setStyle("text", Fe(o) ? o.replace("{current}", l == null ? "" : l + "").replace("{total}", u == null ? "" : u + "") : o({
        current: l,
        total: u
      }));
    }, t.prototype._getPageInfo = function(r) {
      var n = r.get("scrollDataIndex", !0), i = this.getContentGroup(), a = this._containerGroup.__rectSize, o = r.getOrient().index, s = RD[o], l = OD[o], u = this._findTargetItemIndex(n), f = i.children(), c = f[u], h = f.length, v = h ? 1 : 0, d = {
        contentPosition: [i.x, i.y],
        pageCount: v,
        pageIndex: v - 1,
        pagePrevDataIndex: null,
        pageNextDataIndex: null
      };
      if (!c)
        return d;
      var g = C(c);
      d.contentPosition[o] = -g.s;
      for (var y = u + 1, x = g, S = g, T = null; y <= h; ++y)
        T = C(f[y]), // Half of the last item is out of the window.
        (!T && S.e > x.s + a || T && !A(T, x.s)) && (S.i > x.i ? x = S : x = T, x && (d.pageNextDataIndex == null && (d.pageNextDataIndex = x.i), ++d.pageCount)), S = T;
      for (var y = u - 1, x = g, S = g, T = null; y >= -1; --y)
        T = C(f[y]), // If the the end item does not intersect with the window started
        // from the current item, a page can be settled.
        (!T || !A(S, T.s)) && x.i < S.i && (S = x, d.pagePrevDataIndex == null && (d.pagePrevDataIndex = x.i), ++d.pageCount, ++d.pageIndex), x = T;
      return d;
      function C(M) {
        if (M) {
          var E = M.getBoundingRect(), P = E[l] + M[l];
          return {
            s: P,
            e: P + E[s],
            i: M.__legendDataIndex
          };
        }
      }
      function A(M, E) {
        return M.e >= E && M.s <= E + a;
      }
    }, t.prototype._findTargetItemIndex = function(r) {
      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 === r && (n = s);
      }), n ?? a;
    }, t.type = "legend.scroll", t;
  })(qX)
);
function $me(e) {
  e.registerAction("legendScroll", "legendscroll", function(t, r) {
    var n = t.scrollDataIndex;
    n != null && r.eachComponent({
      mainType: "legend",
      subType: "scroll",
      query: t
    }, function(i) {
      i.setScrollDataIndex(n);
    });
  });
}
function qme(e) {
  ft(KX), e.registerComponentModel(Yme), e.registerComponentView(Zme), $me(e);
}
function jme(e) {
  ft(KX), ft(qme);
}
var Kme = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.type = "dataZoom.inside", t.defaultOption = nh(ix.defaultOption, {
      disabled: !1,
      zoomLock: !1,
      zoomOnMouseWheel: !0,
      moveOnMouseMove: !0,
      moveOnMouseWheel: !1,
      preventDefaultMouseMove: !0
    }), t;
  })(ix)
), FN = Bt();
function Qme(e, t, r) {
  FN(e).coordSysRecordMap.each(function(n) {
    var i = n.dataZoomInfoMap.get(t.uid);
    i && (i.getRange = r);
  });
}
function Jme(e, t) {
  for (var r = FN(e).coordSysRecordMap, n = r.keys(), i = 0; i < n.length; i++) {
    var a = n[i], o = r.get(a), s = o.dataZoomInfoMap;
    if (s) {
      var l = t.uid, u = s.get(l);
      u && (s.removeKey(l), s.keys().length || QX(r, o));
    }
  }
}
function QX(e, t) {
  if (t) {
    e.removeKey(t.model.uid);
    var r = t.controller;
    r && r.dispose();
  }
}
function eye(e, t) {
  var r = {
    model: t,
    containsPoint: St(rye, t),
    dispatchAction: St(tye, e),
    dataZoomInfoMap: null,
    controller: null
  }, n = r.controller = new Vd(e.getZr());
  return F(["pan", "zoom", "scrollMove"], function(i) {
    n.on(i, function(a) {
      var o = [];
      r.dataZoomInfoMap.each(function(s) {
        if (a.isAvailableBehavior(s.model.option)) {
          var l = (s.getRange || {})[i], u = l && l(s.dzReferCoordSysInfo, r.model.mainType, r.controller, a);
          !s.model.get("disabled", !0) && u && o.push({
            dataZoomId: s.model.id,
            start: u[0],
            end: u[1]
          });
        }
      }), o.length && r.dispatchAction(o);
    });
  }), r;
}
function tye(e, t) {
  e.isDisposed() || e.dispatchAction({
    type: "dataZoom",
    animation: {
      easing: "cubicOut",
      duration: 100
    },
    batch: t
  });
}
function rye(e, t, r, n) {
  return e.coordinateSystem.containPoint([r, n]);
}
function nye(e, t, r) {
  var n, i = "type_", a = {
    type_true: 2,
    type_move: 1,
    type_false: 0,
    type_undefined: -1
  }, o = !0;
  return e.each(function(s) {
    var l = s.model, u = l.get("disabled", !0) ? !1 : l.get("zoomLock", !0) ? "move" : !0;
    a[i + u] > a[i + n] && (n = u), o = o && l.get("preventDefaultMouseMove", !0);
  }), {
    controlType: n,
    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: !!o,
      api: r,
      zInfo: {
        component: t.model
      },
      triggerInfo: {
        roamTrigger: null,
        isInSelf: t.containsPoint
      }
    }
  };
}
function iye(e) {
  e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER, function(t, r) {
    var n = FN(r), i = n.coordSysRecordMap || (n.coordSysRecordMap = Je());
    i.each(function(a) {
      a.dataZoomInfoMap = null;
    }), t.eachComponent({
      mainType: "dataZoom",
      subType: "inside"
    }, function(a) {
      var o = OX(a);
      F(o.infoList, function(s) {
        var l = s.model.uid, u = i.get(l) || i.set(l, eye(r, s.model)), f = u.dataZoomInfoMap || (u.dataZoomInfoMap = Je());
        f.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) {
        QX(i, a);
        return;
      }
      var f = nye(l, a, r);
      o.enable(f.controlType, f.opt), ay(a, "dispatchAction", s.model.get("throttle", !0), "fixRate");
    });
  });
}
var aye = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = "dataZoom.inside", r;
    }
    return t.prototype.render = function(r, n, i) {
      if (e.prototype.render.apply(this, arguments), r.noTarget()) {
        this._clear();
        return;
      }
      this.range = r.getPercentRange(), Qme(i, r, {
        pan: Ge(ND.pan, this),
        zoom: Ge(ND.zoom, this),
        scrollMove: Ge(ND.scrollMove, this)
      });
    }, t.prototype.dispose = function() {
      this._clear(), e.prototype.dispose.apply(this, arguments);
    }, t.prototype._clear = function() {
      Jme(this.api, this.dataZoomModel), this.range = null;
    }, t.type = "dataZoom.inside", t;
  })(PN)
), ND = {
  zoom: function(e, t, r, n) {
    var i = this.range, a = i.slice(), o = e.axisModels[0];
    if (o) {
      var s = kD[t](null, [n.originX, n.originY], o, r, e), 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 f = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();
      if (jc(0, a, [0, 100], 0, f.minSpan, f.maxSpan), this.range = a, i[0] !== a[0] || i[1] !== a[1])
        return a;
    }
  },
  pan: PG(function(e, t, r, n, i, a) {
    var o = kD[n]([a.oldX, a.oldY], [a.newX, a.newY], t, i, r);
    return o.signal * (e[1] - e[0]) * o.pixel / o.pixelLength;
  }),
  scrollMove: PG(function(e, t, r, n, i, a) {
    var o = kD[n]([0, 0], [a.scrollDelta, a.scrollDelta], t, i, r);
    return o.signal * (e[1] - e[0]) * a.scrollDelta;
  })
};
function PG(e) {
  return function(t, r, n, i) {
    var a = this.range, o = a.slice(), s = t.axisModels[0];
    if (s) {
      var l = e(o, s, t, r, n, i);
      if (jc(l, o, [0, 100], "all"), this.range = o, a[0] !== o[0] || a[1] !== o[1])
        return o;
    }
  };
}
var kD = {
  grid: function(e, t, r, n, i) {
    var a = r.axis, o = {}, s = i.model.coordinateSystem.getRect();
    return e = e || [0, 0], a.dim === "x" ? (o.pixel = t[0] - e[0], o.pixelLength = s.width, o.pixelStart = s.x, o.signal = a.inverse ? 1 : -1) : (o.pixel = t[1] - e[1], o.pixelLength = s.height, o.pixelStart = s.y, o.signal = a.inverse ? -1 : 1), o;
  },
  polar: function(e, t, r, n, i) {
    var a = r.axis, o = {}, s = i.model.coordinateSystem, l = s.getRadiusAxis().getExtent(), u = s.getAngleAxis().getExtent();
    return e = e ? s.pointToCoord(e) : [0, 0], t = s.pointToCoord(t), r.mainType === "radiusAxis" ? (o.pixel = t[0] - e[0], o.pixelLength = l[1] - l[0], o.pixelStart = l[0], o.signal = a.inverse ? 1 : -1) : (o.pixel = t[1] - e[1], o.pixelLength = u[1] - u[0], o.pixelStart = u[0], o.signal = a.inverse ? -1 : 1), o;
  },
  singleAxis: function(e, t, r, n, i) {
    var a = r.axis, o = i.model.coordinateSystem.getRect(), s = {};
    return e = e || [0, 0], a.orient === "horizontal" ? (s.pixel = t[0] - e[0], s.pixelLength = o.width, s.pixelStart = o.x, s.signal = a.inverse ? 1 : -1) : (s.pixel = t[1] - e[1], s.pixelLength = o.height, s.pixelStart = o.y, s.signal = a.inverse ? -1 : 1), s;
  }
};
function JX(e) {
  IN(e), e.registerComponentModel(Kme), e.registerComponentView(aye), iye(e);
}
var oye = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.type = "dataZoom.slider", t.layoutMode = "box", t.defaultOption = nh(ix.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: fe.color.accent10,
      borderRadius: 0,
      backgroundColor: fe.color.transparent,
      // dataBackgroundColor: '#ddd',
      dataBackground: {
        lineStyle: {
          color: fe.color.accent30,
          width: 0.5
        },
        areaStyle: {
          color: fe.color.accent20,
          opacity: 0.2
        }
      },
      selectedDataBackground: {
        lineStyle: {
          color: fe.color.accent40,
          width: 0.5
        },
        areaStyle: {
          color: fe.color.accent20,
          opacity: 0.3
        }
      },
      // 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: fe.color.neutral00,
        borderColor: fe.color.accent20
      },
      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: fe.color.accent40,
        opacity: 0.5
      },
      showDetail: !0,
      showDataShadow: "auto",
      realtime: !0,
      zoomLock: !1,
      textStyle: {
        color: fe.color.tertiary
      },
      brushSelect: !0,
      brushStyle: {
        color: fe.color.accent30,
        opacity: 0.3
      },
      emphasis: {
        handleLabel: {
          show: !0
        },
        handleStyle: {
          borderColor: fe.color.accent40
        },
        moveHandleStyle: {
          opacity: 0.8
        }
      },
      defaultLocationEdgeGap: 15
    }), t;
  })(ix)
), C_ = Mt, sye = 1, BD = 30, lye = 7, A_ = "horizontal", IG = "vertical", uye = 5, fye = ["line", "bar", "candlestick", "scatter"], cye = {
  easing: "cubicOut",
  duration: 100,
  delay: 0
}, hye = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r._displayables = {}, r;
    }
    return t.prototype.init = function(r, n) {
      this.api = n, this._onBrush = Ge(this._onBrush, this), this._onBrushEnd = Ge(this._onBrushEnd, this);
    }, t.prototype.render = function(r, n, i, a) {
      if (e.prototype.render.apply(this, arguments), ay(this, "_dispatchZoomAction", r.get("throttle"), "fixRate"), this._orient = r.getOrient(), r.get("show") === !1) {
        this.group.removeAll();
        return;
      }
      if (r.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(), e.prototype.dispose.apply(this, arguments);
    }, t.prototype._clear = function() {
      U1(this, "_dispatchZoomAction");
      var r = this.api.getZr();
      r.off("mousemove", this._onBrush), r.off("mouseup", this._onBrushEnd);
    }, t.prototype._buildView = function() {
      var r = this.group;
      r.removeAll(), this._brushing = !1, this._displayables.brushRect = null, this._resetLocation(), this._resetInterval();
      var n = this._displayables.sliderGroup = new rt();
      this._renderBackground(), this._renderHandle(), this._renderDataShadow(), r.add(n), this._positionGroup();
    }, t.prototype._resetLocation = function() {
      var r = this.dataZoomModel, n = this.api, i = r.get("brushSelect"), a = i ? lye : 0, o = Yn(r, n).refContainer, s = this._findCoordRect(), l = r.get("defaultLocationEdgeGap", !0) || 0, u = this._orient === A_ ? {
        // Why using 'right', because right should be used in vertical,
        // and it is better to be consistent for dealing with position param merge.
        right: o.width - s.x - s.width,
        top: o.height - BD - l - a,
        width: s.width,
        height: BD
      } : {
        right: l,
        top: s.y,
        width: BD,
        height: s.height
      }, f = Bd(r.option);
      F(["right", "top", "width", "height"], function(h) {
        f[h] === "ph" && (f[h] = u[h]);
      });
      var c = Tr(f, o);
      this._location = {
        x: c.x,
        y: c.y
      }, this._size = [c.width, c.height], this._orient === IG && this._size.reverse();
    }, t.prototype._positionGroup = function() {
      var r = 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 === A_ && !o ? {
        scaleY: l ? 1 : -1,
        scaleX: 1
      } : i === A_ && o ? {
        scaleY: l ? 1 : -1,
        scaleX: -1
      } : i === IG && !o ? {
        scaleY: l ? -1 : 1,
        scaleX: 1,
        rotation: Math.PI / 2
      } : {
        scaleY: l ? -1 : 1,
        scaleX: -1,
        rotation: Math.PI / 2
      });
      var u = r.getBoundingRect([s]);
      r.x = n.x - u.x, r.y = n.y - u.y, r.markRedraw();
    }, t.prototype._getViewExtent = function() {
      return [0, this._size[0]];
    }, t.prototype._renderBackground = function() {
      var r = this.dataZoomModel, n = this._size, i = this._displayables.sliderGroup, a = r.get("brushSelect");
      i.add(new C_({
        silent: !0,
        shape: {
          x: 0,
          y: 0,
          width: n[0],
          height: n[1]
        },
        style: {
          fill: r.get("backgroundColor")
        },
        z2: -40
      }));
      var o = new C_({
        shape: {
          x: 0,
          y: 0,
          width: n[0],
          height: n[1]
        },
        style: {
          fill: "transparent"
        },
        z2: 0,
        onclick: Ge(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 r = this._dataShadowInfo = this._prepareDataShadowInfo();
      if (this._displayables.dataShadowSegs = [], !r)
        return;
      var n = this._size, i = this._shadowSize || [], a = r.series, o = a.getRawData(), s = a.getShadowDim && a.getShadowDim(), l = s && o.getDimensionInfo(s) ? a.getShadowDim() : r.otherDim;
      if (l == null)
        return;
      var u = this._shadowPolygonPts, f = this._shadowPolylinePts;
      if (o !== this._shadowData || l !== this._shadowDim || n[0] !== i[0] || n[1] !== i[1]) {
        var c = o.getDataExtent(r.thisDim), h = o.getDataExtent(l), v = (h[1] - h[0]) * 0.3;
        h = [h[0] - v, h[1] + v];
        var d = [0, n[1]], g = [0, n[0]], y = [[n[0], 0], [0, 0]], x = [], S = g[1] / Math.max(1, o.count() - 1), T = n[0] / (c[1] - c[0]), C = r.thisAxis.type === "time", A = -S, M = Math.round(o.count() / n[0]), E;
        o.each([r.thisDim, l], function(G, z, H) {
          if (M > 0 && H % M) {
            C || (A += S);
            return;
          }
          A = C ? (+G - c[0]) * T : A + S;
          var W = z == null || isNaN(z) || z === "", Z = W ? 0 : er(z, h, d, !0);
          W && !E && H ? (y.push([y[y.length - 1][0], 0]), x.push([x[x.length - 1][0], 0])) : !W && E && (y.push([A, 0]), x.push([A, 0])), W || (y.push([A, Z]), x.push([A, Z])), E = W;
        }), u = this._shadowPolygonPts = y, f = this._shadowPolylinePts = x;
      }
      this._shadowData = o, this._shadowDim = l, this._shadowSize = [n[0], n[1]];
      var P = this.dataZoomModel;
      function R(G) {
        var z = P.getModel(G ? "selectedDataBackground" : "dataBackground"), H = new rt(), W = new Wi({
          shape: {
            points: u
          },
          segmentIgnoreThreshold: 1,
          style: z.getModel("areaStyle").getAreaStyle(),
          silent: !0,
          z2: -20
        }), Z = new Ci({
          shape: {
            points: f
          },
          segmentIgnoreThreshold: 1,
          style: z.getModel("lineStyle").getLineStyle(),
          silent: !0,
          z2: -19
        });
        return H.add(W), H.add(Z), H;
      }
      for (var O = 0; O < 3; O++) {
        var N = R(O === 1);
        this._displayables.sliderGroup.add(N), this._displayables.dataShadowSegs.push(N);
      }
    }, t.prototype._prepareDataShadowInfo = function() {
      var r = this.dataZoomModel, n = r.get("showDataShadow");
      if (n !== !1) {
        var i, a = this.ecModel;
        return r.eachTargetAxis(function(o, s) {
          var l = r.getAxisProxy(o, s).getTargetSeriesModels();
          F(l, function(u) {
            if (!i && !(n !== !0 && Tt(fye, u.get("type")) < 0)) {
              var f = a.getComponent(kc(o), s).axis, c = vye(o), h, v = u.coordinateSystem;
              c != null && v.getOtherAxis && (h = v.getOtherAxis(f).inverse), c = u.getData().mapDimension(c);
              var d = u.getData().mapDimension(o);
              i = {
                thisAxis: f,
                series: u,
                thisDim: d,
                otherDim: c,
                otherAxisInverse: h
              };
            }
          }, this);
        }, this), i;
      }
    }, t.prototype._renderHandle = function() {
      var r = 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, f = l.get("borderRadius") || 0, c = l.get("brushSelect"), h = n.filler = new C_({
        silent: c,
        style: {
          fill: l.get("fillerColor")
        },
        textConfig: {
          position: "inside"
        }
      });
      o.add(h), o.add(new C_({
        silent: !0,
        subPixelOptimize: !0,
        shape: {
          x: 0,
          y: 0,
          width: s[0],
          height: s[1],
          r: f
        },
        style: {
          // deprecated option
          stroke: l.get("dataBackgroundColor") || l.get("borderColor"),
          lineWidth: sye,
          fill: fe.color.transparent
        }
      })), F([0, 1], function(T) {
        var C = l.get("handleIcon");
        !sb[C] && C.indexOf("path://") < 0 && C.indexOf("image://") < 0 && (C = "path://" + C);
        var A = en(C, -1, 0, 2, 2, null, !0);
        A.attr({
          cursor: dye(this._orient),
          draggable: !0,
          drift: Ge(this._onDragMove, this, T),
          ondragend: Ge(this._onDragEnd, this),
          onmouseover: Ge(this._showDataInfo, this, !0),
          onmouseout: Ge(this._showDataInfo, this, !1),
          z2: 5
        });
        var M = A.getBoundingRect(), E = l.get("handleSize");
        this._handleHeight = Be(E, this._size[1]), this._handleWidth = M.width / M.height * this._handleHeight, A.setStyle(l.getModel("handleStyle").getItemStyle()), A.style.strokeNoScale = !0, A.rectHover = !0, A.ensureState("emphasis").style = l.getModel(["emphasis", "handleStyle"]).getItemStyle(), jl(A);
        var P = l.get("handleColor");
        P != null && (A.style.fill = P), o.add(i[T] = A);
        var R = l.getModel("textStyle"), O = l.get("handleLabel") || {}, N = O.show || !1;
        r.add(a[T] = new Rt({
          silent: !0,
          invisible: !N,
          style: gr(R, {
            x: 0,
            y: 0,
            text: "",
            verticalAlign: "middle",
            align: "center",
            fill: R.getTextColor(),
            font: R.getFont()
          }),
          z2: 10
        }));
      }, this);
      var v = h;
      if (c) {
        var d = Be(l.get("moveHandleSize"), s[1]), g = n.moveHandle = new Mt({
          style: l.getModel("moveHandleStyle").getItemStyle(),
          silent: !0,
          shape: {
            r: [0, 0, 2, 2],
            y: s[1] - 0.5,
            height: d
          }
        }), y = d * 0.8, x = n.moveHandleIcon = en(l.get("moveHandleIcon"), -y / 2, -y / 2, y, y, fe.color.neutral00, !0);
        x.silent = !0, x.y = s[1] + d / 2 - 0.5, g.ensureState("emphasis").style = l.getModel(["emphasis", "moveHandleStyle"]).getItemStyle();
        var S = Math.min(s[1] / 2, Math.max(d, 10));
        v = n.moveZone = new Mt({
          invisible: !0,
          shape: {
            y: s[1] - S,
            height: d + S
          }
        }), v.on("mouseover", function() {
          u.enterEmphasis(g);
        }).on("mouseout", function() {
          u.leaveEmphasis(g);
        }), o.add(g), o.add(x), o.add(v);
      }
      v.attr({
        draggable: !0,
        cursor: "default",
        drift: Ge(this._onDragMove, this, "all"),
        ondragstart: Ge(this._showDataInfo, this, !0),
        ondragend: Ge(this._onDragEnd, this),
        onmouseover: Ge(this._showDataInfo, this, !0),
        onmouseout: Ge(this._showDataInfo, this, !1)
      });
    }, t.prototype._resetInterval = function() {
      var r = this._range = this.dataZoomModel.getPercentRange(), n = this._getViewExtent();
      this._handleEnds = [er(r[0], [0, 100], n, !0), er(r[1], [0, 100], n, !0)];
    }, t.prototype._updateInterval = function(r, n) {
      var i = this.dataZoomModel, a = this._handleEnds, o = this._getViewExtent(), s = i.findRepresentativeAxisProxy().getMinMaxSpan(), l = [0, 100];
      jc(n, a, o, i.get("zoomLock") ? "all" : r, s.minSpan != null ? er(s.minSpan, l, o, !0) : null, s.maxSpan != null ? er(s.maxSpan, l, o, !0) : null);
      var u = this._range, f = this._range = xo([er(a[0], o, l, !0), er(a[1], o, l, !0)]);
      return !u || u[0] !== f[0] || u[1] !== f[1];
    }, t.prototype._updateView = function(r) {
      var n = this._displayables, i = this._handleEnds, a = xo(i.slice()), o = this._size;
      F([0, 1], function(v) {
        var d = n.handles[v], g = this._handleHeight;
        d.attr({
          scaleX: g / 2,
          scaleY: g / 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 - g / 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]], f = 0; f < l.length; f++) {
        var c = l[f], h = c.getClipPath();
        h || (h = new Mt(), c.setClipPath(h)), h.setShape({
          x: u[f],
          y: 0,
          width: u[f + 1] - u[f],
          height: o[1]
        });
      }
      this._updateDataInfo(r);
    }, t.prototype._updateDataInfo = function(r) {
      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, f = this._range, c = r ? l.calculateDataWindow({
            start: f[0],
            end: f[1]
          }).valueWindow : l.getDataValueWindow();
          s = [this._formatLabel(c[0], u), this._formatLabel(c[1], u)];
        }
      }
      var h = xo(this._handleEnds.slice());
      v.call(this, 0), v.call(this, 1);
      function v(d) {
        var g = Hc(i.handles[d].parent, this.group), y = MC(d === 0 ? "right" : "left", g), x = this._handleWidth / 2 + uye, S = Ws([h[d] + (d === 0 ? -x : x), this._size[1] / 2], g);
        a[d].setStyle({
          x: S[0],
          y: S[1],
          verticalAlign: o === A_ ? "middle" : y,
          align: o === A_ ? y : "center",
          text: s[d]
        });
      }
    }, t.prototype._formatLabel = function(r, n) {
      var i = this.dataZoomModel, a = i.get("labelFormatter"), o = i.get("labelPrecision");
      (o == null || o === "auto") && (o = n.getPixelPrecision());
      var s = r == null || isNaN(r) ? "" : n.type === "category" || n.type === "time" ? n.scale.getLabel({
        value: Math.round(r)
      }) : r.toFixed(Math.min(o, 20));
      return nt(a) ? a(r, s) : Fe(a) ? a.replace("{value}", s) : s;
    }, t.prototype._showDataInfo = function(r) {
      var n = this.dataZoomModel.get("handleLabel") || {}, i = n.show || !1, a = this.dataZoomModel.getModel(["emphasis", "handleLabel"]), o = a.get("show") || !1, s = r || 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(r, n, i, a) {
      this._dragging = !0, gf(a.event);
      var o = this._displayables.sliderGroup.getLocalTransform(), s = Ws([n, i], o, !0), l = this._updateInterval(r, 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 r = this.dataZoomModel.get("realtime");
      !r && this._dispatchZoomAction(!1);
    }, t.prototype._onClickPanel = function(r) {
      var n = this._size, i = this._displayables.sliderGroup.transformCoordToLocal(r.offsetX, r.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(r) {
      var n = r.offsetX, i = r.offsetY;
      this._brushStart = new ht(n, i), this._brushing = !0, this._brushStartTime = +/* @__PURE__ */ new Date();
    }, t.prototype._onBrushEnd = function(r) {
      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], l = this._handleEnds = [i.x, i.x + i.width], u = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();
            jc(0, l, o, 0, u.minSpan != null ? er(u.minSpan, s, o, !0) : null, u.maxSpan != null ? er(u.maxSpan, s, o, !0) : null), this._range = xo([er(l[0], o, s, !0), er(l[1], o, s, !0)]), this._updateView(), this._dispatchZoomAction(!1);
          }
        }
      }
    }, t.prototype._onBrush = function(r) {
      this._brushing && (gf(r.event), this._updateBrushRect(r.offsetX, r.offsetY));
    }, t.prototype._updateBrushRect = function(r, n) {
      var i = this._displayables, a = this.dataZoomModel, o = i.brushRect;
      o || (o = i.brushRect = new C_({
        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(r, n), f = l.transformCoordToLocal(s.x, s.y), c = this._size;
      u[0] = Math.max(Math.min(c[0], u[0]), 0), o.setShape({
        x: f[0],
        y: 0,
        width: u[0] - f[0],
        height: c[1]
      });
    }, t.prototype._dispatchZoomAction = function(r) {
      var n = this._range;
      this.api.dispatchAction({
        type: "dataZoom",
        from: this.uid,
        dataZoomId: this.dataZoomModel.id,
        animation: r ? cye : null,
        start: n[0],
        end: n[1]
      });
    }, t.prototype._findCoordRect = function() {
      var r, n = OX(this.dataZoomModel).infoList;
      if (!r && n.length) {
        var i = n[0].model.coordinateSystem;
        r = i.getRect && i.getRect();
      }
      if (!r) {
        var a = this.api.getWidth(), o = this.api.getHeight();
        r = {
          x: a * 0.2,
          y: o * 0.2,
          width: a * 0.6,
          height: o * 0.6
        };
      }
      return r;
    }, t.type = "dataZoom.slider", t;
  })(PN)
);
function vye(e) {
  var t = {
    x: "y",
    y: "x",
    radius: "angle",
    angle: "radius"
  };
  return t[e];
}
function dye(e) {
  return e === "vertical" ? "ns-resize" : "ew-resize";
}
function eY(e) {
  e.registerComponentModel(oye), e.registerComponentView(hye), IN(e);
}
function pye(e) {
  ft(JX), ft(eY);
}
var tY = {
  /**
   * @public
   */
  get: function(e, t, r) {
    var n = it((gye[e] || {})[t]);
    return r && Se(n) ? n[n.length - 1] : n;
  }
}, gye = {
  color: {
    active: ["#006edd", "#e0ffff"],
    inactive: [fe.color.transparent]
  },
  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]
  }
}, RG = ai.mapVisual, mye = ai.eachVisual, yye = Se, OG = F, _ye = xo, xye = er, Ub = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.stateList = ["inRange", "outOfRange"], r.replacableOptionKeys = ["inRange", "outOfRange", "target", "controller", "color"], r.layoutMode = {
        type: "box",
        ignoreSize: !0
      }, r.dataBound = [-1 / 0, 1 / 0], r.targetVisuals = {}, r.controllerVisuals = {}, r;
    }
    return t.prototype.init = function(r, n, i) {
      this.mergeDefaultAndTheme(r, i);
    }, t.prototype.optionUpdated = function(r, n) {
      var i = this.option;
      !n && WX(i, r, this.replacableOptionKeys), this.textStyleModel = this.getModel("textStyle"), this.resetItemSize(), this.completeVisualOption();
    }, t.prototype.resetVisual = function(r) {
      var n = this.stateList;
      r = Ge(r, this), this.controllerVisuals = CI(this.option.controller, n, r), this.targetVisuals = CI(this.option.target, n, r);
    }, t.prototype.getItemSymbol = function() {
      return null;
    }, t.prototype.getTargetSeriesIndices = function() {
      var r = this.option.seriesId, n = this.option.seriesIndex;
      n == null && r == null && (n = "all");
      var i = Zm(this.ecModel, "series", {
        index: n,
        id: r
      }, {
        useDefault: !1,
        enableAll: !0,
        enableNone: !1
      }).models;
      return Ce(i, function(a) {
        return a.componentIndex;
      });
    }, t.prototype.eachTargetSeries = function(r, n) {
      F(this.getTargetSeriesIndices(), function(i) {
        var a = this.ecModel.getSeriesByIndex(i);
        a && r.call(n, a);
      }, this);
    }, t.prototype.isTargetSeries = function(r) {
      var n = !1;
      return this.eachTargetSeries(function(i) {
        i === r && (n = !0);
      }), n;
    }, t.prototype.formatValueText = function(r, n, i) {
      var a = this.option, o = a.precision, s = this.dataBound, l = a.formatter, u;
      i = i || ["<", ">"], Se(r) && (r = r.slice(), u = !0);
      var f = n ? r : u ? [c(r[0]), c(r[1])] : c(r);
      if (Fe(l))
        return l.replace("{value}", u ? f[0] : f).replace("{value2}", u ? f[1] : f);
      if (nt(l))
        return u ? l(r[0], r[1]) : l(r);
      if (u)
        return r[0] === s[0] ? i[0] + " " + f[1] : r[1] === s[1] ? i[1] + " " + f[0] : f[0] + " - " + f[1];
      return f;
      function c(h) {
        return h === s[0] ? "min" : h === s[1] ? "max" : (+h).toFixed(Math.min(o, 20));
      }
    }, t.prototype.resetExtent = function() {
      var r = this.option, n = _ye([r.min, r.max]);
      this._dataExtent = n;
    }, t.prototype.getDataDimensionIndex = function(r) {
      var n = this.option.dimension;
      if (n != null)
        return r.getDimensionIndex(n);
      for (var i = r.dimensions, a = i.length - 1; a >= 0; a--) {
        var o = i[a], s = r.getDimensionInfo(o);
        if (!s.isCalculationCoord)
          return s.storeDimIndex;
      }
    }, t.prototype.getExtent = function() {
      return this._dataExtent.slice();
    }, t.prototype.completeVisualOption = function() {
      var r = this.ecModel, n = this.option, i = {
        inRange: n.inRange,
        outOfRange: n.outOfRange
      }, a = n.target || (n.target = {}), o = n.controller || (n.controller = {});
      je(a, i), je(o, i);
      var s = this.isCategory();
      l.call(this, a), l.call(this, o), u.call(this, a, "inRange", "outOfRange"), f.call(this, o);
      function l(c) {
        yye(n.color) && !c.inRange && (c.inRange = {
          color: n.color.slice().reverse()
        }), c.inRange = c.inRange || {
          color: r.get("gradientColor")
        };
      }
      function u(c, h, v) {
        var d = c[h], g = c[v];
        d && !g && (g = c[v] = {}, OG(d, function(y, x) {
          if (ai.isValidType(x)) {
            var S = tY.get(x, "inactive", s);
            S != null && (g[x] = S, x === "color" && !g.hasOwnProperty("opacity") && !g.hasOwnProperty("colorAlpha") && (g.opacity = [0, 0]));
          }
        }));
      }
      function f(c) {
        var h = (c.inRange || {}).symbol || (c.outOfRange || {}).symbol, v = (c.inRange || {}).symbolSize || (c.outOfRange || {}).symbolSize, d = this.get("inactiveColor"), g = this.getItemSymbol(), y = g || "roundRect";
        OG(this.stateList, function(x) {
          var S = this.itemSize, T = c[x];
          T || (T = c[x] = {
            color: s ? d : [d]
          }), T.symbol == null && (T.symbol = h && it(h) || (s ? y : [y])), T.symbolSize == null && (T.symbolSize = v && it(v) || (s ? S[0] : [S[0], S[0]])), T.symbol = RG(T.symbol, function(M) {
            return M === "none" ? y : M;
          });
          var C = T.symbolSize;
          if (C != null) {
            var A = -1 / 0;
            mye(C, function(M) {
              M > A && (A = M);
            }), T.symbolSize = RG(C, function(M) {
              return xye(M, [0, A], [0, S[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(r) {
    }, t.prototype.getSelected = function() {
      return null;
    }, t.prototype.getValueState = function(r) {
      return null;
    }, t.prototype.getVisualMeta = function(r) {
      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: fe.color.transparent,
      borderColor: fe.color.borderTint,
      contentColor: fe.color.theme[0],
      inactiveColor: fe.color.disabled,
      borderWidth: 0,
      padding: fe.size.m,
      // 接受数组分别设定上右下左边距，同css
      textGap: 10,
      precision: 0,
      textStyle: {
        color: fe.color.secondary
        // 值域文字颜色
      }
    }, t;
  })(At)
), NG = [20, 140], Sye = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.optionUpdated = function(r, n) {
      e.prototype.optionUpdated.apply(this, arguments), this.resetExtent(), this.resetVisual(function(i) {
        i.mappingMethod = "linear", i.dataExtent = this.getExtent();
      }), this._resetRange();
    }, t.prototype.resetItemSize = function() {
      e.prototype.resetItemSize.apply(this, arguments);
      var r = this.itemSize;
      (r[0] == null || isNaN(r[0])) && (r[0] = NG[0]), (r[1] == null || isNaN(r[1])) && (r[1] = NG[1]);
    }, t.prototype._resetRange = function() {
      var r = this.getExtent(), n = this.option.range;
      !n || n.auto ? (r.auto = 1, this.option.range = r) : Se(n) && (n[0] > n[1] && n.reverse(), n[0] = Math.max(n[0], r[0]), n[1] = Math.min(n[1], r[1]));
    }, t.prototype.completeVisualOption = function() {
      e.prototype.completeVisualOption.apply(this, arguments), F(this.stateList, function(r) {
        var n = this.option.controller[r].symbolSize;
        n && n[0] !== n[1] && (n[0] = n[1] / 3);
      }, this);
    }, t.prototype.setSelected = function(r) {
      this.option.range = r.slice(), this._resetRange();
    }, t.prototype.getSelected = function() {
      var r = this.getExtent(), n = xo((this.get("range") || []).slice());
      return n[0] > r[1] && (n[0] = r[1]), n[1] > r[1] && (n[1] = r[1]), n[0] < r[0] && (n[0] = r[0]), n[1] < r[0] && (n[1] = r[0]), n;
    }, t.prototype.getValueState = function(r) {
      var n = this.option.range, i = this.getExtent(), a = et(this.option.unboundedRange, !0);
      return (a && n[0] <= i[0] || n[0] <= r) && (a && n[1] >= i[1] || r <= n[1]) ? "inRange" : "outOfRange";
    }, t.prototype.findTargetDataIndices = function(r) {
      var n = [];
      return this.eachTargetSeries(function(i) {
        var a = [], o = i.getData();
        o.each(this.getDataDimensionIndex(o), function(s, l) {
          r[0] <= s && s <= r[1] && a.push(l);
        }, this), n.push({
          seriesId: i.id,
          dataIndex: a
        });
      }, this), n;
    }, t.prototype.getVisualMeta = function(r) {
      var n = kG(this, "outOfRange", this.getExtent()), i = kG(this, "inRange", this.option.range.slice()), a = [];
      function o(v, d) {
        a.push({
          value: v,
          color: r(v, d)
        });
      }
      for (var s = 0, l = 0, u = i.length, f = n.length; l < f && (!i.length || n[l] <= i[0]); l++)
        n[l] < i[s] && o(n[l], "outOfRange");
      for (var c = 1; s < u; s++, c = 0)
        c && a.length && o(i[s], "outOfRange"), o(i[s], "inRange");
      for (var c = 1; l < f; l++)
        (!i.length || i[i.length - 1] < n[l]) && (c && (a.length && o(a[a.length - 1].value, "outOfRange"), c = 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 = nh(Ub.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: fe.color.neutral00,
        borderWidth: 1
      },
      indicatorIcon: "circle",
      indicatorSize: "50%",
      indicatorStyle: {
        borderColor: fe.color.neutral00,
        borderWidth: 2,
        shadowBlur: 2,
        shadowOffsetX: 1,
        shadowOffsetY: 1,
        shadowColor: fe.color.shadow
      }
      // emphasis: {
      //     handleStyle: {
      //         shadowBlur: 3,
      //         shadowOffsetX: 1,
      //         shadowOffsetY: 1,
      //         shadowColor: tokens.color.shadow
      //     }
      // }
    }), t;
  })(Ub)
);
function kG(e, t, r) {
  if (r[0] === r[1])
    return r.slice();
  for (var n = 200, i = (r[1] - r[0]) / n, a = r[0], o = [], s = 0; s <= n && a < r[1]; s++)
    o.push(a), a += i;
  return o.push(r[1]), o;
}
var rY = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.autoPositionValues = {
        left: 1,
        right: 1,
        top: 1,
        bottom: 1
      }, r;
    }
    return t.prototype.init = function(r, n) {
      this.ecModel = r, this.api = n;
    }, t.prototype.render = function(r, n, i, a) {
      if (this.visualMapModel = r, r.get("show") === !1) {
        this.group.removeAll();
        return;
      }
      this.doRender(r, n, i, a);
    }, t.prototype.renderBackground = function(r) {
      var n = this.visualMapModel, i = ry(n.get("padding") || 0), a = r.getBoundingRect();
      r.add(new Mt({
        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(r, 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 f(v, d) {
        s[v] = d;
      }
      var c = o.controllerVisuals[a || o.getValueState(r)], h = ai.prepareVisualTypes(c);
      return F(h, function(v) {
        var d = c[v];
        i.convertOpacityToAlpha && v === "opacity" && (v = "colorAlpha", d = c.__alphaForOpacity), ai.dependsOn(v, n) && d && d.applyVisual(r, u, f);
      }), s[n];
    }, t.prototype.positionGroup = function(r) {
      var n = this.visualMapModel, i = this.api, a = Yn(n, i).refContainer;
      PC(r, n.getBoxLayoutParams(), a);
    }, t.prototype.doRender = function(r, n, i, a) {
    }, t.type = "visualMap", t;
  })(fr)
), BG = [["left", "right", "width"], ["top", "bottom", "height"]];
function nY(e, t, r) {
  var n = e.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 = BG[o], l = [0, null, 10], u = {}, f = 0; f < 3; f++)
    u[BG[1 - o][f]] = l[f], u[s[f]] = f === 2 ? r[0] : n[s[f]];
  var c = [["x", "width", 3], ["y", "height", 0]][o], h = Tr(u, a, n.padding);
  return s[(h.margin[c[2]] || 0) + h[c[0]] + h[c[1]] * 0.5 < a[c[1]] * 0.5 ? 0 : 1];
}
function P2(e, t) {
  return F(e || [], function(r) {
    r.dataIndex != null && (r.dataIndexInside = r.dataIndex, r.dataIndex = null), r.highlightKey = "visualMap" + (t ? t.componentIndex : "");
  }), e;
}
var Nl = er, wye = F, zG = Math.min, zD = Math.max, Tye = 12, bye = 6, Cye = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r._shapes = {}, r._dataInterval = [], r._handleEnds = [], r._hoverLinkDataIndices = [], r;
    }
    return t.prototype.init = function(r, n) {
      e.prototype.init.call(this, r, n), this._hoverLinkFromSeriesMouseOver = Ge(this._hoverLinkFromSeriesMouseOver, this), this._hideIndicator = Ge(this._hideIndicator, this);
    }, t.prototype.doRender = function(r, n, i, a) {
      (!a || a.type !== "selectDataRange" || a.from !== this.uid) && this._buildView();
    }, t.prototype._buildView = function() {
      this.group.removeAll();
      var r = this.visualMapModel, n = this.group;
      this._orient = r.get("orient"), this._useHandle = r.get("calculable"), this._resetInterval(), this._renderBar(n);
      var i = r.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(r, 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, f = this._applyTransform([l[0] / 2, i === 0 ? -s : l[1] + s], u), c = this._applyTransform(i === 0 ? "bottom" : "top", u), h = this._orient, v = this.visualMapModel.textStyleModel;
        this.group.add(new Rt({
          style: gr(v, {
            x: f[0],
            y: f[1],
            verticalAlign: v.get("verticalAlign") || (h === "horizontal" ? "middle" : c),
            align: v.get("align") || (h === "horizontal" ? c : "center"),
            text: a
          })
        }));
      }
    }, t.prototype._renderBar = function(r) {
      var n = this.visualMapModel, i = this._shapes, a = n.itemSize, o = this._orient, s = this._useHandle, l = nY(n, this.api, a), u = i.mainGroup = this._createBarGroup(l), f = new rt();
      u.add(f), f.add(i.outOfRange = FG()), f.add(i.inRange = FG(null, s ? VG(this._orient) : null, Ge(this._dragHandle, this, "all", !1), Ge(this._dragHandle, this, "all", !0))), f.setClipPath(new Mt({
        shape: {
          x: 0,
          y: 0,
          width: a[0],
          height: a[1],
          r: 3
        }
      }));
      var c = n.textStyleModel.getTextRect("国"), h = zD(c.width, c.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), r.add(u);
    }, t.prototype._createHandle = function(r, n, i, a, o, s) {
      var l = Ge(this._dragHandle, this, i, !1), u = Ge(this._dragHandle, this, i, !0), f = $s(r.get("handleSize"), a[0]), c = en(r.get("handleIcon"), -f / 2, -f / 2, f, f, null, !0), h = VG(this._orient);
      c.attr({
        cursor: h,
        draggable: !0,
        drift: l,
        ondragend: u,
        onmousemove: function(x) {
          gf(x.event);
        }
      }), c.x = a[0] / 2, c.useStyle(r.getModel("handleStyle").getItemStyle()), c.setStyle({
        strokeNoScale: !0,
        strokeFirst: !0
      }), c.style.lineWidth *= 2, c.ensureState("emphasis").style = r.getModel(["emphasis", "handleStyle"]).getItemStyle(), rd(c, !0), n.add(c);
      var v = this.visualMapModel.textStyleModel, d = new Rt({
        cursor: h,
        draggable: !0,
        drift: l,
        onmousemove: function(x) {
          gf(x.event);
        },
        ondragend: u,
        style: gr(v, {
          x: 0,
          y: 0,
          text: ""
        })
      });
      d.ensureState("blur").style = {
        opacity: 0.1
      }, d.stateTransition = {
        duration: 200
      }, this.group.add(d);
      var g = [f, 0], y = this._shapes;
      y.handleThumbs[i] = c, y.handleLabelPoints[i] = g, y.handleLabels[i] = d;
    }, t.prototype._createIndicator = function(r, n, i, a, o) {
      var s = $s(r.get("indicatorSize"), i[0]), l = en(r.get("indicatorIcon"), -s / 2, -s / 2, s, s, null, !0);
      l.attr({
        cursor: "move",
        invisible: !0,
        silent: !0,
        x: i[0] / 2
      });
      var u = r.getModel("indicatorStyle").getItemStyle();
      if (l instanceof Xn) {
        var f = l.style;
        l.useStyle(xe({
          // TODO other properties like x, y ?
          image: f.image,
          x: f.x,
          y: f.y,
          width: f.width,
          height: f.height
        }, u));
      } else
        l.useStyle(u);
      n.add(l);
      var c = this.visualMapModel.textStyleModel, h = new Rt({
        silent: !0,
        invisible: !0,
        style: gr(c, {
          x: 0,
          y: 0,
          text: ""
        })
      });
      this.group.add(h);
      var v = [(o === "horizontal" ? a / 2 : bye) + i[0] / 2, 0], d = this._shapes;
      d.indicator = l, d.indicatorLabel = h, d.indicatorLabelPoint = v, this._firstShowIndicator = !0;
    }, t.prototype._dragHandle = function(r, n, i, a) {
      if (this._useHandle) {
        if (this._dragging = !n, !n) {
          var o = this._applyTransform([i, a], this._shapes.mainGroup, !0);
          this._updateInterval(r, 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() : GG(this.visualMapModel) && this._doHoverLinkToSeries(this._handleEnds[r], !1);
      }
    }, t.prototype._resetInterval = function() {
      var r = this.visualMapModel, n = this._dataInterval = r.getSelected(), i = r.getExtent(), a = [0, r.itemSize[1]];
      this._handleEnds = [Nl(n[0], i, a, !0), Nl(n[1], i, a, !0)];
    }, t.prototype._updateInterval = function(r, n) {
      n = n || 0;
      var i = this.visualMapModel, a = this._handleEnds, o = [0, i.itemSize[1]];
      jc(
        n,
        a,
        o,
        r,
        // cross is forbidden
        0
      );
      var s = i.getExtent();
      this._dataInterval = [Nl(a[0], o, s, !0), Nl(a[1], o, s, !0)];
    }, t.prototype._updateView = function(r) {
      var n = this.visualMapModel, i = n.getExtent(), a = this._shapes, o = [0, n.itemSize[1]], s = r ? 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(r, n, i, a) {
      var o = {
        forceState: a,
        convertOpacityToAlpha: !0
      }, s = this._makeColorGradient(r, o), l = [this.getControllerVisual(r[0], "symbolSize", o), this.getControllerVisual(r[1], "symbolSize", o)], u = this._createBarPoints(i, l);
      return {
        barColor: new Nd(0, 0, 0, 1, s),
        barPoints: u,
        handlesColor: [s[0].color, s[s.length - 1].color]
      };
    }, t.prototype._makeColorGradient = function(r, n) {
      var i = 100, a = [], o = (r[1] - r[0]) / i;
      a.push({
        color: this.getControllerVisual(r[0], "color", n),
        offset: 0
      });
      for (var s = 1; s < i; s++) {
        var l = r[0] + o * s;
        if (l > r[1])
          break;
        a.push({
          color: this.getControllerVisual(l, "color", n),
          offset: s / i
        });
      }
      return a.push({
        color: this.getControllerVisual(r[1], "color", n),
        offset: 1
      }), a;
    }, t.prototype._createBarPoints = function(r, n) {
      var i = this.visualMapModel.itemSize;
      return [[i[0] - n[0], r[0]], [i[0], r[0]], [i[0], r[1]], [i[0] - n[1], r[1]]];
    }, t.prototype._createBarGroup = function(r) {
      var n = this._orient, i = this.visualMapModel.get("inverse");
      return new rt(n === "horizontal" && !i ? {
        scaleX: r === "bottom" ? 1 : -1,
        rotation: Math.PI / 2
      } : n === "horizontal" && i ? {
        scaleX: r === "bottom" ? -1 : 1,
        rotation: -Math.PI / 2
      } : n === "vertical" && !i ? {
        scaleX: r === "left" ? 1 : -1,
        scaleY: -1
      } : {
        scaleX: r === "left" ? 1 : -1
      });
    }, t.prototype._updateHandle = function(r, n) {
      if (this._useHandle) {
        var i = this._shapes, a = this.visualMapModel, o = i.handleThumbs, s = i.handleLabels, l = a.itemSize, u = a.getExtent(), f = this._applyTransform("left", i.mainGroup);
        wye([0, 1], function(c) {
          var h = o[c];
          h.setStyle("fill", n.handlesColor[c]), h.y = r[c];
          var v = Nl(r[c], [0, l[1]], u, !0), d = this.getControllerVisual(v, "symbolSize");
          h.scaleX = h.scaleY = d / l[0], h.x = l[0] - d / 2;
          var g = Ws(i.handleLabelPoints[c], Hc(h, this.group));
          if (this._orient === "horizontal") {
            var y = f === "left" || f === "top" ? (l[0] - d) / 2 : (l[0] - d) / -2;
            g[1] += y;
          }
          s[c].setStyle({
            x: g[0],
            y: g[1],
            text: a.formatValueText(this._dataInterval[c]),
            verticalAlign: "middle",
            align: this._orient === "vertical" ? this._applyTransform("left", i.mainGroup) : "center"
          });
        }, this);
      }
    }, t.prototype._showIndicator = function(r, n, i, a) {
      var o = this.visualMapModel, s = o.getExtent(), l = o.itemSize, u = [0, l[1]], f = this._shapes, c = f.indicator;
      if (c) {
        c.attr("invisible", !1);
        var h = {
          convertOpacityToAlpha: !0
        }, v = this.getControllerVisual(r, "color", h), d = this.getControllerVisual(r, "symbolSize"), g = Nl(r, s, u, !0), y = l[0] - d / 2, x = {
          x: c.x,
          y: c.y
        };
        c.y = g, c.x = y;
        var S = Ws(f.indicatorLabelPoint, Hc(c, this.group)), T = f.indicatorLabel;
        T.attr("invisible", !1);
        var C = this._applyTransform("left", f.mainGroup), A = this._orient, M = A === "horizontal";
        T.setStyle({
          text: (i || "") + o.formatValueText(n),
          verticalAlign: M ? C : "middle",
          align: M ? "center" : C
        });
        var E = {
          x: y,
          y: g,
          style: {
            fill: v
          }
        }, P = {
          style: {
            x: S[0],
            y: S[1]
          }
        };
        if (o.ecModel.isAnimationEnabled() && !this._firstShowIndicator) {
          var R = {
            duration: 100,
            easing: "cubicInOut",
            additive: !0
          };
          c.x = x.x, c.y = x.y, c.animateTo(E, R), T.animateTo(P, R);
        } else
          c.attr(E), T.attr(P);
        this._firstShowIndicator = !1;
        var O = this._shapes.handleLabels;
        if (O)
          for (var N = 0; N < O.length; N++)
            this.api.enterBlur(O[N]);
      }
    }, t.prototype._enableHoverLinkToSeries = function() {
      var r = this;
      this._shapes.mainGroup.on("mousemove", function(n) {
        if (r._hovering = !0, !r._dragging) {
          var i = r.visualMapModel.itemSize, a = r._applyTransform([n.offsetX, n.offsetY], r._shapes.mainGroup, !0, !0);
          a[1] = zG(zD(0, a[1]), i[1]), r._doHoverLinkToSeries(a[1], 0 <= a[0] && a[0] <= i[0]);
        }
      }).on("mouseout", function() {
        r._hovering = !1, !r._dragging && r._clearHoverLinkToSeries();
      });
    }, t.prototype._enableHoverLinkFromSeries = function() {
      var r = this.api.getZr();
      this.visualMapModel.option.hoverLink ? (r.on("mouseover", this._hoverLinkFromSeriesMouseOver, this), r.on("mouseout", this._hideIndicator, this)) : this._clearHoverLinkFromSeries();
    }, t.prototype._doHoverLinkToSeries = function(r, n) {
      var i = this.visualMapModel, a = i.itemSize;
      if (i.option.hoverLink) {
        var o = [0, a[1]], s = i.getExtent();
        r = zG(zD(o[0], r), o[1]);
        var l = Aye(i, s, o), u = [r - l, r + l], f = Nl(r, o, s, !0), c = [Nl(u[0], o, s, !0), Nl(u[1], o, s, !0)];
        u[0] < o[0] && (c[0] = -1 / 0), u[1] > o[1] && (c[1] = 1 / 0), n && (c[0] === -1 / 0 ? this._showIndicator(f, c[1], "< ", l) : c[1] === 1 / 0 ? this._showIndicator(f, c[0], "> ", l) : this._showIndicator(f, f, "≈ ", l));
        var h = this._hoverLinkDataIndices, v = [];
        (n || GG(i)) && (v = this._hoverLinkDataIndices = i.findTargetDataIndices(c));
        var d = wQ(h, v);
        this._dispatchHighDown("downplay", P2(d[0], i)), this._dispatchHighDown("highlight", P2(d[1], i));
      }
    }, t.prototype._hoverLinkFromSeriesMouseOver = function(r) {
      var n;
      if (id(r.target, function(l) {
        var u = pt(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 r = this._shapes;
      r.indicator && r.indicator.attr("invisible", !0), r.indicatorLabel && r.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 r = this._hoverLinkDataIndices;
      this._dispatchHighDown("downplay", P2(r, this.visualMapModel)), r.length = 0;
    }, t.prototype._clearHoverLinkFromSeries = function() {
      this._hideIndicator();
      var r = this.api.getZr();
      r.off("mouseover", this._hoverLinkFromSeriesMouseOver), r.off("mouseout", this._hideIndicator);
    }, t.prototype._applyTransform = function(r, n, i, a) {
      var o = Hc(n, a ? null : this.group);
      return Se(r) ? Ws(r, o, i) : MC(r, o, i);
    }, t.prototype._dispatchHighDown = function(r, n) {
      n && n.length && this.api.dispatchAction({
        type: r,
        batch: n
      });
    }, t.prototype.dispose = function() {
      this._clearHoverLinkFromSeries(), this._clearHoverLinkToSeries();
    }, t.type = "visualMap.continuous", t;
  })(rY)
);
function FG(e, t, r, n) {
  return new Wi({
    shape: {
      points: e
    },
    draggable: !!r,
    cursor: t,
    drift: r,
    onmousemove: function(i) {
      gf(i.event);
    },
    ondragend: n
  });
}
function Aye(e, t, r) {
  var n = Tye / 2, i = e.get("hoverLinkDataSize");
  return i && (n = Nl(i, t, r, !0) / 2), n;
}
function GG(e) {
  var t = e.get("hoverLinkOnHandle");
  return !!(t ?? e.get("realtime"));
}
function VG(e) {
  return e === "vertical" ? "ns-resize" : "ew-resize";
}
var Mye = {
  type: "selectDataRange",
  event: "dataRangeSelected",
  // FIXME use updateView appears wrong
  update: "update"
}, Lye = function(e, t) {
  t.eachComponent({
    mainType: "visualMap",
    query: e
  }, function(r) {
    r.setSelected(e.selected);
  });
}, Dye = [
  {
    createOnAllSeries: !0,
    reset: function(e, t) {
      var r = [];
      return t.eachComponent("visualMap", function(n) {
        var i = e.pipelineContext;
        !n.isTargetSeries(e) || i && i.large || r.push(jge(n.stateList, n.targetVisuals, Ge(n.getValueState, n), n.getDataDimensionIndex(e.getData())));
      }), r;
    }
  },
  // Only support color.
  {
    createOnAllSeries: !0,
    reset: function(e, t) {
      var r = e.getData(), n = [];
      t.eachComponent("visualMap", function(i) {
        if (i.isTargetSeries(e)) {
          var a = i.getVisualMeta(Ge(Eye, null, e, i)) || {
            stops: [],
            outerColors: []
          }, o = i.getDataDimensionIndex(r);
          o >= 0 && (a.dimension = o, n.push(a));
        }
      }), e.getData().setVisual("visualMeta", n);
    }
  }
];
function Eye(e, t, r, n) {
  for (var i = t.targetVisuals[n], a = ai.prepareVisualTypes(i), o = {
    color: Px(e.getData(), "color")
    // default color.
  }, s = 0, l = a.length; s < l; s++) {
    var u = a[s], f = i[u === "opacity" ? "__alphaForOpacity" : u];
    f && f.applyVisual(r, c, h);
  }
  return o.color;
  function c(v) {
    return o[v];
  }
  function h(v, d) {
    o[v] = d;
  }
}
var HG = F;
function Pye(e) {
  var t = e && e.visualMap;
  Se(t) || (t = t ? [t] : []), HG(t, function(r) {
    if (r) {
      zg(r, "splitList") && !zg(r, "pieces") && (r.pieces = r.splitList, delete r.splitList);
      var n = r.pieces;
      n && Se(n) && HG(n, function(i) {
        ot(i) && (zg(i, "start") && !zg(i, "min") && (i.min = i.start), zg(i, "end") && !zg(i, "max") && (i.max = i.end));
      });
    }
  });
}
function zg(e, t) {
  return e && e.hasOwnProperty && e.hasOwnProperty(t);
}
var UG = !1;
function iY(e) {
  UG || (UG = !0, e.registerSubTypeDefaulter("visualMap", function(t) {
    return !t.categories && (!(t.pieces ? t.pieces.length > 0 : t.splitNumber > 0) || t.calculable) ? "continuous" : "piecewise";
  }), e.registerAction(Mye, Lye), F(Dye, function(t) {
    e.registerVisual(e.PRIORITY.VISUAL.COMPONENT, t);
  }), e.registerPreprocessor(Pye));
}
function aY(e) {
  e.registerComponentModel(Sye), e.registerComponentView(Cye), iY(e);
}
var Iye = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r._pieceList = [], r;
    }
    return t.prototype.optionUpdated = function(r, n) {
      e.prototype.optionUpdated.apply(this, arguments), this.resetExtent();
      var i = this._mode = this._determineMode();
      this._pieceList = [], Rye[this._mode].call(this, this._pieceList), this._resetSelected(r, n);
      var a = this.option.categories;
      this.resetVisual(function(o, s) {
        i === "categories" ? (o.mappingMethod = "category", o.categories = it(a)) : (o.dataExtent = this.getExtent(), o.mappingMethod = "piecewise", o.pieceList = Ce(this._pieceList, function(l) {
          return l = it(l), s !== "inRange" && (l.visual = null), l;
        }));
      });
    }, t.prototype.completeVisualOption = function() {
      var r = this.option, n = {}, i = ai.listVisualTypes(), a = this.isCategory();
      F(r.pieces, function(s) {
        F(i, function(l) {
          s.hasOwnProperty(l) && (n[l] = 1);
        });
      }), F(n, function(s, l) {
        var u = !1;
        F(this.stateList, function(f) {
          u = u || o(r, f, l) || o(r.target, f, l);
        }, this), !u && F(this.stateList, function(f) {
          (r[f] || (r[f] = {}))[l] = tY.get(l, f === "inRange" ? "active" : "inactive", a);
        });
      }, this);
      function o(s, l, u) {
        return s && s[l] && s[l].hasOwnProperty(u);
      }
      e.prototype.completeVisualOption.apply(this, arguments);
    }, t.prototype._resetSelected = function(r, n) {
      var i = this.option, a = this._pieceList, o = (n ? i : r).selected || {};
      if (i.selected = o, F(a, function(l, u) {
        var f = this.getSelectedMapKey(l);
        o.hasOwnProperty(f) || (o[f] = !0);
      }, this), i.selectedMode === "single") {
        var s = !1;
        F(a, function(l, u) {
          var f = this.getSelectedMapKey(l);
          o[f] && (s ? o[f] = !1 : s = !0);
        }, this);
      }
    }, t.prototype.getItemSymbol = function() {
      return this.get("itemSymbol");
    }, t.prototype.getSelectedMapKey = function(r) {
      return this._mode === "categories" ? r.value + "" : r.index + "";
    }, t.prototype.getPieceList = function() {
      return this._pieceList;
    }, t.prototype._determineMode = function() {
      var r = this.option;
      return r.pieces && r.pieces.length > 0 ? "pieces" : this.option.categories ? "categories" : "splitNumber";
    }, t.prototype.setSelected = function(r) {
      this.option.selected = it(r);
    }, t.prototype.getValueState = function(r) {
      var n = ai.findPieceIndex(r, this._pieceList);
      return n != null && this.option.selected[this.getSelectedMapKey(this._pieceList[n])] ? "inRange" : "outOfRange";
    }, t.prototype.findTargetDataIndices = function(r) {
      var n = [], i = this._pieceList;
      return this.eachTargetSeries(function(a) {
        var o = [], s = a.getData();
        s.each(this.getDataDimensionIndex(s), function(l, u) {
          var f = ai.findPieceIndex(l, i);
          f === r && o.push(u);
        }, this), n.push({
          seriesId: a.id,
          dataIndex: o
        });
      }, this), n;
    }, t.prototype.getRepresentValue = function(r) {
      var n;
      if (this.isCategory())
        n = r.value;
      else if (r.value != null)
        n = r.value;
      else {
        var i = r.interval || [];
        n = i[0] === -1 / 0 && i[1] === 1 / 0 ? 0 : (i[0] + i[1]) / 2;
      }
      return n;
    }, t.prototype.getVisualMeta = function(r) {
      if (this.isCategory())
        return;
      var n = [], i = ["", ""], a = this;
      function o(f, c) {
        var h = a.getRepresentValue({
          interval: f
        });
        c || (c = a.getValueState(h));
        var v = r(h, c);
        f[0] === -1 / 0 ? i[0] = v : f[1] === 1 / 0 ? i[1] = v : n.push({
          value: f[0],
          color: v
        }, {
          value: f[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 F(s, function(f) {
        var c = f.interval;
        c && (c[0] > u && o([u, c[0]], "outOfRange"), o(c.slice()), u = c[1]);
      }, this), {
        stops: n,
        outerColors: i
      };
    }, t.type = "visualMap.piecewise", t.defaultOption = nh(Ub.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;
  })(Ub)
), Rye = {
  splitNumber: function(e) {
    var t = this.option, r = 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(r) !== a && r < 5; )
      r++;
    t.precision = r, a = +a.toFixed(r), t.minOpen && e.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;
      e.push({
        interval: [s, l],
        close: [1, 1]
      });
    }
    t.maxOpen && e.push({
      interval: [n[1], 1 / 0],
      close: [0, 0]
    }), KE(e), F(e, function(u, f) {
      u.index = f, u.text = this.formatValueText(u.interval);
    }, this);
  },
  categories: function(e) {
    var t = this.option;
    F(t.categories, function(r) {
      e.push({
        text: this.formatValueText(r, !0),
        value: r
      });
    }, this), WG(t, e);
  },
  pieces: function(e) {
    var t = this.option;
    F(t.pieces, function(r, n) {
      ot(r) || (r = {
        value: r
      });
      var i = {
        text: "",
        index: n
      };
      if (r.label != null && (i.text = r.label), r.hasOwnProperty("value")) {
        var a = i.value = r.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], f = [], c = 0; c < 2; c++) {
          for (var h = [["gte", "gt", "min"], ["lte", "lt", "max"]][c], v = 0; v < 3 && o[c] == null; v++)
            o[c] = r[h[v]], s[c] = l[v], f[c] = v === 2;
          o[c] == null && (o[c] = u[c]);
        }
        f[0] && o[1] === 1 / 0 && (s[0] = 0), f[1] && o[0] === -1 / 0 && (s[1] = 0), o[0] === o[1] && s[0] && s[1] && (i.value = o[0]);
      }
      i.visual = ai.retrieveVisuals(r), e.push(i);
    }, this), WG(t, e), KE(e), F(e, function(r) {
      var n = r.close, i = [["<", "≤"][n[1]], [">", "≥"][n[0]]];
      r.text = r.text || this.formatValueText(r.value != null ? r.value : r.interval, !1, i);
    }, this);
  }
};
function WG(e, t) {
  var r = e.inverse;
  (e.orient === "vertical" ? !r : r) && t.reverse();
}
var Oye = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.doRender = function() {
      var r = this.group;
      r.removeAll();
      var n = this.visualMapModel, i = n.get("textGap"), a = n.textStyleModel, o = this._getItemAlign(), s = n.itemSize, l = this._getViewData(), u = l.endsText, f = Ti(n.get("showLabel", !0), !u), c = !n.get("selectedMode");
      u && this._renderEndsText(r, u[0], s, f, o), F(l.viewPieceList, function(h) {
        var v = h.piece, d = new rt();
        d.onclick = Ge(this._onItemClick, this, v), this._enableHoverLink(d, h.indexInModelPieceList);
        var g = n.getRepresentValue(v);
        if (this._createItemSymbol(d, g, [0, 0, s[0], s[1]], c), f) {
          var y = this.visualMapModel.getValueState(g), x = a.get("align") || o;
          d.add(new Rt({
            style: gr(a, {
              x: x === "right" ? -i : s[0] + i,
              y: s[1] / 2,
              text: v.text,
              verticalAlign: a.get("verticalAlign") || "middle",
              align: x,
              opacity: et(a.get("opacity"), y === "outOfRange" ? 0.5 : 1)
            }),
            silent: c
          }));
        }
        r.add(d);
      }, this), u && this._renderEndsText(r, u[1], s, f, o), vd(n.get("orient"), r, n.get("itemGap")), this.renderBackground(r), this.positionGroup(r);
    }, t.prototype._enableHoverLink = function(r, n) {
      var i = this;
      r.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: P2(s.findTargetDataIndices(n), s)
        });
      };
    }, t.prototype._getItemAlign = function() {
      var r = this.visualMapModel, n = r.option;
      if (n.orient === "vertical")
        return nY(r, this.api, r.itemSize);
      var i = n.align;
      return (!i || i === "auto") && (i = "left"), i;
    }, t.prototype._renderEndsText = function(r, n, i, a, o) {
      if (n) {
        var s = new rt(), l = this.visualMapModel.textStyleModel;
        s.add(new Rt({
          style: gr(l, {
            x: a ? o === "right" ? i[0] : 0 : i[0] / 2,
            y: i[1] / 2,
            verticalAlign: "middle",
            align: a ? o : "center",
            text: n
          })
        })), r.add(s);
      }
    }, t.prototype._getViewData = function() {
      var r = this.visualMapModel, n = Ce(r.getPieceList(), function(s, l) {
        return {
          piece: s,
          indexInModelPieceList: l
        };
      }), i = r.get("text"), a = r.get("orient"), o = r.get("inverse");
      return (a === "horizontal" ? o : !o) ? n.reverse() : i && (i = i.slice().reverse()), {
        viewPieceList: n,
        endsText: i
      };
    }, t.prototype._createItemSymbol = function(r, n, i, a) {
      var o = en(
        // 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, r.add(o);
    }, t.prototype._onItemClick = function(r) {
      var n = this.visualMapModel, i = n.option, a = i.selectedMode;
      if (a) {
        var o = it(i.selected), s = n.getSelectedMapKey(r);
        a === "single" || a === !0 ? (o[s] = !0, F(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;
  })(rY)
);
function oY(e) {
  e.registerComponentModel(Iye), e.registerComponentView(Oye), iY(e);
}
function Nye(e) {
  ft(aY), ft(oY);
}
var kye = (
  /** @class */
  (function() {
    function e(t) {
      this._thumbnailModel = t;
    }
    return e.prototype.reset = function(t) {
      this._renderVersion = t.getMainProcessVersion();
    }, e.prototype.renderContent = function(t) {
      var r = t.api.getViewOfComponentModel(this._thumbnailModel);
      r && (t.group.silent = !0, r.renderContent({
        group: t.group,
        targetTrans: t.targetTrans,
        z2Range: LW(t.group),
        roamType: t.roamType,
        viewportRect: t.viewportRect,
        renderVersion: this._renderVersion
      }));
    }, e.prototype.updateWindow = function(t, r) {
      var n = r.getViewOfComponentModel(this._thumbnailModel);
      n && n.updateWindow({
        targetTrans: t,
        renderVersion: this._renderVersion
      });
    }, e;
  })()
), Bye = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r.preventAutoZ = !0, r;
    }
    return t.prototype.optionUpdated = function(r, n) {
      this._updateBridge();
    }, t.prototype._updateBridge = function() {
      var r = this._birdge = this._birdge || new kye(this);
      if (this._target = null, this.ecModel.eachSeries(function(i) {
        p4(i, null);
      }), this.shouldShow()) {
        var n = this.getTarget();
        p4(n.baseMapProvider, r);
      }
    }, t.prototype.shouldShow = function() {
      return this.getShallow("show", !0);
    }, t.prototype.getBridge = function() {
      return this._birdge;
    }, t.prototype.getTarget = function() {
      if (this._target)
        return this._target;
      var r = this.getReferringComponents("series", {
        useDefault: !1,
        enableAll: !1,
        enableNone: !1
      }).models[0];
      return r ? r.subType !== "graph" && (r = null) : r = this.ecModel.queryComponents({
        mainType: "series",
        subType: "graph"
      })[0], this._target = {
        baseMapProvider: r
      }, this._target;
    }, t.type = "thumbnail", t.layoutMode = "box", t.dependencies = ["series", "geo"], t.defaultOption = {
      show: !0,
      right: 1,
      bottom: 1,
      height: "25%",
      width: "25%",
      itemStyle: {
        // Use echarts option.backgorundColor by default.
        borderColor: fe.color.border,
        borderWidth: 2
      },
      windowStyle: {
        borderWidth: 1,
        color: fe.color.neutral30,
        borderColor: fe.color.neutral40,
        opacity: 0.3
      },
      z: 10
    }, t;
  })(At)
), zye = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = t.type, r;
    }
    return t.prototype.render = function(r, n, i) {
      if (this._api = i, this._model = r, this._coordSys || (this._coordSys = new Hd()), !this._isEnabled()) {
        this._clear();
        return;
      }
      this._renderVersion = i.getMainProcessVersion();
      var a = this.group;
      a.removeAll();
      var o = r.getModel("itemStyle"), s = o.getItemStyle();
      s.fill == null && (s.fill = n.get("backgroundColor") || fe.color.neutral00);
      var l = Yn(r, i).refContainer, u = Tr(qW(r, !0), l), f = s.lineWidth || 0, c = this._contentRect = bd(u.clone(), f / 2, !0, !0), h = new rt();
      a.add(h), h.setClipPath(new Mt({
        shape: c.plain()
      }));
      var v = this._targetGroup = new rt();
      h.add(v);
      var d = u.plain();
      d.r = o.getShallow("borderRadius", !0), a.add(this._bgRect = new Mt({
        style: s,
        shape: d,
        silent: !1,
        cursor: "grab"
      }));
      var g = r.getModel("windowStyle"), y = g.getShallow("borderRadius", !0);
      h.add(this._windowRect = new Mt({
        shape: {
          x: 0,
          y: 0,
          width: 0,
          height: 0,
          r: y
        },
        style: g.getItemStyle(),
        silent: !1,
        cursor: "grab"
      })), this._dealRenderContent(), this._dealUpdateWindow(), YG(r, this);
    }, t.prototype.renderContent = function(r) {
      this._bridgeRendered = r, this._isEnabled() && (this._dealRenderContent(), this._dealUpdateWindow(), YG(this._model, this));
    }, t.prototype._dealRenderContent = function() {
      var r = this._bridgeRendered;
      if (!(!r || r.renderVersion !== this._renderVersion)) {
        var n = this._targetGroup, i = this._coordSys, a = this._contentRect;
        if (n.removeAll(), !!r) {
          var o = r.group, s = o.getBoundingRect();
          n.add(o), this._bgRect.z2 = r.z2Range.min - 10, i.setBoundingRect(s.x, s.y, s.width, s.height);
          var l = Tr({
            left: "center",
            top: "center",
            aspect: s.width / s.height
          }, a);
          i.setViewRect(l.x, l.y, l.width, l.height), o.attr(i.getTransformInfo().raw), this._windowRect.z2 = r.z2Range.max + 10, this._resetRoamController(r.roamType);
        }
      }
    }, t.prototype.updateWindow = function(r) {
      var n = this._bridgeRendered;
      n && n.renderVersion === r.renderVersion && (n.targetTrans = r.targetTrans), this._isEnabled() && this._dealUpdateWindow();
    }, t.prototype._dealUpdateWindow = function() {
      var r = this._bridgeRendered;
      if (!(!r || r.renderVersion !== this._renderVersion)) {
        var n = cs([], r.targetTrans), i = Hs([], this._coordSys.transform, n);
        this._transThisToTarget = cs([], i);
        var a = r.viewportRect;
        a ? a = a.clone() : a = new st(0, 0, this._api.getWidth(), this._api.getHeight()), a.applyTransform(i);
        var o = this._windowRect, s = o.shape.r;
        o.setShape(tt({
          r: s
        }, a));
      }
    }, t.prototype._resetRoamController = function(r) {
      var n = this, i = this._api, a = this._roamController;
      if (a || (a = this._roamController = new Vd(i.getZr())), !r || !this._isEnabled()) {
        a.disable();
        return;
      }
      a.enable(r, {
        api: i,
        zInfo: {
          component: this._model
        },
        triggerInfo: {
          roamTrigger: null,
          isInSelf: function(o, s, l) {
            return n._contentRect.contain(s, l);
          }
        }
      }), a.off("pan").off("zoom").on("pan", Ge(this._onPan, this)).on("zoom", Ge(this._onZoom, this));
    }, t.prototype._onPan = function(r) {
      var n = this._transThisToTarget;
      if (!(!this._isEnabled() || !n)) {
        var i = fn([], [r.oldX, r.oldY], n), a = fn([], [r.oldX - r.dx, r.oldY - r.dy], n);
        this._api.dispatchAction(XG(this._model.getTarget().baseMapProvider, {
          dx: a[0] - i[0],
          dy: a[1] - i[1]
        }));
      }
    }, t.prototype._onZoom = function(r) {
      var n = this._transThisToTarget;
      if (!(!this._isEnabled() || !n)) {
        var i = fn([], [r.originX, r.originY], n);
        this._api.dispatchAction(XG(this._model.getTarget().baseMapProvider, {
          zoom: 1 / r.scale,
          originX: i[0],
          originY: i[1]
        }));
      }
    }, t.prototype._isEnabled = function() {
      var r = this._model;
      if (!r || !r.shouldShow())
        return !1;
      var n = r.getTarget().baseMapProvider;
      return !!n;
    }, t.prototype._clear = function() {
      this.group.removeAll(), this._bridgeRendered = null, this._roamController && this._roamController.disable();
    }, t.prototype.remove = function() {
      this._clear();
    }, t.prototype.dispose = function() {
      this._clear();
    }, t.type = "thumbnail", t;
  })(fr)
);
function XG(e, t) {
  var r = e.mainType === "series" ? e.subType + "Roam" : e.mainType + "Roam", n = {
    type: r
  };
  return n[e.mainType + "Id"] = e.id, xe(n, t), n;
}
function YG(e, t) {
  var r = Cd(e);
  LC(t.group, r.z, r.zlevel);
}
function Fye(e) {
  e.registerComponentModel(Bye), e.registerComponentView(zye);
}
var Gye = {
  label: {
    enabled: !0
  },
  decal: {
    show: !1
  }
}, ZG = Bt(), Vye = {};
function Hye(e, t) {
  var r = e.getModel("aria");
  if (!r.get("enabled"))
    return;
  var n = it(Gye);
  je(n.label, e.getLocaleModel().get("aria"), !1), je(r.option, n, !1), i(), a();
  function i() {
    var u = r.getModel("decal"), f = u.get("show");
    if (f) {
      var c = Je();
      e.eachSeries(function(h) {
        if (!h.isColorBySeries()) {
          var v = c.get(h.type);
          v || (v = {}, c.set(h.type, v)), ZG(h).scope = v;
        }
      }), e.eachRawSeries(function(h) {
        if (e.isSeriesFiltered(h))
          return;
        if (nt(h.enableAriaDecal)) {
          h.enableAriaDecal();
          return;
        }
        var v = h.getData();
        if (h.isColorBySeries()) {
          var S = yP(h.ecModel, h.name, Vye, e.getSeriesCount()), T = v.getVisual("decal");
          v.setVisual("decal", C(T, S));
        } else {
          var d = h.getRawData(), g = {}, y = ZG(h).scope;
          v.each(function(A) {
            var M = v.getRawIndex(A);
            g[M] = A;
          });
          var x = d.count();
          d.each(function(A) {
            var M = g[A], E = d.getName(A) || A + "", P = yP(h.ecModel, E, y, x), R = v.getItemVisual(M, "decal");
            v.setItemVisual(M, "decal", C(R, P));
          });
        }
        function C(A, M) {
          var E = A ? xe(xe({}, M), A) : M;
          return E.dirty = !0, E;
        }
      });
    }
  }
  function a() {
    var u = t.getZr().dom;
    if (u) {
      var f = e.getLocaleModel().get("aria"), c = r.getModel("label");
      if (c.option = tt(c.option, f), !!c.get("enabled")) {
        if (u.setAttribute("role", "img"), c.get("description")) {
          u.setAttribute("aria-label", c.get("description"));
          return;
        }
        var h = e.getSeriesCount(), v = c.get(["data", "maxCount"]) || 10, d = c.get(["series", "maxCount"]) || 10, g = Math.min(h, d), y;
        if (!(h < 1)) {
          var x = s();
          if (x) {
            var S = c.get(["general", "withTitle"]);
            y = o(S, {
              title: x
            });
          } else
            y = c.get(["general", "withoutTitle"]);
          var T = [], C = h > 1 ? c.get(["series", "multiple", "prefix"]) : c.get(["series", "single", "prefix"]);
          y += o(C, {
            seriesCount: h
          }), e.eachSeries(function(P, R) {
            if (R < g) {
              var O = void 0, N = P.get("name"), G = N ? "withName" : "withoutName";
              O = h > 1 ? c.get(["series", "multiple", G]) : c.get(["series", "single", G]), O = o(O, {
                seriesId: P.seriesIndex,
                seriesName: P.get("name"),
                seriesType: l(P.subType)
              });
              var z = P.getData();
              if (z.count() > v) {
                var H = c.get(["data", "partialData"]);
                O += o(H, {
                  displayCnt: v
                });
              } else
                O += c.get(["data", "allData"]);
              for (var W = c.get(["data", "separator", "middle"]), Z = c.get(["data", "separator", "end"]), ee = c.get(["data", "excludeDimensionId"]), V = [], Q = 0; Q < z.count(); Q++)
                if (Q < v) {
                  var q = z.getName(Q), X = ee ? nr(z.getValues(Q), function(ue, oe) {
                    return Tt(ee, oe) === -1;
                  }) : z.getValues(Q), K = c.get(["data", q ? "withName" : "withoutName"]);
                  V.push(o(K, {
                    name: q,
                    value: X.join(W)
                  }));
                }
              O += V.join(W) + Z, T.push(O);
            }
          });
          var A = c.getModel(["series", "multiple", "separator"]), M = A.get("middle"), E = A.get("end");
          y += T.join(M) + E, u.setAttribute("aria-label", y);
        }
      }
    }
  }
  function o(u, f) {
    if (!Fe(u))
      return u;
    var c = u;
    return F(f, function(h, v) {
      c = c.replace(new RegExp("\\{\\s*" + v + "\\s*\\}", "g"), h);
    }), c;
  }
  function s() {
    var u = e.get("title");
    return u && u.length && (u = u[0]), u && u.text;
  }
  function l(u) {
    var f = e.getLocaleModel().get(["series", "typeNames"]);
    return f[u] || f.chart;
  }
}
function Uye(e) {
  if (!(!e || !e.aria)) {
    var t = e.aria;
    t.show != null && (t.enabled = t.show), t.label = t.label || {}, F(["description", "general", "series", "data"], function(r) {
      t[r] != null && (t.label[r] = t[r]);
    });
  }
}
function Wye(e) {
  e.registerPreprocessor(Uye), e.registerVisual(e.PRIORITY.VISUAL.ARIA, Hye);
}
var $G = {
  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',
}, Xye = (
  /** @class */
  (function() {
    function e(t) {
      var r = this._condVal = Fe(t) ? new RegExp(t) : eU(t) ? t : null;
      if (r == null) {
        var n = "";
        or(n);
      }
    }
    return e.prototype.evaluate = function(t) {
      var r = typeof t;
      return Fe(r) ? this._condVal.test(t) : Xt(r) ? this._condVal.test(t + "") : !1;
    }, e;
  })()
), Yye = (
  /** @class */
  (function() {
    function e() {
    }
    return e.prototype.evaluate = function() {
      return this.value;
    }, e;
  })()
), Zye = (
  /** @class */
  (function() {
    function e() {
    }
    return e.prototype.evaluate = function() {
      for (var t = this.children, r = 0; r < t.length; r++)
        if (!t[r].evaluate())
          return !1;
      return !0;
    }, e;
  })()
), $ye = (
  /** @class */
  (function() {
    function e() {
    }
    return e.prototype.evaluate = function() {
      for (var t = this.children, r = 0; r < t.length; r++)
        if (t[r].evaluate())
          return !0;
      return !1;
    }, e;
  })()
), qye = (
  /** @class */
  (function() {
    function e() {
    }
    return e.prototype.evaluate = function() {
      return !this.child.evaluate();
    }, e;
  })()
), jye = (
  /** @class */
  (function() {
    function e() {
    }
    return e.prototype.evaluate = function() {
      for (var t = !!this.valueParser, r = this.getValue, n = r(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;
    }, e;
  })()
);
function GN(e, t) {
  if (e === !0 || e === !1) {
    var r = new Yye();
    return r.value = e, r;
  }
  var n = "";
  return sY(e) || or(n), e.and ? qG("and", e, t) : e.or ? qG("or", e, t) : e.not ? Kye(e, t) : Qye(e, t);
}
function qG(e, t, r) {
  var n = t[e], i = "";
  Se(n) || or(i), n.length || or(i);
  var a = e === "and" ? new Zye() : new $ye();
  return a.children = Ce(n, function(o) {
    return GN(o, r);
  }), a.children.length || or(i), a;
}
function Kye(e, t) {
  var r = e.not, n = "";
  sY(r) || or(n);
  var i = new qye();
  return i.child = GN(r, t), i.child || or(n), i;
}
function Qye(e, t) {
  for (var r = "", n = t.prepareGetValue(e), i = [], a = Ht(e), o = e.parser, s = o ? m8(o) : null, l = 0; l < a.length; l++) {
    var u = a[l];
    if (!(u === "parser" || t.valueGetterAttrMap.get(u))) {
      var f = qe($G, u) ? $G[u] : u, c = e[u], h = s ? s(c) : c, v = Rte(f, h) || f === "reg" && new Xye(h);
      v || or(r), i.push(v);
    }
  }
  i.length || or(r);
  var d = new jye();
  return d.valueGetterParam = n, d.valueParser = s, d.getValue = t.getValue, d.subCondList = i, d;
}
function sY(e) {
  return ot(e) && !Vi(e);
}
var Jye = (
  /** @class */
  (function() {
    function e(t, r) {
      this._cond = GN(t, r);
    }
    return e.prototype.evaluate = function() {
      return this._cond.evaluate();
    }, e;
  })()
);
function e0e(e, t) {
  return new Jye(e, t);
}
var t0e = {
  type: "echarts:filter",
  // PENDING: enhance to filter by index rather than create new data
  transform: function(e) {
    for (var t = e.upstream, r, n = e0e(e.config, {
      valueGetterAttrMap: Je({
        dimension: !0
      }),
      prepareGetValue: function(s) {
        var l = "", u = s.dimension;
        qe(s, "dimension") || or(l);
        var f = t.getDimensionInfo(u);
        return f || or(l), {
          dimIdx: f.index
        };
      },
      getValue: function(s) {
        return t.retrieveValueFromItem(r, s.dimIdx);
      }
    }), i = [], a = 0, o = t.count(); a < o; a++)
      r = t.getRawDataItem(a), n.evaluate() && i.push(r);
    return {
      data: i
    };
  }
}, r0e = {
  type: "echarts:sort",
  transform: function(e) {
    var t = e.upstream, r = e.config, n = "", i = Mr(r);
    i.length || or(n);
    var a = [];
    F(i, function(f) {
      var c = f.dimension, h = f.order, v = f.parser, d = f.incomparable;
      if (c == null && or(n), h !== "asc" && h !== "desc" && or(n), d && d !== "min" && d !== "max") {
        var g = "";
        or(g);
      }
      if (h !== "asc" && h !== "desc") {
        var y = "";
        or(y);
      }
      var x = t.getDimensionInfo(c);
      x || or(n);
      var S = v ? m8(v) : null;
      v && !S && or(n), a.push({
        dimIdx: x.index,
        parser: S,
        comparator: new _8(h, d)
      });
    });
    var o = t.sourceFormat;
    o !== Ai && o !== Ao && or(n);
    for (var s = [], l = 0, u = t.count(); l < u; l++)
      s.push(t.getRawDataItem(l));
    return s.sort(function(f, c) {
      for (var h = 0; h < a.length; h++) {
        var v = a[h], d = t.retrieveValueFromItem(f, v.dimIdx), g = t.retrieveValueFromItem(c, v.dimIdx);
        v.parser && (d = v.parser(d), g = v.parser(g));
        var y = v.comparator.evaluate(d, g);
        if (y !== 0)
          return y;
      }
      return 0;
    }), {
      data: s
    };
  }
};
function n0e(e) {
  e.registerTransform(t0e), e.registerTransform(r0e);
}
var i0e = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = "dataset", r;
    }
    return t.prototype.init = function(r, n, i) {
      e.prototype.init.call(this, r, n, i), this._sourceManager = new T8(this), MB(this);
    }, t.prototype.mergeOption = function(r, n) {
      e.prototype.mergeOption.call(this, r, n), MB(this);
    }, t.prototype.optionUpdated = function() {
      this._sourceManager.dirty();
    }, t.prototype.getSourceManager = function() {
      return this._sourceManager;
    }, t.type = "dataset", t.defaultOption = {
      seriesLayoutBy: Xs
    }, t;
  })(At)
), a0e = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t() {
      var r = e !== null && e.apply(this, arguments) || this;
      return r.type = "dataset", r;
    }
    return t.type = "dataset", t;
  })(fr)
);
function lY(e) {
  e.registerComponentModel(i0e), e.registerComponentView(a0e);
}
var Rl = ru.CMD;
function um(e, t) {
  return Math.abs(e - t) < 1e-5;
}
function II(e) {
  var t = e.data, r = e.len(), n = [], i, a = 0, o = 0, s = 0, l = 0;
  function u(z, H) {
    i && i.length > 2 && n.push(i), i = [z, H];
  }
  function f(z, H, W, Z) {
    um(z, W) && um(H, Z) || i.push(z, H, W, Z, W, Z);
  }
  function c(z, H, W, Z, ee, V) {
    var Q = Math.abs(H - z), q = Math.tan(Q / 4) * 4 / 3, X = H < z ? -1 : 1, K = Math.cos(z), ue = Math.sin(z), oe = Math.cos(H), te = Math.sin(H), pe = K * ee + W, me = ue * V + Z, de = oe * ee + W, ve = te * V + Z, Ae = ee * q * X, be = V * q * X;
    i.push(pe - Ae * ue, me + be * K, de + Ae * te, ve - be * oe, de, ve);
  }
  for (var h, v, d, g, y = 0; y < r; ) {
    var x = t[y++], S = y === 1;
    switch (S && (a = t[y], o = t[y + 1], s = a, l = o, (x === Rl.L || x === Rl.C || x === Rl.Q) && (i = [s, l])), x) {
      case Rl.M:
        a = s = t[y++], o = l = t[y++], u(s, l);
        break;
      case Rl.L:
        h = t[y++], v = t[y++], f(a, o, h, v), a = h, o = v;
        break;
      case Rl.C:
        i.push(t[y++], t[y++], t[y++], t[y++], a = t[y++], o = t[y++]);
        break;
      case Rl.Q:
        h = t[y++], v = t[y++], d = t[y++], g = t[y++], i.push(a + 2 / 3 * (h - a), o + 2 / 3 * (v - o), d + 2 / 3 * (h - d), g + 2 / 3 * (v - g), d, g), a = d, o = g;
        break;
      case Rl.A:
        var T = t[y++], C = t[y++], A = t[y++], M = t[y++], E = t[y++], P = t[y++] + E;
        y += 1;
        var R = !t[y++];
        h = Math.cos(E) * A + T, v = Math.sin(E) * M + C, S ? (s = h, l = v, u(s, l)) : f(a, o, h, v), a = Math.cos(P) * A + T, o = Math.sin(P) * M + C;
        for (var O = (R ? -1 : 1) * Math.PI / 2, N = E; R ? N > P : N < P; N += O) {
          var G = R ? Math.max(N + O, P) : Math.min(N + O, P);
          c(N, G, T, C, A, M);
        }
        break;
      case Rl.R:
        s = a = t[y++], l = o = t[y++], h = s + t[y++], v = l + t[y++], u(h, l), f(h, l, h, v), f(h, v, s, v), f(s, v, s, l), f(s, l, h, l);
        break;
      case Rl.Z:
        i && f(a, o, s, l), a = s, o = l;
        break;
    }
  }
  return i && i.length > 2 && n.push(i), n;
}
function RI(e, t, r, n, i, a, o, s, l, u) {
  if (um(e, r) && um(t, n) && um(i, o) && um(a, s)) {
    l.push(o, s);
    return;
  }
  var f = 2 / u, c = f * f, h = o - e, v = s - t, d = Math.sqrt(h * h + v * v);
  h /= d, v /= d;
  var g = r - e, y = n - t, x = i - o, S = a - s, T = g * g + y * y, C = x * x + S * S;
  if (T < c && C < c) {
    l.push(o, s);
    return;
  }
  var A = h * g + v * y, M = -h * x - v * S, E = T - A * A, P = C - M * M;
  if (E < c && A >= 0 && P < c && M >= 0) {
    l.push(o, s);
    return;
  }
  var R = [], O = [];
  Yc(e, r, i, o, 0.5, R), Yc(t, n, a, s, 0.5, O), RI(R[0], O[0], R[1], O[1], R[2], O[2], R[3], O[3], l, u), RI(R[4], O[4], R[5], O[5], R[6], O[6], R[7], O[7], l, u);
}
function o0e(e, t) {
  var r = II(e), n = [];
  t = t || 1;
  for (var i = 0; i < r.length; i++) {
    var a = r[i], o = [], s = a[0], l = a[1];
    o.push(s, l);
    for (var u = 2; u < a.length; ) {
      var f = a[u++], c = a[u++], h = a[u++], v = a[u++], d = a[u++], g = a[u++];
      RI(s, l, f, c, h, v, d, g, o, t), s = d, l = g;
    }
    n.push(o);
  }
  return n;
}
function uY(e, t, r) {
  var n = e[t], i = e[1 - t], a = Math.abs(n / i), o = Math.ceil(Math.sqrt(a * r)), s = Math.floor(r / o);
  s === 0 && (s = 1, o = r);
  for (var l = [], u = 0; u < o; u++)
    l.push(s);
  var f = o * s, c = r - f;
  if (c > 0)
    for (var u = 0; u < c; u++)
      l[u % o] += 1;
  return l;
}
function jG(e, t, r) {
  for (var n = e.r0, i = e.r, a = e.startAngle, o = e.endAngle, s = Math.abs(o - a), l = s * i, u = i - n, f = l > Math.abs(u), c = uY([l, u], f ? 0 : 1, t), h = (f ? s : u) / c.length, v = 0; v < c.length; v++)
    for (var d = (f ? u : s) / c[v], g = 0; g < c[v]; g++) {
      var y = {};
      f ? (y.startAngle = a + h * v, y.endAngle = a + h * (v + 1), y.r0 = n + d * g, y.r = n + d * (g + 1)) : (y.startAngle = a + d * g, y.endAngle = a + d * (g + 1), y.r0 = n + h * v, y.r = n + h * (v + 1)), y.clockwise = e.clockwise, y.cx = e.cx, y.cy = e.cy, r.push(y);
    }
}
function s0e(e, t, r) {
  for (var n = e.width, i = e.height, a = n > i, o = uY([n, i], a ? 0 : 1, t), s = a ? "width" : "height", l = a ? "height" : "width", u = a ? "x" : "y", f = a ? "y" : "x", c = e[s] / o.length, h = 0; h < o.length; h++)
    for (var v = e[l] / o[h], d = 0; d < o[h]; d++) {
      var g = {};
      g[u] = h * c, g[f] = d * v, g[s] = c, g[l] = v, g.x += e.x, g.y += e.y, r.push(g);
    }
}
function KG(e, t, r, n) {
  return e * n - r * t;
}
function l0e(e, t, r, n, i, a, o, s) {
  var l = r - e, u = n - t, f = o - i, c = s - a, h = KG(f, c, l, u);
  if (Math.abs(h) < 1e-6)
    return null;
  var v = e - i, d = t - a, g = KG(v, d, f, c) / h;
  return g < 0 || g > 1 ? null : new ht(g * l + e, g * u + t);
}
function u0e(e, t, r) {
  var n = new ht();
  ht.sub(n, r, t), n.normalize();
  var i = new ht();
  ht.sub(i, e, t);
  var a = i.dot(n);
  return a;
}
function Fg(e, t) {
  var r = e[e.length - 1];
  r && r[0] === t[0] && r[1] === t[1] || e.push(t);
}
function f0e(e, t, r) {
  for (var n = e.length, i = [], a = 0; a < n; a++) {
    var o = e[a], s = e[(a + 1) % n], l = l0e(o[0], o[1], s[0], s[1], t.x, t.y, r.x, r.y);
    l && i.push({
      projPt: u0e(l, t, r),
      pt: l,
      idx: a
    });
  }
  if (i.length < 2)
    return [{ points: e }, { points: e }];
  i.sort(function(y, x) {
    return y.projPt - x.projPt;
  });
  var u = i[0], f = i[i.length - 1];
  if (f.idx < u.idx) {
    var c = u;
    u = f, f = c;
  }
  for (var h = [u.pt.x, u.pt.y], v = [f.pt.x, f.pt.y], d = [h], g = [v], a = u.idx + 1; a <= f.idx; a++)
    Fg(d, e[a].slice());
  Fg(d, v), Fg(d, h);
  for (var a = f.idx + 1; a <= u.idx + n; a++)
    Fg(g, e[a % n].slice());
  return Fg(g, h), Fg(g, v), [{
    points: d
  }, {
    points: g
  }];
}
function QG(e) {
  var t = e.points, r = [], n = [];
  wC(t, r, n);
  var i = new st(r[0], r[1], n[0] - r[0], n[1] - r[1]), a = i.width, o = i.height, s = i.x, l = i.y, u = new ht(), f = new ht();
  return a > o ? (u.x = f.x = s + a / 2, u.y = l, f.y = l + o) : (u.y = f.y = l + o / 2, u.x = s, f.x = s + a), f0e(t, u, f);
}
function Wb(e, t, r, n) {
  if (r === 1)
    n.push(t);
  else {
    var i = Math.floor(r / 2), a = e(t);
    Wb(e, a[0], i, n), Wb(e, a[1], r - i, n);
  }
  return n;
}
function c0e(e, t) {
  for (var r = [], n = 0; n < t; n++)
    r.push(DR(e));
  return r;
}
function h0e(e, t) {
  t.setStyle(e.style), t.z = e.z, t.z2 = e.z2, t.zlevel = e.zlevel;
}
function v0e(e) {
  for (var t = [], r = 0; r < e.length; )
    t.push([e[r++], e[r++]]);
  return t;
}
function d0e(e, t) {
  var r = [], n = e.shape, i;
  switch (e.type) {
    case "rect":
      s0e(n, t, r), i = Mt;
      break;
    case "sector":
      jG(n, t, r), i = Ui;
      break;
    case "circle":
      jG({
        r0: 0,
        r: n.r,
        startAngle: 0,
        endAngle: Math.PI * 2,
        cx: n.cx,
        cy: n.cy
      }, t, r), i = Ui;
      break;
    default:
      var a = e.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 = Ce(o0e(e.getUpdatedPathProxy(), o), function(x) {
        return v0e(x);
      }), l = s.length;
      if (l === 0)
        Wb(QG, {
          points: s[0]
        }, t, r);
      else if (l === t)
        for (var u = 0; u < l; u++)
          r.push({
            points: s[u]
          });
      else {
        var f = 0, c = Ce(s, function(x) {
          var S = [], T = [];
          wC(x, S, T);
          var C = (T[1] - S[1]) * (T[0] - S[0]);
          return f += C, { poly: x, area: C };
        });
        c.sort(function(x, S) {
          return S.area - x.area;
        });
        for (var h = t, u = 0; u < l; u++) {
          var v = c[u];
          if (h <= 0)
            break;
          var d = u === l - 1 ? h : Math.ceil(v.area / f * t);
          d < 0 || (Wb(QG, {
            points: v.poly
          }, d, r), h -= d);
        }
      }
      i = Wi;
      break;
  }
  if (!i)
    return c0e(e, t);
  for (var g = [], u = 0; u < r.length; u++) {
    var y = new i();
    y.setShape(r[u]), h0e(e, y), g.push(y);
  }
  return g;
}
function p0e(e, t) {
  var r = e.length, n = t.length;
  if (r === n)
    return [e, t];
  for (var i = [], a = [], o = r < n ? e : t, s = Math.min(r, n), l = Math.abs(n - r) / 6, u = (s - 2) / 6, f = Math.ceil(l / u) + 1, c = [o[0], o[1]], h = l, v = 2; v < s; ) {
    var d = o[v - 2], g = o[v - 1], y = o[v++], x = o[v++], S = o[v++], T = o[v++], C = o[v++], A = o[v++];
    if (h <= 0) {
      c.push(y, x, S, T, C, A);
      continue;
    }
    for (var M = Math.min(h, f - 1) + 1, E = 1; E <= M; E++) {
      var P = E / M;
      Yc(d, y, S, C, P, i), Yc(g, x, T, A, P, a), d = i[3], g = a[3], c.push(i[1], a[1], i[2], a[2], d, g), y = i[5], x = a[5], S = i[6], T = a[6];
    }
    h -= M - 1;
  }
  return o === e ? [c, t] : [e, c];
}
function JG(e, t) {
  for (var r = e.length, n = e[r - 2], i = e[r - 1], a = [], o = 0; o < t.length; )
    a[o++] = n, a[o++] = i;
  return a;
}
function g0e(e, t) {
  for (var r, n, i, a = [], o = [], s = 0; s < Math.max(e.length, t.length); s++) {
    var l = e[s], u = t[s], f = void 0, c = void 0;
    l ? u ? (r = p0e(l, u), f = r[0], c = r[1], n = f, i = c) : (c = JG(i || l, l), f = l) : (f = JG(n || u, u), c = u), a.push(f), o.push(c);
  }
  return [a, o];
}
function eV(e) {
  for (var t = 0, r = 0, n = 0, i = e.length, a = 0, o = i - 2; a < i; o = a, a += 2) {
    var s = e[o], l = e[o + 1], u = e[a], f = e[a + 1], c = s * f - u * l;
    t += c, r += (s + u) * c, n += (l + f) * c;
  }
  return t === 0 ? [e[0] || 0, e[1] || 0] : [r / t / 3, n / t / 3, t];
}
function m0e(e, t, r, n) {
  for (var i = (e.length - 2) / 6, a = 1 / 0, o = 0, s = e.length, l = s - 2, u = 0; u < i; u++) {
    for (var f = u * 6, c = 0, h = 0; h < s; h += 2) {
      var v = h === 0 ? f : (f + h - 2) % l + 2, d = e[v] - r[0], g = e[v + 1] - r[1], y = t[h] - n[0], x = t[h + 1] - n[1], S = y - d, T = x - g;
      c += S * S + T * T;
    }
    c < a && (a = c, o = u);
  }
  return o;
}
function y0e(e) {
  for (var t = [], r = e.length, n = 0; n < r; n += 2)
    t[n] = e[r - n - 2], t[n + 1] = e[r - n - 1];
  return t;
}
function _0e(e, t, r, n) {
  for (var i = [], a, o = 0; o < e.length; o++) {
    var s = e[o], l = t[o], u = eV(s), f = eV(l);
    a == null && (a = u[2] < 0 != f[2] < 0);
    var c = [], h = [], v = 0, d = 1 / 0, g = [], y = s.length;
    a && (s = y0e(s));
    for (var x = m0e(s, l, u, f) * 6, S = y - 2, T = 0; T < S; T += 2) {
      var C = (x + T) % S + 2;
      c[T + 2] = s[C] - u[0], c[T + 3] = s[C + 1] - u[1];
    }
    c[0] = s[x] - u[0], c[1] = s[x + 1] - u[1];
    for (var A = n / r, M = -n / 2; M <= n / 2; M += A) {
      for (var E = Math.sin(M), P = Math.cos(M), R = 0, T = 0; T < s.length; T += 2) {
        var O = c[T], N = c[T + 1], G = l[T] - f[0], z = l[T + 1] - f[1], H = G * P - z * E, W = G * E + z * P;
        g[T] = H, g[T + 1] = W;
        var Z = H - O, ee = W - N;
        R += Z * Z + ee * ee;
      }
      if (R < d) {
        d = R, v = M;
        for (var V = 0; V < g.length; V++)
          h[V] = g[V];
      }
    }
    i.push({
      from: c,
      to: h,
      fromCp: u,
      toCp: f,
      rotation: -v
    });
  }
  return i;
}
function Xb(e) {
  return e.__isCombineMorphing;
}
var fY = "__mOriginal_";
function Yb(e, t, r) {
  var n = fY + t, i = e[n] || e[t];
  e[n] || (e[n] = e[t]);
  var a = r.replace, o = r.after, s = r.before;
  e[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 S1(e, t) {
  var r = fY + t;
  e[r] && (e[t] = e[r], e[r] = null);
}
function tV(e, t) {
  for (var r = 0; r < e.length; r++)
    for (var n = e[r], 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 cY(e, t) {
  var r = e.getUpdatedPathProxy(), n = t.getUpdatedPathProxy(), i = g0e(II(r), II(n)), a = i[0], o = i[1], s = e.getComputedTransform(), l = t.getComputedTransform();
  function u() {
    this.transform = null;
  }
  s && tV(a, s), l && tV(o, l), Yb(t, "updateTransform", { replace: u }), t.transform = null;
  var f = _0e(a, o, 10, Math.PI), c = [];
  Yb(t, "buildPath", { replace: function(h) {
    for (var v = t.__morphT, d = 1 - v, g = [], y = 0; y < f.length; y++) {
      var x = f[y], S = x.from, T = x.to, C = x.rotation * v, A = x.fromCp, M = x.toCp, E = Math.sin(C), P = Math.cos(C);
      l1(g, A, M, v);
      for (var R = 0; R < S.length; R += 2) {
        var O = S[R], N = S[R + 1], G = T[R], z = T[R + 1], H = O * d + G * v, W = N * d + z * v;
        c[R] = H * P - W * E + g[0], c[R + 1] = H * E + W * P + g[1];
      }
      var Z = c[0], ee = c[1];
      h.moveTo(Z, ee);
      for (var R = 2; R < S.length; ) {
        var G = c[R++], z = c[R++], V = c[R++], Q = c[R++], q = c[R++], X = c[R++];
        Z === G && ee === z && V === q && Q === X ? h.lineTo(q, X) : h.bezierCurveTo(G, z, V, Q, q, X), Z = q, ee = X;
      }
    }
  } });
}
function VN(e, t, r) {
  if (!e || !t)
    return t;
  var n = r.done, i = r.during;
  cY(e, t), t.__morphT = 0;
  function a() {
    S1(t, "buildPath"), S1(t, "updateTransform"), t.__morphT = -1, t.createPathProxy(), t.dirtyShape();
  }
  return t.animateTo({
    __morphT: 1
  }, tt({
    during: function(o) {
      t.dirtyShape(), i && i(o);
    },
    done: function() {
      a(), n && n();
    }
  }, r)), t;
}
function x0e(e, t, r, n, i, a) {
  var o = 16;
  e = i === r ? 0 : Math.round(32767 * (e - r) / (i - r)), 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 f = 0, c = 0;
    (e & u) > 0 && (f = 1), (t & u) > 0 && (c = 1), s += u * u * (3 * f ^ c), c === 0 && (f === 1 && (e = u - 1 - e, t = u - 1 - t), l = e, e = t, t = l);
  }
  return s;
}
function Zb(e) {
  var t = 1 / 0, r = 1 / 0, n = -1 / 0, i = -1 / 0, a = Ce(e, function(s) {
    var l = s.getBoundingRect(), u = s.getComputedTransform(), f = l.x + l.width / 2 + (u ? u[4] : 0), c = l.y + l.height / 2 + (u ? u[5] : 0);
    return t = Math.min(f, t), r = Math.min(c, r), n = Math.max(f, n), i = Math.max(c, i), [f, c];
  }), o = Ce(a, function(s, l) {
    return {
      cp: s,
      z: x0e(s[0], s[1], t, r, n, i),
      path: e[l]
    };
  });
  return o.sort(function(s, l) {
    return s.z - l.z;
  }).map(function(s) {
    return s.path;
  });
}
function hY(e) {
  return d0e(e.path, e.count);
}
function OI() {
  return {
    fromIndividuals: [],
    toIndividuals: [],
    count: 0
  };
}
function S0e(e, t, r) {
  var n = [];
  function i(A) {
    for (var M = 0; M < A.length; M++) {
      var E = A[M];
      Xb(E) ? i(E.childrenRef()) : E instanceof zt && n.push(E);
    }
  }
  i(e);
  var a = n.length;
  if (!a)
    return OI();
  var o = r.dividePath || hY, s = o({
    path: t,
    count: a
  });
  if (s.length !== a)
    return console.error("Invalid morphing: unmatched splitted path"), OI();
  n = Zb(n), s = Zb(s);
  for (var l = r.done, u = r.during, f = r.individualDelay, c = new of(), h = 0; h < a; h++) {
    var v = n[h], d = s[h];
    d.parent = t, d.copyTransform(c), f || cY(v, d);
  }
  t.__isCombineMorphing = !0, t.childrenRef = function() {
    return s;
  };
  function g(A) {
    for (var M = 0; M < s.length; M++)
      s[M].addSelfToZr(A);
  }
  Yb(t, "addSelfToZr", {
    after: function(A) {
      g(A);
    }
  }), Yb(t, "removeSelfFromZr", {
    after: function(A) {
      for (var M = 0; M < s.length; M++)
        s[M].removeSelfFromZr(A);
    }
  });
  function y() {
    t.__isCombineMorphing = !1, t.__morphT = -1, t.childrenRef = null, S1(t, "addSelfToZr"), S1(t, "removeSelfFromZr");
  }
  var x = s.length;
  if (f)
    for (var S = x, T = function() {
      S--, S === 0 && (y(), l && l());
    }, h = 0; h < x; h++) {
      var C = f ? tt({
        delay: (r.delay || 0) + f(h, x, n[h], s[h]),
        done: T
      }, r) : r;
      VN(n[h], s[h], C);
    }
  else
    t.__morphT = 0, t.animateTo({
      __morphT: 1
    }, tt({
      during: function(A) {
        for (var M = 0; M < x; M++) {
          var E = s[M];
          E.__morphT = t.__morphT, E.dirtyShape();
        }
        u && u(A);
      },
      done: function() {
        y();
        for (var A = 0; A < e.length; A++)
          S1(e[A], "updateTransform");
        l && l();
      }
    }, r));
  return t.__zr && g(t.__zr), {
    fromIndividuals: n,
    toIndividuals: s,
    count: x
  };
}
function w0e(e, t, r) {
  var n = t.length, i = [], a = r.dividePath || hY;
  function o(v) {
    for (var d = 0; d < v.length; d++) {
      var g = v[d];
      Xb(g) ? o(g.childrenRef()) : g instanceof zt && i.push(g);
    }
  }
  if (Xb(e)) {
    o(e.childrenRef());
    var s = i.length;
    if (s < n)
      for (var l = 0, u = s; u < n; u++)
        i.push(DR(i[l++ % s]));
    i.length = n;
  } else {
    i = a({ path: e, count: n });
    for (var f = e.getComputedTransform(), u = 0; u < i.length; u++)
      i[u].setLocalTransform(f);
    if (i.length !== n)
      return console.error("Invalid morphing: unmatched splitted path"), OI();
  }
  i = Zb(i), t = Zb(t);
  for (var c = r.individualDelay, u = 0; u < n; u++) {
    var h = c ? tt({
      delay: (r.delay || 0) + c(u, n, i[u], t[u])
    }, r) : r;
    VN(i[u], t[u], h);
  }
  return {
    fromIndividuals: i,
    toIndividuals: t,
    count: t.length
  };
}
function rV(e) {
  return Se(e[0]);
}
function nV(e, t) {
  for (var r = [], n = e.length, i = 0; i < n; i++)
    r.push({
      one: e[i],
      many: []
    });
  for (var i = 0; i < t.length; i++) {
    var a = t[i].length, o = void 0;
    for (o = 0; o < a; o++)
      r[o % n].many.push(t[i][o]);
  }
  for (var s = 0, i = n - 1; i >= 0; i--)
    if (!r[i].many.length) {
      var l = r[s].many;
      if (l.length <= 1)
        if (s)
          s = 0;
        else
          return r;
      var a = l.length, u = Math.ceil(a / 2);
      r[i].many = l.slice(u, a), r[s].many = l.slice(0, u), s++;
    }
  return r;
}
var T0e = {
  clone: function(e) {
    for (var t = [], r = 1 - Math.pow(1 - e.path.style.opacity, 1 / e.count), n = 0; n < e.count; n++) {
      var i = DR(e.path);
      i.setStyle("opacity", r), t.push(i);
    }
    return t;
  },
  // Use the default divider
  split: null
};
function FD(e, t, r, n, i, a) {
  if (!e.length || !t.length)
    return;
  var o = Qm("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, f;
  rV(e) && (u = e, f = t), rV(t) && (u = t, f = e);
  function c(x, S, T, C, A) {
    var M = x.many, E = x.one;
    if (M.length === 1 && !A) {
      var P = S ? M[0] : E, R = S ? E : M[0];
      if (Xb(P))
        c({
          many: [P],
          one: R
        }, !0, T, C, !0);
      else {
        var O = s ? tt({
          delay: s(T, C)
        }, l) : l;
        VN(P, R, O), a(P, R, P, R, O);
      }
    } else
      for (var N = tt({
        dividePath: T0e[r],
        individualDelay: s && function(ee, V, Q, q) {
          return s(ee + T, C);
        }
      }, l), G = S ? S0e(M, E, N) : w0e(E, M, N), z = G.fromIndividuals, H = G.toIndividuals, W = z.length, Z = 0; Z < W; Z++) {
        var O = s ? tt({
          delay: s(Z, W)
        }, l) : l;
        a(z[Z], H[Z], S ? M[Z] : x.one, S ? x.one : M[Z], O);
      }
  }
  for (var h = u ? u === e : e.length > t.length, v = u ? nV(f, u) : nV(h ? t : e, [h ? e : t]), d = 0, g = 0; g < v.length; g++)
    d += v[g].many.length;
  for (var y = 0, g = 0; g < v.length; g++)
    c(v[g], h, y, d), y += v[g].many.length;
}
function qv(e) {
  if (!e)
    return [];
  if (Se(e)) {
    for (var t = [], r = 0; r < e.length; r++)
      t.push(qv(e[r]));
    return t;
  }
  var n = [];
  return e.traverse(function(i) {
    i instanceof zt && !i.disableMorphing && !i.invisible && !i.ignore && n.push(i);
  }), n;
}
var vY = 1e4, b0e = 0, iV = 1, aV = 2, C0e = Bt();
function A0e(e, t) {
  for (var r = e.dimensions, n = 0; n < r.length; n++) {
    var i = e.getDimensionInfo(r[n]);
    if (i && i.otherDims[t] === 0)
      return r[n];
  }
}
function M0e(e, t, r) {
  var n = e.getDimensionInfo(r), i = n && n.ordinalMeta;
  if (n) {
    var a = e.get(n.name, t);
    return i && i.categories[a] || a + "";
  }
}
function oV(e, t, r, n) {
  var i = n ? "itemChildGroupId" : "itemGroupId", a = A0e(e, i);
  if (a) {
    var o = M0e(e, t, a);
    return o;
  }
  var s = e.getRawDataItem(t), l = n ? "childGroupId" : "groupId";
  if (s && s[l])
    return s[l] + "";
  if (!n)
    return r || e.getId(t);
}
function sV(e) {
  var t = [];
  return F(e, function(r) {
    var n = r.data, i = r.dataGroupId;
    if (!(n.count() > vY))
      for (var a = n.getIndices(), o = 0; o < a.length; o++)
        t.push({
          data: n,
          groupId: oV(n, o, i, !1),
          childGroupId: oV(n, o, i, !0),
          divide: r.divide,
          dataIndex: o
        });
  }), t;
}
function GD(e, t, r) {
  e.traverse(function(n) {
    n instanceof zt && Ir(n, {
      style: {
        opacity: 0
      }
    }, t, {
      dataIndex: r,
      isFrom: !0
    });
  });
}
function VD(e) {
  if (e.parent) {
    var t = e.getComputedTransform();
    e.setLocalTransform(t), e.parent.remove(e);
  }
}
function Gg(e) {
  e.stopAnimation(), e.isGroup && e.traverse(function(t) {
    t.stopAnimation();
  });
}
function L0e(e, t, r) {
  var n = Qm("update", r, t);
  n && e.traverse(function(i) {
    if (i instanceof hs) {
      var a = uee(i);
      a && i.animateFrom({
        style: a
      }, n);
    }
  });
}
function D0e(e, t) {
  var r = e.length;
  if (r !== t.length)
    return !1;
  for (var n = 0; n < r; n++) {
    var i = e[n], a = t[n];
    if (i.data.getId(i.dataIndex) !== a.data.getId(a.dataIndex))
      return !1;
  }
  return !0;
}
function dY(e, t, r) {
  var n = sV(e), i = sV(t);
  function a(T, C, A, M, E) {
    (A || T) && C.animateFrom({
      style: A && A !== T ? xe(xe({}, A.style), T.style) : T.style
    }, E);
  }
  var o = !1, s = b0e, l = Je(), u = Je();
  n.forEach(function(T) {
    T.groupId && l.set(T.groupId, !0), T.childGroupId && u.set(T.childGroupId, !0);
  });
  for (var f = 0; f < i.length; f++) {
    var c = i[f].groupId;
    if (u.get(c)) {
      s = iV;
      break;
    }
    var h = i[f].childGroupId;
    if (h && l.get(h)) {
      s = aV;
      break;
    }
  }
  function v(T, C) {
    return function(A) {
      var M = A.data, E = A.dataIndex;
      return C ? M.getId(E) : T ? s === iV ? A.childGroupId : A.groupId : s === aV ? A.childGroupId : A.groupId;
    };
  }
  var d = D0e(n, i), g = {};
  if (!d)
    for (var f = 0; f < i.length; f++) {
      var y = i[f], x = y.data.getItemGraphicEl(y.dataIndex);
      x && (g[x.id] = !0);
    }
  function S(T, C) {
    var A = n[C], M = i[T], E = M.data.hostModel, P = A.data.getItemGraphicEl(A.dataIndex), R = M.data.getItemGraphicEl(M.dataIndex);
    if (P === R) {
      R && L0e(R, M.dataIndex, E);
      return;
    }
    // We can't use the elements that already being morphed
    P && g[P.id] || R && (Gg(R), P ? (Gg(P), VD(P), o = !0, FD(qv(P), qv(R), M.divide, E, T, a)) : GD(R, E, T));
  }
  new _f(n, i, v(!0, d), v(!1, d), null, "multiple").update(S).updateManyToOne(function(T, C) {
    var A = i[T], M = A.data, E = M.hostModel, P = M.getItemGraphicEl(A.dataIndex), R = nr(Ce(C, function(O) {
      return n[O].data.getItemGraphicEl(n[O].dataIndex);
    }), function(O) {
      return O && O !== P && !g[O.id];
    });
    P && (Gg(P), R.length ? (F(R, function(O) {
      Gg(O), VD(O);
    }), o = !0, FD(qv(R), qv(P), A.divide, E, T, a)) : GD(P, E, A.dataIndex));
  }).updateOneToMany(function(T, C) {
    var A = n[C], M = A.data.getItemGraphicEl(A.dataIndex);
    if (!(M && g[M.id])) {
      var E = nr(Ce(T, function(R) {
        return i[R].data.getItemGraphicEl(i[R].dataIndex);
      }), function(R) {
        return R && R !== M;
      }), P = i[T[0]].data.hostModel;
      E.length && (F(E, function(R) {
        return Gg(R);
      }), M ? (Gg(M), VD(M), o = !0, FD(
        qv(M),
        qv(E),
        A.divide,
        // Use divide on old.
        P,
        T[0],
        a
      )) : F(E, function(R) {
        return GD(R, P, T[0]);
      }));
    }
  }).updateManyToMany(function(T, C) {
    new _f(C, T, function(A) {
      return n[A].data.getId(n[A].dataIndex);
    }, function(A) {
      return i[A].data.getId(i[A].dataIndex);
    }).update(function(A, M) {
      S(T[A], C[M]);
    }).execute();
  }).execute(), o && F(t, function(T) {
    var C = T.data, A = C.hostModel, M = A && r.getViewOfSeriesModel(A), E = Qm("update", A, 0);
    M && A.isAnimationEnabled() && E && E.duration > 0 && M.group.traverse(function(P) {
      P instanceof zt && !P.animators.length && P.animateFrom({
        style: {
          opacity: 0
        }
      }, E);
    });
  });
}
function lV(e) {
  var t = e.getModel("universalTransition").get("seriesKey");
  return t || e.id;
}
function uV(e) {
  return Se(e) ? e.sort().join(",") : e;
}
function Dc(e) {
  if (e.hostModel)
    return e.hostModel.getModel("universalTransition").get("divideShape");
}
function E0e(e, t) {
  var r = Je(), n = Je(), i = Je();
  return F(e.oldSeries, function(a, o) {
    var s = e.oldDataGroupIds[o], l = e.oldData[o], u = lV(a), f = uV(u);
    n.set(f, {
      dataGroupId: s,
      data: l
    }), Se(u) && F(u, function(c) {
      i.set(c, {
        key: f,
        dataGroupId: s,
        data: l
      });
    });
  }), F(t.updatedSeries, function(a) {
    if (a.isUniversalTransitionEnabled() && a.isAnimationEnabled()) {
      var o = a.get("dataGroupId"), s = a.getData(), l = lV(a), u = uV(l), f = n.get(u);
      if (f)
        r.set(u, {
          oldSeries: [{
            dataGroupId: f.dataGroupId,
            divide: Dc(f.data),
            data: f.data
          }],
          newSeries: [{
            dataGroupId: o,
            divide: Dc(s),
            data: s
          }]
        });
      else if (Se(l)) {
        var c = [];
        F(l, function(d) {
          var g = n.get(d);
          g.data && c.push({
            dataGroupId: g.dataGroupId,
            divide: Dc(g.data),
            data: g.data
          });
        }), c.length && r.set(u, {
          oldSeries: c,
          newSeries: [{
            dataGroupId: o,
            data: s,
            divide: Dc(s)
          }]
        });
      } else {
        var h = i.get(l);
        if (h) {
          var v = r.get(h.key);
          v || (v = {
            oldSeries: [{
              dataGroupId: h.dataGroupId,
              data: h.data,
              divide: Dc(h.data)
            }],
            newSeries: []
          }, r.set(h.key, v)), v.newSeries.push({
            dataGroupId: o,
            data: s,
            divide: Dc(s)
          });
        }
      }
    }
  }), r;
}
function fV(e, t) {
  for (var r = 0; r < e.length; r++) {
    var n = t.seriesIndex != null && t.seriesIndex === e[r].seriesIndex || t.seriesId != null && t.seriesId === e[r].id;
    if (n)
      return r;
  }
}
function P0e(e, t, r, n) {
  var i = [], a = [];
  F(Mr(e.from), function(o) {
    var s = fV(t.oldSeries, o);
    s >= 0 && i.push({
      dataGroupId: t.oldDataGroupIds[s],
      data: t.oldData[s],
      // TODO can specify divideShape in transition.
      divide: Dc(t.oldData[s]),
      groupIdDim: o.dimension
    });
  }), F(Mr(e.to), function(o) {
    var s = fV(r.updatedSeries, o);
    if (s >= 0) {
      var l = r.updatedSeries[s].getData();
      a.push({
        dataGroupId: t.oldDataGroupIds[s],
        data: l,
        divide: Dc(l),
        groupIdDim: o.dimension
      });
    }
  }), i.length > 0 && a.length > 0 && dY(i, a, n);
}
function I0e(e) {
  e.registerUpdateLifecycle("series:beforeupdate", function(t, r, n) {
    F(Mr(n.seriesTransition), function(i) {
      F(Mr(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][b2] = !0);
      });
    });
  }), e.registerUpdateLifecycle("series:transition", function(t, r, n) {
    var i = C0e(r);
    if (i.oldSeries && n.updatedSeries && n.optionChanged) {
      var a = n.seriesTransition;
      if (a)
        F(Mr(a), function(v) {
          P0e(v, i, n, r);
        });
      else {
        var o = E0e(i, n);
        F(o.keys(), function(v) {
          var d = o.get(v);
          dY(d.oldSeries, d.newSeries, r);
        });
      }
      F(n.updatedSeries, function(v) {
        v[b2] && (v[b2] = !1);
      });
    }
    for (var s = t.getSeries(), l = i.oldSeries = [], u = i.oldDataGroupIds = [], f = i.oldData = [], c = 0; c < s.length; c++) {
      var h = s[c].getData();
      h.count() < vY && (l.push(s[c]), u.push(s[c].get("dataGroupId")), f.push(h));
    }
  });
}
var R0e = (
  /** @class */
  (function() {
    function e() {
      this.breaks = [], this._elapsedExtent = [1 / 0, -1 / 0];
    }
    return e.prototype.setBreaks = function(t) {
      this.breaks = t.breaks;
    }, e.prototype.update = function(t) {
      N0e(this, t);
      var r = this._elapsedExtent;
      r[0] = this.elapse(t[0]), r[1] = this.elapse(t[1]);
    }, e.prototype.hasBreaks = function() {
      return !!this.breaks.length;
    }, e.prototype.calcNiceTickMultiple = function(t, r) {
      for (var n = 0; n < this.breaks.length; n++) {
        var i = this.breaks[n];
        if (i.vmin < t && t < i.vmax) {
          var a = r(t, i.vmax);
          return a;
        }
      }
      return 0;
    }, e.prototype.getExtentSpan = function() {
      return this._elapsedExtent[1] - this._elapsedExtent[0];
    }, e.prototype.normalize = function(t) {
      var r = this._elapsedExtent[1] - this._elapsedExtent[0];
      return r === 0 ? 0.5 : (this.elapse(t) - this._elapsedExtent[0]) / r;
    }, e.prototype.scale = function(t) {
      return this.unelapse(t * (this._elapsedExtent[1] - this._elapsedExtent[0]) + this._elapsedExtent[0]);
    }, e.prototype.elapse = function(t) {
      for (var r = cV, n = hV, i = !0, a = 0; a < this.breaks.length; a++) {
        var o = this.breaks[a];
        if (t <= o.vmax) {
          t > o.vmin ? r += o.vmin - n + (t - o.vmin) / (o.vmax - o.vmin) * o.gapReal : r += t - n, n = o.vmax, i = !1;
          break;
        }
        r += o.vmin - n + o.gapReal, n = o.vmax;
      }
      return i && (r += t - n), r;
    }, e.prototype.unelapse = function(t) {
      for (var r = cV, n = hV, i = !0, a = 0, o = 0; o < this.breaks.length; o++) {
        var s = this.breaks[o], l = r + s.vmin - n, u = l + s.gapReal;
        if (t <= u) {
          t > l ? a = s.vmin + (t - l) / (u - l) * (s.vmax - s.vmin) : a = n + t - r, n = s.vmax, i = !1;
          break;
        }
        r = u, n = s.vmax;
      }
      return i && (a = n + t - r), a;
    }, e;
  })()
);
function O0e() {
  return new R0e();
}
var cV = 0, hV = 0;
function N0e(e, t) {
  var r = 0, n = {
    tpAbs: {
      span: 0,
      val: 0
    },
    tpPrct: {
      span: 0,
      val: 0
    }
  }, i = function() {
    return {
      has: !1,
      span: NaN,
      inExtFrac: NaN,
      val: NaN
    };
  }, a = {
    S: {
      tpAbs: i(),
      tpPrct: i()
    },
    E: {
      tpAbs: i(),
      tpPrct: i()
    }
  };
  F(e.breaks, function(s) {
    var l = s.gapParsed;
    l.type === "tpPrct" && (r += l.val);
    var u = HN(s, t);
    if (u) {
      var f = u.vmin !== s.vmin, c = u.vmax !== s.vmax, h = u.vmax - u.vmin;
      if (!(f && c)) if (f || c) {
        var v = f ? "S" : "E";
        a[v][l.type].has = !0, a[v][l.type].span = h, a[v][l.type].inExtFrac = h / (s.vmax - s.vmin), a[v][l.type].val = l.val;
      } else
        n[l.type].span += h, n[l.type].val += l.val;
    }
  });
  var o = r * (0 + (t[1] - t[0]) + (n.tpAbs.val - n.tpAbs.span) + (a.S.tpAbs.has ? (a.S.tpAbs.val - a.S.tpAbs.span) * a.S.tpAbs.inExtFrac : 0) + (a.E.tpAbs.has ? (a.E.tpAbs.val - a.E.tpAbs.span) * a.E.tpAbs.inExtFrac : 0) - n.tpPrct.span - (a.S.tpPrct.has ? a.S.tpPrct.span * a.S.tpPrct.inExtFrac : 0) - (a.E.tpPrct.has ? a.E.tpPrct.span * a.E.tpPrct.inExtFrac : 0)) / (1 - n.tpPrct.val - (a.S.tpPrct.has ? a.S.tpPrct.val * a.S.tpPrct.inExtFrac : 0) - (a.E.tpPrct.has ? a.E.tpPrct.val * a.E.tpPrct.inExtFrac : 0));
  F(e.breaks, function(s) {
    var l = s.gapParsed;
    l.type === "tpPrct" && (s.gapReal = r !== 0 ? Math.max(o, 0) * l.val / r : 0), l.type === "tpAbs" && (s.gapReal = l.val), s.gapReal == null && (s.gapReal = 0);
  });
}
function k0e(e, t, r, n, i, a) {
  e !== "no" && F(r, function(o) {
    var s = HN(o, a);
    if (s)
      for (var l = t.length - 1; l >= 0; l--) {
        var u = t[l], f = n(u), c = i * 3 / 4;
        f > s.vmin - c && f < s.vmax + c && (e !== "preserve_extent_bound" || f !== a[0] && f !== a[1]) && t.splice(l, 1);
      }
  });
}
function B0e(e, t, r, n) {
  F(t, function(i) {
    var a = HN(i, r);
    a && (e.push({
      value: a.vmin,
      break: {
        type: "vmin",
        parsedBreak: a
      },
      time: n ? n(a) : void 0
    }), e.push({
      value: a.vmax,
      break: {
        type: "vmax",
        parsedBreak: a
      },
      time: n ? n(a) : void 0
    }));
  }), t.length && e.sort(function(i, a) {
    return i.value - a.value;
  });
}
function HN(e, t) {
  var r = Math.max(e.vmin, t[0]), n = Math.min(e.vmax, t[1]);
  return r < n || r === n && r > t[0] && r < t[1] ? {
    vmin: r,
    vmax: n,
    breakOption: e.breakOption,
    gapParsed: e.gapParsed,
    gapReal: e.gapReal
  } : null;
}
function NI(e, t, r) {
  var n = [];
  if (!e)
    return {
      breaks: n
    };
  function i(o, s) {
    return o >= 0 && o < 1 - 1e-5;
  }
  F(e, function(o) {
    if (!(!o || o.start == null || o.end == null) && !o.isExpanded) {
      var s = {
        breakOption: it(o),
        vmin: t(o.start),
        vmax: t(o.end),
        gapParsed: {
          type: "tpAbs",
          val: 0
        },
        gapReal: null
      };
      if (o.gap != null) {
        var l = !1;
        if (Fe(o.gap)) {
          var u = _o(o.gap);
          if (u.match(/%$/)) {
            var f = parseFloat(u) / 100;
            i(f) || (f = 0), s.gapParsed.type = "tpPrct", s.gapParsed.val = f, l = !0;
          }
        }
        if (!l) {
          var c = t(o.gap);
          (!isFinite(c) || c < 0) && (c = 0), s.gapParsed.type = "tpAbs", s.gapParsed.val = c;
        }
      }
      if (s.vmin === s.vmax && (s.gapParsed.type = "tpAbs", s.gapParsed.val = 0), r && r.noNegative && F(["vmin", "vmax"], function(v) {
        s[v] < 0 && (s[v] = 0);
      }), s.vmin > s.vmax) {
        var h = s.vmax;
        s.vmax = s.vmin, s.vmin = h;
      }
      n.push(s);
    }
  }), n.sort(function(o, s) {
    return o.vmin - s.vmin;
  });
  var a = -1 / 0;
  return F(n, function(o, s) {
    a > o.vmin && (n[s] = null), a = o.vmax;
  }), {
    breaks: n.filter(function(o) {
      return !!o;
    })
  };
}
function UN(e, t) {
  return kI(t) === kI(e);
}
function kI(e) {
  return e.start + "_\0_" + e.end;
}
function z0e(e, t, r) {
  var n = [];
  F(e, function(a, o) {
    var s = t(a);
    s && s.type === "vmin" && n.push([o]);
  }), F(e, function(a, o) {
    var s = t(a);
    if (s && s.type === "vmax") {
      var l = eh(
        n,
        // parsedBreak may be changed, can only use breakOption to match them.
        function(u) {
          return UN(t(e[u[0]]).parsedBreak.breakOption, s.parsedBreak.breakOption);
        }
      );
      l && l.push(o);
    }
  });
  var i = [];
  return F(n, function(a) {
    a.length === 2 && i.push(r ? a : [e[a[0]], e[a[1]]]);
  }), i;
}
function F0e(e, t, r, n) {
  var i, a;
  if (e.break) {
    var o = e.break.parsedBreak, s = eh(r, function(c) {
      return UN(c.breakOption, e.break.parsedBreak.breakOption);
    }), l = n(Math.pow(t, o.vmin), s.vmin), u = n(Math.pow(t, o.vmax), s.vmax), f = {
      type: o.gapParsed.type,
      val: o.gapParsed.type === "tpAbs" ? jr(Math.pow(t, o.vmin + o.gapParsed.val)) - l : o.gapParsed.val
    };
    i = {
      type: e.break.type,
      parsedBreak: {
        breakOption: o.breakOption,
        vmin: l,
        vmax: u,
        gapParsed: f,
        gapReal: o.gapReal
      }
    }, a = s[e.break.type];
  }
  return {
    brkRoundingCriterion: a,
    vBreak: i
  };
}
function G0e(e, t, r) {
  var n = {
    noNegative: !0
  }, i = NI(e, r, n), a = NI(e, r, n), o = Math.log(t);
  return a.breaks = Ce(a.breaks, function(s) {
    var l = Math.log(s.vmin) / o, u = Math.log(s.vmax) / o, f = {
      type: s.gapParsed.type,
      val: s.gapParsed.type === "tpAbs" ? Math.log(s.vmin + s.gapParsed.val) / o - l : s.gapParsed.val
    };
    return {
      vmin: l,
      vmax: u,
      gapParsed: f,
      gapReal: s.gapReal,
      breakOption: s.breakOption
    };
  }), {
    parsedOriginal: i,
    parsedLogged: a
  };
}
var V0e = {
  vmin: "start",
  vmax: "end"
};
function H0e(e, t) {
  return t && (e = e || {}, e.break = {
    type: V0e[t.type],
    start: t.parsedBreak.vmin,
    end: t.parsedBreak.vmax
  }), e;
}
function U0e() {
  Dee({
    createScaleBreakContext: O0e,
    pruneTicksByBreak: k0e,
    addBreaksToTicks: B0e,
    parseAxisBreakOption: NI,
    identifyAxisBreak: UN,
    serializeAxisBreakIdentifier: kI,
    retrieveAxisBreakPairs: z0e,
    getTicksLogTransformBreak: F0e,
    logarithmicParseBreaksFromOption: G0e,
    makeAxisLabelFormatterParamBreak: H0e
  });
}
var vV = Bt();
function W0e(e, t) {
  var r = eh(e, function(n) {
    return En().identifyAxisBreak(n.parsedBreak.breakOption, t.breakOption);
  });
  return r || e.push(r = {
    zigzagRandomList: [],
    parsedBreak: t,
    shouldRemove: !1
  }), r;
}
function X0e(e) {
  F(e, function(t) {
    return t.shouldRemove = !0;
  });
}
function Y0e(e) {
  for (var t = e.length - 1; t >= 0; t--)
    e[t].shouldRemove && e.splice(t, 1);
}
function Z0e(e, t, r, n, i) {
  var a = r.axis;
  if (a.scale.isBlank() || !En())
    return;
  var o = En().retrieveAxisBreakPairs(a.scale.getTicks({
    breakTicks: "only_break"
  }), function(R) {
    return R.break;
  }, !1);
  if (!o.length)
    return;
  var s = r.getModel("breakArea"), l = s.get("zigzagAmplitude"), u = s.get("zigzagMinSpan"), f = s.get("zigzagMaxSpan");
  u = Math.max(2, u || 0), f = Math.max(u, f || 0);
  var c = s.get("expandOnClick"), h = s.get("zigzagZ"), v = s.getModel("itemStyle"), d = v.getItemStyle(), g = d.stroke, y = d.lineWidth, x = d.lineDash, S = d.fill, T = new rt({
    ignoreModelZ: !0
  }), C = a.isHorizontal(), A = vV(t).visualList || (vV(t).visualList = []);
  X0e(A);
  for (var M = function(R) {
    var O = o[R][0].break.parsedBreak, N = [];
    N[0] = a.toGlobalCoord(a.dataToCoord(O.vmin, !0)), N[1] = a.toGlobalCoord(a.dataToCoord(O.vmax, !0)), N[1] < N[0] && N.reverse();
    var G = W0e(A, O);
    G.shouldRemove = !1;
    var z = new rt();
    P(G.zigzagRandomList, z, N[0], N[1], C, O), c && z.on("click", function() {
      var H = {
        type: UC,
        breaks: [{
          start: O.breakOption.start,
          end: O.breakOption.end
        }]
      };
      H[a.dim + "AxisIndex"] = r.componentIndex, i.dispatchAction(H);
    }), z.silent = !c, T.add(z);
  }, E = 0; E < o.length; E++)
    M(E);
  e.add(T), Y0e(A);
  function P(R, O, N, G, z, H) {
    var W = {
      stroke: g,
      lineWidth: y,
      lineDash: x,
      fill: "none"
    }, Z = z ? 0 : 1, ee = 1 - Z, V = n[_t[ee]] + n[In[ee]];
    function Q(Ue) {
      var Xe = [], $e = [];
      Xe[Z] = $e[Z] = Ue, Xe[ee] = n[_t[ee]], $e[ee] = V;
      var vt = {
        x1: Xe[0],
        y1: Xe[1],
        x2: $e[0],
        y2: $e[1]
      };
      return bC(vt, vt, {
        lineWidth: 1
      }), Xe[0] = vt.x1, Xe[1] = vt.y1, Xe[Z];
    }
    N = Q(N), G = Q(G);
    for (var q = [], X = [], K = !0, ue = n[_t[ee]], oe = 0; ; oe++) {
      var te = ue === n[_t[ee]], pe = ue >= V;
      pe && (ue = V);
      var me = [], de = [];
      me[Z] = N, de[Z] = G, !te && !pe && (me[Z] += K ? -l : l, de[Z] -= K ? l : -l), me[ee] = ue, de[ee] = ue, q.push(me), X.push(de);
      var ve = void 0;
      if (oe < R.length ? ve = R[oe] : (ve = Math.random(), R.push(ve)), ue += ve * (f - u) + u, K = !K, pe)
        break;
    }
    var Ae = En().serializeAxisBreakIdentifier(H.breakOption);
    if (O.add(new Ci({
      anid: "break_a_" + Ae,
      shape: {
        points: q
      },
      style: W,
      z: h
    })), H.gapReal !== 0) {
      O.add(new Ci({
        anid: "break_b_" + Ae,
        shape: {
          // Not reverse to keep the dash stable when dragging resizing.
          points: X
        },
        style: W,
        z: h
      }));
      var be = X.slice();
      be.reverse();
      var De = q.concat(be);
      O.add(new Wi({
        anid: "break_c_" + Ae,
        shape: {
          points: De
        },
        style: {
          fill: S,
          opacity: d.opacity
        },
        z: h
      }));
    }
  }
}
function $0e(e, t, r, n) {
  var i = e.axis, a = r.transform;
  Hi(n.style);
  var o = i.getExtent();
  i.inverse && (o = o.slice(), o.reverse());
  var s = En().retrieveAxisBreakPairs(i.scale.getTicks({
    breakTicks: "only_break"
  }), function(y) {
    return y.break;
  }, !1), l = Ce(s, function(y) {
    var x = y[0].break.parsedBreak, S = [i.dataToCoord(x.vmin, !0), i.dataToCoord(x.vmax, !0)];
    return S[0] > S[1] && S.reverse(), {
      coordPair: S,
      brkId: En().serializeAxisBreakIdentifier(x.breakOption)
    };
  });
  l.sort(function(y, x) {
    return y.coordPair[0] - x.coordPair[0];
  });
  for (var u = o[0], f = null, c = 0; c < l.length; c++) {
    var h = l[c], v = Math.max(h.coordPair[0], o[0]), d = Math.min(h.coordPair[1], o[1]);
    u <= v && g(u, v, f, h), u = d, f = h;
  }
  u <= o[1] && g(u, o[1], f, null);
  function g(y, x, S, T) {
    function C(N, G) {
      a && (fn(N, N, a), fn(G, G, a));
    }
    function A(N, G) {
      var z = {
        x1: N[0],
        y1: N[1],
        x2: G[0],
        y2: G[1]
      };
      bC(z, z, n.style), N[0] = z.x1, N[1] = z.y1, G[0] = z.x2, G[1] = z.y2;
    }
    var M = [y, 0], E = [x, 0], P = [y, 5], R = [x, 5];
    C(M, P), A(M, P), C(E, R), A(E, R), A(M, E);
    var O = new wn(xe({
      shape: {
        x1: M[0],
        y1: M[1],
        x2: E[0],
        y2: E[1]
      }
    }, n));
    t.add(O), O.anid = "breakLine_" + (S ? S.brkId : "\0") + "_\0_" + (T ? T.brkId : "\0");
  }
}
function q0e(e, t, r) {
  if (eh(r, function(S) {
    return !S;
  }))
    return;
  var n = new ht();
  if (!VC(r[0], r[1], n, {
    // Assert `labelPair` is `[break_min, break_max]`.
    // `axis.inverse: true` means a smaller scale value corresponds to a bigger value in axis.extent.
    // The axisRotation indicates mtv direction of OBB intersecting.
    direction: -(e ? t + Math.PI : t),
    touchThreshold: 0,
    // If need to resovle intersection align axis by moving labels according to MTV,
    // the direction must not be opposite, otherwise cause misleading.
    bidirectional: !1
  }))
    return;
  var i = ii();
  Tf(i, i, -t);
  var a = Ce(r, function(S) {
    return S.transform ? Hs(ii(), i, S.transform) : i;
  });
  function o(S) {
    var T = r[0].localRect, C = new ht(T[In[S]] * a[0][0], T[In[S]] * a[0][1]);
    return Math.abs(C.y) < 1e-5;
  }
  var s = 0.5;
  if (o(0) || o(1)) {
    var l = Ce(r, function(S, T) {
      var C = S.localRect.clone();
      return C.applyTransform(a[T]), C;
    }), u = new ht();
    u.copy(r[0].label).add(r[1].label).scale(0.5), u.transform(i);
    var f = n.clone().transform(i), c = l[0].x + l[1].x + (f.x >= 0 ? l[0].width : l[1].width), h = (c + f.x) / 2 - u.x, v = Math.min(h, h - f.x), d = Math.max(h, h - f.x), g = d < 0 ? d : v > 0 ? v : 0;
    s = (h - g) / f.x;
  }
  var y = new ht(), x = new ht();
  ht.scale(y, n, -s), ht.scale(x, n, 1 - s), BP(r[0], y), BP(r[1], x);
}
function j0e(e, t) {
  var r = {
    breaks: []
  };
  return F(t.breaks, function(n) {
    if (n) {
      var i = eh(e.get("breaks", !0), function(s) {
        return En().identifyAxisBreak(s, n);
      });
      if (i) {
        var a = t.type, o = {
          isExpanded: !!i.isExpanded
        };
        i.isExpanded = a === UC ? !0 : a === R9 ? !1 : a === O9 ? !i.isExpanded : i.isExpanded, r.breaks.push({
          start: i.start,
          end: i.end,
          isExpanded: !!i.isExpanded,
          old: o
        });
      }
    }
  }), r;
}
function K0e() {
  joe({
    adjustBreakLabelPair: q0e,
    buildAxisBreakLine: $0e,
    rectCoordBuildBreakAxis: Z0e,
    updateModelAxisBreak: j0e
  });
}
function Q0e(e) {
  tse(e), U0e(), K0e();
}
function J0e() {
  wse(e_e);
}
function e_e(e, t) {
  F(e, function(r) {
    if (!r.model.get(["axisLabel", "inside"])) {
      var n = t_e(r);
      if (n) {
        var i = r.isHorizontal() ? "height" : "width", a = r.model.get(["axisLabel", "margin"]);
        t[i] -= n[i] + a, r.position === "top" ? t.y += n.height + a : r.position === "left" && (t.x += n.width + a);
      }
    }
  });
}
function t_e(e) {
  var t = e.model, r = e.scale;
  if (!t.get(["axisLabel", "show"]) || r.isBlank())
    return;
  var n, i, a = r.getExtent();
  r instanceof Lm ? i = r.count() : (n = r.getTicks(), i = n.length);
  var o = e.getLabelModel(), s = ly(e), l, u = 1;
  i > 40 && (u = Math.ceil(i / 40));
  for (var f = 0; f < i; f += u) {
    var c = n ? n[f] : {
      value: a[0] + f
    }, h = s(c, f), v = o.getTextRect(h), d = g(v, o.get("rotate") || 0);
    l ? l.union(d) : l = d;
  }
  return l;
  function g(y, x) {
    var S = x * Math.PI / 180, T = y.width, C = y.height, A = T * Math.abs(Math.cos(S)) + Math.abs(C * Math.sin(S)), M = T * Math.abs(Math.sin(S)) + Math.abs(C * Math.cos(S)), E = new st(y.x, y.y, A, M);
    return E;
  }
}
ft([h9]);
ft([Wae]);
ft([doe, Doe, Foe, Vse, Qse, Gle, vue, jue, gfe, Tfe, Dfe, Bfe, Ece, ehe, che, Mhe, Phe, Vhe, $he, ave, cve, Sve, ade]);
ft(bde);
ft(qde);
ft(s7);
ft(spe);
ft(Z7);
ft(cpe);
ft(Ppe);
ft(Gpe);
ft(Age);
ft(Xge);
ft(Gx);
ft(sme);
ft(fme);
ft(xme);
ft(Lme);
ft(Ome);
ft(Gme);
ft(jme);
ft(pye);
ft(JX);
ft(eY);
ft(Nye);
ft(aY);
ft(oY);
ft(Fye);
ft(Wye);
ft(n0e);
ft(lY);
ft(I0e);
ft(j6);
ft(Q0e);
ft(J0e);
ft(Hse);
const r_e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  Axis: ra,
  ChartView: Ut,
  ComponentModel: At,
  ComponentView: fr,
  List: zr,
  Model: It,
  PRIORITY: e6,
  SeriesModel: Yt,
  color: SK,
  connect: bne,
  dataTool: Ene,
  dependencies: one,
  disConnect: Cne,
  disconnect: l6,
  dispose: Ane,
  env: Gt,
  extendChartView: LO,
  extendComponentModel: qie,
  extendComponentView: jie,
  extendSeriesModel: MO,
  format: Oie,
  getCoordinateSystemDimensions: gO,
  getInstanceByDom: hO,
  getInstanceById: Mne,
  getMap: db,
  graphic: Rie,
  helper: Cie,
  init: Tne,
  innerDrawElementOnCanvas: Ix,
  matrix: jj,
  number: Pie,
  parseGeoJSON: $1,
  parseGeoJson: $1,
  registerAction: el,
  registerCoordinateSystem: u6,
  registerCustomSeries: Lne,
  registerLayout: mO,
  registerLoading: _O,
  registerLocale: VR,
  registerMap: xO,
  registerPostInit: dO,
  registerPostUpdate: pO,
  registerPreprocessor: Rx,
  registerProcessor: vO,
  registerTheme: BC,
  registerTransform: f6,
  registerUpdateLifecycle: zC,
  registerVisual: ih,
  setCanvasCreator: Dne,
  setPlatformAPI: jH,
  throttle: NC,
  time: Iie,
  use: ft,
  util: Nie,
  vector: Nj,
  version: ane,
  zrUtil: Lj,
  zrender: nQ
}, Symbol.toStringTag, { value: "Module" }));
ft([h9, lY]);
ft(j6);
function dV(e, t, r) {
  typeof t == "object" && (r = t, t = null);
  var n = this, i;
  if (!(e instanceof Function)) {
    i = [];
    for (var a in e)
      e.hasOwnProperty(a) && i.push(a);
  }
  var o = function(l) {
    if (n.apply(this, arguments), e instanceof Function ? pV(this, e.call(this, l)) : n_e(this, e, i), this.constructor === o)
      for (var u = o.__initializers__, f = 0; f < u.length; f++)
        u[f].apply(this, arguments);
  };
  o.__super__ = n, n.__initializers__ ? o.__initializers__ = n.__initializers__.slice() : o.__initializers__ = [], t && o.__initializers__.push(t);
  var s = function() {
  };
  return s.prototype = n.prototype, o.prototype = new s(), o.prototype.constructor = o, pV(o.prototype, r), o.extend = n.extend, o.derive = n.extend, o;
}
function pV(e, t) {
  if (t)
    for (var r in t)
      t.hasOwnProperty(r) && (e[r] = t[r]);
}
function n_e(e, t, r) {
  for (var n = 0; n < r.length; n++) {
    var i = r[n];
    e[i] = t[i];
  }
}
const i_e = {
  extend: dV,
  // DEPCRATED
  derive: dV
};
function a_e(e, t) {
  this.action = e, this.context = t;
}
var WN = {
  /**
   * Trigger event
   * @param  {string} name
   */
  trigger: function(e) {
    if (this.hasOwnProperty("__handlers__") && this.__handlers__.hasOwnProperty(e)) {
      var t = this.__handlers__[e], r = t.length, n = -1, i = arguments;
      switch (i.length) {
        case 1:
          for (; ++n < r; )
            t[n].action.call(t[n].context);
          return;
        case 2:
          for (; ++n < r; )
            t[n].action.call(t[n].context, i[1]);
          return;
        case 3:
          for (; ++n < r; )
            t[n].action.call(t[n].context, i[1], i[2]);
          return;
        case 4:
          for (; ++n < r; )
            t[n].action.call(t[n].context, i[1], i[2], i[3]);
          return;
        case 5:
          for (; ++n < r; )
            t[n].action.call(t[n].context, i[1], i[2], i[3], i[4]);
          return;
        default:
          for (; ++n < r; )
            t[n].action.apply(t[n].context, Array.prototype.slice.call(i, 1));
          return;
      }
    }
  },
  /**
   * Register event handler
   * @param  {string} name
   * @param  {Function} action
   * @param  {Object} [context]
   * @chainable
   */
  on: function(e, t, r) {
    if (!(!e || !t)) {
      var n = this.__handlers__ || (this.__handlers__ = {});
      if (!n[e])
        n[e] = [];
      else if (this.has(e, t))
        return;
      var i = new a_e(t, r || this);
      return n[e].push(i), this;
    }
  },
  /**
   * Register event, event will only be triggered once and then removed
   * @param  {string} name
   * @param  {Function} action
   * @param  {Object} [context]
   * @chainable
   */
  once: function(e, t, r) {
    if (!e || !t)
      return;
    var n = this;
    function i() {
      n.off(e, i), t.apply(this, arguments);
    }
    return this.on(e, i, r);
  },
  /**
   * Alias of once('before' + name)
   * @param  {string} name
   * @param  {Function} action
   * @param  {Object} [context]
   * @chainable
   */
  before: function(e, t, r) {
    if (!(!e || !t))
      return e = "before" + e, this.on(e, t, r);
  },
  /**
   * Alias of once('after' + name)
   * @param  {string} name
   * @param  {Function} action
   * @param  {Object} [context]
   * @chainable
   */
  after: function(e, t, r) {
    if (!(!e || !t))
      return e = "after" + e, this.on(e, t, r);
  },
  /**
   * Alias of on('success')
   * @param  {Function} action
   * @param  {Object} [context]
   * @chainable
   */
  success: function(e, t) {
    return this.once("success", e, t);
  },
  /**
   * Alias of on('error')
   * @param  {Function} action
   * @param  {Object} [context]
   * @chainable
   */
  error: function(e, t) {
    return this.once("error", e, t);
  },
  /**
   * Remove event listener
   * @param  {Function} action
   * @param  {Object} [context]
   * @chainable
   */
  off: function(e, t) {
    var r = this.__handlers__ || (this.__handlers__ = {});
    if (!t) {
      r[e] = [];
      return;
    }
    if (r[e]) {
      for (var n = r[e], i = [], a = 0; a < n.length; a++)
        t && n[a].action !== t && i.push(n[a]);
      r[e] = i;
    }
    return this;
  },
  /**
   * If registered the event handler
   * @param  {string}  name
   * @param  {Function}  action
   * @return {boolean}
   */
  has: function(e, t) {
    var r = this.__handlers__;
    if (!r || !r[e])
      return !1;
    for (var n = r[e], i = 0; i < n.length; i++)
      if (n[i].action === t)
        return !0;
  }
}, o_e = 0, s_e = Array.prototype, l_e = s_e.forEach, xn = {
  /**
   * Generate GUID
   * @return {number}
   * @memberOf clay.core.util
   */
  genGUID: function() {
    return ++o_e;
  },
  /**
   * Relative path to absolute path
   * @param  {string} path
   * @param  {string} basePath
   * @return {string}
   * @memberOf clay.core.util
   */
  relative2absolute: function(e, t) {
    if (!t || e.match(/^\//))
      return e;
    for (var r = e.split("/"), n = t.split("/"), i = r[0]; i === "." || i === ".."; )
      i === ".." && n.pop(), r.shift(), i = r[0];
    return n.join("/") + "/" + r.join("/");
  },
  /**
   * Extend target with source
   * @param  {Object} target
   * @param  {Object} source
   * @return {Object}
   * @memberOf clay.core.util
   */
  extend: function(e, t) {
    if (t)
      for (var r in t)
        t.hasOwnProperty(r) && (e[r] = t[r]);
    return e;
  },
  /**
   * Extend properties to target if not exist.
   * @param  {Object} target
   * @param  {Object} source
   * @return {Object}
   * @memberOf clay.core.util
   */
  defaults: function(e, t) {
    if (t)
      for (var r in t)
        e[r] === void 0 && (e[r] = t[r]);
    return e;
  },
  /**
   * Extend properties with a given property list to avoid for..in.. iteration.
   * @param  {Object} target
   * @param  {Object} source
   * @param  {Array.<string>} propList
   * @return {Object}
   * @memberOf clay.core.util
   */
  extendWithPropList: function(e, t, r) {
    if (t)
      for (var n = 0; n < r.length; n++) {
        var i = r[n];
        e[i] = t[i];
      }
    return e;
  },
  /**
   * Extend properties to target if not exist. With a given property list avoid for..in.. iteration.
   * @param  {Object} target
   * @param  {Object} source
   * @param  {Array.<string>} propList
   * @return {Object}
   * @memberOf clay.core.util
   */
  defaultsWithPropList: function(e, t, r) {
    if (t)
      for (var n = 0; n < r.length; n++) {
        var i = r[n];
        e[i] == null && (e[i] = t[i]);
      }
    return e;
  },
  /**
   * @param  {Object|Array} obj
   * @param  {Function} iterator
   * @param  {Object} [context]
   * @memberOf clay.core.util
   */
  each: function(e, t, r) {
    if (e && t)
      if (e.forEach && e.forEach === l_e)
        e.forEach(t, r);
      else if (e.length === +e.length)
        for (var n = 0, i = e.length; n < i; n++)
          t.call(r, e[n], n, e);
      else
        for (var a in e)
          e.hasOwnProperty(a) && t.call(r, e[a], a, e);
  },
  /**
   * Is object
   * @param  {}  obj
   * @return {boolean}
   * @memberOf clay.core.util
   */
  isObject: function(e) {
    return e === Object(e);
  },
  /**
   * Is array ?
   * @param  {}  obj
   * @return {boolean}
   * @memberOf clay.core.util
   */
  isArray: function(e) {
    return Array.isArray(e);
  },
  /**
   * Is array like, which have a length property
   * @param  {}  obj
   * @return {boolean}
   * @memberOf clay.core.util
   */
  isArrayLike: function(e) {
    return e ? e.length === +e.length : !1;
  },
  /**
   * @param  {} obj
   * @return {}
   * @memberOf clay.core.util
   */
  clone: function(e) {
    if (xn.isObject(e)) {
      if (xn.isArray(e))
        return e.slice();
      if (xn.isArrayLike(e)) {
        for (var t = new e.constructor(e.length), r = 0; r < e.length; r++)
          t[r] = e[r];
        return t;
      } else
        return xn.extend({}, e);
    } else return e;
  }
}, Mi = function() {
  this.__uid__ = xn.genGUID();
};
Mi.__initializers__ = [
  function(e) {
    xn.extend(this, e);
  }
];
xn.extend(Mi, i_e);
xn.extend(Mi.prototype, WN);
var gV = [
  "OES_texture_float",
  "OES_texture_half_float",
  "OES_texture_float_linear",
  "OES_texture_half_float_linear",
  "OES_standard_derivatives",
  "OES_vertex_array_object",
  "OES_element_index_uint",
  "WEBGL_compressed_texture_s3tc",
  "WEBGL_depth_texture",
  "EXT_texture_filter_anisotropic",
  "EXT_shader_texture_lod",
  "WEBGL_draw_buffers",
  "EXT_frag_depth",
  "EXT_sRGB",
  "ANGLE_instanced_arrays"
], mV = [
  "MAX_TEXTURE_SIZE",
  "MAX_CUBE_MAP_TEXTURE_SIZE"
];
function u_e(e) {
  for (var t = {}, r = {}, n = 0; n < gV.length; n++) {
    var i = gV[n];
    o(i);
  }
  for (var n = 0; n < mV.length; n++) {
    var a = mV[n];
    r[a] = e.getParameter(e[a]);
  }
  this.getExtension = function(s) {
    return s in t || o(s), t[s];
  }, this.getParameter = function(s) {
    return r[s];
  };
  function o(s) {
    if (e.getExtension) {
      var l = e.getExtension(s);
      l || (l = e.getExtension("MOZ_" + s)), l || (l = e.getExtension("WEBKIT_" + s)), t[s] = l;
    }
  }
}
const Ee = {
  /* ClearBufferMask */
  DEPTH_BUFFER_BIT: 256,
  STENCIL_BUFFER_BIT: 1024,
  COLOR_BUFFER_BIT: 16384,
  /* BeginMode */
  POINTS: 0,
  LINES: 1,
  LINE_LOOP: 2,
  LINE_STRIP: 3,
  TRIANGLES: 4,
  TRIANGLE_STRIP: 5,
  TRIANGLE_FAN: 6,
  STREAM_DRAW: 35040,
  STATIC_DRAW: 35044,
  DYNAMIC_DRAW: 35048,
  /* CullFaceMode */
  FRONT: 1028,
  BACK: 1029,
  FRONT_AND_BACK: 1032,
  /* FrontFaceDirection */
  CW: 2304,
  CCW: 2305,
  /* DataType */
  BYTE: 5120,
  UNSIGNED_BYTE: 5121,
  SHORT: 5122,
  UNSIGNED_SHORT: 5123,
  INT: 5124,
  UNSIGNED_INT: 5125,
  FLOAT: 5126,
  /* PixelFormat */
  DEPTH_COMPONENT: 6402,
  ALPHA: 6406,
  RGB: 6407,
  RGBA: 6408,
  LUMINANCE: 6409,
  LUMINANCE_ALPHA: 6410,
  /* TextureMagFilter */
  NEAREST: 9728,
  LINEAR: 9729,
  /* TextureMinFilter */
  /*      NEAREST */
  /*      LINEAR */
  NEAREST_MIPMAP_NEAREST: 9984,
  LINEAR_MIPMAP_NEAREST: 9985,
  NEAREST_MIPMAP_LINEAR: 9986,
  LINEAR_MIPMAP_LINEAR: 9987,
  /* TextureTarget */
  TEXTURE_2D: 3553,
  TEXTURE_CUBE_MAP: 34067,
  /* TextureWrapMode */
  REPEAT: 10497,
  CLAMP_TO_EDGE: 33071,
  MIRRORED_REPEAT: 33648,
  /* Framebuffer Object. */
  FRAMEBUFFER: 36160,
  RENDERBUFFER: 36161,
  DEPTH_STENCIL: 34041,
  COLOR_ATTACHMENT0: 36064,
  DEPTH_ATTACHMENT: 36096,
  STENCIL_ATTACHMENT: 36128,
  DEPTH_STENCIL_ATTACHMENT: 33306
};
function f_e(e) {
  var t = new XMLHttpRequest();
  t.open("get", e.url), t.responseType = e.responseType || "text", e.onprogress && (t.onprogress = function(r) {
    if (r.lengthComputable) {
      var n = r.loaded / r.total;
      e.onprogress(n, r.loaded, r.total);
    } else
      e.onprogress(null);
  }), t.onload = function(r) {
    t.status >= 400 ? e.onerror && e.onerror() : e.onload && e.onload(t.response);
  }, e.onerror && (t.onerror = e.onerror), t.send(null);
}
const c_e = {
  get: f_e
};
var HD, pr = {};
pr.supportWebGL = function() {
  if (HD == null)
    try {
      var e = document.createElement("canvas"), t = e.getContext("webgl") || e.getContext("experimental-webgl");
      if (!t)
        throw new Error();
    } catch {
      HD = !1;
    }
  return HD;
};
pr.Int8Array = typeof Int8Array > "u" ? Array : Int8Array;
pr.Uint8Array = typeof Uint8Array > "u" ? Array : Uint8Array;
pr.Uint16Array = typeof Uint16Array > "u" ? Array : Uint16Array;
pr.Uint32Array = typeof Uint32Array > "u" ? Array : Uint32Array;
pr.Int16Array = typeof Int16Array > "u" ? Array : Int16Array;
pr.Float32Array = typeof Float32Array > "u" ? Array : Float32Array;
pr.Float64Array = typeof Float64Array > "u" ? Array : Float64Array;
var sd = {};
typeof window < "u" ? sd = window : typeof global < "u" && (sd = global);
pr.requestAnimationFrame = sd.requestAnimationFrame || sd.msRequestAnimationFrame || sd.mozRequestAnimationFrame || sd.webkitRequestAnimationFrame || function(e) {
  setTimeout(e, 16);
};
pr.createCanvas = function() {
  return document.createElement("canvas");
};
pr.createImage = function() {
  return new sd.Image();
};
pr.request = {
  get: c_e.get
};
pr.addEventListener = function(e, t, r, n) {
  e.addEventListener(t, r, n);
};
pr.removeEventListener = function(e, t, r) {
  e.removeEventListener(t, r);
};
var li = function() {
  this.head = null, this.tail = null, this._length = 0;
};
li.prototype.insert = function(e) {
  var t = new li.Entry(e);
  return this.insertEntry(t), t;
};
li.prototype.insertAt = function(e, t) {
  if (!(e < 0)) {
    for (var r = this.head, n = 0; r && n != e; )
      r = r.next, n++;
    if (r) {
      var i = new li.Entry(t), a = r.prev;
      a ? (a.next = i, i.prev = a) : this.head = i, i.next = r, r.prev = i;
    } else
      this.insert(t);
  }
};
li.prototype.insertBeforeEntry = function(e, t) {
  var r = new li.Entry(e), n = t.prev;
  n ? (n.next = r, r.prev = n) : this.head = r, r.next = t, t.prev = r, this._length++;
};
li.prototype.insertEntry = function(e) {
  this.head ? (this.tail.next = e, e.prev = this.tail, this.tail = e) : this.head = this.tail = e, this._length++;
};
li.prototype.remove = function(e) {
  var t = e.prev, r = e.next;
  t ? t.next = r : this.head = r, r ? r.prev = t : this.tail = t, e.next = e.prev = null, this._length--;
};
li.prototype.removeAt = function(e) {
  if (!(e < 0)) {
    for (var t = this.head, r = 0; t && r != e; )
      t = t.next, r++;
    if (t)
      return this.remove(t), t.value;
  }
};
li.prototype.getHead = function() {
  if (this.head)
    return this.head.value;
};
li.prototype.getTail = function() {
  if (this.tail)
    return this.tail.value;
};
li.prototype.getAt = function(e) {
  if (!(e < 0)) {
    for (var t = this.head, r = 0; t && r != e; )
      t = t.next, r++;
    return t.value;
  }
};
li.prototype.indexOf = function(e) {
  for (var t = this.head, r = 0; t; ) {
    if (t.value === e)
      return r;
    t = t.next, r++;
  }
};
li.prototype.length = function() {
  return this._length;
};
li.prototype.isEmpty = function() {
  return this._length === 0;
};
li.prototype.forEach = function(e, t) {
  for (var r = this.head, n = 0, i = typeof t < "u"; r; )
    i ? e.call(t, r.value, n) : e(r.value, n), r = r.next, n++;
};
li.prototype.clear = function() {
  this.tail = this.head = null, this._length = 0;
};
li.Entry = function(e) {
  this.value = e, this.next = null, this.prev = null;
};
var Ud = function(e) {
  this._list = new li(), this._map = {}, this._maxSize = e || 10;
};
Ud.prototype.setMaxSize = function(e) {
  this._maxSize = e;
};
Ud.prototype.put = function(e, t) {
  if (!this._map.hasOwnProperty(e)) {
    var r = this._list.length();
    if (r >= this._maxSize && r > 0) {
      var n = this._list.head;
      this._list.remove(n), delete this._map[n.key];
    }
    var i = this._list.insert(t);
    i.key = e, this._map[e] = i;
  }
};
Ud.prototype.get = function(e) {
  var t = this._map[e];
  if (this._map.hasOwnProperty(e))
    return t !== this._list.tail && (this._list.remove(t), this._list.insertEntry(t)), t.value;
};
Ud.prototype.remove = function(e) {
  var t = this._map[e];
  typeof t < "u" && (delete this._map[e], this._list.remove(t));
};
Ud.prototype.clear = function() {
  this._list.clear(), this._map = {};
};
var Jr = {}, yV = {
  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 Ys(e) {
  return e = Math.round(e), e < 0 ? 0 : e > 255 ? 255 : e;
}
function h_e(e) {
  return e = Math.round(e), e < 0 ? 0 : e > 360 ? 360 : e;
}
function sx(e) {
  return e < 0 ? 0 : e > 1 ? 1 : e;
}
function UD(e) {
  return e.length && e.charAt(e.length - 1) === "%" ? Ys(parseFloat(e) / 100 * 255) : Ys(parseInt(e, 10));
}
function km(e) {
  return e.length && e.charAt(e.length - 1) === "%" ? sx(parseFloat(e) / 100) : sx(parseFloat(e));
}
function WD(e, t, r) {
  return r < 0 ? r += 1 : r > 1 && (r -= 1), r * 6 < 1 ? e + (t - e) * r * 6 : r * 2 < 1 ? t : r * 3 < 2 ? e + (t - e) * (2 / 3 - r) * 6 : e;
}
function Bc(e, t, r) {
  return e + (t - e) * r;
}
function ks(e, t, r, n, i) {
  return e[0] = t, e[1] = r, e[2] = n, e[3] = i, e;
}
function BI(e, t) {
  return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e;
}
var pY = new Ud(20), VT = null;
function Vg(e, t) {
  VT && BI(VT, t), VT = pY.put(e, VT || t.slice());
}
Jr.parse = function(e, t) {
  if (e) {
    t = t || [];
    var r = pY.get(e);
    if (r)
      return BI(t, r);
    e = e + "";
    var n = e.replace(/ /g, "").toLowerCase();
    if (n in yV)
      return BI(t, yV[n]), Vg(e, t), t;
    if (n.charAt(0) === "#") {
      if (n.length === 4) {
        var i = parseInt(n.substr(1), 16);
        if (!(i >= 0 && i <= 4095)) {
          ks(t, 0, 0, 0, 1);
          return;
        }
        return ks(
          t,
          (i & 3840) >> 4 | (i & 3840) >> 8,
          i & 240 | (i & 240) >> 4,
          i & 15 | (i & 15) << 4,
          1
        ), Vg(e, t), t;
      } else if (n.length === 7) {
        var i = parseInt(n.substr(1), 16);
        if (!(i >= 0 && i <= 16777215)) {
          ks(t, 0, 0, 0, 1);
          return;
        }
        return ks(
          t,
          (i & 16711680) >> 16,
          (i & 65280) >> 8,
          i & 255,
          1
        ), Vg(e, t), t;
      }
      return;
    }
    var a = n.indexOf("("), o = n.indexOf(")");
    if (a !== -1 && o + 1 === n.length) {
      var s = n.substr(0, a), l = n.substr(a + 1, o - (a + 1)).split(","), u = 1;
      switch (s) {
        case "rgba":
          if (l.length !== 4) {
            ks(t, 0, 0, 0, 1);
            return;
          }
          u = km(l.pop());
        // jshint ignore:line
        // Fall through.
        case "rgb":
          if (l.length !== 3) {
            ks(t, 0, 0, 0, 1);
            return;
          }
          return ks(
            t,
            UD(l[0]),
            UD(l[1]),
            UD(l[2]),
            u
          ), Vg(e, t), t;
        case "hsla":
          if (l.length !== 4) {
            ks(t, 0, 0, 0, 1);
            return;
          }
          return l[3] = km(l[3]), zI(l, t), Vg(e, t), t;
        case "hsl":
          if (l.length !== 3) {
            ks(t, 0, 0, 0, 1);
            return;
          }
          return zI(l, t), Vg(e, t), t;
        default:
          return;
      }
    }
    ks(t, 0, 0, 0, 1);
  }
};
Jr.parseToFloat = function(e, t) {
  if (t = Jr.parse(e, t), !!t)
    return t[0] /= 255, t[1] /= 255, t[2] /= 255, t;
};
function zI(e, t) {
  var r = (parseFloat(e[0]) % 360 + 360) % 360 / 360, n = km(e[1]), i = km(e[2]), a = i <= 0.5 ? i * (n + 1) : i + n - i * n, o = i * 2 - a;
  return t = t || [], ks(
    t,
    Ys(WD(o, a, r + 1 / 3) * 255),
    Ys(WD(o, a, r) * 255),
    Ys(WD(o, a, r - 1 / 3) * 255),
    1
  ), e.length === 4 && (t[3] = e[3]), t;
}
function v_e(e) {
  if (e) {
    var t = e[0] / 255, r = e[1] / 255, n = e[2] / 255, i = Math.min(t, r, n), a = Math.max(t, r, 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 f = ((a - t) / 6 + o / 2) / o, c = ((a - r) / 6 + o / 2) / o, h = ((a - n) / 6 + o / 2) / o;
      t === a ? l = h - c : r === a ? l = 1 / 3 + f - h : n === a && (l = 2 / 3 + c - f), l < 0 && (l += 1), l > 1 && (l -= 1);
    }
    var v = [l * 360, u, s];
    return e[3] != null && v.push(e[3]), v;
  }
}
Jr.lift = function(e, t) {
  var r = Jr.parse(e);
  if (r) {
    for (var n = 0; n < 3; n++)
      t < 0 ? r[n] = r[n] * (1 - t) | 0 : r[n] = (255 - r[n]) * t + r[n] | 0;
    return Jr.stringify(r, r.length === 4 ? "rgba" : "rgb");
  }
};
Jr.toHex = function(e) {
  var t = Jr.parse(e);
  if (t)
    return ((1 << 24) + (t[0] << 16) + (t[1] << 8) + +t[2]).toString(16).slice(1);
};
Jr.fastLerp = function(e, t, r) {
  if (!(!(t && t.length) || !(e >= 0 && e <= 1))) {
    r = r || [];
    var n = e * (t.length - 1), i = Math.floor(n), a = Math.ceil(n), o = t[i], s = t[a], l = n - i;
    return r[0] = Ys(Bc(o[0], s[0], l)), r[1] = Ys(Bc(o[1], s[1], l)), r[2] = Ys(Bc(o[2], s[2], l)), r[3] = sx(Bc(o[3], s[3], l)), r;
  }
};
Jr.fastMapToColor = Jr.fastLerp;
Jr.lerp = function(e, t, r) {
  if (!(!(t && t.length) || !(e >= 0 && e <= 1))) {
    var n = e * (t.length - 1), i = Math.floor(n), a = Math.ceil(n), o = Jr.parse(t[i]), s = Jr.parse(t[a]), l = n - i, u = Jr.stringify(
      [
        Ys(Bc(o[0], s[0], l)),
        Ys(Bc(o[1], s[1], l)),
        Ys(Bc(o[2], s[2], l)),
        sx(Bc(o[3], s[3], l))
      ],
      "rgba"
    );
    return r ? {
      color: u,
      leftIndex: i,
      rightIndex: a,
      value: n
    } : u;
  }
};
Jr.mapToColor = Jr.lerp;
Jr.modifyHSL = function(e, t, r, n) {
  if (e = Jr.parse(e), e)
    return e = v_e(e), t != null && (e[0] = h_e(t)), r != null && (e[1] = km(r)), n != null && (e[2] = km(n)), Jr.stringify(zI(e), "rgba");
};
Jr.modifyAlpha = function(e, t) {
  if (e = Jr.parse(e), e && t != null)
    return e[3] = sx(t), Jr.stringify(e, "rgba");
};
Jr.stringify = function(e, t) {
  if (!(!e || !e.length)) {
    var r = e[0] + "," + e[1] + "," + e[2];
    return (t === "rgba" || t === "hsva" || t === "hsla") && (r += "," + e[3]), t + "(" + r + ")";
  }
};
var d_e = Jr.parseToFloat, XD = {};
function _V(e) {
  var t = Object.keys(e);
  t.sort();
  for (var r = [], n = 0; n < t.length; n++) {
    var i = t[n], a = e[i];
    a === null ? r.push(i) : r.push(i + " " + a.toString());
  }
  return r.join(`
`);
}
function p_e(e, t, r) {
  r.sort();
  for (var n = [], i = 0; i < r.length; i++) {
    var a = r[i];
    n.push(a);
  }
  var o = _V(e) + `
` + _V(t) + `
` + n.join(`
`);
  if (XD[o])
    return XD[o];
  var s = xn.genGUID();
  return XD[o] = s, s;
}
var ls = Mi.extend(
  function() {
    return (
      /** @lends clay.Material# */
      {
        /**
         * @type {string}
         */
        name: "",
        /**
         * @type {Object}
         */
        // uniforms: null,
        /**
         * @type {clay.Shader}
         */
        // shader: null,
        /**
         * @type {boolean}
         */
        depthTest: !0,
        /**
         * @type {boolean}
         */
        depthMask: !0,
        /**
         * @type {boolean}
         */
        transparent: !1,
        /**
         * Blend func is a callback function when the material
         * have custom blending
         * The gl context will be the only argument passed in tho the
         * blend function
         * Detail of blend function in WebGL:
         * http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf
         *
         * Example :
         * function(_gl) {
         *  _gl.blendEquation(_gl.FUNC_ADD);
         *  _gl.blendFunc(_gl.SRC_ALPHA, _gl.ONE_MINUS_SRC_ALPHA);
         * }
         */
        blend: null,
        /**
         * If update texture status automatically.
         */
        autoUpdateTextureStatus: !0,
        uniforms: {},
        vertexDefines: {},
        fragmentDefines: {},
        _textureStatus: {},
        // shadowTransparentMap : null
        // PENDING enable the uniform that only used in shader.
        _enabledUniforms: null
      }
    );
  },
  function() {
    this.name || (this.name = "MATERIAL_" + this.__uid__), this.shader && this.attachShader(this.shader, !0);
  },
  /** @lends clay.Material.prototype */
  {
    precision: "highp",
    /**
     * Set material uniform
     * @example
     *  mat.setUniform('color', [1, 1, 1, 1]);
     * @param {string} symbol
     * @param {number|array|clay.Texture|ArrayBufferView} value
     */
    setUniform: function(e, t) {
      t === void 0 && console.warn('Uniform value "' + e + '" is undefined');
      var r = this.uniforms[e];
      r && (typeof t == "string" && (t = d_e(t) || t), r.value = t, this.autoUpdateTextureStatus && r.type === "t" && (t ? this.enableTexture(e) : this.disableTexture(e)));
    },
    /**
     * @param {Object} obj
     */
    setUniforms: function(e) {
      for (var t in e) {
        var r = e[t];
        this.setUniform(t, r);
      }
    },
    /**
     * @param  {string}  symbol
     * @return {boolean}
     */
    isUniformEnabled: function(e) {
      return this._enabledUniforms.indexOf(e) >= 0;
    },
    getEnabledUniforms: function() {
      return this._enabledUniforms;
    },
    getTextureUniforms: function() {
      return this._textureUniforms;
    },
    /**
     * Alias of setUniform and setUniforms
     * @param {object|string} symbol
     * @param {number|array|clay.Texture|ArrayBufferView} [value]
     */
    set: function(e, t) {
      if (typeof e == "object")
        for (var r in e) {
          var n = e[r];
          this.setUniform(r, n);
        }
      else
        this.setUniform(e, t);
    },
    /**
     * Get uniform value
     * @param  {string} symbol
     * @return {number|array|clay.Texture|ArrayBufferView}
     */
    get: function(e) {
      var t = this.uniforms[e];
      if (t)
        return t.value;
    },
    /**
     * Attach a shader instance
     * @param  {clay.Shader} shader
     * @param  {boolean} keepStatus If try to keep uniform and texture
     */
    attachShader: function(e, t) {
      var r = this.uniforms;
      this.uniforms = e.createUniforms(), this.shader = e;
      var n = this.uniforms;
      this._enabledUniforms = Object.keys(n), this._enabledUniforms.sort(), this._textureUniforms = this._enabledUniforms.filter(function(u) {
        var f = this.uniforms[u].type;
        return f === "t" || f === "tv";
      }, this);
      var i = this.vertexDefines, a = this.fragmentDefines;
      if (this.vertexDefines = xn.clone(e.vertexDefines), this.fragmentDefines = xn.clone(e.fragmentDefines), t) {
        for (var o in r)
          n[o] && (n[o].value = r[o].value);
        xn.defaults(this.vertexDefines, i), xn.defaults(this.fragmentDefines, a);
      }
      var s = {};
      for (var l in e.textures)
        s[l] = {
          shaderType: e.textures[l].shaderType,
          type: e.textures[l].type,
          enabled: t && this._textureStatus[l] ? this._textureStatus[l].enabled : !1
        };
      this._textureStatus = s, this._programKey = "";
    },
    /**
     * Clone a new material and keep uniforms, shader will not be cloned
     * @return {clay.Material}
     */
    clone: function() {
      var e = new this.constructor({
        name: this.name,
        shader: this.shader
      });
      for (var t in this.uniforms)
        e.uniforms[t].value = this.uniforms[t].value;
      return e.depthTest = this.depthTest, e.depthMask = this.depthMask, e.transparent = this.transparent, e.blend = this.blend, e.vertexDefines = xn.clone(this.vertexDefines), e.fragmentDefines = xn.clone(this.fragmentDefines), e.enableTexture(this.getEnabledTextures()), e.precision = this.precision, e;
    },
    /**
     * Add a #define macro in shader code
     * @param  {string} shaderType Can be vertex, fragment or both
     * @param  {string} symbol
     * @param  {number} [val]
     */
    define: function(e, t, r) {
      var n = this.vertexDefines, i = this.fragmentDefines;
      e !== "vertex" && e !== "fragment" && e !== "both" && arguments.length < 3 && (r = t, t = e, e = "both"), r = r ?? null, (e === "vertex" || e === "both") && n[t] !== r && (n[t] = r, this._programKey = ""), (e === "fragment" || e === "both") && i[t] !== r && (i[t] = r, e !== "both" && (this._programKey = ""));
    },
    /**
     * Remove a #define macro in shader code
     * @param  {string} shaderType Can be vertex, fragment or both
     * @param  {string} symbol
     */
    undefine: function(e, t) {
      e !== "vertex" && e !== "fragment" && e !== "both" && arguments.length < 2 && (t = e, e = "both"), (e === "vertex" || e === "both") && this.isDefined("vertex", t) && (delete this.vertexDefines[t], this._programKey = ""), (e === "fragment" || e === "both") && this.isDefined("fragment", t) && (delete this.fragmentDefines[t], e !== "both" && (this._programKey = ""));
    },
    /**
     * If macro is defined in shader.
     * @param  {string} shaderType Can be vertex, fragment or both
     * @param  {string} symbol
     */
    isDefined: function(e, t) {
      switch (e) {
        case "vertex":
          return this.vertexDefines[t] !== void 0;
        case "fragment":
          return this.fragmentDefines[t] !== void 0;
      }
    },
    /**
     * Get macro value defined in shader.
     * @param  {string} shaderType Can be vertex, fragment or both
     * @param  {string} symbol
     */
    getDefine: function(e, t) {
      switch (e) {
        case "vertex":
          return this.vertexDefines[t];
        case "fragment":
          return this.fragmentDefines[t];
      }
    },
    /**
     * Enable a texture, actually it will add a #define macro in the shader code
     * For example, if texture symbol is diffuseMap, it will add a line `#define DIFFUSEMAP_ENABLED` in the shader code
     * @param  {string} symbol
     */
    enableTexture: function(e) {
      if (Array.isArray(e)) {
        for (var t = 0; t < e.length; t++)
          this.enableTexture(e[t]);
        return;
      }
      var r = this._textureStatus[e];
      if (r) {
        var n = r.enabled;
        n || (r.enabled = !0, this._programKey = "");
      }
    },
    /**
     * Enable all textures used in the shader
     */
    enableTexturesAll: function() {
      var e = this._textureStatus;
      for (var t in e)
        e[t].enabled = !0;
      this._programKey = "";
    },
    /**
     * Disable a texture, it remove a #define macro in the shader
     * @param  {string} symbol
     */
    disableTexture: function(e) {
      if (Array.isArray(e)) {
        for (var t = 0; t < e.length; t++)
          this.disableTexture(e[t]);
        return;
      }
      var r = this._textureStatus[e];
      if (r) {
        var n = !r.enabled;
        n || (r.enabled = !1, this._programKey = "");
      }
    },
    /**
     * Disable all textures used in the shader
     */
    disableTexturesAll: function() {
      var e = this._textureStatus;
      for (var t in e)
        e[t].enabled = !1;
      this._programKey = "";
    },
    /**
     * If texture of given type is enabled.
     * @param  {string}  symbol
     * @return {boolean}
     */
    isTextureEnabled: function(e) {
      var t = this._textureStatus;
      return !!t[e] && t[e].enabled;
    },
    /**
     * Get all enabled textures
     * @return {string[]}
     */
    getEnabledTextures: function() {
      var e = [], t = this._textureStatus;
      for (var r in t)
        t[r].enabled && e.push(r);
      return e;
    },
    /**
     * Mark defines are updated.
     */
    dirtyDefines: function() {
      this._programKey = "";
    },
    getProgramKey: function() {
      return this._programKey || (this._programKey = p_e(
        this.vertexDefines,
        this.fragmentDefines,
        this.getEnabledTextures()
      )), this._programKey;
    }
  }
), I2 = 1e-6, Li = Array, fm = Math.random, He = {};
He.create = function() {
  var e = new Li(2);
  return e[0] = 0, e[1] = 0, e;
};
He.clone = function(e) {
  var t = new Li(2);
  return t[0] = e[0], t[1] = e[1], t;
};
He.fromValues = function(e, t) {
  var r = new Li(2);
  return r[0] = e, r[1] = t, r;
};
He.copy = function(e, t) {
  return e[0] = t[0], e[1] = t[1], e;
};
He.set = function(e, t, r) {
  return e[0] = t, e[1] = r, e;
};
He.add = function(e, t, r) {
  return e[0] = t[0] + r[0], e[1] = t[1] + r[1], e;
};
He.subtract = function(e, t, r) {
  return e[0] = t[0] - r[0], e[1] = t[1] - r[1], e;
};
He.sub = He.subtract;
He.multiply = function(e, t, r) {
  return e[0] = t[0] * r[0], e[1] = t[1] * r[1], e;
};
He.mul = He.multiply;
He.divide = function(e, t, r) {
  return e[0] = t[0] / r[0], e[1] = t[1] / r[1], e;
};
He.div = He.divide;
He.min = function(e, t, r) {
  return e[0] = Math.min(t[0], r[0]), e[1] = Math.min(t[1], r[1]), e;
};
He.max = function(e, t, r) {
  return e[0] = Math.max(t[0], r[0]), e[1] = Math.max(t[1], r[1]), e;
};
He.scale = function(e, t, r) {
  return e[0] = t[0] * r, e[1] = t[1] * r, e;
};
He.scaleAndAdd = function(e, t, r, n) {
  return e[0] = t[0] + r[0] * n, e[1] = t[1] + r[1] * n, e;
};
He.distance = function(e, t) {
  var r = t[0] - e[0], n = t[1] - e[1];
  return Math.sqrt(r * r + n * n);
};
He.dist = He.distance;
He.squaredDistance = function(e, t) {
  var r = t[0] - e[0], n = t[1] - e[1];
  return r * r + n * n;
};
He.sqrDist = He.squaredDistance;
He.length = function(e) {
  var t = e[0], r = e[1];
  return Math.sqrt(t * t + r * r);
};
He.len = He.length;
He.squaredLength = function(e) {
  var t = e[0], r = e[1];
  return t * t + r * r;
};
He.sqrLen = He.squaredLength;
He.negate = function(e, t) {
  return e[0] = -t[0], e[1] = -t[1], e;
};
He.inverse = function(e, t) {
  return e[0] = 1 / t[0], e[1] = 1 / t[1], e;
};
He.normalize = function(e, t) {
  var r = t[0], n = t[1], i = r * r + n * n;
  return i > 0 && (i = 1 / Math.sqrt(i), e[0] = t[0] * i, e[1] = t[1] * i), e;
};
He.dot = function(e, t) {
  return e[0] * t[0] + e[1] * t[1];
};
He.cross = function(e, t, r) {
  var n = t[0] * r[1] - t[1] * r[0];
  return e[0] = e[1] = 0, e[2] = n, e;
};
He.lerp = function(e, t, r, n) {
  var i = t[0], a = t[1];
  return e[0] = i + n * (r[0] - i), e[1] = a + n * (r[1] - a), e;
};
He.random = function(e, t) {
  t = t || 1;
  var r = GLMAT_RANDOM() * 2 * Math.PI;
  return e[0] = Math.cos(r) * t, e[1] = Math.sin(r) * t, e;
};
He.transformMat2 = function(e, t, r) {
  var n = t[0], i = t[1];
  return e[0] = r[0] * n + r[2] * i, e[1] = r[1] * n + r[3] * i, e;
};
He.transformMat2d = function(e, t, r) {
  var n = t[0], i = t[1];
  return e[0] = r[0] * n + r[2] * i + r[4], e[1] = r[1] * n + r[3] * i + r[5], e;
};
He.transformMat3 = function(e, t, r) {
  var n = t[0], i = t[1];
  return e[0] = r[0] * n + r[3] * i + r[6], e[1] = r[1] * n + r[4] * i + r[7], e;
};
He.transformMat4 = function(e, t, r) {
  var n = t[0], i = t[1];
  return e[0] = r[0] * n + r[4] * i + r[12], e[1] = r[1] * n + r[5] * i + r[13], e;
};
He.forEach = (function() {
  var e = He.create();
  return function(t, r, n, i, a, o) {
    var s, l;
    for (r || (r = 2), n || (n = 0), i ? l = Math.min(i * r + n, t.length) : l = t.length, s = n; s < l; s += r)
      e[0] = t[s], e[1] = t[s + 1], a(e, e, o), t[s] = e[0], t[s + 1] = e[1];
    return t;
  };
})();
var Pt = function(e, t) {
  e = e || 0, t = t || 0, this.array = He.fromValues(e, t), this._dirty = !0;
};
Pt.prototype = {
  constructor: Pt,
  /**
   * Add b to self
   * @param  {clay.Vector2} b
   * @return {clay.Vector2}
   */
  add: function(e) {
    return He.add(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Set x and y components
   * @param  {number}  x
   * @param  {number}  y
   * @return {clay.Vector2}
   */
  set: function(e, t) {
    return this.array[0] = e, this.array[1] = t, this._dirty = !0, this;
  },
  /**
   * Set x and y components from array
   * @param  {Float32Array|number[]} arr
   * @return {clay.Vector2}
   */
  setArray: function(e) {
    return this.array[0] = e[0], this.array[1] = e[1], this._dirty = !0, this;
  },
  /**
   * Clone a new Vector2
   * @return {clay.Vector2}
   */
  clone: function() {
    return new Pt(this.x, this.y);
  },
  /**
   * Copy x, y from b
   * @param  {clay.Vector2} b
   * @return {clay.Vector2}
   */
  copy: function(e) {
    return He.copy(this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Cross product of self and b, written to a Vector3 out
   * @param  {clay.Vector3} out
   * @param  {clay.Vector2} b
   * @return {clay.Vector2}
   */
  cross: function(e, t) {
    return He.cross(e.array, this.array, t.array), e._dirty = !0, this;
  },
  /**
   * Alias for distance
   * @param  {clay.Vector2} b
   * @return {number}
   */
  dist: function(e) {
    return He.dist(this.array, e.array);
  },
  /**
   * Distance between self and b
   * @param  {clay.Vector2} b
   * @return {number}
   */
  distance: function(e) {
    return He.distance(this.array, e.array);
  },
  /**
   * Alias for divide
   * @param  {clay.Vector2} b
   * @return {clay.Vector2}
   */
  div: function(e) {
    return He.div(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Divide self by b
   * @param  {clay.Vector2} b
   * @return {clay.Vector2}
   */
  divide: function(e) {
    return He.divide(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Dot product of self and b
   * @param  {clay.Vector2} b
   * @return {number}
   */
  dot: function(e) {
    return He.dot(this.array, e.array);
  },
  /**
   * Alias of length
   * @return {number}
   */
  len: function() {
    return He.len(this.array);
  },
  /**
   * Calculate the length
   * @return {number}
   */
  length: function() {
    return He.length(this.array);
  },
  /**
   * Linear interpolation between a and b
   * @param  {clay.Vector2} a
   * @param  {clay.Vector2} b
   * @param  {number}  t
   * @return {clay.Vector2}
   */
  lerp: function(e, t, r) {
    return He.lerp(this.array, e.array, t.array, r), this._dirty = !0, this;
  },
  /**
   * Minimum of self and b
   * @param  {clay.Vector2} b
   * @return {clay.Vector2}
   */
  min: function(e) {
    return He.min(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Maximum of self and b
   * @param  {clay.Vector2} b
   * @return {clay.Vector2}
   */
  max: function(e) {
    return He.max(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Alias for multiply
   * @param  {clay.Vector2} b
   * @return {clay.Vector2}
   */
  mul: function(e) {
    return He.mul(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Mutiply self and b
   * @param  {clay.Vector2} b
   * @return {clay.Vector2}
   */
  multiply: function(e) {
    return He.multiply(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Negate self
   * @return {clay.Vector2}
   */
  negate: function() {
    return He.negate(this.array, this.array), this._dirty = !0, this;
  },
  /**
   * Normalize self
   * @return {clay.Vector2}
   */
  normalize: function() {
    return He.normalize(this.array, this.array), this._dirty = !0, this;
  },
  /**
   * Generate random x, y components with a given scale
   * @param  {number} scale
   * @return {clay.Vector2}
   */
  random: function(e) {
    return He.random(this.array, e), this._dirty = !0, this;
  },
  /**
   * Scale self
   * @param  {number}  scale
   * @return {clay.Vector2}
   */
  scale: function(e) {
    return He.scale(this.array, this.array, e), this._dirty = !0, this;
  },
  /**
   * Scale b and add to self
   * @param  {clay.Vector2} b
   * @param  {number}  scale
   * @return {clay.Vector2}
   */
  scaleAndAdd: function(e, t) {
    return He.scaleAndAdd(this.array, this.array, e.array, t), this._dirty = !0, this;
  },
  /**
   * Alias for squaredDistance
   * @param  {clay.Vector2} b
   * @return {number}
   */
  sqrDist: function(e) {
    return He.sqrDist(this.array, e.array);
  },
  /**
   * Squared distance between self and b
   * @param  {clay.Vector2} b
   * @return {number}
   */
  squaredDistance: function(e) {
    return He.squaredDistance(this.array, e.array);
  },
  /**
   * Alias for squaredLength
   * @return {number}
   */
  sqrLen: function() {
    return He.sqrLen(this.array);
  },
  /**
   * Squared length of self
   * @return {number}
   */
  squaredLength: function() {
    return He.squaredLength(this.array);
  },
  /**
   * Alias for subtract
   * @param  {clay.Vector2} b
   * @return {clay.Vector2}
   */
  sub: function(e) {
    return He.sub(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Subtract b from self
   * @param  {clay.Vector2} b
   * @return {clay.Vector2}
   */
  subtract: function(e) {
    return He.subtract(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Transform self with a Matrix2 m
   * @param  {clay.Matrix2} m
   * @return {clay.Vector2}
   */
  transformMat2: function(e) {
    return He.transformMat2(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Transform self with a Matrix2d m
   * @param  {clay.Matrix2d} m
   * @return {clay.Vector2}
   */
  transformMat2d: function(e) {
    return He.transformMat2d(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Transform self with a Matrix3 m
   * @param  {clay.Matrix3} m
   * @return {clay.Vector2}
   */
  transformMat3: function(e) {
    return He.transformMat3(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Transform self with a Matrix4 m
   * @param  {clay.Matrix4} m
   * @return {clay.Vector2}
   */
  transformMat4: function(e) {
    return He.transformMat4(this.array, this.array, e.array), this._dirty = !0, this;
  },
  toString: function() {
    return "[" + Array.prototype.join.call(this.array, ",") + "]";
  },
  toArray: function() {
    return Array.prototype.slice.call(this.array);
  }
};
if (Object.defineProperty) {
  var xV = Pt.prototype;
  Object.defineProperty(xV, "x", {
    get: function() {
      return this.array[0];
    },
    set: function(e) {
      this.array[0] = e, this._dirty = !0;
    }
  }), Object.defineProperty(xV, "y", {
    get: function() {
      return this.array[1];
    },
    set: function(e) {
      this.array[1] = e, this._dirty = !0;
    }
  });
}
Pt.add = function(e, t, r) {
  return He.add(e.array, t.array, r.array), e._dirty = !0, e;
};
Pt.set = function(e, t, r) {
  return He.set(e.array, t, r), e._dirty = !0, e;
};
Pt.copy = function(e, t) {
  return He.copy(e.array, t.array), e._dirty = !0, e;
};
Pt.cross = function(e, t, r) {
  return He.cross(e.array, t.array, r.array), e._dirty = !0, e;
};
Pt.dist = function(e, t) {
  return He.distance(e.array, t.array);
};
Pt.distance = Pt.dist;
Pt.div = function(e, t, r) {
  return He.divide(e.array, t.array, r.array), e._dirty = !0, e;
};
Pt.divide = Pt.div;
Pt.dot = function(e, t) {
  return He.dot(e.array, t.array);
};
Pt.len = function(e) {
  return He.length(e.array);
};
Pt.lerp = function(e, t, r, n) {
  return He.lerp(e.array, t.array, r.array, n), e._dirty = !0, e;
};
Pt.min = function(e, t, r) {
  return He.min(e.array, t.array, r.array), e._dirty = !0, e;
};
Pt.max = function(e, t, r) {
  return He.max(e.array, t.array, r.array), e._dirty = !0, e;
};
Pt.mul = function(e, t, r) {
  return He.multiply(e.array, t.array, r.array), e._dirty = !0, e;
};
Pt.multiply = Pt.mul;
Pt.negate = function(e, t) {
  return He.negate(e.array, t.array), e._dirty = !0, e;
};
Pt.normalize = function(e, t) {
  return He.normalize(e.array, t.array), e._dirty = !0, e;
};
Pt.random = function(e, t) {
  return He.random(e.array, t), e._dirty = !0, e;
};
Pt.scale = function(e, t, r) {
  return He.scale(e.array, t.array, r), e._dirty = !0, e;
};
Pt.scaleAndAdd = function(e, t, r, n) {
  return He.scaleAndAdd(e.array, t.array, r.array, n), e._dirty = !0, e;
};
Pt.sqrDist = function(e, t) {
  return He.sqrDist(e.array, t.array);
};
Pt.squaredDistance = Pt.sqrDist;
Pt.sqrLen = function(e) {
  return He.sqrLen(e.array);
};
Pt.squaredLength = Pt.sqrLen;
Pt.sub = function(e, t, r) {
  return He.subtract(e.array, t.array, r.array), e._dirty = !0, e;
};
Pt.subtract = Pt.sub;
Pt.transformMat2 = function(e, t, r) {
  return He.transformMat2(e.array, t.array, r.array), e._dirty = !0, e;
};
Pt.transformMat2d = function(e, t, r) {
  return He.transformMat2d(e.array, t.array, r.array), e._dirty = !0, e;
};
Pt.transformMat3 = function(e, t, r) {
  return He.transformMat3(e.array, t.array, r.array), e._dirty = !0, e;
};
Pt.transformMat4 = function(e, t, r) {
  return He.transformMat4(e.array, t.array, r.array), e._dirty = !0, e;
};
var SV = 1, wV = 2, YD = 3, TV = {};
function g_e(e) {
  for (var t = e.split(`
`), r = 0, n = t.length; r < n; r++)
    t[r] = r + 1 + ": " + t[r];
  return t.join(`
`);
}
function bV(e, t, r) {
  if (!e.getShaderParameter(t, e.COMPILE_STATUS))
    return [e.getShaderInfoLog(t), g_e(r)].join(`
`);
}
var CV = new pr.Float32Array(16), m_e = Mi.extend({
  uniformSemantics: {},
  attributes: {}
}, function() {
  this._locations = {}, this._textureSlot = 0, this._program = null;
}, {
  bind: function(e) {
    this._textureSlot = 0, e.gl.useProgram(this._program);
  },
  hasUniform: function(e) {
    var t = this._locations[e];
    return t != null;
  },
  useTextureSlot: function(e, t, r) {
    t && (e.gl.activeTexture(e.gl.TEXTURE0 + r), t.isRenderable() ? t.bind(e) : t.unbind(e));
  },
  currentTextureSlot: function() {
    return this._textureSlot;
  },
  resetTextureSlot: function(e) {
    this._textureSlot = e || 0;
  },
  takeCurrentTextureSlot: function(e, t) {
    var r = this._textureSlot;
    return this.useTextureSlot(e, t, r), this._textureSlot++, r;
  },
  setUniform: function(e, t, r, n) {
    var i = this._locations, a = i[r];
    if (a == null)
      return !1;
    switch (t) {
      case "m4":
        if (!(n instanceof Float32Array)) {
          for (var o = 0; o < n.length; o++)
            CV[o] = n[o];
          n = CV;
        }
        e.uniformMatrix4fv(a, !1, n);
        break;
      case "2i":
        e.uniform2i(a, n[0], n[1]);
        break;
      case "2f":
        e.uniform2f(a, n[0], n[1]);
        break;
      case "3i":
        e.uniform3i(a, n[0], n[1], n[2]);
        break;
      case "3f":
        e.uniform3f(a, n[0], n[1], n[2]);
        break;
      case "4i":
        e.uniform4i(a, n[0], n[1], n[2], n[3]);
        break;
      case "4f":
        e.uniform4f(a, n[0], n[1], n[2], n[3]);
        break;
      case "1i":
        e.uniform1i(a, n);
        break;
      case "1f":
        e.uniform1f(a, n);
        break;
      case "1fv":
        e.uniform1fv(a, n);
        break;
      case "1iv":
        e.uniform1iv(a, n);
        break;
      case "2iv":
        e.uniform2iv(a, n);
        break;
      case "2fv":
        e.uniform2fv(a, n);
        break;
      case "3iv":
        e.uniform3iv(a, n);
        break;
      case "3fv":
        e.uniform3fv(a, n);
        break;
      case "4iv":
        e.uniform4iv(a, n);
        break;
      case "4fv":
        e.uniform4fv(a, n);
        break;
      case "m2":
      case "m2v":
        e.uniformMatrix2fv(a, !1, n);
        break;
      case "m3":
      case "m3v":
        e.uniformMatrix3fv(a, !1, n);
        break;
      case "m4v":
        if (Array.isArray(n) && Array.isArray(n[0])) {
          for (var s = new pr.Float32Array(n.length * 16), l = 0, o = 0; o < n.length; o++)
            for (var u = n[o], f = 0; f < 16; f++)
              s[l++] = u[f];
          e.uniformMatrix4fv(a, !1, s);
        } else
          e.uniformMatrix4fv(a, !1, n);
        break;
    }
    return !0;
  },
  setUniformOfSemantic: function(e, t, r) {
    var n = this.uniformSemantics[t];
    return n ? this.setUniform(e, n.type, n.symbol, r) : !1;
  },
  // Used for creating VAO
  // Enable the attributes passed in and disable the rest
  // Example Usage:
  // enableAttributes(renderer, ["position", "texcoords"])
  enableAttributes: function(e, t, r) {
    var n = e.gl, i = this._program, a = this._locations, o;
    r ? o = r.__enabledAttributeList : o = TV[e.__uid__], o || (r ? o = r.__enabledAttributeList = [] : o = TV[e.__uid__] = []);
    for (var s = [], l = 0; l < t.length; l++) {
      var u = t[l];
      if (!this.attributes[u]) {
        s[l] = -1;
        continue;
      }
      var f = a[u];
      if (f == null) {
        if (f = n.getAttribLocation(i, u), f === -1) {
          s[l] = -1;
          continue;
        }
        a[u] = f;
      }
      s[l] = f, o[f] ? o[f] = wV : o[f] = SV;
    }
    for (var l = 0; l < o.length; l++)
      switch (o[l]) {
        case SV:
          n.enableVertexAttribArray(l), o[l] = YD;
          break;
        case wV:
          o[l] = YD;
          break;
        // Expired
        case YD:
          n.disableVertexAttribArray(l), o[l] = 0;
          break;
      }
    return s;
  },
  getAttribLocation: function(e, t) {
    var r = this._locations, n = r[t];
    return n == null && (n = e.getAttribLocation(this._program, t), r[t] = n), n;
  },
  buildProgram: function(e, t, r, n) {
    var i = e.createShader(e.VERTEX_SHADER), a = e.createProgram();
    e.shaderSource(i, r), e.compileShader(i);
    var o = e.createShader(e.FRAGMENT_SHADER);
    e.shaderSource(o, n), e.compileShader(o);
    var s = bV(e, i, r);
    if (s || (s = bV(e, o, n), s))
      return s;
    if (e.attachShader(a, i), e.attachShader(a, o), t.attributeSemantics.POSITION)
      e.bindAttribLocation(a, 0, t.attributeSemantics.POSITION.symbol);
    else {
      var l = Object.keys(this.attributes);
      e.bindAttribLocation(a, 0, l[0]);
    }
    if (e.linkProgram(a), e.deleteShader(i), e.deleteShader(o), this._program = a, this.vertexCode = r, this.fragmentCode = n, !e.getProgramParameter(a, e.LINK_STATUS))
      return `Could not link program
` + e.getProgramInfoLog(a);
    for (var u = 0; u < t.uniforms.length; u++) {
      var f = t.uniforms[u];
      this._locations[f] = e.getUniformLocation(a, f);
    }
  }
}), y_e = /for\s*?\(int\s*?_idx_\s*\=\s*([\w-]+)\;\s*_idx_\s*<\s*([\w-]+);\s*_idx_\s*\+\+\s*\)\s*\{\{([\s\S]+?)(?=\}\})\}\}/g;
function AV(e, t, r) {
  function n(o, s, l, u) {
    var f = "";
    isNaN(s) && (s in t ? s = t[s] : s = i[s]), isNaN(l) && (l in t ? l = t[l] : l = i[l]);
    for (var c = parseInt(s); c < parseInt(l); c++)
      f += "{" + u.replace(/float\s*\(\s*_idx_\s*\)/g, c.toFixed(1)).replace(/_idx_/g, c) + "}";
    return f;
  }
  var i = {};
  for (var a in r)
    i[a + "_COUNT"] = r[a];
  return e.replace(y_e, n);
}
function ZD(e, t, r) {
  var n = [];
  if (t)
    for (var i in t) {
      var a = t[i];
      a > 0 && n.push("#define " + i.toUpperCase() + "_COUNT " + a);
    }
  if (r)
    for (var o = 0; o < r.length; o++) {
      var s = r[o];
      n.push("#define " + s.toUpperCase() + "_ENABLED");
    }
  for (var s in e) {
    var l = e[s];
    l === null ? n.push("#define " + s) : n.push("#define " + s + " " + l.toString());
  }
  return n.join(`
`);
}
function __e(e) {
  for (var t = [], r = 0; r < e.length; r++)
    t.push("#extension GL_" + e[r] + " : enable");
  return t.join(`
`);
}
function x_e(e) {
  return ["precision", e, "float"].join(" ") + `;
` + ["precision", e, "int"].join(" ") + `;
` + ["precision", e, "sampler2D"].join(" ") + `;
`;
}
function gY(e) {
  this._renderer = e, this._cache = {};
}
gY.prototype.getProgram = function(e, t, r) {
  var n = this._cache, i = e.isSkinnedMesh && e.isSkinnedMesh(), a = e.isInstancedMesh && e.isInstancedMesh(), o = "s" + t.shader.shaderID + "m" + t.getProgramKey();
  r && (o += "se" + r.getProgramKey(e.lightGroup)), i && (o += ",sk" + e.joints.length), a && (o += ",is");
  var C = n[o];
  if (C)
    return C;
  var s = r ? r.getLightsNumbers(e.lightGroup) : {}, l = this._renderer, u = l.gl, f = t.getEnabledTextures(), c = "";
  if (i) {
    var h = {
      SKINNING: null,
      JOINT_COUNT: e.joints.length
    };
    e.joints.length > l.getMaxJointNumber() && (h.USE_SKIN_MATRICES_TEXTURE = null), c += `
` + ZD(h) + `
`;
  }
  a && (c += `
#define INSTANCING
`);
  var v = c + ZD(t.vertexDefines, s, f), d = c + ZD(t.fragmentDefines, s, f), g = v + `
` + t.shader.vertex, y = [
    "OES_standard_derivatives",
    "EXT_shader_texture_lod"
  ].filter(function(M) {
    return l.getGLExtension(M) != null;
  });
  y.indexOf("EXT_shader_texture_lod") >= 0 && (d += `
#define SUPPORT_TEXTURE_LOD`), y.indexOf("OES_standard_derivatives") >= 0 && (d += `
#define SUPPORT_STANDARD_DERIVATIVES`);
  var x = __e(y) + `
` + x_e(t.precision) + `
` + d + `
` + t.shader.fragment, S = AV(g, t.vertexDefines, s), T = AV(x, t.fragmentDefines, s), C = new m_e();
  C.uniformSemantics = t.shader.uniformSemantics, C.attributes = t.shader.attributes;
  var A = C.buildProgram(u, t.shader, S, T);
  return C.__error = A, n[o] = C, C;
};
var MV = /uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\s\S]*?);/g, S_e = /attribute\s+(float|int|vec2|vec3|vec4)\s+([\s\S]*?);/g, LV = /#define\s+(\w+)?(\s+[\d-.]+)?\s*;?\s*\n/g, w_e = {
  bool: "1i",
  int: "1i",
  sampler2D: "t",
  samplerCube: "t",
  float: "1f",
  vec2: "2f",
  vec3: "3f",
  vec4: "4f",
  ivec2: "2i",
  ivec3: "3i",
  ivec4: "4i",
  mat2: "m2",
  mat3: "m3",
  mat4: "m4"
};
function Wu(e) {
  for (var t = [], r = 0; r < e; r++)
    t[r] = 0;
  return t;
}
var DV = {
  bool: function() {
    return !0;
  },
  int: function() {
    return 0;
  },
  float: function() {
    return 0;
  },
  sampler2D: function() {
    return null;
  },
  samplerCube: function() {
    return null;
  },
  vec2: function() {
    return Wu(2);
  },
  vec3: function() {
    return Wu(3);
  },
  vec4: function() {
    return Wu(4);
  },
  ivec2: function() {
    return Wu(2);
  },
  ivec3: function() {
    return Wu(3);
  },
  ivec4: function() {
    return Wu(4);
  },
  mat2: function() {
    return Wu(4);
  },
  mat3: function() {
    return Wu(9);
  },
  mat4: function() {
    return Wu(16);
  },
  array: function() {
    return [];
  }
}, FI = [
  "POSITION",
  "NORMAL",
  "BINORMAL",
  "TANGENT",
  "TEXCOORD",
  "TEXCOORD_0",
  "TEXCOORD_1",
  "COLOR",
  // Skinning
  // https://github.com/KhronosGroup/glTF/blob/master/specification/README.md#semantics
  "JOINT",
  "WEIGHT"
], mY = [
  "SKIN_MATRIX",
  // Information about viewport
  "VIEWPORT_SIZE",
  "VIEWPORT",
  "DEVICEPIXELRATIO",
  // Window size for window relative coordinate
  // https://www.opengl.org/sdk/docs/man/html/gl_FragCoord.xhtml
  "WINDOW_SIZE",
  // Infomation about camera
  "NEAR",
  "FAR",
  // Time
  "TIME"
], yY = [
  "WORLD",
  "VIEW",
  "PROJECTION",
  "WORLDVIEW",
  "VIEWPROJECTION",
  "WORLDVIEWPROJECTION",
  "WORLDINVERSE",
  "VIEWINVERSE",
  "PROJECTIONINVERSE",
  "WORLDVIEWINVERSE",
  "VIEWPROJECTIONINVERSE",
  "WORLDVIEWPROJECTIONINVERSE",
  "WORLDTRANSPOSE",
  "VIEWTRANSPOSE",
  "PROJECTIONTRANSPOSE",
  "WORLDVIEWTRANSPOSE",
  "VIEWPROJECTIONTRANSPOSE",
  "WORLDVIEWPROJECTIONTRANSPOSE",
  "WORLDINVERSETRANSPOSE",
  "VIEWINVERSETRANSPOSE",
  "PROJECTIONINVERSETRANSPOSE",
  "WORLDVIEWINVERSETRANSPOSE",
  "VIEWPROJECTIONINVERSETRANSPOSE",
  "WORLDVIEWPROJECTIONINVERSETRANSPOSE"
], T_e = {
  // WebGL does not support integer attributes
  vec4: 4,
  vec3: 3,
  vec2: 2,
  float: 1
}, $D = {}, _Y = {};
function b_e(e, t) {
  var r = "vertex:" + e + "fragment:" + t;
  if ($D[r])
    return $D[r];
  var n = xn.genGUID();
  return $D[r] = n, _Y[n] = {
    vertex: e,
    fragment: t
  }, n;
}
function EV(e) {
  return e.replace(/[ \t]*\/\/.*\n/g, "").replace(/[ \t]*\/\*[\s\S]*?\*\//g, "");
}
function Hg() {
  console.error("Wrong uniform/attributes syntax");
}
function PV(e, t) {
  for (var r = /[,=\(\):]/, n = t.replace(/:\s*\[\s*(.*)\s*\]/g, "=" + e + "($1)").replace(/\s+/g, "").split(/(?=[,=\(\):])/g), i = [], a = 0; a < n.length; a++)
    n[a].match(r) ? i.push(
      n[a].charAt(0),
      n[a].slice(1)
    ) : i.push(n[a]);
  n = i;
  var o = 0, s = 1, l = 2, u = 3, f = 4, c = 5, h = o, v = {}, d = null, g;
  y(n[0]);
  function y(T) {
    T || Hg();
    var C = T.match(/\[(.*?)\]/);
    g = T.replace(/\[(.*?)\]/, ""), v[g] = {}, C && (v[g].isArray = !0, v[g].arraySize = C[1]);
  }
  for (var a = 1; a < n.length; a++) {
    var x = n[a];
    if (x) {
      if (x === "=") {
        if (h !== o && h !== u) {
          Hg();
          break;
        }
        h = s;
        continue;
      } else if (x === ":") {
        h = f;
        continue;
      } else if (x === ",") {
        if (h === l) {
          if (!(d instanceof Array)) {
            Hg();
            break;
          }
          d.push(+n[++a]);
        } else
          h = c;
        continue;
      } else if (x === ")") {
        v[g].value = new pr.Float32Array(d), d = null, h = c;
        continue;
      } else if (x === "(") {
        if (h !== l) {
          Hg();
          break;
        }
        if (!(d instanceof Array)) {
          Hg();
          break;
        }
        d.push(+n[++a]);
        continue;
      } else if (x.indexOf("vec") >= 0) {
        if (h !== s && h !== f) {
          Hg();
          break;
        }
        h = l, d = [];
        continue;
      } else if (h === s) {
        e === "bool" ? v[g].value = x === "true" : v[g].value = parseFloat(x), d = null;
        continue;
      } else if (h === f) {
        var S = x;
        FI.indexOf(S) >= 0 || mY.indexOf(S) >= 0 || yY.indexOf(S) >= 0 ? v[g].semantic = S : S === "ignore" || S === "unconfigurable" ? v[g].ignore = !0 : e === "bool" ? v[g].value = S === "true" : v[g].value = parseFloat(S);
        continue;
      }
      y(x), h = o;
    }
  }
  return v;
}
function Ze(e, t) {
  typeof e == "object" && (t = e.fragment, e = e.vertex), e = EV(e), t = EV(t), this._shaderID = b_e(e, t), this._vertexCode = Ze.parseImport(e), this._fragmentCode = Ze.parseImport(t), this.attributeSemantics = {}, this.matrixSemantics = {}, this.uniformSemantics = {}, this.matrixSemanticKeys = [], this.uniformTemplates = {}, this.attributes = {}, this.textures = {}, this.vertexDefines = {}, this.fragmentDefines = {}, this._parseAttributes(), this._parseUniforms(), this._parseDefines();
}
Ze.prototype = {
  constructor: Ze,
  // Create a new uniform instance for material
  createUniforms: function() {
    var e = {};
    for (var t in this.uniformTemplates) {
      var r = this.uniformTemplates[t];
      e[t] = {
        type: r.type,
        value: r.value()
      };
    }
    return e;
  },
  _parseImport: function() {
    this._vertexCode = Ze.parseImport(this.vertex), this._fragmentCode = Ze.parseImport(this.fragment);
  },
  _addSemanticUniform: function(e, t, r) {
    if (FI.indexOf(r) >= 0)
      this.attributeSemantics[r] = {
        symbol: e,
        type: t
      };
    else if (yY.indexOf(r) >= 0) {
      var n = !1, i = r;
      r.match(/TRANSPOSE$/) && (n = !0, i = r.slice(0, -9)), this.matrixSemantics[r] = {
        symbol: e,
        type: t,
        isTranspose: n,
        semanticNoTranspose: i
      };
    } else mY.indexOf(r) >= 0 && (this.uniformSemantics[r] = {
      symbol: e,
      type: t
    });
  },
  _addMaterialUniform: function(e, t, r, n, i, a) {
    a[e] = {
      type: r,
      value: i ? DV.array : n || DV[t],
      semantic: null
    };
  },
  _parseUniforms: function() {
    var e = {}, t = this, r = "vertex";
    this._uniformList = [], this._vertexCode = this._vertexCode.replace(MV, i), r = "fragment", this._fragmentCode = this._fragmentCode.replace(MV, i), t.matrixSemanticKeys = Object.keys(this.matrixSemantics);
    function n(a) {
      return a != null ? function() {
        return a;
      } : null;
    }
    function i(a, o, s) {
      var l = PV(o, s), u = [];
      for (var f in l) {
        var c = l[f], h = c.semantic, v = f, d = w_e[o], g = n(l[f].value);
        l[f].isArray && (v += "[" + l[f].arraySize + "]", d += "v"), u.push(v), t._uniformList.push(f), c.ignore || ((o === "sampler2D" || o === "samplerCube") && (t.textures[f] = {
          shaderType: r,
          type: o
        }), h ? t._addSemanticUniform(f, d, h) : t._addMaterialUniform(
          f,
          o,
          d,
          g,
          l[f].isArray,
          e
        ));
      }
      return u.length > 0 ? "uniform " + o + " " + u.join(",") + `;
` : "";
    }
    this.uniformTemplates = e;
  },
  _parseAttributes: function() {
    var e = {}, t = this;
    this._vertexCode = this._vertexCode.replace(S_e, r);
    function r(n, i, a) {
      var o = PV(i, a), s = T_e[i] || 1, l = [];
      for (var u in o) {
        var f = o[u].semantic;
        if (e[u] = {
          // TODO Can only be float
          type: "float",
          size: s,
          semantic: f || null
        }, f) {
          if (FI.indexOf(f) < 0)
            throw new Error('Unkown semantic "' + f + '"');
          t.attributeSemantics[f] = {
            symbol: u,
            type: i
          };
        }
        l.push(u);
      }
      return "attribute " + i + " " + l.join(",") + `;
`;
    }
    this.attributes = e;
  },
  _parseDefines: function() {
    var e = this, t = "vertex";
    this._vertexCode = this._vertexCode.replace(LV, r), t = "fragment", this._fragmentCode = this._fragmentCode.replace(LV, r);
    function r(n, i, a) {
      var o = t === "vertex" ? e.vertexDefines : e.fragmentDefines;
      return o[i] || (a === "false" ? o[i] = !1 : a === "true" ? o[i] = !0 : o[i] = a ? isNaN(parseFloat(a)) ? a.trim() : parseFloat(a) : null), "";
    }
  },
  /**
   * Clone a new shader
   * @return {clay.Shader}
   */
  clone: function() {
    var e = _Y[this._shaderID], t = new Ze(e.vertex, e.fragment);
    return t;
  }
};
Object.defineProperty && (Object.defineProperty(Ze.prototype, "shaderID", {
  get: function() {
    return this._shaderID;
  }
}), Object.defineProperty(Ze.prototype, "vertex", {
  get: function() {
    return this._vertexCode;
  }
}), Object.defineProperty(Ze.prototype, "fragment", {
  get: function() {
    return this._fragmentCode;
  }
}), Object.defineProperty(Ze.prototype, "uniforms", {
  get: function() {
    return this._uniformList;
  }
}));
var C_e = /(@import)\s*([0-9a-zA-Z_\-\.]*)/g;
Ze.parseImport = function(e) {
  return e = e.replace(C_e, function(i, r, n) {
    var i = Ze.source(n);
    return i ? Ze.parseImport(i) : (console.error('Shader chunk "' + n + '" not existed in library'), "");
  }), e;
};
var A_e = /(@export)\s*([0-9a-zA-Z_\-\.]*)\s*\n([\s\S]*?)@end/g;
Ze.import = function(e) {
  e.replace(A_e, function(t, r, n, a) {
    var a = a.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+\x24)/g, "");
    if (a) {
      for (var o = n.split("."), s = Ze.codes, l = 0, u; l < o.length - 1; )
        u = o[l++], s[u] || (s[u] = {}), s = s[u];
      u = o[l], s[u] = a;
    }
    return a;
  });
};
Ze.codes = {};
Ze.source = function(e) {
  for (var t = e.split("."), r = Ze.codes, n = 0; r && n < t.length; ) {
    var i = t[n++];
    r = r[i];
  }
  return typeof r != "string" ? (console.error('Shader "' + e + '" not existed in library'), "") : r;
};
const xY = `@export clay.prez.vertex
uniform mat4 WVP : WORLDVIEWPROJECTION;
attribute vec3 pos : POSITION;
attribute vec2 uv : TEXCOORD_0;
uniform vec2 uvRepeat : [1.0, 1.0];
uniform vec2 uvOffset : [0.0, 0.0];
@import clay.chunk.skinning_header
@import clay.chunk.instancing_header
varying vec2 v_Texcoord;
void main()
{
 vec4 P = vec4(pos, 1.0);
#ifdef SKINNING
 @import clay.chunk.skin_matrix
 P = skinMatrixWS * P;
#endif
#ifdef INSTANCING
 @import clay.chunk.instancing_matrix
 P = instanceMat * P;
#endif
 gl_Position = WVP * P;
 v_Texcoord = uv * uvRepeat + uvOffset;
}
@end
@export clay.prez.fragment
uniform sampler2D alphaMap;
uniform float alphaCutoff: 0.0;
varying vec2 v_Texcoord;
void main()
{
 if (alphaCutoff > 0.0) {
 if (texture2D(alphaMap, v_Texcoord).a <= alphaCutoff) {
 discard;
 }
 }
 gl_FragColor = vec4(0.0,0.0,0.0,1.0);
}
@end`;
var Oe = {};
Oe.create = function() {
  var e = new Li(16);
  return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = 1, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = 1, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e;
};
Oe.clone = function(e) {
  var t = new Li(16);
  return t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[3], t[4] = e[4], t[5] = e[5], t[6] = e[6], t[7] = e[7], t[8] = e[8], t[9] = e[9], t[10] = e[10], t[11] = e[11], t[12] = e[12], t[13] = e[13], t[14] = e[14], t[15] = e[15], t;
};
Oe.copy = function(e, t) {
  return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[4] = t[4], e[5] = t[5], e[6] = t[6], e[7] = t[7], e[8] = t[8], e[9] = t[9], e[10] = t[10], e[11] = t[11], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15], e;
};
Oe.identity = function(e) {
  return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = 1, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = 1, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e;
};
Oe.transpose = function(e, t) {
  if (e === t) {
    var r = t[1], n = t[2], i = t[3], a = t[6], o = t[7], s = t[11];
    e[1] = t[4], e[2] = t[8], e[3] = t[12], e[4] = r, e[6] = t[9], e[7] = t[13], e[8] = n, e[9] = a, e[11] = t[14], e[12] = i, e[13] = o, e[14] = s;
  } else
    e[0] = t[0], e[1] = t[4], e[2] = t[8], e[3] = t[12], e[4] = t[1], e[5] = t[5], e[6] = t[9], e[7] = t[13], e[8] = t[2], e[9] = t[6], e[10] = t[10], e[11] = t[14], e[12] = t[3], e[13] = t[7], e[14] = t[11], e[15] = t[15];
  return e;
};
Oe.invert = function(e, t) {
  var r = t[0], n = t[1], i = t[2], a = t[3], o = t[4], s = t[5], l = t[6], u = t[7], f = t[8], c = t[9], h = t[10], v = t[11], d = t[12], g = t[13], y = t[14], x = t[15], S = r * s - n * o, T = r * l - i * o, C = r * u - a * o, A = n * l - i * s, M = n * u - a * s, E = i * u - a * l, P = f * g - c * d, R = f * y - h * d, O = f * x - v * d, N = c * y - h * g, G = c * x - v * g, z = h * x - v * y, H = S * z - T * G + C * N + A * O - M * R + E * P;
  return H ? (H = 1 / H, e[0] = (s * z - l * G + u * N) * H, e[1] = (i * G - n * z - a * N) * H, e[2] = (g * E - y * M + x * A) * H, e[3] = (h * M - c * E - v * A) * H, e[4] = (l * O - o * z - u * R) * H, e[5] = (r * z - i * O + a * R) * H, e[6] = (y * C - d * E - x * T) * H, e[7] = (f * E - h * C + v * T) * H, e[8] = (o * G - s * O + u * P) * H, e[9] = (n * O - r * G - a * P) * H, e[10] = (d * M - g * C + x * S) * H, e[11] = (c * C - f * M - v * S) * H, e[12] = (s * R - o * N - l * P) * H, e[13] = (r * N - n * R + i * P) * H, e[14] = (g * T - d * A - y * S) * H, e[15] = (f * A - c * T + h * S) * H, e) : null;
};
Oe.adjoint = function(e, t) {
  var r = t[0], n = t[1], i = t[2], a = t[3], o = t[4], s = t[5], l = t[6], u = t[7], f = t[8], c = t[9], h = t[10], v = t[11], d = t[12], g = t[13], y = t[14], x = t[15];
  return e[0] = s * (h * x - v * y) - c * (l * x - u * y) + g * (l * v - u * h), e[1] = -(n * (h * x - v * y) - c * (i * x - a * y) + g * (i * v - a * h)), e[2] = n * (l * x - u * y) - s * (i * x - a * y) + g * (i * u - a * l), e[3] = -(n * (l * v - u * h) - s * (i * v - a * h) + c * (i * u - a * l)), e[4] = -(o * (h * x - v * y) - f * (l * x - u * y) + d * (l * v - u * h)), e[5] = r * (h * x - v * y) - f * (i * x - a * y) + d * (i * v - a * h), e[6] = -(r * (l * x - u * y) - o * (i * x - a * y) + d * (i * u - a * l)), e[7] = r * (l * v - u * h) - o * (i * v - a * h) + f * (i * u - a * l), e[8] = o * (c * x - v * g) - f * (s * x - u * g) + d * (s * v - u * c), e[9] = -(r * (c * x - v * g) - f * (n * x - a * g) + d * (n * v - a * c)), e[10] = r * (s * x - u * g) - o * (n * x - a * g) + d * (n * u - a * s), e[11] = -(r * (s * v - u * c) - o * (n * v - a * c) + f * (n * u - a * s)), e[12] = -(o * (c * y - h * g) - f * (s * y - l * g) + d * (s * h - l * c)), e[13] = r * (c * y - h * g) - f * (n * y - i * g) + d * (n * h - i * c), e[14] = -(r * (s * y - l * g) - o * (n * y - i * g) + d * (n * l - i * s)), e[15] = r * (s * h - l * c) - o * (n * h - i * c) + f * (n * l - i * s), e;
};
Oe.determinant = function(e) {
  var t = e[0], r = e[1], n = e[2], i = e[3], a = e[4], o = e[5], s = e[6], l = e[7], u = e[8], f = e[9], c = e[10], h = e[11], v = e[12], d = e[13], g = e[14], y = e[15], x = t * o - r * a, S = t * s - n * a, T = t * l - i * a, C = r * s - n * o, A = r * l - i * o, M = n * l - i * s, E = u * d - f * v, P = u * g - c * v, R = u * y - h * v, O = f * g - c * d, N = f * y - h * d, G = c * y - h * g;
  return x * G - S * N + T * O + C * R - A * P + M * E;
};
Oe.multiply = function(e, t, r) {
  var n = t[0], i = t[1], a = t[2], o = t[3], s = t[4], l = t[5], u = t[6], f = t[7], c = t[8], h = t[9], v = t[10], d = t[11], g = t[12], y = t[13], x = t[14], S = t[15], T = r[0], C = r[1], A = r[2], M = r[3];
  return e[0] = T * n + C * s + A * c + M * g, e[1] = T * i + C * l + A * h + M * y, e[2] = T * a + C * u + A * v + M * x, e[3] = T * o + C * f + A * d + M * S, T = r[4], C = r[5], A = r[6], M = r[7], e[4] = T * n + C * s + A * c + M * g, e[5] = T * i + C * l + A * h + M * y, e[6] = T * a + C * u + A * v + M * x, e[7] = T * o + C * f + A * d + M * S, T = r[8], C = r[9], A = r[10], M = r[11], e[8] = T * n + C * s + A * c + M * g, e[9] = T * i + C * l + A * h + M * y, e[10] = T * a + C * u + A * v + M * x, e[11] = T * o + C * f + A * d + M * S, T = r[12], C = r[13], A = r[14], M = r[15], e[12] = T * n + C * s + A * c + M * g, e[13] = T * i + C * l + A * h + M * y, e[14] = T * a + C * u + A * v + M * x, e[15] = T * o + C * f + A * d + M * S, e;
};
Oe.multiplyAffine = function(e, t, r) {
  var n = t[0], i = t[1], a = t[2], o = t[4], s = t[5], l = t[6], u = t[8], f = t[9], c = t[10], h = t[12], v = t[13], d = t[14], g = r[0], y = r[1], x = r[2];
  return e[0] = g * n + y * o + x * u, e[1] = g * i + y * s + x * f, e[2] = g * a + y * l + x * c, g = r[4], y = r[5], x = r[6], e[4] = g * n + y * o + x * u, e[5] = g * i + y * s + x * f, e[6] = g * a + y * l + x * c, g = r[8], y = r[9], x = r[10], e[8] = g * n + y * o + x * u, e[9] = g * i + y * s + x * f, e[10] = g * a + y * l + x * c, g = r[12], y = r[13], x = r[14], e[12] = g * n + y * o + x * u + h, e[13] = g * i + y * s + x * f + v, e[14] = g * a + y * l + x * c + d, e;
};
Oe.mul = Oe.multiply;
Oe.mulAffine = Oe.multiplyAffine;
Oe.translate = function(e, t, r) {
  var n = r[0], i = r[1], a = r[2], o, s, l, u, f, c, h, v, d, g, y, x;
  return t === e ? (e[12] = t[0] * n + t[4] * i + t[8] * a + t[12], e[13] = t[1] * n + t[5] * i + t[9] * a + t[13], e[14] = t[2] * n + t[6] * i + t[10] * a + t[14], e[15] = t[3] * n + t[7] * i + t[11] * a + t[15]) : (o = t[0], s = t[1], l = t[2], u = t[3], f = t[4], c = t[5], h = t[6], v = t[7], d = t[8], g = t[9], y = t[10], x = t[11], e[0] = o, e[1] = s, e[2] = l, e[3] = u, e[4] = f, e[5] = c, e[6] = h, e[7] = v, e[8] = d, e[9] = g, e[10] = y, e[11] = x, e[12] = o * n + f * i + d * a + t[12], e[13] = s * n + c * i + g * a + t[13], e[14] = l * n + h * i + y * a + t[14], e[15] = u * n + v * i + x * a + t[15]), e;
};
Oe.scale = function(e, t, r) {
  var n = r[0], i = r[1], a = r[2];
  return e[0] = t[0] * n, e[1] = t[1] * n, e[2] = t[2] * n, e[3] = t[3] * n, e[4] = t[4] * i, e[5] = t[5] * i, e[6] = t[6] * i, e[7] = t[7] * i, e[8] = t[8] * a, e[9] = t[9] * a, e[10] = t[10] * a, e[11] = t[11] * a, e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15], e;
};
Oe.rotate = function(e, t, r, n) {
  var i = n[0], a = n[1], o = n[2], s = Math.sqrt(i * i + a * a + o * o), l, u, f, c, h, v, d, g, y, x, S, T, C, A, M, E, P, R, O, N, G, z, H, W;
  return Math.abs(s) < I2 ? null : (s = 1 / s, i *= s, a *= s, o *= s, l = Math.sin(r), u = Math.cos(r), f = 1 - u, c = t[0], h = t[1], v = t[2], d = t[3], g = t[4], y = t[5], x = t[6], S = t[7], T = t[8], C = t[9], A = t[10], M = t[11], E = i * i * f + u, P = a * i * f + o * l, R = o * i * f - a * l, O = i * a * f - o * l, N = a * a * f + u, G = o * a * f + i * l, z = i * o * f + a * l, H = a * o * f - i * l, W = o * o * f + u, e[0] = c * E + g * P + T * R, e[1] = h * E + y * P + C * R, e[2] = v * E + x * P + A * R, e[3] = d * E + S * P + M * R, e[4] = c * O + g * N + T * G, e[5] = h * O + y * N + C * G, e[6] = v * O + x * N + A * G, e[7] = d * O + S * N + M * G, e[8] = c * z + g * H + T * W, e[9] = h * z + y * H + C * W, e[10] = v * z + x * H + A * W, e[11] = d * z + S * H + M * W, t !== e && (e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e);
};
Oe.rotateX = function(e, t, r) {
  var n = Math.sin(r), i = Math.cos(r), a = t[4], o = t[5], s = t[6], l = t[7], u = t[8], f = t[9], c = t[10], h = t[11];
  return t !== e && (e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e[4] = a * i + u * n, e[5] = o * i + f * n, e[6] = s * i + c * n, e[7] = l * i + h * n, e[8] = u * i - a * n, e[9] = f * i - o * n, e[10] = c * i - s * n, e[11] = h * i - l * n, e;
};
Oe.rotateY = function(e, t, r) {
  var n = Math.sin(r), i = Math.cos(r), a = t[0], o = t[1], s = t[2], l = t[3], u = t[8], f = t[9], c = t[10], h = t[11];
  return t !== e && (e[4] = t[4], e[5] = t[5], e[6] = t[6], e[7] = t[7], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e[0] = a * i - u * n, e[1] = o * i - f * n, e[2] = s * i - c * n, e[3] = l * i - h * n, e[8] = a * n + u * i, e[9] = o * n + f * i, e[10] = s * n + c * i, e[11] = l * n + h * i, e;
};
Oe.rotateZ = function(e, t, r) {
  var n = Math.sin(r), i = Math.cos(r), a = t[0], o = t[1], s = t[2], l = t[3], u = t[4], f = t[5], c = t[6], h = t[7];
  return t !== e && (e[8] = t[8], e[9] = t[9], e[10] = t[10], e[11] = t[11], e[12] = t[12], e[13] = t[13], e[14] = t[14], e[15] = t[15]), e[0] = a * i + u * n, e[1] = o * i + f * n, e[2] = s * i + c * n, e[3] = l * i + h * n, e[4] = u * i - a * n, e[5] = f * i - o * n, e[6] = c * i - s * n, e[7] = h * i - l * n, e;
};
Oe.fromRotationTranslation = function(e, t, r) {
  var n = t[0], i = t[1], a = t[2], o = t[3], s = n + n, l = i + i, u = a + a, f = n * s, c = n * l, h = n * u, v = i * l, d = i * u, g = a * u, y = o * s, x = o * l, S = o * u;
  return e[0] = 1 - (v + g), e[1] = c + S, e[2] = h - x, e[3] = 0, e[4] = c - S, e[5] = 1 - (f + g), e[6] = d + y, e[7] = 0, e[8] = h + x, e[9] = d - y, e[10] = 1 - (f + v), e[11] = 0, e[12] = r[0], e[13] = r[1], e[14] = r[2], e[15] = 1, e;
};
Oe.fromQuat = function(e, t) {
  var r = t[0], n = t[1], i = t[2], a = t[3], o = r + r, s = n + n, l = i + i, u = r * o, f = n * o, c = n * s, h = i * o, v = i * s, d = i * l, g = a * o, y = a * s, x = a * l;
  return e[0] = 1 - c - d, e[1] = f + x, e[2] = h - y, e[3] = 0, e[4] = f - x, e[5] = 1 - u - d, e[6] = v + g, e[7] = 0, e[8] = h + y, e[9] = v - g, e[10] = 1 - u - c, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, e;
};
Oe.frustum = function(e, t, r, n, i, a, o) {
  var s = 1 / (r - t), l = 1 / (i - n), u = 1 / (a - o);
  return e[0] = a * 2 * s, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = a * 2 * l, e[6] = 0, e[7] = 0, e[8] = (r + t) * s, e[9] = (i + n) * l, e[10] = (o + a) * u, e[11] = -1, e[12] = 0, e[13] = 0, e[14] = o * a * 2 * u, e[15] = 0, e;
};
Oe.perspective = function(e, t, r, n, i) {
  var a = 1 / Math.tan(t / 2), o = 1 / (n - i);
  return e[0] = a / r, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = a, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = (i + n) * o, e[11] = -1, e[12] = 0, e[13] = 0, e[14] = 2 * i * n * o, e[15] = 0, e;
};
Oe.ortho = function(e, t, r, n, i, a, o) {
  var s = 1 / (t - r), l = 1 / (n - i), u = 1 / (a - o);
  return e[0] = -2 * s, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 0, e[5] = -2 * l, e[6] = 0, e[7] = 0, e[8] = 0, e[9] = 0, e[10] = 2 * u, e[11] = 0, e[12] = (t + r) * s, e[13] = (i + n) * l, e[14] = (o + a) * u, e[15] = 1, e;
};
Oe.lookAt = function(e, t, r, n) {
  var i, a, o, s, l, u, f, c, h, v, d = t[0], g = t[1], y = t[2], x = n[0], S = n[1], T = n[2], C = r[0], A = r[1], M = r[2];
  return Math.abs(d - C) < I2 && Math.abs(g - A) < I2 && Math.abs(y - M) < I2 ? Oe.identity(e) : (f = d - C, c = g - A, h = y - M, v = 1 / Math.sqrt(f * f + c * c + h * h), f *= v, c *= v, h *= v, i = S * h - T * c, a = T * f - x * h, o = x * c - S * f, v = Math.sqrt(i * i + a * a + o * o), v ? (v = 1 / v, i *= v, a *= v, o *= v) : (i = 0, a = 0, o = 0), s = c * o - h * a, l = h * i - f * o, u = f * a - c * i, v = Math.sqrt(s * s + l * l + u * u), v ? (v = 1 / v, s *= v, l *= v, u *= v) : (s = 0, l = 0, u = 0), e[0] = i, e[1] = s, e[2] = f, e[3] = 0, e[4] = a, e[5] = l, e[6] = c, e[7] = 0, e[8] = o, e[9] = u, e[10] = h, e[11] = 0, e[12] = -(i * d + a * g + o * y), e[13] = -(s * d + l * g + u * y), e[14] = -(f * d + c * g + h * y), e[15] = 1, e);
};
Oe.frob = function(e) {
  return Math.sqrt(Math.pow(e[0], 2) + Math.pow(e[1], 2) + Math.pow(e[2], 2) + Math.pow(e[3], 2) + Math.pow(e[4], 2) + Math.pow(e[5], 2) + Math.pow(e[6], 2) + Math.pow(e[7], 2) + Math.pow(e[8], 2) + Math.pow(e[9], 2) + Math.pow(e[10], 2) + Math.pow(e[11], 2) + Math.pow(e[12], 2) + Math.pow(e[13], 2) + Math.pow(e[14], 2) + Math.pow(e[15], 2));
};
var ie = {};
ie.create = function() {
  var e = new Li(3);
  return e[0] = 0, e[1] = 0, e[2] = 0, e;
};
ie.clone = function(e) {
  var t = new Li(3);
  return t[0] = e[0], t[1] = e[1], t[2] = e[2], t;
};
ie.fromValues = function(e, t, r) {
  var n = new Li(3);
  return n[0] = e, n[1] = t, n[2] = r, n;
};
ie.copy = function(e, t) {
  return e[0] = t[0], e[1] = t[1], e[2] = t[2], e;
};
ie.set = function(e, t, r, n) {
  return e[0] = t, e[1] = r, e[2] = n, e;
};
ie.add = function(e, t, r) {
  return e[0] = t[0] + r[0], e[1] = t[1] + r[1], e[2] = t[2] + r[2], e;
};
ie.subtract = function(e, t, r) {
  return e[0] = t[0] - r[0], e[1] = t[1] - r[1], e[2] = t[2] - r[2], e;
};
ie.sub = ie.subtract;
ie.multiply = function(e, t, r) {
  return e[0] = t[0] * r[0], e[1] = t[1] * r[1], e[2] = t[2] * r[2], e;
};
ie.mul = ie.multiply;
ie.divide = function(e, t, r) {
  return e[0] = t[0] / r[0], e[1] = t[1] / r[1], e[2] = t[2] / r[2], e;
};
ie.div = ie.divide;
ie.min = function(e, t, r) {
  return e[0] = Math.min(t[0], r[0]), e[1] = Math.min(t[1], r[1]), e[2] = Math.min(t[2], r[2]), e;
};
ie.max = function(e, t, r) {
  return e[0] = Math.max(t[0], r[0]), e[1] = Math.max(t[1], r[1]), e[2] = Math.max(t[2], r[2]), e;
};
ie.scale = function(e, t, r) {
  return e[0] = t[0] * r, e[1] = t[1] * r, e[2] = t[2] * r, e;
};
ie.scaleAndAdd = function(e, t, r, n) {
  return e[0] = t[0] + r[0] * n, e[1] = t[1] + r[1] * n, e[2] = t[2] + r[2] * n, e;
};
ie.distance = function(e, t) {
  var r = t[0] - e[0], n = t[1] - e[1], i = t[2] - e[2];
  return Math.sqrt(r * r + n * n + i * i);
};
ie.dist = ie.distance;
ie.squaredDistance = function(e, t) {
  var r = t[0] - e[0], n = t[1] - e[1], i = t[2] - e[2];
  return r * r + n * n + i * i;
};
ie.sqrDist = ie.squaredDistance;
ie.length = function(e) {
  var t = e[0], r = e[1], n = e[2];
  return Math.sqrt(t * t + r * r + n * n);
};
ie.len = ie.length;
ie.squaredLength = function(e) {
  var t = e[0], r = e[1], n = e[2];
  return t * t + r * r + n * n;
};
ie.sqrLen = ie.squaredLength;
ie.negate = function(e, t) {
  return e[0] = -t[0], e[1] = -t[1], e[2] = -t[2], e;
};
ie.inverse = function(e, t) {
  return e[0] = 1 / t[0], e[1] = 1 / t[1], e[2] = 1 / t[2], e;
};
ie.normalize = function(e, t) {
  var r = t[0], n = t[1], i = t[2], a = r * r + n * n + i * i;
  return a > 0 && (a = 1 / Math.sqrt(a), e[0] = t[0] * a, e[1] = t[1] * a, e[2] = t[2] * a), e;
};
ie.dot = function(e, t) {
  return e[0] * t[0] + e[1] * t[1] + e[2] * t[2];
};
ie.cross = function(e, t, r) {
  var n = t[0], i = t[1], a = t[2], o = r[0], s = r[1], l = r[2];
  return e[0] = i * l - a * s, e[1] = a * o - n * l, e[2] = n * s - i * o, e;
};
ie.lerp = function(e, t, r, n) {
  var i = t[0], a = t[1], o = t[2];
  return e[0] = i + n * (r[0] - i), e[1] = a + n * (r[1] - a), e[2] = o + n * (r[2] - o), e;
};
ie.random = function(e, t) {
  t = t || 1;
  var r = fm() * 2 * Math.PI, n = fm() * 2 - 1, i = Math.sqrt(1 - n * n) * t;
  return e[0] = Math.cos(r) * i, e[1] = Math.sin(r) * i, e[2] = n * t, e;
};
ie.transformMat4 = function(e, t, r) {
  var n = t[0], i = t[1], a = t[2], o = r[3] * n + r[7] * i + r[11] * a + r[15];
  return o = o || 1, e[0] = (r[0] * n + r[4] * i + r[8] * a + r[12]) / o, e[1] = (r[1] * n + r[5] * i + r[9] * a + r[13]) / o, e[2] = (r[2] * n + r[6] * i + r[10] * a + r[14]) / o, e;
};
ie.transformMat3 = function(e, t, r) {
  var n = t[0], i = t[1], a = t[2];
  return e[0] = n * r[0] + i * r[3] + a * r[6], e[1] = n * r[1] + i * r[4] + a * r[7], e[2] = n * r[2] + i * r[5] + a * r[8], e;
};
ie.transformQuat = function(e, t, r) {
  var n = t[0], i = t[1], a = t[2], o = r[0], s = r[1], l = r[2], u = r[3], f = u * n + s * a - l * i, c = u * i + l * n - o * a, h = u * a + o * i - s * n, v = -o * n - s * i - l * a;
  return e[0] = f * u + v * -o + c * -l - h * -s, e[1] = c * u + v * -s + h * -o - f * -l, e[2] = h * u + v * -l + f * -s - c * -o, e;
};
ie.rotateX = function(e, t, r, n) {
  var i = [], a = [];
  return i[0] = t[0] - r[0], i[1] = t[1] - r[1], i[2] = t[2] - r[2], a[0] = i[0], a[1] = i[1] * Math.cos(n) - i[2] * Math.sin(n), a[2] = i[1] * Math.sin(n) + i[2] * Math.cos(n), e[0] = a[0] + r[0], e[1] = a[1] + r[1], e[2] = a[2] + r[2], e;
};
ie.rotateY = function(e, t, r, n) {
  var i = [], a = [];
  return i[0] = t[0] - r[0], i[1] = t[1] - r[1], i[2] = t[2] - r[2], a[0] = i[2] * Math.sin(n) + i[0] * Math.cos(n), a[1] = i[1], a[2] = i[2] * Math.cos(n) - i[0] * Math.sin(n), e[0] = a[0] + r[0], e[1] = a[1] + r[1], e[2] = a[2] + r[2], e;
};
ie.rotateZ = function(e, t, r, n) {
  var i = [], a = [];
  return i[0] = t[0] - r[0], i[1] = t[1] - r[1], i[2] = t[2] - r[2], a[0] = i[0] * Math.cos(n) - i[1] * Math.sin(n), a[1] = i[0] * Math.sin(n) + i[1] * Math.cos(n), a[2] = i[2], e[0] = a[0] + r[0], e[1] = a[1] + r[1], e[2] = a[2] + r[2], e;
};
ie.forEach = (function() {
  var e = ie.create();
  return function(t, r, n, i, a, o) {
    var s, l;
    for (r || (r = 3), n || (n = 0), i ? l = Math.min(i * r + n, t.length) : l = t.length, s = n; s < l; s += r)
      e[0] = t[s], e[1] = t[s + 1], e[2] = t[s + 2], a(e, e, o), t[s] = e[0], t[s + 1] = e[1], t[s + 2] = e[2];
    return t;
  };
})();
ie.angle = function(e, t) {
  var r = ie.fromValues(e[0], e[1], e[2]), n = ie.fromValues(t[0], t[1], t[2]);
  ie.normalize(r, r), ie.normalize(n, n);
  var i = ie.dot(r, n);
  return i > 1 ? 0 : Math.acos(i);
};
Ze.import(xY);
var qr = Oe.create, IV = {};
function RV(e) {
  return e.material;
}
function M_e(e, t, r) {
  return t.uniforms[r].value;
}
function L_e(e, t, r, n) {
  return r !== n;
}
function D_e(e) {
  return !0;
}
function OV() {
}
var NV = {
  float: Ee.FLOAT,
  byte: Ee.BYTE,
  ubyte: Ee.UNSIGNED_BYTE,
  short: Ee.SHORT,
  ushort: Ee.UNSIGNED_SHORT
};
function E_e(e, t, r) {
  this.availableAttributes = e, this.availableAttributeSymbols = t, this.indicesBuffer = r, this.vao = null;
}
function P_e(e) {
  var t, r;
  this.bind = function(n) {
    t || (t = pr.createCanvas(), t.width = t.height = 1, t.getContext("2d"));
    var i = n.gl, a = !r;
    a && (r = i.createTexture()), i.bindTexture(i.TEXTURE_2D, r), a && i.texImage2D(i.TEXTURE_2D, 0, i.RGBA, i.RGBA, i.UNSIGNED_BYTE, t);
  }, this.unbind = function(n) {
    n.gl.bindTexture(n.gl.TEXTURE_2D, null);
  }, this.isRenderable = function() {
    return !0;
  };
}
var us = Mi.extend(
  function() {
    return (
      /** @lends clay.Renderer# */
      {
        /**
         * @type {HTMLCanvasElement}
         * @readonly
         */
        canvas: null,
        /**
         * Canvas width, set by resize method
         * @type {number}
         * @private
         */
        _width: 100,
        /**
         * Canvas width, set by resize method
         * @type {number}
         * @private
         */
        _height: 100,
        /**
         * Device pixel ratio, set by setDevicePixelRatio method
         * Specially for high defination display
         * @see http://www.khronos.org/webgl/wiki/HandlingHighDPI
         * @type {number}
         * @private
         */
        devicePixelRatio: typeof window < "u" && window.devicePixelRatio || 1,
        /**
         * Clear color
         * @type {number[]}
         */
        clearColor: [0, 0, 0, 0],
        /**
         * Default:
         *     _gl.COLOR_BUFFER_BIT | _gl.DEPTH_BUFFER_BIT | _gl.STENCIL_BUFFER_BIT
         * @type {number}
         */
        clearBit: 17664,
        // Settings when getting context
        // http://www.khronos.org/registry/webgl/specs/latest/#2.4
        /**
         * If enable alpha, default true
         * @type {boolean}
         */
        alpha: !0,
        /**
         * If enable depth buffer, default true
         * @type {boolean}
         */
        depth: !0,
        /**
         * If enable stencil buffer, default false
         * @type {boolean}
         */
        stencil: !1,
        /**
         * If enable antialias, default true
         * @type {boolean}
         */
        antialias: !0,
        /**
         * If enable premultiplied alpha, default true
         * @type {boolean}
         */
        premultipliedAlpha: !0,
        /**
         * If preserve drawing buffer, default false
         * @type {boolean}
         */
        preserveDrawingBuffer: !1,
        /**
         * If throw context error, usually turned on in debug mode
         * @type {boolean}
         */
        throwError: !0,
        /**
         * WebGL Context created from given canvas
         * @type {WebGLRenderingContext}
         */
        gl: null,
        /**
         * Renderer viewport, read-only, can be set by setViewport method
         * @type {Object}
         */
        viewport: {},
        /**
         * Max joint number
         * @type {number}
         */
        maxJointNumber: 20,
        // Set by FrameBuffer#bind
        __currentFrameBuffer: null,
        _viewportStack: [],
        _clearStack: [],
        _sceneRendering: null
      }
    );
  },
  function() {
    this.canvas || (this.canvas = pr.createCanvas());
    var e = this.canvas;
    try {
      var t = {
        alpha: this.alpha,
        depth: this.depth,
        stencil: this.stencil,
        antialias: this.antialias,
        premultipliedAlpha: this.premultipliedAlpha,
        preserveDrawingBuffer: this.preserveDrawingBuffer
      };
      if (this.gl = e.getContext("webgl", t) || e.getContext("experimental-webgl", t), !this.gl)
        throw new Error();
      this._glinfo = new u_e(this.gl), this.gl.targetRenderer && console.error("Already created a renderer"), this.gl.targetRenderer = this, this.resize();
    } catch (r) {
      throw "Error creating WebGL Context " + r;
    }
    this._programMgr = new gY(this), this._placeholderTexture = new P_e();
  },
  /** @lends clay.Renderer.prototype. **/
  {
    /**
     * Resize the canvas
     * @param {number} width
     * @param {number} height
     */
    resize: function(e, t) {
      var r = this.canvas, n = this.devicePixelRatio;
      e != null ? (r.style && (r.style.width = e + "px", r.style.height = t + "px"), r.width = e * n, r.height = t * n, this._width = e, this._height = t) : (this._width = r.width / n, this._height = r.height / n), this.setViewport(0, 0, this._width, this._height);
    },
    /**
     * Get renderer width
     * @return {number}
     */
    getWidth: function() {
      return this._width;
    },
    /**
     * Get renderer height
     * @return {number}
     */
    getHeight: function() {
      return this._height;
    },
    /**
     * Get viewport aspect,
     * @return {number}
     */
    getViewportAspect: function() {
      var e = this.viewport;
      return e.width / e.height;
    },
    /**
     * Set devicePixelRatio
     * @param {number} devicePixelRatio
     */
    setDevicePixelRatio: function(e) {
      this.devicePixelRatio = e, this.resize(this._width, this._height);
    },
    /**
     * Get devicePixelRatio
     * @param {number} devicePixelRatio
     */
    getDevicePixelRatio: function() {
      return this.devicePixelRatio;
    },
    /**
     * Get WebGL extension
     * @param {string} name
     * @return {object}
     */
    getGLExtension: function(e) {
      return this._glinfo.getExtension(e);
    },
    /**
     * Get WebGL parameter
     * @param {string} name
     * @return {*}
     */
    getGLParameter: function(e) {
      return this._glinfo.getParameter(e);
    },
    /**
     * Set rendering viewport
     * @param {number|Object} x
     * @param {number} [y]
     * @param {number} [width]
     * @param {number} [height]
     * @param {number} [devicePixelRatio]
     *        Defaultly use the renderere devicePixelRatio
     *        It needs to be 1 when setViewport is called by frameBuffer
     *
     * @example
     *  setViewport(0,0,width,height,1)
     *  setViewport({
     *      x: 0,
     *      y: 0,
     *      width: width,
     *      height: height,
     *      devicePixelRatio: 1
     *  })
     */
    setViewport: function(e, t, r, n, i) {
      if (typeof e == "object") {
        var a = e;
        e = a.x, t = a.y, r = a.width, n = a.height, i = a.devicePixelRatio;
      }
      i = i || this.devicePixelRatio, this.gl.viewport(
        e * i,
        t * i,
        r * i,
        n * i
      ), this.viewport = {
        x: e,
        y: t,
        width: r,
        height: n,
        devicePixelRatio: i
      };
    },
    /**
     * Push current viewport into a stack
     */
    saveViewport: function() {
      this._viewportStack.push(this.viewport);
    },
    /**
     * Pop viewport from stack, restore in the renderer
     */
    restoreViewport: function() {
      this._viewportStack.length > 0 && this.setViewport(this._viewportStack.pop());
    },
    /**
     * Push current clear into a stack
     */
    saveClear: function() {
      this._clearStack.push({
        clearBit: this.clearBit,
        clearColor: this.clearColor
      });
    },
    /**
     * Pop clear from stack, restore in the renderer
     */
    restoreClear: function() {
      if (this._clearStack.length > 0) {
        var e = this._clearStack.pop();
        this.clearColor = e.clearColor, this.clearBit = e.clearBit;
      }
    },
    bindSceneRendering: function(e) {
      this._sceneRendering = e;
    },
    /**
     * Render the scene in camera to the screen or binded offline framebuffer
     * @param  {clay.Scene}       scene
     * @param  {clay.Camera}      camera
     * @param  {boolean}     [notUpdateScene] If not call the scene.update methods in the rendering, default true
     * @param  {boolean}     [preZ]           If use preZ optimization, default false
     * @return {IRenderInfo}
     */
    render: function(e, t, r, n) {
      var i = this.gl, a = this.clearColor;
      if (this.clearBit) {
        i.colorMask(!0, !0, !0, !0), i.depthMask(!0);
        var o = this.viewport, s = !1, l = o.devicePixelRatio;
        (o.width !== this._width || o.height !== this._height || l && l !== this.devicePixelRatio || o.x || o.y) && (s = !0, i.enable(i.SCISSOR_TEST), i.scissor(o.x * l, o.y * l, o.width * l, o.height * l)), i.clearColor(a[0], a[1], a[2], a[3]), i.clear(this.clearBit), s && i.disable(i.SCISSOR_TEST);
      }
      if (r || e.update(!1), e.updateLights(), t = t || e.getMainCamera(), !t) {
        console.error("Can't find camera in the scene.");
        return;
      }
      t.update();
      var u = e.updateRenderList(t, !0);
      this._sceneRendering = e;
      var f = u.opaque, c = u.transparent, h = e.material;
      e.trigger("beforerender", this, e, t, u), n ? (this.renderPreZ(f, e, t), i.depthFunc(i.LEQUAL)) : i.depthFunc(i.LESS);
      for (var v = qr(), d = ie.create(), g = 0; g < c.length; g++) {
        var y = c[g];
        Oe.multiplyAffine(v, t.viewMatrix.array, y.worldTransform.array), ie.transformMat4(d, y.position.array, v), y.__depth = d[2];
      }
      this.renderPass(f, t, {
        getMaterial: function(x) {
          return h || x.material;
        },
        sortCompare: this.opaqueSortCompare
      }), this.renderPass(c, t, {
        getMaterial: function(x) {
          return h || x.material;
        },
        sortCompare: this.transparentSortCompare
      }), e.trigger("afterrender", this, e, t, u), this._sceneRendering = null;
    },
    getProgram: function(e, t, r) {
      return t = t || e.material, this._programMgr.getProgram(e, t, r);
    },
    validateProgram: function(e) {
      if (e.__error) {
        var t = e.__error;
        if (IV[e.__uid__])
          return;
        if (IV[e.__uid__] = !0, this.throwError)
          throw new Error(t);
        this.trigger("error", t);
      }
    },
    updatePrograms: function(e, t, r) {
      var n = r && r.getMaterial || RV;
      t = t || null;
      for (var i = 0; i < e.length; i++) {
        var a = e[i], o = n.call(this, a);
        if (i > 0) {
          var s = e[i - 1], l = s.joints ? s.joints.length : 0, u = a.joints ? a.joints.length : 0;
          if (u === l && a.material === s.material && a.lightGroup === s.lightGroup) {
            a.__program = s.__program;
            continue;
          }
        }
        var f = this._programMgr.getProgram(a, o, t);
        this.validateProgram(f), a.__program = f;
      }
    },
    /**
     * Render a single renderable list in camera in sequence
     * @param {clay.Renderable[]} list List of all renderables.
     * @param {clay.Camera} [camera] Camera provide view matrix and porjection matrix. It can be null.
     * @param {Object} [passConfig]
     * @param {Function} [passConfig.getMaterial] Get renderable material.
     * @param {Function} [passConfig.getUniform] Get material uniform value.
     * @param {Function} [passConfig.isMaterialChanged] If material changed.
     * @param {Function} [passConfig.beforeRender] Before render each renderable.
     * @param {Function} [passConfig.afterRender] After render each renderable
     * @param {Function} [passConfig.ifRender] If render the renderable.
     * @param {Function} [passConfig.sortCompare] Sort compare function.
     * @return {IRenderInfo}
     */
    renderPass: function(e, t, r) {
      this.trigger("beforerenderpass", this, e, t, r), r = r || {}, r.getMaterial = r.getMaterial || RV, r.getUniform = r.getUniform || M_e, r.isMaterialChanged = r.isMaterialChanged || L_e, r.beforeRender = r.beforeRender || OV, r.afterRender = r.afterRender || OV;
      var n = r.ifRender || D_e;
      this.updatePrograms(e, this._sceneRendering, r), r.sortCompare && e.sort(r.sortCompare);
      var i = this.viewport, a = i.devicePixelRatio, o = [
        i.x * a,
        i.y * a,
        i.width * a,
        i.height * a
      ], s = this.devicePixelRatio, l = this.__currentFrameBuffer ? [this.__currentFrameBuffer.getTextureWidth(), this.__currentFrameBuffer.getTextureHeight()] : [this._width * s, this._height * s], u = [
        o[2],
        o[3]
      ], f = Date.now();
      t ? (Oe.copy($r.VIEW, t.viewMatrix.array), Oe.copy($r.PROJECTION, t.projectionMatrix.array), Oe.copy($r.VIEWINVERSE, t.worldTransform.array)) : (Oe.identity($r.VIEW), Oe.identity($r.PROJECTION), Oe.identity($r.VIEWINVERSE)), Oe.multiply($r.VIEWPROJECTION, $r.PROJECTION, $r.VIEW), Oe.invert($r.PROJECTIONINVERSE, $r.PROJECTION), Oe.invert($r.VIEWPROJECTIONINVERSE, $r.VIEWPROJECTION);
      for (var c = this.gl, h = this._sceneRendering, v, d, g, y, x, S, T, C, A, M, E, P, R = null, O = 0; O < e.length; O++) {
        var N = e[O], G = N.worldTransform != null, z;
        if (n(N)) {
          G && (z = N.isSkinnedMesh && N.isSkinnedMesh() ? N.offsetMatrix ? N.offsetMatrix.array : $r.IDENTITY : N.worldTransform.array);
          var H = N.geometry, W = r.getMaterial.call(this, N), Z = N.__program, ee = W.shader, V = H.__uid__ + "-" + Z.__uid__, Q = V !== M;
          M = V, G && (Oe.copy($r.WORLD, z), Oe.multiply($r.WORLDVIEWPROJECTION, $r.VIEWPROJECTION, z), Oe.multiplyAffine($r.WORLDVIEW, $r.VIEW, z), (ee.matrixSemantics.WORLDINVERSE || ee.matrixSemantics.WORLDINVERSETRANSPOSE) && Oe.invert($r.WORLDINVERSE, z), (ee.matrixSemantics.WORLDVIEWINVERSE || ee.matrixSemantics.WORLDVIEWINVERSETRANSPOSE) && Oe.invert($r.WORLDVIEWINVERSE, $r.WORLDVIEW), (ee.matrixSemantics.WORLDVIEWPROJECTIONINVERSE || ee.matrixSemantics.WORLDVIEWPROJECTIONINVERSETRANSPOSE) && Oe.invert($r.WORLDVIEWPROJECTIONINVERSE, $r.WORLDVIEWPROJECTION)), N.beforeRender && N.beforeRender(this), r.beforeRender.call(this, N, W, v);
          var q = Z !== d;
          q ? (Z.bind(this), Z.setUniformOfSemantic(c, "VIEWPORT", o), Z.setUniformOfSemantic(c, "WINDOW_SIZE", l), t && (Z.setUniformOfSemantic(c, "NEAR", t.near), Z.setUniformOfSemantic(c, "FAR", t.far)), Z.setUniformOfSemantic(c, "DEVICEPIXELRATIO", a), Z.setUniformOfSemantic(c, "TIME", f), Z.setUniformOfSemantic(c, "VIEWPORT_SIZE", u), h && h.setLightUniforms(Z, N.lightGroup, this)) : Z = d, (q || r.isMaterialChanged(
            N,
            g,
            W,
            v
          )) && (W.depthTest !== y && (W.depthTest ? c.enable(c.DEPTH_TEST) : c.disable(c.DEPTH_TEST), y = W.depthTest), W.depthMask !== x && (c.depthMask(W.depthMask), x = W.depthMask), W.transparent !== A && (W.transparent ? c.enable(c.BLEND) : c.disable(c.BLEND), A = W.transparent), W.transparent && (W.blend ? W.blend(c) : (c.blendEquationSeparate(c.FUNC_ADD, c.FUNC_ADD), c.blendFuncSeparate(c.SRC_ALPHA, c.ONE_MINUS_SRC_ALPHA, c.ONE, c.ONE_MINUS_SRC_ALPHA))), P = this._bindMaterial(
            N,
            W,
            Z,
            g || null,
            v || null,
            d || null,
            r.getUniform
          ), v = W);
          var X = ee.matrixSemanticKeys;
          if (G)
            for (var K = 0; K < X.length; K++) {
              var ue = X[K], oe = ee.matrixSemantics[ue], te = $r[ue];
              if (oe.isTranspose) {
                var pe = $r[oe.semanticNoTranspose];
                Oe.transpose(te, pe);
              }
              Z.setUniform(c, oe.type, oe.symbol, te);
            }
          N.cullFace !== T && (T = N.cullFace, c.cullFace(T)), N.frontFace !== C && (C = N.frontFace, c.frontFace(C)), N.culling !== S && (S = N.culling, S ? c.enable(c.CULL_FACE) : c.disable(c.CULL_FACE)), this._updateSkeleton(N, Z, P), Q && (E = this._bindVAO(R, ee, H, Z)), this._renderObject(N, E, Z), r.afterRender(this, N), N.afterRender && N.afterRender(this), d = Z, g = N;
        }
      }
      this.trigger("afterrenderpass", this, e, t, r);
    },
    getMaxJointNumber: function() {
      return this.maxJointNumber;
    },
    _updateSkeleton: function(e, t, r) {
      var n = this.gl, i = e.skeleton;
      if (i)
        if (i.update(), e.joints.length > this.getMaxJointNumber()) {
          var a = i.getSubSkinMatricesTexture(e.__uid__, e.joints);
          t.useTextureSlot(this, a, r), t.setUniform(n, "1i", "skinMatricesTexture", r), t.setUniform(n, "1f", "skinMatricesTextureSize", a.width);
        } else {
          var o = i.getSubSkinMatrices(e.__uid__, e.joints);
          t.setUniformOfSemantic(n, "SKIN_MATRIX", o);
        }
    },
    _renderObject: function(e, t, r) {
      var n = this.gl, i = e.geometry, a = e.mode;
      a == null && (a = 4);
      var o = null, s = e.isInstancedMesh && e.isInstancedMesh();
      if (s && (o = this.getGLExtension("ANGLE_instanced_arrays"), !o)) {
        console.warn("Device not support ANGLE_instanced_arrays extension");
        return;
      }
      var l;
      if (s && (l = this._bindInstancedAttributes(e, r, o)), t.indicesBuffer) {
        var u = this.getGLExtension("OES_element_index_uint"), f = u && i.indices instanceof Uint32Array, c = f ? n.UNSIGNED_INT : n.UNSIGNED_SHORT;
        s ? o.drawElementsInstancedANGLE(
          a,
          t.indicesBuffer.count,
          c,
          0,
          e.getInstanceCount()
        ) : n.drawElements(a, t.indicesBuffer.count, c, 0);
      } else
        s ? o.drawArraysInstancedANGLE(a, 0, i.vertexCount, e.getInstanceCount()) : n.drawArrays(a, 0, i.vertexCount);
      if (s)
        for (var h = 0; h < l.length; h++)
          n.disableVertexAttribArray(l[h]);
    },
    _bindInstancedAttributes: function(e, t, r) {
      for (var n = this.gl, i = e.getInstancedAttributesBuffers(this), a = [], o = 0; o < i.length; o++) {
        var s = i[o], l = t.getAttribLocation(n, s.symbol);
        if (!(l < 0)) {
          var u = NV[s.type] || n.FLOAT;
          n.enableVertexAttribArray(l), n.bindBuffer(n.ARRAY_BUFFER, s.buffer), n.vertexAttribPointer(l, s.size, u, !1, 0, 0), r.vertexAttribDivisorANGLE(l, s.divisor), a.push(l);
        }
      }
      return a;
    },
    _bindMaterial: function(e, t, r, n, i, a, o) {
      for (var s = this.gl, l = a === r, u = r.currentTextureSlot(), f = t.getEnabledUniforms(), c = t.getTextureUniforms(), h = this._placeholderTexture, v = 0; v < c.length; v++) {
        var d = c[v], g = o(e, t, d), y = t.uniforms[d].type;
        if (y === "t" && g)
          g.__slot = -1;
        else if (y === "tv")
          for (var x = 0; x < g.length; x++)
            g[x] && (g[x].__slot = -1);
      }
      h.__slot = -1;
      for (var v = 0; v < f.length; v++) {
        var d = f[v], S = t.uniforms[d], g = o(e, t, d), y = S.type, T = y === "t";
        if (T && (!g || !g.isRenderable()) && (g = h), i && l) {
          var C = o(n, i, d);
          if (T && (!C || !C.isRenderable()) && (C = h), C === g) {
            if (T)
              r.takeCurrentTextureSlot(this, null);
            else if (y === "tv" && g)
              for (var x = 0; x < g.length; x++)
                r.takeCurrentTextureSlot(this, null);
            continue;
          }
        }
        if (g != null)
          if (T)
            if (g.__slot < 0) {
              var A = r.currentTextureSlot(), M = r.setUniform(s, "1i", d, A);
              M && (r.takeCurrentTextureSlot(this, g), g.__slot = A);
            } else
              r.setUniform(s, "1i", d, g.__slot);
          else if (Array.isArray(g)) {
            if (g.length === 0)
              continue;
            if (y === "tv") {
              if (!r.hasUniform(d))
                continue;
              for (var E = [], x = 0; x < g.length; x++) {
                var P = g[x];
                if (P.__slot < 0) {
                  var A = r.currentTextureSlot();
                  E.push(A), r.takeCurrentTextureSlot(this, P), P.__slot = A;
                } else
                  E.push(P.__slot);
              }
              r.setUniform(s, "1iv", d, E);
            } else
              r.setUniform(s, S.type, d, g);
          } else
            r.setUniform(s, S.type, d, g);
      }
      var R = r.currentTextureSlot();
      return r.resetTextureSlot(u), R;
    },
    _bindVAO: function(e, t, r, n) {
      var i = !r.dynamic, a = this.gl, o = this.__uid__ + "-" + n.__uid__, s = r.__vaoCache[o];
      if (!s) {
        var l = r.getBufferChunks(this);
        if (!l || !l.length)
          return;
        for (var u = l[0], f = u.attributeBuffers, C = u.indicesBuffer, T = [], c = [], h = 0; h < f.length; h++) {
          var v = f[h], d = v.name, g = v.semantic, y;
          if (g) {
            var x = t.attributeSemantics[g];
            y = x && x.symbol;
          } else
            y = d;
          y && n.attributes[y] && (T.push(v), c.push(y));
        }
        s = new E_e(
          T,
          c,
          C
        ), i && (r.__vaoCache[o] = s);
      }
      var S = !0;
      e && i && (s.vao == null ? s.vao = e.createVertexArrayOES() : S = !1, e.bindVertexArrayOES(s.vao));
      var T = s.availableAttributes, C = s.indicesBuffer;
      if (S) {
        for (var A = n.enableAttributes(this, s.availableAttributeSymbols, e && i && s), h = 0; h < T.length; h++) {
          var M = A[h];
          if (M !== -1) {
            var v = T[h], E = v.buffer, P = v.size, R = NV[v.type] || a.FLOAT;
            a.bindBuffer(a.ARRAY_BUFFER, E), a.vertexAttribPointer(M, P, R, !1, 0, 0);
          }
        }
        r.isUseIndices() && a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, C.buffer);
      }
      return s;
    },
    renderPreZ: function(e, t, r) {
      var n = this.gl, i = this._prezMaterial || new ls({
        shader: new Ze(Ze.source("clay.prez.vertex"), Ze.source("clay.prez.fragment"))
      });
      this._prezMaterial = i, n.colorMask(!1, !1, !1, !1), n.depthMask(!0), this.renderPass(e, r, {
        ifRender: function(a) {
          return !a.ignorePreZ;
        },
        isMaterialChanged: function(a, o) {
          var s = a.material, l = o.material;
          return s.get("diffuseMap") !== l.get("diffuseMap") || (s.get("alphaCutoff") || 0) !== (l.get("alphaCutoff") || 0);
        },
        getUniform: function(a, o, s) {
          if (s === "alphaMap")
            return a.material.get("diffuseMap");
          if (s === "alphaCutoff") {
            if (a.material.isDefined("fragment", "ALPHA_TEST") && a.material.get("diffuseMap")) {
              var l = a.material.get("alphaCutoff");
              return l || 0;
            }
            return 0;
          } else return s === "uvRepeat" ? a.material.get("uvRepeat") : s === "uvOffset" ? a.material.get("uvOffset") : o.get(s);
        },
        getMaterial: function() {
          return i;
        },
        sort: this.opaqueSortCompare
      }), n.colorMask(!0, !0, !0, !0), n.depthMask(!0);
    },
    /**
     * Dispose given scene, including all geometris, textures and shaders in the scene
     * @param {clay.Scene} scene
     */
    disposeScene: function(e) {
      this.disposeNode(e, !0, !0), e.dispose();
    },
    /**
     * Dispose given node, including all geometries, textures and shaders attached on it or its descendant
     * @param {clay.Node} node
     * @param {boolean} [disposeGeometry=false] If dispose the geometries used in the descendant mesh
     * @param {boolean} [disposeTexture=false] If dispose the textures used in the descendant mesh
     */
    disposeNode: function(e, t, r) {
      e.getParent() && e.getParent().remove(e);
      var n = {};
      e.traverse(function(i) {
        var a = i.material;
        if (i.geometry && t && i.geometry.dispose(this), r && a && !n[a.__uid__]) {
          for (var o = a.getTextureUniforms(), s = 0; s < o.length; s++) {
            var l = o[s], u = a.uniforms[l].value, f = a.uniforms[l].type;
            if (u) {
              if (f === "t")
                u.dispose && u.dispose(this);
              else if (f === "tv")
                for (var c = 0; c < u.length; c++)
                  u[c] && u[c].dispose && u[c].dispose(this);
            }
          }
          n[a.__uid__] = !0;
        }
        i.dispose && i.dispose(this);
      }, this);
    },
    /**
     * Dispose given geometry
     * @param {clay.Geometry} geometry
     */
    disposeGeometry: function(e) {
      e.dispose(this);
    },
    /**
     * Dispose given texture
     * @param {clay.Texture} texture
     */
    disposeTexture: function(e) {
      e.dispose(this);
    },
    /**
     * Dispose given frame buffer
     * @param {clay.FrameBuffer} frameBuffer
     */
    disposeFrameBuffer: function(e) {
      e.dispose(this);
    },
    /**
     * Dispose renderer
     */
    dispose: function() {
    },
    /**
     * Convert screen coords to normalized device coordinates(NDC)
     * Screen coords can get from mouse event, it is positioned relative to canvas element
     * NDC can be used in ray casting with Camera.prototype.castRay methods
     *
     * @param  {number}       x
     * @param  {number}       y
     * @param  {clay.Vector2} [out]
     * @return {clay.Vector2}
     */
    screenToNDC: function(e, t, r) {
      r || (r = new Pt()), t = this._height - t;
      var n = this.viewport, i = r.array;
      return i[0] = (e - n.x) / n.width, i[0] = i[0] * 2 - 1, i[1] = (t - n.y) / n.height, i[1] = i[1] * 2 - 1, r;
    }
  }
);
us.opaqueSortCompare = us.prototype.opaqueSortCompare = function(e, t) {
  return e.renderOrder === t.renderOrder ? e.__program === t.__program ? e.material === t.material ? e.geometry.__uid__ - t.geometry.__uid__ : e.material.__uid__ - t.material.__uid__ : e.__program && t.__program ? e.__program.__uid__ - t.__program.__uid__ : 0 : e.renderOrder - t.renderOrder;
};
us.transparentSortCompare = us.prototype.transparentSortCompare = function(e, t) {
  return e.renderOrder === t.renderOrder ? e.__depth === t.__depth ? e.__program === t.__program ? e.material === t.material ? e.geometry.__uid__ - t.geometry.__uid__ : e.material.__uid__ - t.material.__uid__ : e.__program && t.__program ? e.__program.__uid__ - t.__program.__uid__ : 0 : e.__depth - t.__depth : e.renderOrder - t.renderOrder;
};
var $r = {
  IDENTITY: qr(),
  WORLD: qr(),
  VIEW: qr(),
  PROJECTION: qr(),
  WORLDVIEW: qr(),
  VIEWPROJECTION: qr(),
  WORLDVIEWPROJECTION: qr(),
  WORLDINVERSE: qr(),
  VIEWINVERSE: qr(),
  PROJECTIONINVERSE: qr(),
  WORLDVIEWINVERSE: qr(),
  VIEWPROJECTIONINVERSE: qr(),
  WORLDVIEWPROJECTIONINVERSE: qr(),
  WORLDTRANSPOSE: qr(),
  VIEWTRANSPOSE: qr(),
  PROJECTIONTRANSPOSE: qr(),
  WORLDVIEWTRANSPOSE: qr(),
  VIEWPROJECTIONTRANSPOSE: qr(),
  WORLDVIEWPROJECTIONTRANSPOSE: qr(),
  WORLDINVERSETRANSPOSE: qr(),
  VIEWINVERSETRANSPOSE: qr(),
  PROJECTIONINVERSETRANSPOSE: qr(),
  WORLDVIEWINVERSETRANSPOSE: qr(),
  VIEWPROJECTIONINVERSETRANSPOSE: qr(),
  WORLDVIEWPROJECTIONINVERSETRANSPOSE: qr()
};
us.COLOR_BUFFER_BIT = Ee.COLOR_BUFFER_BIT;
us.DEPTH_BUFFER_BIT = Ee.DEPTH_BUFFER_BIT;
us.STENCIL_BUFFER_BIT = Ee.STENCIL_BUFFER_BIT;
var Me = function(e, t, r) {
  e = e || 0, t = t || 0, r = r || 0, this.array = ie.fromValues(e, t, r), this._dirty = !0;
};
Me.prototype = {
  constructor: Me,
  /**
   * Add b to self
   * @param  {clay.Vector3} b
   * @return {clay.Vector3}
   */
  add: function(e) {
    return ie.add(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Set x, y and z components
   * @param  {number}  x
   * @param  {number}  y
   * @param  {number}  z
   * @return {clay.Vector3}
   */
  set: function(e, t, r) {
    return this.array[0] = e, this.array[1] = t, this.array[2] = r, this._dirty = !0, this;
  },
  /**
   * Set x, y and z components from array
   * @param  {Float32Array|number[]} arr
   * @return {clay.Vector3}
   */
  setArray: function(e) {
    return this.array[0] = e[0], this.array[1] = e[1], this.array[2] = e[2], this._dirty = !0, this;
  },
  /**
   * Clone a new Vector3
   * @return {clay.Vector3}
   */
  clone: function() {
    return new Me(this.x, this.y, this.z);
  },
  /**
   * Copy from b
   * @param  {clay.Vector3} b
   * @return {clay.Vector3}
   */
  copy: function(e) {
    return ie.copy(this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Cross product of self and b, written to a Vector3 out
   * @param  {clay.Vector3} a
   * @param  {clay.Vector3} b
   * @return {clay.Vector3}
   */
  cross: function(e, t) {
    return ie.cross(this.array, e.array, t.array), this._dirty = !0, this;
  },
  /**
   * Alias for distance
   * @param  {clay.Vector3} b
   * @return {number}
   */
  dist: function(e) {
    return ie.dist(this.array, e.array);
  },
  /**
   * Distance between self and b
   * @param  {clay.Vector3} b
   * @return {number}
   */
  distance: function(e) {
    return ie.distance(this.array, e.array);
  },
  /**
   * Alias for divide
   * @param  {clay.Vector3} b
   * @return {clay.Vector3}
   */
  div: function(e) {
    return ie.div(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Divide self by b
   * @param  {clay.Vector3} b
   * @return {clay.Vector3}
   */
  divide: function(e) {
    return ie.divide(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Dot product of self and b
   * @param  {clay.Vector3} b
   * @return {number}
   */
  dot: function(e) {
    return ie.dot(this.array, e.array);
  },
  /**
   * Alias of length
   * @return {number}
   */
  len: function() {
    return ie.len(this.array);
  },
  /**
   * Calculate the length
   * @return {number}
   */
  length: function() {
    return ie.length(this.array);
  },
  /**
   * Linear interpolation between a and b
   * @param  {clay.Vector3} a
   * @param  {clay.Vector3} b
   * @param  {number}  t
   * @return {clay.Vector3}
   */
  lerp: function(e, t, r) {
    return ie.lerp(this.array, e.array, t.array, r), this._dirty = !0, this;
  },
  /**
   * Minimum of self and b
   * @param  {clay.Vector3} b
   * @return {clay.Vector3}
   */
  min: function(e) {
    return ie.min(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Maximum of self and b
   * @param  {clay.Vector3} b
   * @return {clay.Vector3}
   */
  max: function(e) {
    return ie.max(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Alias for multiply
   * @param  {clay.Vector3} b
   * @return {clay.Vector3}
   */
  mul: function(e) {
    return ie.mul(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Mutiply self and b
   * @param  {clay.Vector3} b
   * @return {clay.Vector3}
   */
  multiply: function(e) {
    return ie.multiply(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Negate self
   * @return {clay.Vector3}
   */
  negate: function() {
    return ie.negate(this.array, this.array), this._dirty = !0, this;
  },
  /**
   * Normalize self
   * @return {clay.Vector3}
   */
  normalize: function() {
    return ie.normalize(this.array, this.array), this._dirty = !0, this;
  },
  /**
   * Generate random x, y, z components with a given scale
   * @param  {number} scale
   * @return {clay.Vector3}
   */
  random: function(e) {
    return ie.random(this.array, e), this._dirty = !0, this;
  },
  /**
   * Scale self
   * @param  {number}  scale
   * @return {clay.Vector3}
   */
  scale: function(e) {
    return ie.scale(this.array, this.array, e), this._dirty = !0, this;
  },
  /**
   * Scale b and add to self
   * @param  {clay.Vector3} b
   * @param  {number}  scale
   * @return {clay.Vector3}
   */
  scaleAndAdd: function(e, t) {
    return ie.scaleAndAdd(this.array, this.array, e.array, t), this._dirty = !0, this;
  },
  /**
   * Alias for squaredDistance
   * @param  {clay.Vector3} b
   * @return {number}
   */
  sqrDist: function(e) {
    return ie.sqrDist(this.array, e.array);
  },
  /**
   * Squared distance between self and b
   * @param  {clay.Vector3} b
   * @return {number}
   */
  squaredDistance: function(e) {
    return ie.squaredDistance(this.array, e.array);
  },
  /**
   * Alias for squaredLength
   * @return {number}
   */
  sqrLen: function() {
    return ie.sqrLen(this.array);
  },
  /**
   * Squared length of self
   * @return {number}
   */
  squaredLength: function() {
    return ie.squaredLength(this.array);
  },
  /**
   * Alias for subtract
   * @param  {clay.Vector3} b
   * @return {clay.Vector3}
   */
  sub: function(e) {
    return ie.sub(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Subtract b from self
   * @param  {clay.Vector3} b
   * @return {clay.Vector3}
   */
  subtract: function(e) {
    return ie.subtract(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Transform self with a Matrix3 m
   * @param  {clay.Matrix3} m
   * @return {clay.Vector3}
   */
  transformMat3: function(e) {
    return ie.transformMat3(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Transform self with a Matrix4 m
   * @param  {clay.Matrix4} m
   * @return {clay.Vector3}
   */
  transformMat4: function(e) {
    return ie.transformMat4(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Transform self with a Quaternion q
   * @param  {clay.Quaternion} q
   * @return {clay.Vector3}
   */
  transformQuat: function(e) {
    return ie.transformQuat(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Trasnform self into projection space with m
   * @param  {clay.Matrix4} m
   * @return {clay.Vector3}
   */
  applyProjection: function(e) {
    var t = this.array;
    if (e = e.array, e[15] === 0) {
      var r = -1 / t[2];
      t[0] = e[0] * t[0] * r, t[1] = e[5] * t[1] * r, t[2] = (e[10] * t[2] + e[14]) * r;
    } else
      t[0] = e[0] * t[0] + e[12], t[1] = e[5] * t[1] + e[13], t[2] = e[10] * t[2] + e[14];
    return this._dirty = !0, this;
  },
  eulerFromQuat: function(e, t) {
    Me.eulerFromQuat(this, e, t);
  },
  eulerFromMat3: function(e, t) {
    Me.eulerFromMat3(this, e, t);
  },
  toString: function() {
    return "[" + Array.prototype.join.call(this.array, ",") + "]";
  },
  toArray: function() {
    return Array.prototype.slice.call(this.array);
  }
};
var HT = Object.defineProperty;
if (HT) {
  var qD = Me.prototype;
  HT(qD, "x", {
    get: function() {
      return this.array[0];
    },
    set: function(e) {
      this.array[0] = e, this._dirty = !0;
    }
  }), HT(qD, "y", {
    get: function() {
      return this.array[1];
    },
    set: function(e) {
      this.array[1] = e, this._dirty = !0;
    }
  }), HT(qD, "z", {
    get: function() {
      return this.array[2];
    },
    set: function(e) {
      this.array[2] = e, this._dirty = !0;
    }
  });
}
Me.add = function(e, t, r) {
  return ie.add(e.array, t.array, r.array), e._dirty = !0, e;
};
Me.set = function(e, t, r, n) {
  ie.set(e.array, t, r, n), e._dirty = !0;
};
Me.copy = function(e, t) {
  return ie.copy(e.array, t.array), e._dirty = !0, e;
};
Me.cross = function(e, t, r) {
  return ie.cross(e.array, t.array, r.array), e._dirty = !0, e;
};
Me.dist = function(e, t) {
  return ie.distance(e.array, t.array);
};
Me.distance = Me.dist;
Me.div = function(e, t, r) {
  return ie.divide(e.array, t.array, r.array), e._dirty = !0, e;
};
Me.divide = Me.div;
Me.dot = function(e, t) {
  return ie.dot(e.array, t.array);
};
Me.len = function(e) {
  return ie.length(e.array);
};
Me.lerp = function(e, t, r, n) {
  return ie.lerp(e.array, t.array, r.array, n), e._dirty = !0, e;
};
Me.min = function(e, t, r) {
  return ie.min(e.array, t.array, r.array), e._dirty = !0, e;
};
Me.max = function(e, t, r) {
  return ie.max(e.array, t.array, r.array), e._dirty = !0, e;
};
Me.mul = function(e, t, r) {
  return ie.multiply(e.array, t.array, r.array), e._dirty = !0, e;
};
Me.multiply = Me.mul;
Me.negate = function(e, t) {
  return ie.negate(e.array, t.array), e._dirty = !0, e;
};
Me.normalize = function(e, t) {
  return ie.normalize(e.array, t.array), e._dirty = !0, e;
};
Me.random = function(e, t) {
  return ie.random(e.array, t), e._dirty = !0, e;
};
Me.scale = function(e, t, r) {
  return ie.scale(e.array, t.array, r), e._dirty = !0, e;
};
Me.scaleAndAdd = function(e, t, r, n) {
  return ie.scaleAndAdd(e.array, t.array, r.array, n), e._dirty = !0, e;
};
Me.sqrDist = function(e, t) {
  return ie.sqrDist(e.array, t.array);
};
Me.squaredDistance = Me.sqrDist;
Me.sqrLen = function(e) {
  return ie.sqrLen(e.array);
};
Me.squaredLength = Me.sqrLen;
Me.sub = function(e, t, r) {
  return ie.subtract(e.array, t.array, r.array), e._dirty = !0, e;
};
Me.subtract = Me.sub;
Me.transformMat3 = function(e, t, r) {
  return ie.transformMat3(e.array, t.array, r.array), e._dirty = !0, e;
};
Me.transformMat4 = function(e, t, r) {
  return ie.transformMat4(e.array, t.array, r.array), e._dirty = !0, e;
};
Me.transformQuat = function(e, t, r) {
  return ie.transformQuat(e.array, t.array, r.array), e._dirty = !0, e;
};
function ns(e, t, r) {
  return e < t ? t : e > r ? r : e;
}
var Pr = Math.atan2, is = Math.asin, Ug = Math.abs;
Me.eulerFromQuat = function(e, t, h) {
  e._dirty = !0, t = t.array;
  var n = e.array, i = t[0], a = t[1], o = t[2], s = t[3], l = i * i, u = a * a, f = o * o, c = s * s, h = (h || "XYZ").toUpperCase();
  switch (h) {
    case "XYZ":
      n[0] = Pr(2 * (i * s - a * o), c - l - u + f), n[1] = is(ns(2 * (i * o + a * s), -1, 1)), n[2] = Pr(2 * (o * s - i * a), c + l - u - f);
      break;
    case "YXZ":
      n[0] = is(ns(2 * (i * s - a * o), -1, 1)), n[1] = Pr(2 * (i * o + a * s), c - l - u + f), n[2] = Pr(2 * (i * a + o * s), c - l + u - f);
      break;
    case "ZXY":
      n[0] = is(ns(2 * (i * s + a * o), -1, 1)), n[1] = Pr(2 * (a * s - o * i), c - l - u + f), n[2] = Pr(2 * (o * s - i * a), c - l + u - f);
      break;
    case "ZYX":
      n[0] = Pr(2 * (i * s + o * a), c - l - u + f), n[1] = is(ns(2 * (a * s - i * o), -1, 1)), n[2] = Pr(2 * (i * a + o * s), c + l - u - f);
      break;
    case "YZX":
      n[0] = Pr(2 * (i * s - o * a), c - l + u - f), n[1] = Pr(2 * (a * s - i * o), c + l - u - f), n[2] = is(ns(2 * (i * a + o * s), -1, 1));
      break;
    case "XZY":
      n[0] = Pr(2 * (i * s + a * o), c - l + u - f), n[1] = Pr(2 * (i * o + a * s), c + l - u - f), n[2] = is(ns(2 * (o * s - i * a), -1, 1));
      break;
    default:
      console.warn("Unkown order: " + h);
  }
  return e;
};
Me.eulerFromMat3 = function(e, t, d) {
  var n = t.array, i = n[0], a = n[3], o = n[6], s = n[1], l = n[4], u = n[7], f = n[2], c = n[5], h = n[8], v = e.array, d = (d || "XYZ").toUpperCase();
  switch (d) {
    case "XYZ":
      v[1] = is(ns(o, -1, 1)), Ug(o) < 0.99999 ? (v[0] = Pr(-u, h), v[2] = Pr(-a, i)) : (v[0] = Pr(c, l), v[2] = 0);
      break;
    case "YXZ":
      v[0] = is(-ns(u, -1, 1)), Ug(u) < 0.99999 ? (v[1] = Pr(o, h), v[2] = Pr(s, l)) : (v[1] = Pr(-f, i), v[2] = 0);
      break;
    case "ZXY":
      v[0] = is(ns(c, -1, 1)), Ug(c) < 0.99999 ? (v[1] = Pr(-f, h), v[2] = Pr(-a, l)) : (v[1] = 0, v[2] = Pr(s, i));
      break;
    case "ZYX":
      v[1] = is(-ns(f, -1, 1)), Ug(f) < 0.99999 ? (v[0] = Pr(c, h), v[2] = Pr(s, i)) : (v[0] = 0, v[2] = Pr(-a, l));
      break;
    case "YZX":
      v[2] = is(ns(s, -1, 1)), Ug(s) < 0.99999 ? (v[0] = Pr(-u, l), v[1] = Pr(-f, i)) : (v[0] = 0, v[1] = Pr(o, h));
      break;
    case "XZY":
      v[2] = is(-ns(a, -1, 1)), Ug(a) < 0.99999 ? (v[0] = Pr(c, l), v[1] = Pr(o, i)) : (v[0] = Pr(-u, h), v[1] = 0);
      break;
    default:
      console.warn("Unkown order: " + d);
  }
  return e._dirty = !0, e;
};
Object.defineProperties(Me, {
  /**
   * @type {clay.Vector3}
   * @readOnly
   * @memberOf clay.Vector3
   */
  POSITIVE_X: {
    get: function() {
      return new Me(1, 0, 0);
    }
  },
  /**
   * @type {clay.Vector3}
   * @readOnly
   * @memberOf clay.Vector3
   */
  NEGATIVE_X: {
    get: function() {
      return new Me(-1, 0, 0);
    }
  },
  /**
   * @type {clay.Vector3}
   * @readOnly
   * @memberOf clay.Vector3
   */
  POSITIVE_Y: {
    get: function() {
      return new Me(0, 1, 0);
    }
  },
  /**
   * @type {clay.Vector3}
   * @readOnly
   * @memberOf clay.Vector3
   */
  NEGATIVE_Y: {
    get: function() {
      return new Me(0, -1, 0);
    }
  },
  /**
   * @type {clay.Vector3}
   * @readOnly
   * @memberOf clay.Vector3
   */
  POSITIVE_Z: {
    get: function() {
      return new Me(0, 0, 1);
    }
  },
  /**
   * @type {clay.Vector3}
   * @readOnly
   */
  NEGATIVE_Z: {
    get: function() {
      return new Me(0, 0, -1);
    }
  },
  /**
   * @type {clay.Vector3}
   * @readOnly
   * @memberOf clay.Vector3
   */
  UP: {
    get: function() {
      return new Me(0, 1, 0);
    }
  },
  /**
   * @type {clay.Vector3}
   * @readOnly
   * @memberOf clay.Vector3
   */
  ZERO: {
    get: function() {
      return new Me();
    }
  }
});
var jD = 1e-5, md = function(e, t) {
  this.origin = e || new Me(), this.direction = t || new Me();
};
md.prototype = {
  constructor: md,
  // http://www.siggraph.org/education/materials/HyperGraph/raytrace/rayplane_intersection.htm
  /**
   * Calculate intersection point between ray and a give plane
   * @param  {clay.Plane} plane
   * @param  {clay.Vector3} [out]
   * @return {clay.Vector3}
   */
  intersectPlane: function(e, t) {
    var r = e.normal.array, n = e.distance, i = this.origin.array, a = this.direction.array, o = ie.dot(r, a);
    if (o === 0)
      return null;
    t || (t = new Me());
    var s = (ie.dot(r, i) - n) / o;
    return ie.scaleAndAdd(t.array, i, a, -s), t._dirty = !0, t;
  },
  /**
   * Mirror the ray against plane
   * @param  {clay.Plane} plane
   */
  mirrorAgainstPlane: function(e) {
    var t = ie.dot(e.normal.array, this.direction.array);
    ie.scaleAndAdd(this.direction.array, this.direction.array, e.normal.array, -t * 2), this.direction._dirty = !0;
  },
  distanceToPoint: (function() {
    var e = ie.create();
    return function(t) {
      ie.sub(e, t, this.origin.array);
      var r = ie.dot(e, this.direction.array);
      if (r < 0)
        return ie.distance(this.origin.array, t);
      var n = ie.lenSquared(e);
      return Math.sqrt(n - r * r);
    };
  })(),
  /**
   * Calculate intersection point between ray and sphere
   * @param  {clay.Vector3} center
   * @param  {number} radius
   * @param  {clay.Vector3} out
   * @return {clay.Vector3}
   */
  intersectSphere: (function() {
    var e = ie.create();
    return function(t, r, n) {
      var i = this.origin.array, a = this.direction.array;
      t = t.array, ie.sub(e, t, i);
      var o = ie.dot(e, a), s = ie.squaredLength(e), l = s - o * o, u = r * r;
      if (!(l > u)) {
        var f = Math.sqrt(u - l), c = o - f, h = o + f;
        return n || (n = new Me()), c < 0 ? h < 0 ? null : (ie.scaleAndAdd(n.array, i, a, h), n) : (ie.scaleAndAdd(n.array, i, a, c), n);
      }
    };
  })(),
  // http://www.scratchapixel.com/lessons/3d-basic-lessons/lesson-7-intersecting-simple-shapes/ray-box-intersection/
  /**
   * Calculate intersection point between ray and bounding box
   * @param {clay.BoundingBox} bbox
   * @param {clay.Vector3}
   * @return {clay.Vector3}
   */
  intersectBoundingBox: function(e, t) {
    var r = this.direction.array, n = this.origin.array, i = e.min.array, a = e.max.array, o = 1 / r[0], s = 1 / r[1], l = 1 / r[2], u, f, c, h, v, d;
    if (o >= 0 ? (u = (i[0] - n[0]) * o, f = (a[0] - n[0]) * o) : (f = (i[0] - n[0]) * o, u = (a[0] - n[0]) * o), s >= 0 ? (c = (i[1] - n[1]) * s, h = (a[1] - n[1]) * s) : (h = (i[1] - n[1]) * s, c = (a[1] - n[1]) * s), u > h || c > f || ((c > u || u !== u) && (u = c), (h < f || f !== f) && (f = h), l >= 0 ? (v = (i[2] - n[2]) * l, d = (a[2] - n[2]) * l) : (d = (i[2] - n[2]) * l, v = (a[2] - n[2]) * l), u > d || v > f) || ((v > u || u !== u) && (u = v), (d < f || f !== f) && (f = d), f < 0))
      return null;
    var g = u >= 0 ? u : f;
    return t || (t = new Me()), ie.scaleAndAdd(t.array, n, r, g), t;
  },
  // http://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm
  /**
   * Calculate intersection point between ray and three triangle vertices
   * @param {clay.Vector3} a
   * @param {clay.Vector3} b
   * @param {clay.Vector3} c
   * @param {boolean}           singleSided, CW triangle will be ignored
   * @param {clay.Vector3} [out]
   * @param {clay.Vector3} [barycenteric] barycentric coords
   * @return {clay.Vector3}
   */
  intersectTriangle: (function() {
    var e = ie.create(), t = ie.create(), r = ie.create(), n = ie.create();
    return function(i, a, o, s, l, u) {
      var f = this.direction.array, c = this.origin.array;
      i = i.array, a = a.array, o = o.array, ie.sub(e, a, i), ie.sub(t, o, i), ie.cross(n, t, f);
      var h = ie.dot(e, n);
      if (s) {
        if (h > -jD)
          return null;
      } else if (h > -jD && h < jD)
        return null;
      ie.sub(r, c, i);
      var v = ie.dot(n, r) / h;
      if (v < 0 || v > 1)
        return null;
      ie.cross(n, e, r);
      var d = ie.dot(f, n) / h;
      if (d < 0 || d > 1 || v + d > 1)
        return null;
      ie.cross(n, e, t);
      var g = -ie.dot(r, n) / h;
      return g < 0 ? null : (l || (l = new Me()), u && Me.set(u, 1 - v - d, v, d), ie.scaleAndAdd(l.array, c, f, g), l);
    };
  })(),
  /**
   * Apply an affine transform matrix to the ray
   * @return {clay.Matrix4} matrix
   */
  applyTransform: function(e) {
    Me.add(this.direction, this.direction, this.origin), Me.transformMat4(this.origin, this.origin, e), Me.transformMat4(this.direction, this.direction, e), Me.sub(this.direction, this.direction, this.origin), Me.normalize(this.direction, this.direction);
  },
  /**
   * Copy values from another ray
   * @param {clay.Ray} ray
   */
  copy: function(e) {
    Me.copy(this.origin, e.origin), Me.copy(this.direction, e.direction);
  },
  /**
   * Clone a new ray
   * @return {clay.Ray}
   */
  clone: function() {
    var e = new md();
    return e.copy(this), e;
  }
};
var Ie = {};
Ie.create = function() {
  var e = new Li(4);
  return e[0] = 0, e[1] = 0, e[2] = 0, e[3] = 0, e;
};
Ie.clone = function(e) {
  var t = new Li(4);
  return t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[3], t;
};
Ie.fromValues = function(e, t, r, n) {
  var i = new Li(4);
  return i[0] = e, i[1] = t, i[2] = r, i[3] = n, i;
};
Ie.copy = function(e, t) {
  return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e;
};
Ie.set = function(e, t, r, n, i) {
  return e[0] = t, e[1] = r, e[2] = n, e[3] = i, e;
};
Ie.add = function(e, t, r) {
  return e[0] = t[0] + r[0], e[1] = t[1] + r[1], e[2] = t[2] + r[2], e[3] = t[3] + r[3], e;
};
Ie.subtract = function(e, t, r) {
  return e[0] = t[0] - r[0], e[1] = t[1] - r[1], e[2] = t[2] - r[2], e[3] = t[3] - r[3], e;
};
Ie.sub = Ie.subtract;
Ie.multiply = function(e, t, r) {
  return e[0] = t[0] * r[0], e[1] = t[1] * r[1], e[2] = t[2] * r[2], e[3] = t[3] * r[3], e;
};
Ie.mul = Ie.multiply;
Ie.divide = function(e, t, r) {
  return e[0] = t[0] / r[0], e[1] = t[1] / r[1], e[2] = t[2] / r[2], e[3] = t[3] / r[3], e;
};
Ie.div = Ie.divide;
Ie.min = function(e, t, r) {
  return e[0] = Math.min(t[0], r[0]), e[1] = Math.min(t[1], r[1]), e[2] = Math.min(t[2], r[2]), e[3] = Math.min(t[3], r[3]), e;
};
Ie.max = function(e, t, r) {
  return e[0] = Math.max(t[0], r[0]), e[1] = Math.max(t[1], r[1]), e[2] = Math.max(t[2], r[2]), e[3] = Math.max(t[3], r[3]), e;
};
Ie.scale = function(e, t, r) {
  return e[0] = t[0] * r, e[1] = t[1] * r, e[2] = t[2] * r, e[3] = t[3] * r, e;
};
Ie.scaleAndAdd = function(e, t, r, n) {
  return e[0] = t[0] + r[0] * n, e[1] = t[1] + r[1] * n, e[2] = t[2] + r[2] * n, e[3] = t[3] + r[3] * n, e;
};
Ie.distance = function(e, t) {
  var r = t[0] - e[0], n = t[1] - e[1], i = t[2] - e[2], a = t[3] - e[3];
  return Math.sqrt(r * r + n * n + i * i + a * a);
};
Ie.dist = Ie.distance;
Ie.squaredDistance = function(e, t) {
  var r = t[0] - e[0], n = t[1] - e[1], i = t[2] - e[2], a = t[3] - e[3];
  return r * r + n * n + i * i + a * a;
};
Ie.sqrDist = Ie.squaredDistance;
Ie.length = function(e) {
  var t = e[0], r = e[1], n = e[2], i = e[3];
  return Math.sqrt(t * t + r * r + n * n + i * i);
};
Ie.len = Ie.length;
Ie.squaredLength = function(e) {
  var t = e[0], r = e[1], n = e[2], i = e[3];
  return t * t + r * r + n * n + i * i;
};
Ie.sqrLen = Ie.squaredLength;
Ie.negate = function(e, t) {
  return e[0] = -t[0], e[1] = -t[1], e[2] = -t[2], e[3] = -t[3], e;
};
Ie.inverse = function(e, t) {
  return e[0] = 1 / t[0], e[1] = 1 / t[1], e[2] = 1 / t[2], e[3] = 1 / t[3], e;
};
Ie.normalize = function(e, t) {
  var r = t[0], n = t[1], i = t[2], a = t[3], o = r * r + n * n + i * i + a * a;
  return o > 0 && (o = 1 / Math.sqrt(o), e[0] = t[0] * o, e[1] = t[1] * o, e[2] = t[2] * o, e[3] = t[3] * o), e;
};
Ie.dot = function(e, t) {
  return e[0] * t[0] + e[1] * t[1] + e[2] * t[2] + e[3] * t[3];
};
Ie.lerp = function(e, t, r, n) {
  var i = t[0], a = t[1], o = t[2], s = t[3];
  return e[0] = i + n * (r[0] - i), e[1] = a + n * (r[1] - a), e[2] = o + n * (r[2] - o), e[3] = s + n * (r[3] - s), e;
};
Ie.random = function(e, t) {
  return t = t || 1, e[0] = fm(), e[1] = fm(), e[2] = fm(), e[3] = fm(), Ie.normalize(e, e), Ie.scale(e, e, t), e;
};
Ie.transformMat4 = function(e, t, r) {
  var n = t[0], i = t[1], a = t[2], o = t[3];
  return e[0] = r[0] * n + r[4] * i + r[8] * a + r[12] * o, e[1] = r[1] * n + r[5] * i + r[9] * a + r[13] * o, e[2] = r[2] * n + r[6] * i + r[10] * a + r[14] * o, e[3] = r[3] * n + r[7] * i + r[11] * a + r[15] * o, e;
};
Ie.transformQuat = function(e, t, r) {
  var n = t[0], i = t[1], a = t[2], o = r[0], s = r[1], l = r[2], u = r[3], f = u * n + s * a - l * i, c = u * i + l * n - o * a, h = u * a + o * i - s * n, v = -o * n - s * i - l * a;
  return e[0] = f * u + v * -o + c * -l - h * -s, e[1] = c * u + v * -s + h * -o - f * -l, e[2] = h * u + v * -l + f * -s - c * -o, e;
};
Ie.forEach = (function() {
  var e = Ie.create();
  return function(t, r, n, i, a, o) {
    var s, l;
    for (r || (r = 4), n || (n = 0), i ? l = Math.min(i * r + n, t.length) : l = t.length, s = n; s < l; s += r)
      e[0] = t[s], e[1] = t[s + 1], e[2] = t[s + 2], e[3] = t[s + 3], a(e, e, o), t[s] = e[0], t[s + 1] = e[1], t[s + 2] = e[2], t[s + 3] = e[3];
    return t;
  };
})();
var bt = {};
bt.create = function() {
  var e = new Li(9);
  return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 1, e[5] = 0, e[6] = 0, e[7] = 0, e[8] = 1, e;
};
bt.fromMat4 = function(e, t) {
  return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[4], e[4] = t[5], e[5] = t[6], e[6] = t[8], e[7] = t[9], e[8] = t[10], e;
};
bt.clone = function(e) {
  var t = new Li(9);
  return t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[3], t[4] = e[4], t[5] = e[5], t[6] = e[6], t[7] = e[7], t[8] = e[8], t;
};
bt.copy = function(e, t) {
  return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[4] = t[4], e[5] = t[5], e[6] = t[6], e[7] = t[7], e[8] = t[8], e;
};
bt.identity = function(e) {
  return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 0, e[4] = 1, e[5] = 0, e[6] = 0, e[7] = 0, e[8] = 1, e;
};
bt.transpose = function(e, t) {
  if (e === t) {
    var r = t[1], n = t[2], i = t[5];
    e[1] = t[3], e[2] = t[6], e[3] = r, e[5] = t[7], e[6] = n, e[7] = i;
  } else
    e[0] = t[0], e[1] = t[3], e[2] = t[6], e[3] = t[1], e[4] = t[4], e[5] = t[7], e[6] = t[2], e[7] = t[5], e[8] = t[8];
  return e;
};
bt.invert = function(e, t) {
  var r = t[0], n = t[1], i = t[2], a = t[3], o = t[4], s = t[5], l = t[6], u = t[7], f = t[8], c = f * o - s * u, h = -f * a + s * l, v = u * a - o * l, d = r * c + n * h + i * v;
  return d ? (d = 1 / d, e[0] = c * d, e[1] = (-f * n + i * u) * d, e[2] = (s * n - i * o) * d, e[3] = h * d, e[4] = (f * r - i * l) * d, e[5] = (-s * r + i * a) * d, e[6] = v * d, e[7] = (-u * r + n * l) * d, e[8] = (o * r - n * a) * d, e) : null;
};
bt.adjoint = function(e, t) {
  var r = t[0], n = t[1], i = t[2], a = t[3], o = t[4], s = t[5], l = t[6], u = t[7], f = t[8];
  return e[0] = o * f - s * u, e[1] = i * u - n * f, e[2] = n * s - i * o, e[3] = s * l - a * f, e[4] = r * f - i * l, e[5] = i * a - r * s, e[6] = a * u - o * l, e[7] = n * l - r * u, e[8] = r * o - n * a, e;
};
bt.determinant = function(e) {
  var t = e[0], r = e[1], n = e[2], i = e[3], a = e[4], o = e[5], s = e[6], l = e[7], u = e[8];
  return t * (u * a - o * l) + r * (-u * i + o * s) + n * (l * i - a * s);
};
bt.multiply = function(e, t, r) {
  var n = t[0], i = t[1], a = t[2], o = t[3], s = t[4], l = t[5], u = t[6], f = t[7], c = t[8], h = r[0], v = r[1], d = r[2], g = r[3], y = r[4], x = r[5], S = r[6], T = r[7], C = r[8];
  return e[0] = h * n + v * o + d * u, e[1] = h * i + v * s + d * f, e[2] = h * a + v * l + d * c, e[3] = g * n + y * o + x * u, e[4] = g * i + y * s + x * f, e[5] = g * a + y * l + x * c, e[6] = S * n + T * o + C * u, e[7] = S * i + T * s + C * f, e[8] = S * a + T * l + C * c, e;
};
bt.mul = bt.multiply;
bt.translate = function(e, t, r) {
  var n = t[0], i = t[1], a = t[2], o = t[3], s = t[4], l = t[5], u = t[6], f = t[7], c = t[8], h = r[0], v = r[1];
  return e[0] = n, e[1] = i, e[2] = a, e[3] = o, e[4] = s, e[5] = l, e[6] = h * n + v * o + u, e[7] = h * i + v * s + f, e[8] = h * a + v * l + c, e;
};
bt.rotate = function(e, t, r) {
  var n = t[0], i = t[1], a = t[2], o = t[3], s = t[4], l = t[5], u = t[6], f = t[7], c = t[8], h = Math.sin(r), v = Math.cos(r);
  return e[0] = v * n + h * o, e[1] = v * i + h * s, e[2] = v * a + h * l, e[3] = v * o - h * n, e[4] = v * s - h * i, e[5] = v * l - h * a, e[6] = u, e[7] = f, e[8] = c, e;
};
bt.scale = function(e, t, r) {
  var n = r[0], i = r[1];
  return e[0] = n * t[0], e[1] = n * t[1], e[2] = n * t[2], e[3] = i * t[3], e[4] = i * t[4], e[5] = i * t[5], e[6] = t[6], e[7] = t[7], e[8] = t[8], e;
};
bt.fromMat2d = function(e, t) {
  return e[0] = t[0], e[1] = t[1], e[2] = 0, e[3] = t[2], e[4] = t[3], e[5] = 0, e[6] = t[4], e[7] = t[5], e[8] = 1, e;
};
bt.fromQuat = function(e, t) {
  var r = t[0], n = t[1], i = t[2], a = t[3], o = r + r, s = n + n, l = i + i, u = r * o, f = n * o, c = n * s, h = i * o, v = i * s, d = i * l, g = a * o, y = a * s, x = a * l;
  return e[0] = 1 - c - d, e[3] = f - x, e[6] = h + y, e[1] = f + x, e[4] = 1 - u - d, e[7] = v - g, e[2] = h - y, e[5] = v + g, e[8] = 1 - u - c, e;
};
bt.normalFromMat4 = function(e, t) {
  var r = t[0], n = t[1], i = t[2], a = t[3], o = t[4], s = t[5], l = t[6], u = t[7], f = t[8], c = t[9], h = t[10], v = t[11], d = t[12], g = t[13], y = t[14], x = t[15], S = r * s - n * o, T = r * l - i * o, C = r * u - a * o, A = n * l - i * s, M = n * u - a * s, E = i * u - a * l, P = f * g - c * d, R = f * y - h * d, O = f * x - v * d, N = c * y - h * g, G = c * x - v * g, z = h * x - v * y, H = S * z - T * G + C * N + A * O - M * R + E * P;
  return H ? (H = 1 / H, e[0] = (s * z - l * G + u * N) * H, e[1] = (l * O - o * z - u * R) * H, e[2] = (o * G - s * O + u * P) * H, e[3] = (i * G - n * z - a * N) * H, e[4] = (r * z - i * O + a * R) * H, e[5] = (n * O - r * G - a * P) * H, e[6] = (g * E - y * M + x * A) * H, e[7] = (y * C - d * E - x * T) * H, e[8] = (d * M - g * C + x * S) * H, e) : null;
};
bt.frob = function(e) {
  return Math.sqrt(Math.pow(e[0], 2) + Math.pow(e[1], 2) + Math.pow(e[2], 2) + Math.pow(e[3], 2) + Math.pow(e[4], 2) + Math.pow(e[5], 2) + Math.pow(e[6], 2) + Math.pow(e[7], 2) + Math.pow(e[8], 2));
};
var Qe = {};
Qe.create = function() {
  var e = new Li(4);
  return e[0] = 0, e[1] = 0, e[2] = 0, e[3] = 1, e;
};
Qe.rotationTo = (function() {
  var e = ie.create(), t = ie.fromValues(1, 0, 0), r = ie.fromValues(0, 1, 0);
  return function(n, i, a) {
    var o = ie.dot(i, a);
    return o < -0.999999 ? (ie.cross(e, t, i), ie.length(e) < 1e-6 && ie.cross(e, r, i), ie.normalize(e, e), Qe.setAxisAngle(n, e, Math.PI), n) : o > 0.999999 ? (n[0] = 0, n[1] = 0, n[2] = 0, n[3] = 1, n) : (ie.cross(e, i, a), n[0] = e[0], n[1] = e[1], n[2] = e[2], n[3] = 1 + o, Qe.normalize(n, n));
  };
})();
Qe.setAxes = (function() {
  var e = bt.create();
  return function(t, r, n, i) {
    return e[0] = n[0], e[3] = n[1], e[6] = n[2], e[1] = i[0], e[4] = i[1], e[7] = i[2], e[2] = -r[0], e[5] = -r[1], e[8] = -r[2], Qe.normalize(t, Qe.fromMat3(t, e));
  };
})();
Qe.clone = Ie.clone;
Qe.fromValues = Ie.fromValues;
Qe.copy = Ie.copy;
Qe.set = Ie.set;
Qe.identity = function(e) {
  return e[0] = 0, e[1] = 0, e[2] = 0, e[3] = 1, e;
};
Qe.setAxisAngle = function(e, t, r) {
  r = r * 0.5;
  var n = Math.sin(r);
  return e[0] = n * t[0], e[1] = n * t[1], e[2] = n * t[2], e[3] = Math.cos(r), e;
};
Qe.add = Ie.add;
Qe.multiply = function(e, t, r) {
  var n = t[0], i = t[1], a = t[2], o = t[3], s = r[0], l = r[1], u = r[2], f = r[3];
  return e[0] = n * f + o * s + i * u - a * l, e[1] = i * f + o * l + a * s - n * u, e[2] = a * f + o * u + n * l - i * s, e[3] = o * f - n * s - i * l - a * u, e;
};
Qe.mul = Qe.multiply;
Qe.scale = Ie.scale;
Qe.rotateX = function(e, t, r) {
  r *= 0.5;
  var n = t[0], i = t[1], a = t[2], o = t[3], s = Math.sin(r), l = Math.cos(r);
  return e[0] = n * l + o * s, e[1] = i * l + a * s, e[2] = a * l - i * s, e[3] = o * l - n * s, e;
};
Qe.rotateY = function(e, t, r) {
  r *= 0.5;
  var n = t[0], i = t[1], a = t[2], o = t[3], s = Math.sin(r), l = Math.cos(r);
  return e[0] = n * l - a * s, e[1] = i * l + o * s, e[2] = a * l + n * s, e[3] = o * l - i * s, e;
};
Qe.rotateZ = function(e, t, r) {
  r *= 0.5;
  var n = t[0], i = t[1], a = t[2], o = t[3], s = Math.sin(r), l = Math.cos(r);
  return e[0] = n * l + i * s, e[1] = i * l - n * s, e[2] = a * l + o * s, e[3] = o * l - a * s, e;
};
Qe.calculateW = function(e, t) {
  var r = t[0], n = t[1], i = t[2];
  return e[0] = r, e[1] = n, e[2] = i, e[3] = Math.sqrt(Math.abs(1 - r * r - n * n - i * i)), e;
};
Qe.dot = Ie.dot;
Qe.lerp = Ie.lerp;
Qe.slerp = function(e, t, r, n) {
  var i = t[0], a = t[1], o = t[2], s = t[3], l = r[0], u = r[1], f = r[2], c = r[3], h, v, d, g, y;
  return v = i * l + a * u + o * f + s * c, v < 0 && (v = -v, l = -l, u = -u, f = -f, c = -c), 1 - v > 1e-6 ? (h = Math.acos(v), d = Math.sin(h), g = Math.sin((1 - n) * h) / d, y = Math.sin(n * h) / d) : (g = 1 - n, y = n), e[0] = g * i + y * l, e[1] = g * a + y * u, e[2] = g * o + y * f, e[3] = g * s + y * c, e;
};
Qe.invert = function(e, t) {
  var r = t[0], n = t[1], i = t[2], a = t[3], o = r * r + n * n + i * i + a * a, s = o ? 1 / o : 0;
  return e[0] = -r * s, e[1] = -n * s, e[2] = -i * s, e[3] = a * s, e;
};
Qe.conjugate = function(e, t) {
  return e[0] = -t[0], e[1] = -t[1], e[2] = -t[2], e[3] = t[3], e;
};
Qe.length = Ie.length;
Qe.len = Qe.length;
Qe.squaredLength = Ie.squaredLength;
Qe.sqrLen = Qe.squaredLength;
Qe.normalize = Ie.normalize;
Qe.fromMat3 = function(e, t) {
  var r = t[0] + t[4] + t[8], n;
  if (r > 0)
    n = Math.sqrt(r + 1), e[3] = 0.5 * n, n = 0.5 / n, e[0] = (t[5] - t[7]) * n, e[1] = (t[6] - t[2]) * n, e[2] = (t[1] - t[3]) * n;
  else {
    var i = 0;
    t[4] > t[0] && (i = 1), t[8] > t[i * 3 + i] && (i = 2);
    var a = (i + 1) % 3, o = (i + 2) % 3;
    n = Math.sqrt(t[i * 3 + i] - t[a * 3 + a] - t[o * 3 + o] + 1), e[i] = 0.5 * n, n = 0.5 / n, e[3] = (t[a * 3 + o] - t[o * 3 + a]) * n, e[a] = (t[a * 3 + i] + t[i * 3 + a]) * n, e[o] = (t[o * 3 + i] + t[i * 3 + o]) * n;
  }
  return e;
};
var Ke = function() {
  this._axisX = new Me(), this._axisY = new Me(), this._axisZ = new Me(), this.array = Oe.create(), this._dirty = !0;
};
Ke.prototype = {
  constructor: Ke,
  /**
   * Set components from array
   * @param  {Float32Array|number[]} arr
   */
  setArray: function(e) {
    for (var t = 0; t < this.array.length; t++)
      this.array[t] = e[t];
    return this._dirty = !0, this;
  },
  /**
   * Calculate the adjugate of self, in-place
   * @return {clay.Matrix4}
   */
  adjoint: function() {
    return Oe.adjoint(this.array, this.array), this._dirty = !0, this;
  },
  /**
   * Clone a new Matrix4
   * @return {clay.Matrix4}
   */
  clone: function() {
    return new Ke().copy(this);
  },
  /**
   * Copy from b
   * @param  {clay.Matrix4} b
   * @return {clay.Matrix4}
   */
  copy: function(e) {
    return Oe.copy(this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Calculate matrix determinant
   * @return {number}
   */
  determinant: function() {
    return Oe.determinant(this.array);
  },
  /**
   * Set upper 3x3 part from quaternion
   * @param  {clay.Quaternion} q
   * @return {clay.Matrix4}
   */
  fromQuat: function(e) {
    return Oe.fromQuat(this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Set from a quaternion rotation and a vector translation
   * @param  {clay.Quaternion} q
   * @param  {clay.Vector3} v
   * @return {clay.Matrix4}
   */
  fromRotationTranslation: function(e, t) {
    return Oe.fromRotationTranslation(this.array, e.array, t.array), this._dirty = !0, this;
  },
  /**
   * Set from Matrix2d, it is used when converting a 2d shape to 3d space.
   * In 3d space it is equivalent to ranslate on xy plane and rotate about z axis
   * @param  {clay.Matrix2d} m2d
   * @return {clay.Matrix4}
   */
  fromMat2d: function(e) {
    return Ke.fromMat2d(this, e), this;
  },
  /**
   * Set from frustum bounds
   * @param  {number} left
   * @param  {number} right
   * @param  {number} bottom
   * @param  {number} top
   * @param  {number} near
   * @param  {number} far
   * @return {clay.Matrix4}
   */
  frustum: function(e, t, r, n, i, a) {
    return Oe.frustum(this.array, e, t, r, n, i, a), this._dirty = !0, this;
  },
  /**
   * Set to a identity matrix
   * @return {clay.Matrix4}
   */
  identity: function() {
    return Oe.identity(this.array), this._dirty = !0, this;
  },
  /**
   * Invert self
   * @return {clay.Matrix4}
   */
  invert: function() {
    return Oe.invert(this.array, this.array), this._dirty = !0, this;
  },
  /**
   * Set as a matrix with the given eye position, focal point, and up axis
   * @param  {clay.Vector3} eye
   * @param  {clay.Vector3} center
   * @param  {clay.Vector3} up
   * @return {clay.Matrix4}
   */
  lookAt: function(e, t, r) {
    return Oe.lookAt(this.array, e.array, t.array, r.array), this._dirty = !0, this;
  },
  /**
   * Alias for mutiply
   * @param  {clay.Matrix4} b
   * @return {clay.Matrix4}
   */
  mul: function(e) {
    return Oe.mul(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Alias for multiplyLeft
   * @param  {clay.Matrix4} a
   * @return {clay.Matrix4}
   */
  mulLeft: function(e) {
    return Oe.mul(this.array, e.array, this.array), this._dirty = !0, this;
  },
  /**
   * Multiply self and b
   * @param  {clay.Matrix4} b
   * @return {clay.Matrix4}
   */
  multiply: function(e) {
    return Oe.multiply(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Multiply a and self, a is on the left
   * @param  {clay.Matrix3} a
   * @return {clay.Matrix3}
   */
  multiplyLeft: function(e) {
    return Oe.multiply(this.array, e.array, this.array), this._dirty = !0, this;
  },
  /**
   * Set as a orthographic projection matrix
   * @param  {number} left
   * @param  {number} right
   * @param  {number} bottom
   * @param  {number} top
   * @param  {number} near
   * @param  {number} far
   * @return {clay.Matrix4}
   */
  ortho: function(e, t, r, n, i, a) {
    return Oe.ortho(this.array, e, t, r, n, i, a), this._dirty = !0, this;
  },
  /**
   * Set as a perspective projection matrix
   * @param  {number} fovy
   * @param  {number} aspect
   * @param  {number} near
   * @param  {number} far
   * @return {clay.Matrix4}
   */
  perspective: function(e, t, r, n) {
    return Oe.perspective(this.array, e, t, r, n), this._dirty = !0, this;
  },
  /**
   * Rotate self by rad about axis.
   * Equal to right-multiply a rotaion matrix
   * @param  {number}   rad
   * @param  {clay.Vector3} axis
   * @return {clay.Matrix4}
   */
  rotate: function(e, t) {
    return Oe.rotate(this.array, this.array, e, t.array), this._dirty = !0, this;
  },
  /**
   * Rotate self by a given radian about X axis.
   * Equal to right-multiply a rotaion matrix
   * @param {number} rad
   * @return {clay.Matrix4}
   */
  rotateX: function(e) {
    return Oe.rotateX(this.array, this.array, e), this._dirty = !0, this;
  },
  /**
   * Rotate self by a given radian about Y axis.
   * Equal to right-multiply a rotaion matrix
   * @param {number} rad
   * @return {clay.Matrix4}
   */
  rotateY: function(e) {
    return Oe.rotateY(this.array, this.array, e), this._dirty = !0, this;
  },
  /**
   * Rotate self by a given radian about Z axis.
   * Equal to right-multiply a rotaion matrix
   * @param {number} rad
   * @return {clay.Matrix4}
   */
  rotateZ: function(e) {
    return Oe.rotateZ(this.array, this.array, e), this._dirty = !0, this;
  },
  /**
   * Scale self by s
   * Equal to right-multiply a scale matrix
   * @param  {clay.Vector3}  s
   * @return {clay.Matrix4}
   */
  scale: function(e) {
    return Oe.scale(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Translate self by v.
   * Equal to right-multiply a translate matrix
   * @param  {clay.Vector3}  v
   * @return {clay.Matrix4}
   */
  translate: function(e) {
    return Oe.translate(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Transpose self, in-place.
   * @return {clay.Matrix2}
   */
  transpose: function() {
    return Oe.transpose(this.array, this.array), this._dirty = !0, this;
  },
  /**
   * Decompose a matrix to SRT
   * @param {clay.Vector3} [scale]
   * @param {clay.Quaternion} rotation
   * @param {clay.Vector} position
   * @see http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.matrix.decompose.aspx
   */
  decomposeMatrix: (function() {
    var e = ie.create(), t = ie.create(), r = ie.create(), n = bt.create();
    return function(i, a, o) {
      var s = this.array;
      ie.set(e, s[0], s[1], s[2]), ie.set(t, s[4], s[5], s[6]), ie.set(r, s[8], s[9], s[10]);
      var l = ie.length(e), u = ie.length(t), f = ie.length(r), c = this.determinant();
      c < 0 && (l = -l), i && i.set(l, u, f), o.set(s[12], s[13], s[14]), bt.fromMat4(n, s), n[0] /= l, n[1] /= l, n[2] /= l, n[3] /= u, n[4] /= u, n[5] /= u, n[6] /= f, n[7] /= f, n[8] /= f, Qe.fromMat3(a.array, n), Qe.normalize(a.array, a.array), a._dirty = !0, o._dirty = !0;
    };
  })(),
  toString: function() {
    return "[" + Array.prototype.join.call(this.array, ",") + "]";
  },
  toArray: function() {
    return Array.prototype.slice.call(this.array);
  }
};
var UT = Object.defineProperty;
if (UT) {
  var KD = Ke.prototype;
  UT(KD, "z", {
    get: function() {
      var e = this.array;
      return this._axisZ.set(e[8], e[9], e[10]), this._axisZ;
    },
    set: function(e) {
      var t = this.array;
      e = e.array, t[8] = e[0], t[9] = e[1], t[10] = e[2], this._dirty = !0;
    }
  }), UT(KD, "y", {
    get: function() {
      var e = this.array;
      return this._axisY.set(e[4], e[5], e[6]), this._axisY;
    },
    set: function(e) {
      var t = this.array;
      e = e.array, t[4] = e[0], t[5] = e[1], t[6] = e[2], this._dirty = !0;
    }
  }), UT(KD, "x", {
    get: function() {
      var e = this.array;
      return this._axisX.set(e[0], e[1], e[2]), this._axisX;
    },
    set: function(e) {
      var t = this.array;
      e = e.array, t[0] = e[0], t[1] = e[1], t[2] = e[2], this._dirty = !0;
    }
  });
}
Ke.adjoint = function(e, t) {
  return Oe.adjoint(e.array, t.array), e._dirty = !0, e;
};
Ke.copy = function(e, t) {
  return Oe.copy(e.array, t.array), e._dirty = !0, e;
};
Ke.determinant = function(e) {
  return Oe.determinant(e.array);
};
Ke.identity = function(e) {
  return Oe.identity(e.array), e._dirty = !0, e;
};
Ke.ortho = function(e, t, r, n, i, a, o) {
  return Oe.ortho(e.array, t, r, n, i, a, o), e._dirty = !0, e;
};
Ke.perspective = function(e, t, r, n, i) {
  return Oe.perspective(e.array, t, r, n, i), e._dirty = !0, e;
};
Ke.lookAt = function(e, t, r, n) {
  return Oe.lookAt(e.array, t.array, r.array, n.array), e._dirty = !0, e;
};
Ke.invert = function(e, t) {
  return Oe.invert(e.array, t.array), e._dirty = !0, e;
};
Ke.mul = function(e, t, r) {
  return Oe.mul(e.array, t.array, r.array), e._dirty = !0, e;
};
Ke.multiply = Ke.mul;
Ke.fromQuat = function(e, t) {
  return Oe.fromQuat(e.array, t.array), e._dirty = !0, e;
};
Ke.fromRotationTranslation = function(e, t, r) {
  return Oe.fromRotationTranslation(e.array, t.array, r.array), e._dirty = !0, e;
};
Ke.fromMat2d = function(n, r) {
  n._dirty = !0;
  var r = r.array, n = n.array;
  return n[0] = r[0], n[4] = r[2], n[12] = r[4], n[1] = r[1], n[5] = r[3], n[13] = r[5], n;
};
Ke.rotate = function(e, t, r, n) {
  return Oe.rotate(e.array, t.array, r, n.array), e._dirty = !0, e;
};
Ke.rotateX = function(e, t, r) {
  return Oe.rotateX(e.array, t.array, r), e._dirty = !0, e;
};
Ke.rotateY = function(e, t, r) {
  return Oe.rotateY(e.array, t.array, r), e._dirty = !0, e;
};
Ke.rotateZ = function(e, t, r) {
  return Oe.rotateZ(e.array, t.array, r), e._dirty = !0, e;
};
Ke.scale = function(e, t, r) {
  return Oe.scale(e.array, t.array, r.array), e._dirty = !0, e;
};
Ke.transpose = function(e, t) {
  return Oe.transpose(e.array, t.array), e._dirty = !0, e;
};
Ke.translate = function(e, t, r) {
  return Oe.translate(e.array, t.array, r.array), e._dirty = !0, e;
};
var wr = function(e, t, r, n) {
  e = e || 0, t = t || 0, r = r || 0, n = n === void 0 ? 1 : n, this.array = Qe.fromValues(e, t, r, n), this._dirty = !0;
};
wr.prototype = {
  constructor: wr,
  /**
   * Add b to self
   * @param  {clay.Quaternion} b
   * @return {clay.Quaternion}
   */
  add: function(e) {
    return Qe.add(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Calculate the w component from x, y, z component
   * @return {clay.Quaternion}
   */
  calculateW: function() {
    return Qe.calculateW(this.array, this.array), this._dirty = !0, this;
  },
  /**
   * Set x, y and z components
   * @param  {number}  x
   * @param  {number}  y
   * @param  {number}  z
   * @param  {number}  w
   * @return {clay.Quaternion}
   */
  set: function(e, t, r, n) {
    return this.array[0] = e, this.array[1] = t, this.array[2] = r, this.array[3] = n, this._dirty = !0, this;
  },
  /**
   * Set x, y, z and w components from array
   * @param  {Float32Array|number[]} arr
   * @return {clay.Quaternion}
   */
  setArray: function(e) {
    return this.array[0] = e[0], this.array[1] = e[1], this.array[2] = e[2], this.array[3] = e[3], this._dirty = !0, this;
  },
  /**
   * Clone a new Quaternion
   * @return {clay.Quaternion}
   */
  clone: function() {
    return new wr(this.x, this.y, this.z, this.w);
  },
  /**
   * Calculates the conjugate of self If the quaternion is normalized,
   * this function is faster than invert and produces the same result.
   *
   * @return {clay.Quaternion}
   */
  conjugate: function() {
    return Qe.conjugate(this.array, this.array), this._dirty = !0, this;
  },
  /**
   * Copy from b
   * @param  {clay.Quaternion} b
   * @return {clay.Quaternion}
   */
  copy: function(e) {
    return Qe.copy(this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Dot product of self and b
   * @param  {clay.Quaternion} b
   * @return {number}
   */
  dot: function(e) {
    return Qe.dot(this.array, e.array);
  },
  /**
   * Set from the given 3x3 rotation matrix
   * @param  {clay.Matrix3} m
   * @return {clay.Quaternion}
   */
  fromMat3: function(e) {
    return Qe.fromMat3(this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Set from the given 4x4 rotation matrix
   * The 4th column and 4th row will be droped
   * @param  {clay.Matrix4} m
   * @return {clay.Quaternion}
   */
  fromMat4: (function() {
    var e = bt.create();
    return function(t) {
      return bt.fromMat4(e, t.array), bt.transpose(e, e), Qe.fromMat3(this.array, e), this._dirty = !0, this;
    };
  })(),
  /**
   * Set to identity quaternion
   * @return {clay.Quaternion}
   */
  identity: function() {
    return Qe.identity(this.array), this._dirty = !0, this;
  },
  /**
   * Invert self
   * @return {clay.Quaternion}
   */
  invert: function() {
    return Qe.invert(this.array, this.array), this._dirty = !0, this;
  },
  /**
   * Alias of length
   * @return {number}
   */
  len: function() {
    return Qe.len(this.array);
  },
  /**
   * Calculate the length
   * @return {number}
   */
  length: function() {
    return Qe.length(this.array);
  },
  /**
   * Linear interpolation between a and b
   * @param  {clay.Quaternion} a
   * @param  {clay.Quaternion} b
   * @param  {number}  t
   * @return {clay.Quaternion}
   */
  lerp: function(e, t, r) {
    return Qe.lerp(this.array, e.array, t.array, r), this._dirty = !0, this;
  },
  /**
   * Alias for multiply
   * @param  {clay.Quaternion} b
   * @return {clay.Quaternion}
   */
  mul: function(e) {
    return Qe.mul(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Alias for multiplyLeft
   * @param  {clay.Quaternion} a
   * @return {clay.Quaternion}
   */
  mulLeft: function(e) {
    return Qe.multiply(this.array, e.array, this.array), this._dirty = !0, this;
  },
  /**
   * Mutiply self and b
   * @param  {clay.Quaternion} b
   * @return {clay.Quaternion}
   */
  multiply: function(e) {
    return Qe.multiply(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Mutiply a and self
   * Quaternion mutiply is not commutative, so the result of mutiplyLeft is different with multiply.
   * @param  {clay.Quaternion} a
   * @return {clay.Quaternion}
   */
  multiplyLeft: function(e) {
    return Qe.multiply(this.array, e.array, this.array), this._dirty = !0, this;
  },
  /**
   * Normalize self
   * @return {clay.Quaternion}
   */
  normalize: function() {
    return Qe.normalize(this.array, this.array), this._dirty = !0, this;
  },
  /**
   * Rotate self by a given radian about X axis
   * @param {number} rad
   * @return {clay.Quaternion}
   */
  rotateX: function(e) {
    return Qe.rotateX(this.array, this.array, e), this._dirty = !0, this;
  },
  /**
   * Rotate self by a given radian about Y axis
   * @param {number} rad
   * @return {clay.Quaternion}
   */
  rotateY: function(e) {
    return Qe.rotateY(this.array, this.array, e), this._dirty = !0, this;
  },
  /**
   * Rotate self by a given radian about Z axis
   * @param {number} rad
   * @return {clay.Quaternion}
   */
  rotateZ: function(e) {
    return Qe.rotateZ(this.array, this.array, e), this._dirty = !0, this;
  },
  /**
   * Sets self to represent the shortest rotation from Vector3 a to Vector3 b.
   * a and b needs to be normalized
   * @param  {clay.Vector3} a
   * @param  {clay.Vector3} b
   * @return {clay.Quaternion}
   */
  rotationTo: function(e, t) {
    return Qe.rotationTo(this.array, e.array, t.array), this._dirty = !0, this;
  },
  /**
   * Sets self with values corresponding to the given axes
   * @param {clay.Vector3} view
   * @param {clay.Vector3} right
   * @param {clay.Vector3} up
   * @return {clay.Quaternion}
   */
  setAxes: function(e, t, r) {
    return Qe.setAxes(this.array, e.array, t.array, r.array), this._dirty = !0, this;
  },
  /**
   * Sets self with a rotation axis and rotation angle
   * @param {clay.Vector3} axis
   * @param {number} rad
   * @return {clay.Quaternion}
   */
  setAxisAngle: function(e, t) {
    return Qe.setAxisAngle(this.array, e.array, t), this._dirty = !0, this;
  },
  /**
   * Perform spherical linear interpolation between a and b
   * @param  {clay.Quaternion} a
   * @param  {clay.Quaternion} b
   * @param  {number} t
   * @return {clay.Quaternion}
   */
  slerp: function(e, t, r) {
    return Qe.slerp(this.array, e.array, t.array, r), this._dirty = !0, this;
  },
  /**
   * Alias for squaredLength
   * @return {number}
   */
  sqrLen: function() {
    return Qe.sqrLen(this.array);
  },
  /**
   * Squared length of self
   * @return {number}
   */
  squaredLength: function() {
    return Qe.squaredLength(this.array);
  },
  /**
   * Set from euler
   * @param {clay.Vector3} v
   * @param {String} order
   */
  fromEuler: function(e, t) {
    return wr.fromEuler(this, e, t);
  },
  toString: function() {
    return "[" + Array.prototype.join.call(this.array, ",") + "]";
  },
  toArray: function() {
    return Array.prototype.slice.call(this.array);
  }
};
var M_ = Object.defineProperty;
if (M_) {
  var WT = wr.prototype;
  M_(WT, "x", {
    get: function() {
      return this.array[0];
    },
    set: function(e) {
      this.array[0] = e, this._dirty = !0;
    }
  }), M_(WT, "y", {
    get: function() {
      return this.array[1];
    },
    set: function(e) {
      this.array[1] = e, this._dirty = !0;
    }
  }), M_(WT, "z", {
    get: function() {
      return this.array[2];
    },
    set: function(e) {
      this.array[2] = e, this._dirty = !0;
    }
  }), M_(WT, "w", {
    get: function() {
      return this.array[3];
    },
    set: function(e) {
      this.array[3] = e, this._dirty = !0;
    }
  });
}
wr.add = function(e, t, r) {
  return Qe.add(e.array, t.array, r.array), e._dirty = !0, e;
};
wr.set = function(e, t, r, n, i) {
  Qe.set(e.array, t, r, n, i), e._dirty = !0;
};
wr.copy = function(e, t) {
  return Qe.copy(e.array, t.array), e._dirty = !0, e;
};
wr.calculateW = function(e, t) {
  return Qe.calculateW(e.array, t.array), e._dirty = !0, e;
};
wr.conjugate = function(e, t) {
  return Qe.conjugate(e.array, t.array), e._dirty = !0, e;
};
wr.identity = function(e) {
  return Qe.identity(e.array), e._dirty = !0, e;
};
wr.invert = function(e, t) {
  return Qe.invert(e.array, t.array), e._dirty = !0, e;
};
wr.dot = function(e, t) {
  return Qe.dot(e.array, t.array);
};
wr.len = function(e) {
  return Qe.length(e.array);
};
wr.lerp = function(e, t, r, n) {
  return Qe.lerp(e.array, t.array, r.array, n), e._dirty = !0, e;
};
wr.slerp = function(e, t, r, n) {
  return Qe.slerp(e.array, t.array, r.array, n), e._dirty = !0, e;
};
wr.mul = function(e, t, r) {
  return Qe.multiply(e.array, t.array, r.array), e._dirty = !0, e;
};
wr.multiply = wr.mul;
wr.rotateX = function(e, t, r) {
  return Qe.rotateX(e.array, t.array, r), e._dirty = !0, e;
};
wr.rotateY = function(e, t, r) {
  return Qe.rotateY(e.array, t.array, r), e._dirty = !0, e;
};
wr.rotateZ = function(e, t, r) {
  return Qe.rotateZ(e.array, t.array, r), e._dirty = !0, e;
};
wr.setAxisAngle = function(e, t, r) {
  return Qe.setAxisAngle(e.array, t.array, r), e._dirty = !0, e;
};
wr.normalize = function(e, t) {
  return Qe.normalize(e.array, t.array), e._dirty = !0, e;
};
wr.sqrLen = function(e) {
  return Qe.sqrLen(e.array);
};
wr.squaredLength = wr.sqrLen;
wr.fromMat3 = function(e, t) {
  return Qe.fromMat3(e.array, t.array), e._dirty = !0, e;
};
wr.setAxes = function(e, t, r, n) {
  return Qe.setAxes(e.array, t.array, r.array, n.array), e._dirty = !0, e;
};
wr.rotationTo = function(e, t, r) {
  return Qe.rotationTo(e.array, t.array, r.array), e._dirty = !0, e;
};
wr.fromEuler = function(e, t, f) {
  e._dirty = !0, t = t.array;
  var n = e.array, i = Math.cos(t[0] / 2), a = Math.cos(t[1] / 2), o = Math.cos(t[2] / 2), s = Math.sin(t[0] / 2), l = Math.sin(t[1] / 2), u = Math.sin(t[2] / 2), f = (f || "XYZ").toUpperCase();
  switch (f) {
    case "XYZ":
      n[0] = s * a * o + i * l * u, n[1] = i * l * o - s * a * u, n[2] = i * a * u + s * l * o, n[3] = i * a * o - s * l * u;
      break;
    case "YXZ":
      n[0] = s * a * o + i * l * u, n[1] = i * l * o - s * a * u, n[2] = i * a * u - s * l * o, n[3] = i * a * o + s * l * u;
      break;
    case "ZXY":
      n[0] = s * a * o - i * l * u, n[1] = i * l * o + s * a * u, n[2] = i * a * u + s * l * o, n[3] = i * a * o - s * l * u;
      break;
    case "ZYX":
      n[0] = s * a * o - i * l * u, n[1] = i * l * o + s * a * u, n[2] = i * a * u - s * l * o, n[3] = i * a * o + s * l * u;
      break;
    case "YZX":
      n[0] = s * a * o + i * l * u, n[1] = i * l * o + s * a * u, n[2] = i * a * u - s * l * o, n[3] = i * a * o - s * l * u;
      break;
    case "XZY":
      n[0] = s * a * o - i * l * u, n[1] = i * l * o - s * a * u, n[2] = i * a * u + s * l * o, n[3] = i * a * o + s * l * u;
      break;
  }
};
var Sc = ie.set, XT = ie.copy, wi = function(e, t) {
  this.min = e || new Me(1 / 0, 1 / 0, 1 / 0), this.max = t || new Me(-1 / 0, -1 / 0, -1 / 0), this.vertices = null;
};
wi.prototype = {
  constructor: wi,
  /**
   * Update min and max coords from a vertices array
   * @param  {array} vertices
   */
  updateFromVertices: function(e) {
    if (e.length > 0) {
      var t = this.min, r = this.max, n = t.array, i = r.array;
      XT(n, e[0]), XT(i, e[0]);
      for (var a = 1; a < e.length; a++) {
        var o = e[a];
        o[0] < n[0] && (n[0] = o[0]), o[1] < n[1] && (n[1] = o[1]), o[2] < n[2] && (n[2] = o[2]), o[0] > i[0] && (i[0] = o[0]), o[1] > i[1] && (i[1] = o[1]), o[2] > i[2] && (i[2] = o[2]);
      }
      t._dirty = !0, r._dirty = !0;
    }
  },
  /**
   * Union operation with another bounding box
   * @param  {clay.BoundingBox} bbox
   */
  union: function(e) {
    var t = this.min, r = this.max;
    return ie.min(t.array, t.array, e.min.array), ie.max(r.array, r.array, e.max.array), t._dirty = !0, r._dirty = !0, this;
  },
  /**
   * Intersection operation with another bounding box
   * @param  {clay.BoundingBox} bbox
   */
  intersection: function(e) {
    var t = this.min, r = this.max;
    return ie.max(t.array, t.array, e.min.array), ie.min(r.array, r.array, e.max.array), t._dirty = !0, r._dirty = !0, this;
  },
  /**
   * If intersect with another bounding box
   * @param  {clay.BoundingBox} bbox
   * @return {boolean}
   */
  intersectBoundingBox: function(e) {
    var t = this.min.array, r = this.max.array, n = e.min.array, i = e.max.array;
    return !(t[0] > i[0] || t[1] > i[1] || t[2] > i[2] || r[0] < n[0] || r[1] < n[1] || r[2] < n[2]);
  },
  /**
   * If contain another bounding box entirely
   * @param  {clay.BoundingBox} bbox
   * @return {boolean}
   */
  containBoundingBox: function(e) {
    var t = this.min.array, r = this.max.array, n = e.min.array, i = e.max.array;
    return t[0] <= n[0] && t[1] <= n[1] && t[2] <= n[2] && r[0] >= i[0] && r[1] >= i[1] && r[2] >= i[2];
  },
  /**
   * If contain point entirely
   * @param  {clay.Vector3} point
   * @return {boolean}
   */
  containPoint: function(e) {
    var t = this.min.array, r = this.max.array, n = e.array;
    return t[0] <= n[0] && t[1] <= n[1] && t[2] <= n[2] && r[0] >= n[0] && r[1] >= n[1] && r[2] >= n[2];
  },
  /**
   * If bounding box is finite
   */
  isFinite: function() {
    var e = this.min.array, t = this.max.array;
    return isFinite(e[0]) && isFinite(e[1]) && isFinite(e[2]) && isFinite(t[0]) && isFinite(t[1]) && isFinite(t[2]);
  },
  /**
   * Apply an affine transform matrix to the bounding box
   * @param  {clay.Matrix4} matrix
   */
  applyTransform: function(e) {
    this.transformFrom(this, e);
  },
  /**
   * Get from another bounding box and an affine transform matrix.
   * @param {clay.BoundingBox} source
   * @param {clay.Matrix4} matrix
   */
  transformFrom: (function() {
    var e = ie.create(), t = ie.create(), r = ie.create(), n = ie.create(), i = ie.create(), a = ie.create();
    return function(o, s) {
      var l = o.min.array, u = o.max.array, f = s.array;
      return e[0] = f[0] * l[0], e[1] = f[1] * l[0], e[2] = f[2] * l[0], t[0] = f[0] * u[0], t[1] = f[1] * u[0], t[2] = f[2] * u[0], r[0] = f[4] * l[1], r[1] = f[5] * l[1], r[2] = f[6] * l[1], n[0] = f[4] * u[1], n[1] = f[5] * u[1], n[2] = f[6] * u[1], i[0] = f[8] * l[2], i[1] = f[9] * l[2], i[2] = f[10] * l[2], a[0] = f[8] * u[2], a[1] = f[9] * u[2], a[2] = f[10] * u[2], l = this.min.array, u = this.max.array, l[0] = Math.min(e[0], t[0]) + Math.min(r[0], n[0]) + Math.min(i[0], a[0]) + f[12], l[1] = Math.min(e[1], t[1]) + Math.min(r[1], n[1]) + Math.min(i[1], a[1]) + f[13], l[2] = Math.min(e[2], t[2]) + Math.min(r[2], n[2]) + Math.min(i[2], a[2]) + f[14], u[0] = Math.max(e[0], t[0]) + Math.max(r[0], n[0]) + Math.max(i[0], a[0]) + f[12], u[1] = Math.max(e[1], t[1]) + Math.max(r[1], n[1]) + Math.max(i[1], a[1]) + f[13], u[2] = Math.max(e[2], t[2]) + Math.max(r[2], n[2]) + Math.max(i[2], a[2]) + f[14], this.min._dirty = !0, this.max._dirty = !0, this;
    };
  })(),
  /**
   * Apply a projection matrix to the bounding box
   * @param  {clay.Matrix4} matrix
   */
  applyProjection: function(e) {
    var t = this.min.array, r = this.max.array, n = e.array, i = t[0], a = t[1], o = t[2], s = r[0], l = r[1], u = t[2], f = r[0], c = r[1], h = r[2];
    if (n[15] === 1)
      t[0] = n[0] * i + n[12], t[1] = n[5] * a + n[13], r[2] = n[10] * o + n[14], r[0] = n[0] * f + n[12], r[1] = n[5] * c + n[13], t[2] = n[10] * h + n[14];
    else {
      var v = -1 / o;
      t[0] = n[0] * i * v, t[1] = n[5] * a * v, r[2] = (n[10] * o + n[14]) * v, v = -1 / u, r[0] = n[0] * s * v, r[1] = n[5] * l * v, v = -1 / h, t[2] = (n[10] * h + n[14]) * v;
    }
    return this.min._dirty = !0, this.max._dirty = !0, this;
  },
  updateVertices: function() {
    var e = this.vertices;
    if (!e) {
      e = [];
      for (var t = 0; t < 8; t++)
        e[t] = ie.fromValues(0, 0, 0);
      this.vertices = e;
    }
    var r = this.min.array, n = this.max.array;
    return Sc(e[0], r[0], r[1], r[2]), Sc(e[1], r[0], n[1], r[2]), Sc(e[2], n[0], r[1], r[2]), Sc(e[3], n[0], n[1], r[2]), Sc(e[4], r[0], r[1], n[2]), Sc(e[5], r[0], n[1], n[2]), Sc(e[6], n[0], r[1], n[2]), Sc(e[7], n[0], n[1], n[2]), this;
  },
  /**
   * Copy values from another bounding box
   * @param  {clay.BoundingBox} bbox
   */
  copy: function(e) {
    var t = this.min, r = this.max;
    return XT(t.array, e.min.array), XT(r.array, e.max.array), t._dirty = !0, r._dirty = !0, this;
  },
  /**
   * Clone a new bounding box
   * @return {clay.BoundingBox}
   */
  clone: function() {
    var e = new wi();
    return e.copy(this), e;
  }
};
var I_e = 0, Kl = Mi.extend(
  /** @lends clay.Node# */
  {
    /**
     * Scene node name
     * @type {string}
     */
    name: "",
    /**
     * Position relative to its parent node. aka translation.
     * @type {clay.Vector3}
     */
    position: null,
    /**
     * Rotation relative to its parent node. Represented by a quaternion
     * @type {clay.Quaternion}
     */
    rotation: null,
    /**
     * Scale relative to its parent node
     * @type {clay.Vector3}
     */
    scale: null,
    /**
     * Affine transform matrix relative to its root scene.
     * @type {clay.Matrix4}
     */
    worldTransform: null,
    /**
     * Affine transform matrix relative to its parent node.
     * Composited with position, rotation and scale.
     * @type {clay.Matrix4}
     */
    localTransform: null,
    /**
     * If the local transform is update from SRT(scale, rotation, translation, which is position here) each frame
     * @type {boolean}
     */
    autoUpdateLocalTransform: !0,
    /**
     * Parent of current scene node
     * @type {?clay.Node}
     * @private
     */
    _parent: null,
    /**
     * The root scene mounted. Null if it is a isolated node
     * @type {?clay.Scene}
     * @private
     */
    _scene: null,
    /**
     * @type {boolean}
     * @private
     */
    _needsUpdateWorldTransform: !0,
    /**
     * @type {boolean}
     * @private
     */
    _inIterating: !1,
    // Depth for transparent list sorting
    __depth: 0
  },
  function() {
    this.name || (this.name = (this.type || "NODE") + "_" + I_e++), this.position || (this.position = new Me()), this.rotation || (this.rotation = new wr()), this.scale || (this.scale = new Me(1, 1, 1)), this.worldTransform = new Ke(), this.localTransform = new Ke(), this._children = [];
  },
  /**@lends clay.Node.prototype. */
  {
    /**
     * @type {?clay.Vector3}
     * @instance
     */
    target: null,
    /**
     * If node and its chilren invisible
     * @type {boolean}
     * @instance
     */
    invisible: !1,
    /**
     * If Node is a skinned mesh
     * @return {boolean}
     */
    isSkinnedMesh: function() {
      return !1;
    },
    /**
     * Return true if it is a renderable scene node, like Mesh and ParticleSystem
     * @return {boolean}
     */
    isRenderable: function() {
      return !1;
    },
    /**
     * Set the name of the scene node
     * @param {string} name
     */
    setName: function(e) {
      var t = this._scene;
      if (t) {
        var r = t._nodeRepository;
        delete r[this.name], r[e] = this;
      }
      this.name = e;
    },
    /**
     * Add a child node
     * @param {clay.Node} node
     */
    add: function(e) {
      var t = e._parent;
      if (t !== this) {
        t && t.remove(e), e._parent = this, this._children.push(e);
        var r = this._scene;
        r && r !== e.scene && e.traverse(this._addSelfToScene, this), e._needsUpdateWorldTransform = !0;
      }
    },
    /**
     * Remove the given child scene node
     * @param {clay.Node} node
     */
    remove: function(e) {
      var t = this._children, r = t.indexOf(e);
      r < 0 || (t.splice(r, 1), e._parent = null, this._scene && e.traverse(this._removeSelfFromScene, this));
    },
    /**
     * Remove all children
     */
    removeAll: function() {
      for (var e = this._children, t = 0; t < e.length; t++)
        e[t]._parent = null, this._scene && e[t].traverse(this._removeSelfFromScene, this);
      this._children = [];
    },
    /**
     * Get the scene mounted
     * @return {clay.Scene}
     */
    getScene: function() {
      return this._scene;
    },
    /**
     * Get parent node
     * @return {clay.Scene}
     */
    getParent: function() {
      return this._parent;
    },
    _removeSelfFromScene: function(e) {
      e._scene.removeFromScene(e), e._scene = null;
    },
    _addSelfToScene: function(e) {
      this._scene.addToScene(e), e._scene = this._scene;
    },
    /**
     * Return true if it is ancestor of the given scene node
     * @param {clay.Node} node
     */
    isAncestor: function(e) {
      for (var t = e._parent; t; ) {
        if (t === this)
          return !0;
        t = t._parent;
      }
      return !1;
    },
    /**
     * Get a new created array of all children nodes
     * @return {clay.Node[]}
     */
    children: function() {
      return this._children.slice();
    },
    /**
     * Get child scene node at given index.
     * @param {number} idx
     * @return {clay.Node}
     */
    childAt: function(e) {
      return this._children[e];
    },
    /**
     * Get first child with the given name
     * @param {string} name
     * @return {clay.Node}
     */
    getChildByName: function(e) {
      for (var t = this._children, r = 0; r < t.length; r++)
        if (t[r].name === e)
          return t[r];
    },
    /**
     * Get first descendant have the given name
     * @param {string} name
     * @return {clay.Node}
     */
    getDescendantByName: function(e) {
      for (var t = this._children, r = 0; r < t.length; r++) {
        var n = t[r];
        if (n.name === e)
          return n;
        var i = n.getDescendantByName(e);
        if (i)
          return i;
      }
    },
    /**
     * Query descendant node by path
     * @param {string} path
     * @return {clay.Node}
     * @example
     *  node.queryNode('root/parent/child');
     */
    queryNode: function(e) {
      if (e) {
        for (var t = e.split("/"), r = this, n = 0; n < t.length; n++) {
          var i = t[n];
          if (i) {
            for (var a = !1, o = r._children, s = 0; s < o.length; s++) {
              var l = o[s];
              if (l.name === i) {
                r = l, a = !0;
                break;
              }
            }
            if (!a)
              return;
          }
        }
        return r;
      }
    },
    /**
     * Get query path, relative to rootNode(default is scene)
     * @param {clay.Node} [rootNode]
     * @return {string}
     */
    getPath: function(e) {
      if (!this._parent)
        return "/";
      for (var t = this._parent, r = this.name; t._parent && (r = t.name + "/" + r, t._parent != e); )
        t = t._parent;
      return !t._parent && e ? null : r;
    },
    /**
     * Depth first traverse all its descendant scene nodes.
     *
     * **WARN** Don't do `add`, `remove` operation in the callback during traverse.
     * @param {Function} callback
     * @param {Node} [context]
     */
    traverse: function(e, t) {
      e.call(t, this);
      for (var r = this._children, n = 0, i = r.length; n < i; n++)
        r[n].traverse(e, t);
    },
    /**
     * Traverse all children nodes.
     *
     * **WARN** DON'T do `add`, `remove` operation in the callback during iteration.
     *
     * @param {Function} callback
     * @param {Node} [context]
     */
    eachChild: function(e, t) {
      for (var r = this._children, n = 0, i = r.length; n < i; n++) {
        var a = r[n];
        e.call(t, a, n);
      }
    },
    /**
     * Set the local transform and decompose to SRT
     * @param {clay.Matrix4} matrix
     */
    setLocalTransform: function(e) {
      Oe.copy(this.localTransform.array, e.array), this.decomposeLocalTransform();
    },
    /**
     * Decompose the local transform to SRT
     */
    decomposeLocalTransform: function(e) {
      var t = e ? null : this.scale;
      this.localTransform.decomposeMatrix(t, this.rotation, this.position);
    },
    /**
     * Set the world transform and decompose to SRT
     * @param {clay.Matrix4} matrix
     */
    setWorldTransform: function(e) {
      Oe.copy(this.worldTransform.array, e.array), this.decomposeWorldTransform();
    },
    /**
     * Decompose the world transform to SRT
     * @function
     */
    decomposeWorldTransform: (function() {
      var e = Oe.create();
      return function(t) {
        var r = this.localTransform, n = this.worldTransform;
        this._parent ? (Oe.invert(e, this._parent.worldTransform.array), Oe.multiply(r.array, e, n.array)) : Oe.copy(r.array, n.array);
        var i = t ? null : this.scale;
        r.decomposeMatrix(i, this.rotation, this.position);
      };
    })(),
    transformNeedsUpdate: function() {
      return this.position._dirty || this.rotation._dirty || this.scale._dirty;
    },
    /**
     * Update local transform from SRT
     * Notice that local transform will not be updated if _dirty mark of position, rotation, scale is all false
     */
    updateLocalTransform: function() {
      var e = this.position, t = this.rotation, r = this.scale;
      if (this.transformNeedsUpdate()) {
        var n = this.localTransform.array;
        Oe.fromRotationTranslation(n, t.array, e.array), Oe.scale(n, n, r.array), t._dirty = !1, r._dirty = !1, e._dirty = !1, this._needsUpdateWorldTransform = !0;
      }
    },
    /**
     * Update world transform, assume its parent world transform have been updated
     * @private
     */
    _updateWorldTransformTopDown: function() {
      var e = this.localTransform.array, t = this.worldTransform.array;
      this._parent ? Oe.multiplyAffine(
        t,
        this._parent.worldTransform.array,
        e
      ) : Oe.copy(t, e);
    },
    /**
     * Update world transform before whole scene is updated.
     */
    updateWorldTransform: function() {
      for (var e = this; e && e.getParent() && e.getParent().transformNeedsUpdate(); )
        e = e.getParent();
      e.update();
    },
    /**
     * Update local transform and world transform recursively
     * @param {boolean} forceUpdateWorld
     */
    update: function(e) {
      this.autoUpdateLocalTransform ? this.updateLocalTransform() : e = !0, (e || this._needsUpdateWorldTransform) && (this._updateWorldTransformTopDown(), e = !0, this._needsUpdateWorldTransform = !1);
      for (var t = this._children, r = 0, n = t.length; r < n; r++)
        t[r].update(e);
    },
    /**
     * Get bounding box of node
     * @param  {Function} [filter]
     * @param  {clay.BoundingBox} [out]
     * @return {clay.BoundingBox}
     */
    // TODO Skinning
    getBoundingBox: (function() {
      function e(i) {
        return !i.invisible && i.geometry;
      }
      var t = new wi(), r = new Ke(), n = new Ke();
      return function(i, a) {
        return a = a || new wi(), this._parent ? Ke.invert(n, this._parent.worldTransform) : Ke.identity(n), this.traverse(function(o) {
          o.geometry && o.geometry.boundingBox && (t.copy(o.geometry.boundingBox), Ke.multiply(r, n, o.worldTransform), t.applyTransform(r), a.union(t));
        }, this, e), a;
      };
    })(),
    /**
     * Get world position, extracted from world transform
     * @param  {clay.Vector3} [out]
     * @return {clay.Vector3}
     */
    getWorldPosition: function(e) {
      this.transformNeedsUpdate() && this.updateWorldTransform();
      var t = this.worldTransform.array;
      if (e) {
        var r = e.array;
        return r[0] = t[12], r[1] = t[13], r[2] = t[14], e;
      } else
        return new Me(t[12], t[13], t[14]);
    },
    /**
     * Clone a new node
     * @return {Node}
     */
    clone: function() {
      var e = new this.constructor(), t = this._children;
      e.setName(this.name), e.position.copy(this.position), e.rotation.copy(this.rotation), e.scale.copy(this.scale);
      for (var r = 0; r < t.length; r++)
        e.add(t[r].clone());
      return e;
    },
    /**
     * Rotate the node around a axis by angle degrees, axis passes through point
     * @param {clay.Vector3} point Center point
     * @param {clay.Vector3} axis  Center axis
     * @param {number}       angle Rotation angle
     * @see http://docs.unity3d.com/Documentation/ScriptReference/Transform.RotateAround.html
     * @function
     */
    rotateAround: (function() {
      var e = new Me(), t = new Ke();
      return function(r, n, i) {
        e.copy(this.position).subtract(r);
        var a = this.localTransform;
        a.identity(), a.translate(r), a.rotate(i, n), t.fromRotationTranslation(this.rotation, e), a.multiply(t), a.scale(this.scale), this.decomposeLocalTransform(), this._needsUpdateWorldTransform = !0;
      };
    })(),
    /**
     * @param {clay.Vector3} target
     * @param {clay.Vector3} [up]
     * @see http://www.opengl.org/sdk/docs/man2/xhtml/gluLookAt.xml
     * @function
     */
    lookAt: (function() {
      var e = new Ke();
      return function(t, r) {
        e.lookAt(this.position, t, r || this.localTransform.y).invert(), this.setLocalTransform(e), this.target = t;
      };
    })()
  }
), ba = Kl.extend(
  /** @lends clay.Renderable# */
  {
    /**
     * @type {clay.Material}
     */
    material: null,
    /**
     * @type {clay.Geometry}
     */
    geometry: null,
    /**
     * @type {number}
     */
    mode: Ee.TRIANGLES,
    _renderInfo: null
  },
  /** @lends clay.Renderable.prototype */
  {
    __program: null,
    /**
     * Group of received light.
     */
    lightGroup: 0,
    /**
     * Render order, Nodes with smaller value renders before nodes with larger values.
     * @type {Number}
     */
    renderOrder: 0,
    /**
     * Used when mode is LINES, LINE_STRIP or LINE_LOOP
     * @type {number}
     */
    // lineWidth: 1,
    /**
     * If enable culling
     * @type {boolean}
     */
    culling: !0,
    /**
     * Specify which side of polygon will be culled.
     * Possible values:
     *  + {@link clay.Renderable.BACK}
     *  + {@link clay.Renderable.FRONT}
     *  + {@link clay.Renderable.FRONT_AND_BACK}
     * @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/cullFace
     * @type {number}
     */
    cullFace: Ee.BACK,
    /**
     * Specify which side is front face.
     * Possible values:
     *  + {@link clay.Renderable.CW}
     *  + {@link clay.Renderable.CCW}
     * @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/frontFace
     * @type {number}
     */
    frontFace: Ee.CCW,
    /**
     * If enable software frustum culling
     * @type {boolean}
     */
    frustumCulling: !0,
    /**
     * @type {boolean}
     */
    receiveShadow: !0,
    /**
     * @type {boolean}
     */
    castShadow: !0,
    /**
     * @type {boolean}
     */
    ignorePicking: !1,
    /**
     * @type {boolean}
     */
    ignorePreZ: !1,
    /**
     * @type {boolean}
     */
    ignoreGBuffer: !1,
    /**
     * @return {boolean}
     */
    isRenderable: function() {
      return this.geometry && this.material && this.material.shader && !this.invisible && this.geometry.vertexCount > 0;
    },
    /**
     * Before render hook
     * @type {Function}
     */
    beforeRender: function(e) {
    },
    /**
     * Before render hook
     * @type {Function}
     */
    afterRender: function(e, t) {
    },
    getBoundingBox: function(e, t) {
      return t = Kl.prototype.getBoundingBox.call(this, e, t), this.geometry && this.geometry.boundingBox && t.union(this.geometry.boundingBox), t;
    },
    /**
     * Clone a new renderable
     * @function
     * @return {clay.Renderable}
     */
    clone: /* @__PURE__ */ (function() {
      var e = [
        "castShadow",
        "receiveShadow",
        "mode",
        "culling",
        "cullFace",
        "frontFace",
        "frustumCulling",
        "renderOrder",
        "lineWidth",
        "ignorePicking",
        "ignorePreZ",
        "ignoreGBuffer"
      ];
      return function() {
        var t = Kl.prototype.clone.call(this);
        t.geometry = this.geometry, t.material = this.material;
        for (var r = 0; r < e.length; r++) {
          var n = e[r];
          t[n] !== this[n] && (t[n] = this[n]);
        }
        return t;
      };
    })()
  }
);
ba.POINTS = Ee.POINTS;
ba.LINES = Ee.LINES;
ba.LINE_LOOP = Ee.LINE_LOOP;
ba.LINE_STRIP = Ee.LINE_STRIP;
ba.TRIANGLES = Ee.TRIANGLES;
ba.TRIANGLE_STRIP = Ee.TRIANGLE_STRIP;
ba.TRIANGLE_FAN = Ee.TRIANGLE_FAN;
ba.BACK = Ee.BACK;
ba.FRONT = Ee.FRONT;
ba.FRONT_AND_BACK = Ee.FRONT_AND_BACK;
ba.CW = Ee.CW;
ba.CCW = Ee.CCW;
var XN = Mi.extend(
  /** @lends clay.picking.RayPicking# */
  {
    /**
     * Target scene
     * @type {clay.Scene}
     */
    scene: null,
    /**
     * Target camera
     * @type {clay.Camera}
     */
    camera: null,
    /**
     * Target renderer
     * @type {clay.Renderer}
     */
    renderer: null
  },
  function() {
    this._ray = new md(), this._ndc = new Pt();
  },
  /** @lends clay.picking.RayPicking.prototype */
  {
    /**
     * Pick the nearest intersection object in the scene
     * @param  {number} x Mouse position x
     * @param  {number} y Mouse position y
     * @param  {boolean} [forcePickAll=false] ignore ignorePicking
     * @return {clay.picking.RayPicking~Intersection}
     */
    pick: function(e, t, r) {
      var n = this.pickAll(e, t, [], r);
      return n[0] || null;
    },
    /**
     * Pick all intersection objects, wich will be sorted from near to far
     * @param  {number} x Mouse position x
     * @param  {number} y Mouse position y
     * @param  {Array} [output]
     * @param  {boolean} [forcePickAll=false] ignore ignorePicking
     * @return {Array.<clay.picking.RayPicking~Intersection>}
     */
    pickAll: function(e, t, r, n) {
      return this.renderer.screenToNDC(e, t, this._ndc), this.camera.castRay(this._ndc, this._ray), r = r || [], this._intersectNode(this.scene, r, n || !1), r.sort(this._intersectionCompareFunc), r;
    },
    _intersectNode: function(e, t, r) {
      e instanceof ba && e.isRenderable() && (!e.ignorePicking || r) && // Only triangle mesh support ray picking
      (e.mode === Ee.TRIANGLES && e.geometry.isUseIndices() || e.geometry.pickByRay || e.geometry.pick) && this._intersectRenderable(e, t);
      for (var n = 0; n < e._children.length; n++)
        this._intersectNode(e._children[n], t, r);
    },
    _intersectRenderable: (function() {
      var e = new Me(), t = new Me(), r = new Me(), n = new md(), i = new Ke();
      return function(a, o) {
        var s = a.isSkinnedMesh();
        n.copy(this._ray), Ke.invert(i, a.worldTransform), s || n.applyTransform(i);
        var l = a.geometry, u = s ? a.skeleton.boundingBox : l.boundingBox;
        if (!(u && !n.intersectBoundingBox(u))) {
          if (l.pick) {
            l.pick(
              this._ndc.x,
              this._ndc.y,
              this.renderer,
              this.camera,
              a,
              o
            );
            return;
          } else if (l.pickByRay) {
            l.pickByRay(n, a, o);
            return;
          }
          var f = a.cullFace === Ee.BACK && a.frontFace === Ee.CCW || a.cullFace === Ee.FRONT && a.frontFace === Ee.CW, c, h = l.indices, v = l.attributes.position, d = l.attributes.weight, g = l.attributes.joint, y, x = [];
          if (!(!v || !v.value || !h)) {
            if (s) {
              y = a.skeleton.getSubSkinMatrices(a.__uid__, a.joints);
              for (var S = 0; S < a.joints.length; S++) {
                x[S] = x[S] || [];
                for (var T = 0; T < 16; T++)
                  x[S][T] = y[S * 16 + T];
              }
              var C = [], A = [], M = [], E = [], P = [], R = l.attributes.skinnedPosition;
              (!R || !R.value) && (l.createAttribute("skinnedPosition", "f", 3), R = l.attributes.skinnedPosition, R.init(l.vertexCount));
              for (var S = 0; S < l.vertexCount; S++) {
                v.get(S, C), d.get(S, A), g.get(S, M), A[3] = 1 - A[0] - A[1] - A[2], ie.set(E, 0, 0, 0);
                for (var T = 0; T < 4; T++)
                  M[T] >= 0 && A[T] > 1e-4 && (ie.transformMat4(P, C, x[M[T]]), ie.scaleAndAdd(E, E, P, A[T]));
                R.set(S, E);
              }
            }
            for (var S = 0; S < h.length; S += 3) {
              var O = h[S], N = h[S + 1], G = h[S + 2], z = s ? l.attributes.skinnedPosition : v;
              if (z.get(O, e.array), z.get(N, t.array), z.get(G, r.array), f ? c = n.intersectTriangle(e, t, r, a.culling) : c = n.intersectTriangle(e, r, t, a.culling), c) {
                var H = new Me();
                s ? Me.copy(H, c) : Me.transformMat4(H, c, a.worldTransform), o.push(new XN.Intersection(
                  c,
                  H,
                  a,
                  [O, N, G],
                  S / 3,
                  Me.dist(H, this._ray.origin)
                ));
              }
            }
          }
        }
      };
    })(),
    _intersectionCompareFunc: function(e, t) {
      return e.distance - t.distance;
    }
  }
);
XN.Intersection = function(e, t, r, n, i, a) {
  this.point = e, this.pointWorld = t, this.target = r, this.triangle = n, this.triangleIndex = i, this.distance = a;
};
var L_ = "__dt__", Bm = function() {
  this._contextId = 0, this._caches = [], this._context = {};
};
Bm.prototype = {
  use: function(e, t) {
    var r = this._caches;
    r[e] || (r[e] = {}, t && (r[e] = t())), this._contextId = e, this._context = r[e];
  },
  put: function(e, t) {
    this._context[e] = t;
  },
  get: function(e) {
    return this._context[e];
  },
  dirty: function(e) {
    e = e || "";
    var t = L_ + e;
    this.put(t, !0);
  },
  dirtyAll: function(e) {
    e = e || "";
    for (var t = L_ + e, r = this._caches, n = 0; n < r.length; n++)
      r[n] && (r[n][t] = !0);
  },
  fresh: function(e) {
    e = e || "";
    var t = L_ + e;
    this.put(t, !1);
  },
  freshAll: function(e) {
    e = e || "";
    for (var t = L_ + e, r = this._caches, n = 0; n < r.length; n++)
      r[n] && (r[n][t] = !1);
  },
  isDirty: function(e) {
    e = e || "";
    var t = L_ + e, r = this._context;
    return !r.hasOwnProperty(t) || r[t] === !0;
  },
  deleteContext: function(e) {
    delete this._caches[e], this._context = {};
  },
  delete: function(e) {
    delete this._context[e];
  },
  clearAll: function() {
    this._caches = {};
  },
  getContext: function() {
    return this._context;
  },
  eachContext: function(e, t) {
    var r = Object.keys(this._caches);
    r.forEach(function(n) {
      e && e.call(t, n);
    });
  },
  miss: function(e) {
    return !this._context.hasOwnProperty(e);
  }
};
Bm.prototype.constructor = Bm;
var We = Mi.extend(
  /** @lends clay.Texture# */
  {
    /**
     * Texture width, readonly when the texture source is image
     * @type {number}
     */
    width: 512,
    /**
     * Texture height, readonly when the texture source is image
     * @type {number}
     */
    height: 512,
    /**
     * Texel data type.
     * Possible values:
     *  + {@link clay.Texture.UNSIGNED_BYTE}
     *  + {@link clay.Texture.HALF_FLOAT}
     *  + {@link clay.Texture.FLOAT}
     *  + {@link clay.Texture.UNSIGNED_INT_24_8_WEBGL}
     *  + {@link clay.Texture.UNSIGNED_INT}
     * @type {number}
     */
    type: Ee.UNSIGNED_BYTE,
    /**
     * Format of texel data
     * Possible values:
     *  + {@link clay.Texture.RGBA}
     *  + {@link clay.Texture.DEPTH_COMPONENT}
     *  + {@link clay.Texture.DEPTH_STENCIL}
     * @type {number}
     */
    format: Ee.RGBA,
    /**
     * Texture wrap. Default to be REPEAT.
     * Possible values:
     *  + {@link clay.Texture.CLAMP_TO_EDGE}
     *  + {@link clay.Texture.REPEAT}
     *  + {@link clay.Texture.MIRRORED_REPEAT}
     * @type {number}
     */
    wrapS: Ee.REPEAT,
    /**
     * Texture wrap. Default to be REPEAT.
     * Possible values:
     *  + {@link clay.Texture.CLAMP_TO_EDGE}
     *  + {@link clay.Texture.REPEAT}
     *  + {@link clay.Texture.MIRRORED_REPEAT}
     * @type {number}
     */
    wrapT: Ee.REPEAT,
    /**
     * Possible values:
     *  + {@link clay.Texture.NEAREST}
     *  + {@link clay.Texture.LINEAR}
     *  + {@link clay.Texture.NEAREST_MIPMAP_NEAREST}
     *  + {@link clay.Texture.LINEAR_MIPMAP_NEAREST}
     *  + {@link clay.Texture.NEAREST_MIPMAP_LINEAR}
     *  + {@link clay.Texture.LINEAR_MIPMAP_LINEAR}
     * @type {number}
     */
    minFilter: Ee.LINEAR_MIPMAP_LINEAR,
    /**
     * Possible values:
     *  + {@link clay.Texture.NEAREST}
     *  + {@link clay.Texture.LINEAR}
     * @type {number}
     */
    magFilter: Ee.LINEAR,
    /**
     * If enable mimap.
     * @type {boolean}
     */
    useMipmap: !0,
    /**
     * Anisotropic filtering, enabled if value is larger than 1
     * @see https://developer.mozilla.org/en-US/docs/Web/API/EXT_texture_filter_anisotropic
     * @type {number}
     */
    anisotropic: 1,
    // pixelStorei parameters, not available when texture is used as render target
    // http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml
    /**
     * If flip in y axis for given image source
     * @type {boolean}
     * @default true
     */
    flipY: !0,
    /**
     * A flag to indicate if texture source is sRGB
     */
    sRGB: !0,
    /**
     * @type {number}
     * @default 4
     */
    unpackAlignment: 4,
    /**
     * @type {boolean}
     * @default false
     */
    premultiplyAlpha: !1,
    /**
     * Dynamic option for texture like video
     * @type {boolean}
     */
    dynamic: !1,
    NPOT: !1,
    // PENDING
    // Init it here to avoid deoptimization when it's assigned in application dynamically
    __used: 0
  },
  function() {
    this._cache = new Bm();
  },
  /** @lends clay.Texture.prototype */
  {
    getWebGLTexture: function(e) {
      var t = e.gl, r = this._cache;
      return r.use(e.__uid__), r.miss("webgl_texture") && r.put("webgl_texture", t.createTexture()), this.dynamic ? this.update(e) : r.isDirty() && (this.update(e), r.fresh()), r.get("webgl_texture");
    },
    bind: function() {
    },
    unbind: function() {
    },
    /**
     * Mark texture is dirty and update in the next frame
     */
    dirty: function() {
      this._cache && this._cache.dirtyAll();
    },
    update: function(e) {
    },
    // Update the common parameters of texture
    updateCommon: function(e) {
      var t = e.gl;
      t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL, this.flipY), t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this.premultiplyAlpha), t.pixelStorei(t.UNPACK_ALIGNMENT, this.unpackAlignment), this.format === Ee.DEPTH_COMPONENT && (this.useMipmap = !1);
      var r = e.getGLExtension("EXT_sRGB");
      this.format === We.SRGB && !r && (this.format = We.RGB), this.format === We.SRGB_ALPHA && !r && (this.format = We.RGBA), this.NPOT = !this.isPowerOfTwo();
    },
    getAvailableWrapS: function() {
      return this.NPOT ? Ee.CLAMP_TO_EDGE : this.wrapS;
    },
    getAvailableWrapT: function() {
      return this.NPOT ? Ee.CLAMP_TO_EDGE : this.wrapT;
    },
    getAvailableMinFilter: function() {
      var e = this.minFilter;
      return this.NPOT || !this.useMipmap ? e === Ee.NEAREST_MIPMAP_NEAREST || e === Ee.NEAREST_MIPMAP_LINEAR ? Ee.NEAREST : e === Ee.LINEAR_MIPMAP_LINEAR || e === Ee.LINEAR_MIPMAP_NEAREST ? Ee.LINEAR : e : e;
    },
    getAvailableMagFilter: function() {
      return this.magFilter;
    },
    nextHighestPowerOfTwo: function(e) {
      --e;
      for (var t = 1; t < 32; t <<= 1)
        e = e | e >> t;
      return e + 1;
    },
    /**
     * @param  {clay.Renderer} renderer
     */
    dispose: function(e) {
      var t = this._cache;
      t.use(e.__uid__);
      var r = t.get("webgl_texture");
      r && e.gl.deleteTexture(r), t.deleteContext(e.__uid__);
    },
    /**
     * Test if image of texture is valid and loaded.
     * @return {boolean}
     */
    isRenderable: function() {
    },
    /**
     * Test if texture size is power of two
     * @return {boolean}
     */
    isPowerOfTwo: function() {
    }
  }
);
Object.defineProperty(We.prototype, "width", {
  get: function() {
    return this._width;
  },
  set: function(e) {
    this._width = e;
  }
});
Object.defineProperty(We.prototype, "height", {
  get: function() {
    return this._height;
  },
  set: function(e) {
    this._height = e;
  }
});
We.BYTE = Ee.BYTE;
We.UNSIGNED_BYTE = Ee.UNSIGNED_BYTE;
We.SHORT = Ee.SHORT;
We.UNSIGNED_SHORT = Ee.UNSIGNED_SHORT;
We.INT = Ee.INT;
We.UNSIGNED_INT = Ee.UNSIGNED_INT;
We.FLOAT = Ee.FLOAT;
We.HALF_FLOAT = 36193;
We.UNSIGNED_INT_24_8_WEBGL = 34042;
We.DEPTH_COMPONENT = Ee.DEPTH_COMPONENT;
We.DEPTH_STENCIL = Ee.DEPTH_STENCIL;
We.ALPHA = Ee.ALPHA;
We.RGB = Ee.RGB;
We.RGBA = Ee.RGBA;
We.LUMINANCE = Ee.LUMINANCE;
We.LUMINANCE_ALPHA = Ee.LUMINANCE_ALPHA;
We.SRGB = 35904;
We.SRGB_ALPHA = 35906;
We.COMPRESSED_RGB_S3TC_DXT1_EXT = 33776;
We.COMPRESSED_RGBA_S3TC_DXT1_EXT = 33777;
We.COMPRESSED_RGBA_S3TC_DXT3_EXT = 33778;
We.COMPRESSED_RGBA_S3TC_DXT5_EXT = 33779;
We.NEAREST = Ee.NEAREST;
We.LINEAR = Ee.LINEAR;
We.NEAREST_MIPMAP_NEAREST = Ee.NEAREST_MIPMAP_NEAREST;
We.LINEAR_MIPMAP_NEAREST = Ee.LINEAR_MIPMAP_NEAREST;
We.NEAREST_MIPMAP_LINEAR = Ee.NEAREST_MIPMAP_LINEAR;
We.LINEAR_MIPMAP_LINEAR = Ee.LINEAR_MIPMAP_LINEAR;
We.REPEAT = Ee.REPEAT;
We.CLAMP_TO_EDGE = Ee.CLAMP_TO_EDGE;
We.MIRRORED_REPEAT = Ee.MIRRORED_REPEAT;
var ri = ba.extend(
  /** @lends clay.Mesh# */
  {
    /**
     * Used when it is a skinned mesh
     * @type {clay.Skeleton}
     */
    skeleton: null,
    /**
     * Joints indices Meshes can share the one skeleton instance and each mesh can use one part of joints. Joints indices indicate the index of joint in the skeleton instance
     * @type {number[]}
     */
    joints: null
  },
  function() {
    this.joints || (this.joints = []);
  },
  {
    /**
     * Offset matrix used for multiple skinned mesh clone sharing one skeleton
     * @type {clay.Matrix4}
     */
    offsetMatrix: null,
    isInstancedMesh: function() {
      return !1;
    },
    isSkinnedMesh: function() {
      return !!(this.skeleton && this.joints && this.joints.length > 0);
    },
    clone: function() {
      var e = ba.prototype.clone.call(this);
      return e.skeleton = this.skeleton, this.joints && (e.joints = this.joints.slice()), e;
    }
  }
);
ri.POINTS = Ee.POINTS;
ri.LINES = Ee.LINES;
ri.LINE_LOOP = Ee.LINE_LOOP;
ri.LINE_STRIP = Ee.LINE_STRIP;
ri.TRIANGLES = Ee.TRIANGLES;
ri.TRIANGLE_STRIP = Ee.TRIANGLE_STRIP;
ri.TRIANGLE_FAN = Ee.TRIANGLE_FAN;
ri.BACK = Ee.BACK;
ri.FRONT = Ee.FRONT;
ri.FRONT_AND_BACK = Ee.FRONT_AND_BACK;
ri.CW = Ee.CW;
ri.CCW = Ee.CCW;
var Vx = {};
Vx.isPowerOfTwo = function(e) {
  return (e & e - 1) === 0;
};
Vx.nextPowerOfTwo = function(e) {
  return e--, e |= e >> 1, e |= e >> 2, e |= e >> 4, e |= e >> 8, e |= e >> 16, e++, e;
};
Vx.nearestPowerOfTwo = function(e) {
  return Math.pow(2, Math.round(Math.log(e) / Math.LN2));
};
var kV = Vx.isPowerOfTwo;
function BV(e) {
  return Math.pow(2, Math.round(Math.log(e) / Math.LN2));
}
function R_e(e, t) {
  var r = BV(e.width), n = BV(e.height);
  t = t || document.createElement("canvas"), t.width = r, t.height = n;
  var i = t.getContext("2d");
  return i.drawImage(e.image, 0, 0, r, n), t;
}
var Vt = We.extend(function() {
  return (
    /** @lends clay.Texture2D# */
    {
      /**
       * @type {?HTMLImageElement|HTMLCanvasElemnet}
       */
      // TODO mark dirty when assigned.
      image: null,
      /**
       * Pixels data. Will be ignored if image is set.
       * @type {?Uint8Array|Float32Array}
       */
      pixels: null,
      /**
       * @type {Array.<Object>}
       * @example
       *     [{
       *         image: mipmap0,
       *         pixels: null
       *     }, {
       *         image: mipmap1,
       *         pixels: null
       *     }, ....]
       */
      mipmaps: [],
      /**
       * If convert texture to power-of-two
       * @type {boolean}
       */
      convertToPOT: !1
    }
  );
}, {
  textureType: "texture2D",
  update: function(e) {
    var t = e.gl;
    t.bindTexture(t.TEXTURE_2D, this._cache.get("webgl_texture")), this.updateCommon(e);
    var r = this.format, n = this.type, i = !!(this.convertToPOT && !this.mipmaps.length && this.image && (this.wrapS === We.REPEAT || this.wrapT === We.REPEAT) && this.NPOT);
    t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_S, i ? this.wrapS : this.getAvailableWrapS()), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_T, i ? this.wrapT : this.getAvailableWrapT()), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MAG_FILTER, i ? this.magFilter : this.getAvailableMagFilter()), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MIN_FILTER, i ? this.minFilter : this.getAvailableMinFilter());
    var a = e.getGLExtension("EXT_texture_filter_anisotropic");
    if (a && this.anisotropic > 1 && t.texParameterf(t.TEXTURE_2D, a.TEXTURE_MAX_ANISOTROPY_EXT, this.anisotropic), n === 36193) {
      var o = e.getGLExtension("OES_texture_half_float");
      o || (n = Ee.FLOAT);
    }
    if (this.mipmaps.length)
      for (var s = this.width, l = this.height, u = 0; u < this.mipmaps.length; u++) {
        var f = this.mipmaps[u];
        this._updateTextureData(t, f, u, s, l, r, n, !1), s /= 2, l /= 2;
      }
    else
      this._updateTextureData(t, this, 0, this.width, this.height, r, n, i), this.useMipmap && (!this.NPOT || i) && t.generateMipmap(t.TEXTURE_2D);
    t.bindTexture(t.TEXTURE_2D, null);
  },
  _updateTextureData: function(e, t, r, n, i, a, o, s) {
    if (t.image) {
      var l = t.image;
      s && (this._potCanvas = R_e(this, this._potCanvas), l = this._potCanvas), e.texImage2D(e.TEXTURE_2D, r, a, a, o, l);
    } else
      a <= We.COMPRESSED_RGBA_S3TC_DXT5_EXT && a >= We.COMPRESSED_RGB_S3TC_DXT1_EXT ? e.compressedTexImage2D(e.TEXTURE_2D, r, a, n, i, 0, t.pixels) : e.texImage2D(e.TEXTURE_2D, r, a, n, i, 0, a, o, t.pixels);
  },
  /**
   * @param  {clay.Renderer} renderer
   * @memberOf clay.Texture2D.prototype
   */
  generateMipmap: function(e) {
    var t = e.gl;
    this.useMipmap && !this.NPOT && (t.bindTexture(t.TEXTURE_2D, this._cache.get("webgl_texture")), t.generateMipmap(t.TEXTURE_2D));
  },
  isPowerOfTwo: function() {
    return kV(this.width) && kV(this.height);
  },
  isRenderable: function() {
    return this.image ? this.image.width > 0 && this.image.height > 0 : !!(this.width && this.height);
  },
  bind: function(e) {
    e.gl.bindTexture(e.gl.TEXTURE_2D, this.getWebGLTexture(e));
  },
  unbind: function(e) {
    e.gl.bindTexture(e.gl.TEXTURE_2D, null);
  },
  load: function(e, t) {
    var r = pr.createImage();
    t && (r.crossOrigin = t);
    var n = this;
    return r.onload = function() {
      n.dirty(), n.trigger("success", n);
    }, r.onerror = function() {
      n.trigger("error", n);
    }, r.src = e, this.image = r, this;
  }
});
Object.defineProperty(Vt.prototype, "width", {
  get: function() {
    return this.image ? this.image.width : this._width;
  },
  set: function(e) {
    this.image ? console.warn("Texture from image can't set width") : (this._width !== e && this.dirty(), this._width = e);
  }
});
Object.defineProperty(Vt.prototype, "height", {
  get: function() {
    return this.image ? this.image.height : this._height;
  },
  set: function(e) {
    this.image ? console.warn("Texture from image can't set height") : (this._height !== e && this.dirty(), this._height = e);
  }
});
function SY(e) {
  return {
    byte: pr.Int8Array,
    ubyte: pr.Uint8Array,
    short: pr.Int16Array,
    ushort: pr.Uint16Array
  }[e] || pr.Float32Array;
}
function QD(e) {
  return "attr_" + e;
}
function zm(e, t, r, n) {
  switch (this.name = e, this.type = t, this.size = r, this.semantic = n || "", this.value = null, r) {
    case 1:
      this.get = function(i) {
        return this.value[i];
      }, this.set = function(i, a) {
        this.value[i] = a;
      }, this.copy = function(i, a) {
        this.value[i] = this.value[i];
      };
      break;
    case 2:
      this.get = function(i, a) {
        var o = this.value;
        return a[0] = o[i * 2], a[1] = o[i * 2 + 1], a;
      }, this.set = function(i, a) {
        var o = this.value;
        o[i * 2] = a[0], o[i * 2 + 1] = a[1];
      }, this.copy = function(i, a) {
        var o = this.value;
        a *= 2, i *= 2, o[i] = o[a], o[i + 1] = o[a + 1];
      };
      break;
    case 3:
      this.get = function(i, a) {
        var o = i * 3, s = this.value;
        return a[0] = s[o], a[1] = s[o + 1], a[2] = s[o + 2], a;
      }, this.set = function(i, a) {
        var o = i * 3, s = this.value;
        s[o] = a[0], s[o + 1] = a[1], s[o + 2] = a[2];
      }, this.copy = function(i, a) {
        var o = this.value;
        a *= 3, i *= 3, o[i] = o[a], o[i + 1] = o[a + 1], o[i + 2] = o[a + 2];
      };
      break;
    case 4:
      this.get = function(i, a) {
        var o = this.value, s = i * 4;
        return a[0] = o[s], a[1] = o[s + 1], a[2] = o[s + 2], a[3] = o[s + 3], a;
      }, this.set = function(i, a) {
        var o = this.value, s = i * 4;
        o[s] = a[0], o[s + 1] = a[1], o[s + 2] = a[2], o[s + 3] = a[3];
      }, this.copy = function(i, a) {
        var o = this.value;
        a *= 4, i *= 4, o[i] = o[a], o[i + 1] = o[a + 1], o[i + 2] = o[a + 2], o[i + 3] = o[a + 3];
      };
  }
}
zm.prototype.init = function(e) {
  if (!this.value || this.value.length !== e * this.size) {
    var t = SY(this.type);
    this.value = new t(e * this.size);
  }
};
zm.prototype.fromArray = function(e) {
  var t = SY(this.type), r;
  if (e[0] && e[0].length) {
    var n = 0, i = this.size;
    r = new t(e.length * i);
    for (var a = 0; a < e.length; a++)
      for (var o = 0; o < i; o++)
        r[n++] = e[a][o];
  } else
    r = new t(e);
  this.value = r;
};
zm.prototype.clone = function(e) {
  var t = new zm(this.name, this.type, this.size, this.semantic);
  return e && console.warn("todo"), t;
};
function wY(e, t, r, n, i) {
  this.name = e, this.type = t, this.buffer = r, this.size = n, this.semantic = i, this.symbol = "", this.needsRemove = !1;
}
function TY(e) {
  this.buffer = e, this.count = 0;
}
var Ca = Mi.extend(
  function() {
    return (
      /** @lends clay.GeometryBase# */
      {
        /**
         * Attributes of geometry.
         * @type {Object.<string, clay.GeometryBase.Attribute>}
         */
        attributes: {},
        /**
         * Indices of geometry.
         * @type {Uint16Array|Uint32Array}
         */
        indices: null,
        /**
         * Is vertices data dynamically updated.
         * Attributes value can't be changed after first render if dyanmic is false.
         * @type {boolean}
         */
        dynamic: !0,
        _enabledAttributes: null,
        // PENDING
        // Init it here to avoid deoptimization when it's assigned in application dynamically
        __used: 0
      }
    );
  },
  function() {
    this._cache = new Bm(), this._attributeList = Object.keys(this.attributes), this.__vaoCache = {};
  },
  /** @lends clay.GeometryBase.prototype */
  {
    /**
     * Main attribute will be used to count vertex number
     * @type {string}
     */
    mainAttribute: "",
    /**
     * User defined picking algorithm instead of default
     * triangle ray intersection
     * x, y are NDC.
     * ```typescript
     * (x, y, renderer, camera, renderable, out) => boolean
     * ```
     * @type {?Function}
     */
    pick: null,
    /**
     * User defined ray picking algorithm instead of default
     * triangle ray intersection
     * ```typescript
     * (ray: clay.Ray, renderable: clay.Renderable, out: Array) => boolean
     * ```
     * @type {?Function}
     */
    pickByRay: null,
    /**
     * Mark attributes and indices in geometry needs to update.
     * Usually called after you change the data in attributes.
     */
    dirty: function() {
      for (var e = this.getEnabledAttributes(), t = 0; t < e.length; t++)
        this.dirtyAttribute(e[t]);
      this.dirtyIndices(), this._enabledAttributes = null, this._cache.dirty("any");
    },
    /**
     * Mark the indices needs to update.
     */
    dirtyIndices: function() {
      this._cache.dirtyAll("indices");
    },
    /**
     * Mark the attributes needs to update.
     * @param {string} [attrName]
     */
    dirtyAttribute: function(e) {
      this._cache.dirtyAll(QD(e)), this._cache.dirtyAll("attributes");
    },
    /**
     * Get indices of triangle at given index.
     * @param {number} idx
     * @param {Array.<number>} out
     * @return {Array.<number>}
     */
    getTriangleIndices: function(e, t) {
      if (e < this.triangleCount && e >= 0) {
        t || (t = []);
        var r = this.indices;
        return t[0] = r[e * 3], t[1] = r[e * 3 + 1], t[2] = r[e * 3 + 2], t;
      }
    },
    /**
     * Set indices of triangle at given index.
     * @param {number} idx
     * @param {Array.<number>} arr
     */
    setTriangleIndices: function(e, t) {
      var r = this.indices;
      r[e * 3] = t[0], r[e * 3 + 1] = t[1], r[e * 3 + 2] = t[2];
    },
    isUseIndices: function() {
      return !!this.indices;
    },
    /**
     * Initialize indices from an array.
     * @param {Array} array
     */
    initIndicesFromArray: function(e) {
      var t, r = this.vertexCount > 65535 ? pr.Uint32Array : pr.Uint16Array;
      if (e[0] && e[0].length) {
        var n = 0, i = 3;
        t = new r(e.length * i);
        for (var a = 0; a < e.length; a++)
          for (var o = 0; o < i; o++)
            t[n++] = e[a][o];
      } else
        t = new r(e);
      this.indices = t;
    },
    /**
     * Create a new attribute
     * @param {string} name
     * @param {string} type
     * @param {number} size
     * @param {string} [semantic]
     */
    createAttribute: function(e, t, r, n) {
      var i = new zm(e, t, r, n);
      return this.attributes[e] && this.removeAttribute(e), this.attributes[e] = i, this._attributeList.push(e), i;
    },
    /**
     * Remove attribute
     * @param {string} name
     */
    removeAttribute: function(e) {
      var t = this._attributeList, r = t.indexOf(e);
      return r >= 0 ? (t.splice(r, 1), delete this.attributes[e], !0) : !1;
    },
    /**
     * Get attribute
     * @param {string} name
     * @return {clay.GeometryBase.Attribute}
     */
    getAttribute: function(e) {
      return this.attributes[e];
    },
    /**
     * Get enabled attributes name list
     * Attribute which has the same vertex number with position is treated as a enabled attribute
     * @return {string[]}
     */
    getEnabledAttributes: function() {
      var e = this._enabledAttributes, t = this._attributeList;
      if (e)
        return e;
      for (var r = [], n = this.vertexCount, i = 0; i < t.length; i++) {
        var a = t[i], o = this.attributes[a];
        o.value && o.value.length === n * o.size && r.push(a);
      }
      return this._enabledAttributes = r, r;
    },
    getBufferChunks: function(e) {
      var t = this._cache;
      t.use(e.__uid__);
      var r = t.isDirty("attributes"), n = t.isDirty("indices");
      if (r || n) {
        this._updateBuffer(e.gl, r, n);
        for (var i = this.getEnabledAttributes(), a = 0; a < i.length; a++)
          t.fresh(QD(i[a]));
        t.fresh("attributes"), t.fresh("indices");
      }
      return t.fresh("any"), t.get("chunks");
    },
    _updateBuffer: function(e, t, r) {
      var n = this._cache, i = n.get("chunks"), a = !1;
      i || (i = [], i[0] = {
        attributeBuffers: [],
        indicesBuffer: null
      }, n.put("chunks", i), a = !0);
      var o = i[0], s = o.attributeBuffers, l = o.indicesBuffer;
      if (t || a) {
        var u = this.getEnabledAttributes(), f = {};
        if (!a)
          for (var c = 0; c < s.length; c++)
            f[s[c].name] = s[c];
        for (var h = 0; h < u.length; h++) {
          var v = u[h], d = this.attributes[v], g;
          a || (g = f[v]);
          var y;
          g ? y = g.buffer : y = e.createBuffer(), n.isDirty(QD(v)) && (e.bindBuffer(e.ARRAY_BUFFER, y), e.bufferData(e.ARRAY_BUFFER, d.value, this.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW)), s[h] = new wY(v, d.type, y, d.size, d.semantic);
        }
        for (var c = h; c < s.length; c++)
          e.deleteBuffer(s[c].buffer);
        s.length = h;
      }
      this.isUseIndices() && (r || a) && (l || (l = new TY(e.createBuffer()), o.indicesBuffer = l), l.count = this.indices.length, e.bindBuffer(e.ELEMENT_ARRAY_BUFFER, l.buffer), e.bufferData(e.ELEMENT_ARRAY_BUFFER, this.indices, this.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW));
    },
    /**
     * Dispose geometry data in GL context.
     * @param {clay.Renderer} renderer
     */
    dispose: function(e) {
      var t = this._cache;
      t.use(e.__uid__);
      var r = t.get("chunks");
      if (r)
        for (var n = 0; n < r.length; n++) {
          for (var i = r[n], a = 0; a < i.attributeBuffers.length; a++) {
            var o = i.attributeBuffers[a];
            e.gl.deleteBuffer(o.buffer);
          }
          i.indicesBuffer && e.gl.deleteBuffer(i.indicesBuffer.buffer);
        }
      if (this.__vaoCache) {
        var s = e.getGLExtension("OES_vertex_array_object");
        for (var l in this.__vaoCache) {
          var u = this.__vaoCache[l].vao;
          u && s.deleteVertexArrayOES(u);
        }
      }
      this.__vaoCache = {}, t.deleteContext(e.__uid__);
    }
  }
);
Object.defineProperty && (Object.defineProperty(Ca.prototype, "vertexCount", {
  enumerable: !1,
  get: function() {
    var e = this.attributes[this.mainAttribute];
    return e || (e = this.attributes[this._attributeList[0]]), !e || !e.value ? 0 : e.value.length / e.size;
  }
}), Object.defineProperty(Ca.prototype, "triangleCount", {
  enumerable: !1,
  get: function() {
    var e = this.indices;
    return e ? e.length / 3 : 0;
  }
}));
Ca.STATIC_DRAW = Ee.STATIC_DRAW;
Ca.DYNAMIC_DRAW = Ee.DYNAMIC_DRAW;
Ca.STREAM_DRAW = Ee.STREAM_DRAW;
Ca.AttributeBuffer = wY;
Ca.IndicesBuffer = TY;
Ca.Attribute = zm;
var pa = ie.create, Wg = ie.add, Bv = ie.set, kl = Ca.Attribute, jt = Ca.extend(
  function() {
    return (
      /** @lends clay.Geometry# */
      {
        /**
         * Attributes of geometry. Including:
         *  + `position`
         *  + `texcoord0`
         *  + `texcoord1`
         *  + `normal`
         *  + `tangent`
         *  + `color`
         *  + `weight`
         *  + `joint`
         *  + `barycentric`
         *
         * @type {Object.<string, clay.Geometry.Attribute>}
         */
        attributes: {
          position: new kl("position", "float", 3, "POSITION"),
          texcoord0: new kl("texcoord0", "float", 2, "TEXCOORD_0"),
          texcoord1: new kl("texcoord1", "float", 2, "TEXCOORD_1"),
          normal: new kl("normal", "float", 3, "NORMAL"),
          tangent: new kl("tangent", "float", 4, "TANGENT"),
          color: new kl("color", "float", 4, "COLOR"),
          // Skinning attributes
          // Each vertex can be bind to 4 bones, because the
          // sum of weights is 1, so the weights is stored in vec3 and the last
          // can be calculated by 1-w.x-w.y-w.z
          weight: new kl("weight", "float", 3, "WEIGHT"),
          joint: new kl("joint", "float", 4, "JOINT"),
          // For wireframe display
          // http://codeflow.org/entries/2012/aug/02/easy-wireframe-display-with-barycentric-coordinates/
          barycentric: new kl("barycentric", "float", 3, null)
        },
        /**
         * Calculated bounding box of geometry.
         * @type {clay.BoundingBox}
         */
        boundingBox: null
      }
    );
  },
  /** @lends clay.Geometry.prototype */
  {
    mainAttribute: "position",
    /**
     * Update boundingBox of Geometry
     */
    updateBoundingBox: function() {
      var e = this.boundingBox;
      e || (e = this.boundingBox = new wi());
      var t = this.attributes.position.value;
      if (t && t.length) {
        var r = e.min, n = e.max, i = r.array, a = n.array;
        ie.set(i, t[0], t[1], t[2]), ie.set(a, t[0], t[1], t[2]);
        for (var o = 3; o < t.length; ) {
          var s = t[o++], l = t[o++], u = t[o++];
          s < i[0] && (i[0] = s), l < i[1] && (i[1] = l), u < i[2] && (i[2] = u), s > a[0] && (a[0] = s), l > a[1] && (a[1] = l), u > a[2] && (a[2] = u);
        }
        r._dirty = !0, n._dirty = !0;
      }
    },
    /**
     * Generate normals per vertex.
     */
    generateVertexNormals: function() {
      if (this.vertexCount) {
        var e = this.indices, t = this.attributes, r = t.position.value, n = t.normal.value;
        if (!n || n.length !== r.length)
          n = t.normal.value = new pr.Float32Array(r.length);
        else
          for (var i = 0; i < n.length; i++)
            n[i] = 0;
        for (var a = pa(), o = pa(), s = pa(), l = pa(), u = pa(), f = pa(), c = e ? e.length : this.vertexCount, h, v, d, g = 0; g < c; ) {
          e ? (h = e[g++], v = e[g++], d = e[g++]) : (h = g++, v = g++, d = g++), Bv(a, r[h * 3], r[h * 3 + 1], r[h * 3 + 2]), Bv(o, r[v * 3], r[v * 3 + 1], r[v * 3 + 2]), Bv(s, r[d * 3], r[d * 3 + 1], r[d * 3 + 2]), ie.sub(l, a, o), ie.sub(u, o, s), ie.cross(f, l, u);
          for (var i = 0; i < 3; i++)
            n[h * 3 + i] = n[h * 3 + i] + f[i], n[v * 3 + i] = n[v * 3 + i] + f[i], n[d * 3 + i] = n[d * 3 + i] + f[i];
        }
        for (var i = 0; i < n.length; )
          Bv(f, n[i], n[i + 1], n[i + 2]), ie.normalize(f, f), n[i++] = f[0], n[i++] = f[1], n[i++] = f[2];
        this.dirty();
      }
    },
    /**
     * Generate normals per face.
     */
    generateFaceNormals: function() {
      if (this.vertexCount) {
        this.isUniqueVertex() || this.generateUniqueVertex();
        var e = this.indices, t = this.attributes, r = t.position.value, n = t.normal.value, i = pa(), a = pa(), o = pa(), s = pa(), l = pa(), u = pa();
        n || (n = t.normal.value = new Float32Array(r.length));
        for (var f = e ? e.length : this.vertexCount, c, h, v, d = 0; d < f; ) {
          e ? (c = e[d++], h = e[d++], v = e[d++]) : (c = d++, h = d++, v = d++), Bv(i, r[c * 3], r[c * 3 + 1], r[c * 3 + 2]), Bv(a, r[h * 3], r[h * 3 + 1], r[h * 3 + 2]), Bv(o, r[v * 3], r[v * 3 + 1], r[v * 3 + 2]), ie.sub(s, i, a), ie.sub(l, a, o), ie.cross(u, s, l), ie.normalize(u, u);
          for (var g = 0; g < 3; g++)
            n[c * 3 + g] = u[g], n[h * 3 + g] = u[g], n[v * 3 + g] = u[g];
        }
        this.dirty();
      }
    },
    /**
     * Generate tangents attributes.
     */
    generateTangents: function() {
      if (this.vertexCount) {
        var e = this.vertexCount, t = this.attributes;
        t.tangent.value || (t.tangent.value = new Float32Array(e * 4));
        var r = t.texcoord0.value, n = t.position.value, i = t.tangent.value, a = t.normal.value;
        if (!r) {
          console.warn("Geometry without texcoords can't generate tangents.");
          return;
        }
        for (var o = [], s = [], l = 0; l < e; l++)
          o[l] = [0, 0, 0], s[l] = [0, 0, 0];
        for (var u = [0, 0, 0], f = [0, 0, 0], c = this.indices, h = c ? c.length : this.vertexCount, v, d, g, l = 0; l < h; ) {
          c ? (v = c[l++], d = c[l++], g = c[l++]) : (v = l++, d = l++, g = l++);
          var y = r[v * 2], x = r[d * 2], S = r[g * 2], T = r[v * 2 + 1], C = r[d * 2 + 1], A = r[g * 2 + 1], M = n[v * 3], E = n[d * 3], P = n[g * 3], R = n[v * 3 + 1], O = n[d * 3 + 1], N = n[g * 3 + 1], G = n[v * 3 + 2], z = n[d * 3 + 2], H = n[g * 3 + 2], W = E - M, Z = P - M, ee = O - R, V = N - R, Q = z - G, q = H - G, X = x - y, K = S - y, ue = C - T, oe = A - T, te = 1 / (X * oe - ue * K);
          u[0] = (oe * W - ue * Z) * te, u[1] = (oe * ee - ue * V) * te, u[2] = (oe * Q - ue * q) * te, f[0] = (X * Z - K * W) * te, f[1] = (X * V - K * ee) * te, f[2] = (X * q - K * Q) * te, Wg(o[v], o[v], u), Wg(o[d], o[d], u), Wg(o[g], o[g], u), Wg(s[v], s[v], f), Wg(s[d], s[d], f), Wg(s[g], s[g], f);
        }
        for (var pe = pa(), me = pa(), de = pa(), l = 0; l < e; l++) {
          de[0] = a[l * 3], de[1] = a[l * 3 + 1], de[2] = a[l * 3 + 2];
          var ve = o[l];
          ie.scale(pe, de, ie.dot(de, ve)), ie.sub(pe, ve, pe), ie.normalize(pe, pe), ie.cross(me, de, ve), i[l * 4] = pe[0], i[l * 4 + 1] = pe[1], i[l * 4 + 2] = pe[2], i[l * 4 + 3] = ie.dot(me, s[l]) < 0 ? -1 : 1;
        }
        this.dirty();
      }
    },
    /**
     * If vertices are not shared by different indices.
     */
    isUniqueVertex: function() {
      return this.isUseIndices() ? this.vertexCount === this.indices.length : !0;
    },
    /**
     * Create a unique vertex for each index.
     */
    generateUniqueVertex: function() {
      if (!(!this.vertexCount || !this.indices)) {
        this.indices.length > 65535 && (this.indices = new pr.Uint32Array(this.indices));
        for (var e = this.attributes, t = this.indices, r = this.getEnabledAttributes(), n = {}, i = 0; i < r.length; i++) {
          var a = r[i];
          n[a] = e[a].value, e[a].init(this.indices.length);
        }
        for (var o = 0, s = 0; s < t.length; s++) {
          for (var l = t[s], i = 0; i < r.length; i++)
            for (var a = r[i], u = e[a].value, f = e[a].size, c = 0; c < f; c++)
              u[o * f + c] = n[a][l * f + c];
          t[s] = o, o++;
        }
        this.dirty();
      }
    },
    /**
     * Generate barycentric coordinates for wireframe draw.
     */
    generateBarycentric: function() {
      if (this.vertexCount) {
        this.isUniqueVertex() || this.generateUniqueVertex();
        var e = this.attributes, t = e.barycentric.value, r = this.indices;
        if (!(t && t.length === r.length * 3)) {
          t = e.barycentric.value = new Float32Array(r.length * 3);
          for (var n = 0; n < (r ? r.length : this.vertexCount / 3); )
            for (var i = 0; i < 3; i++) {
              var a = r ? r[n++] : n * 3 + i;
              t[a * 3 + i] = 1;
            }
          this.dirty();
        }
      }
    },
    /**
     * Apply transform to geometry attributes.
     * @param {clay.Matrix4} matrix
     */
    applyTransform: function(e) {
      var t = this.attributes, r = t.position.value, n = t.normal.value, i = t.tangent.value;
      e = e.array;
      var a = Oe.create();
      Oe.invert(a, e), Oe.transpose(a, a);
      var o = ie.transformMat4, s = ie.forEach;
      s(r, 3, 0, null, o, e), n && s(n, 3, 0, null, o, a), i && s(i, 4, 0, null, o, a), this.boundingBox && this.updateBoundingBox();
    },
    /**
     * Dispose geometry data in GL context.
     * @param {clay.Renderer} renderer
     */
    dispose: function(e) {
      var t = this._cache;
      t.use(e.__uid__);
      var r = t.get("chunks");
      if (r)
        for (var n = 0; n < r.length; n++) {
          for (var i = r[n], a = 0; a < i.attributeBuffers.length; a++) {
            var o = i.attributeBuffers[a];
            e.gl.deleteBuffer(o.buffer);
          }
          i.indicesBuffer && e.gl.deleteBuffer(i.indicesBuffer.buffer);
        }
      if (this.__vaoCache) {
        var s = e.getGLExtension("OES_vertex_array_object");
        for (var l in this.__vaoCache) {
          var u = this.__vaoCache[l].vao;
          u && s.deleteVertexArrayOES(u);
        }
      }
      this.__vaoCache = {}, t.deleteContext(e.__uid__);
    }
  }
);
jt.STATIC_DRAW = Ca.STATIC_DRAW;
jt.DYNAMIC_DRAW = Ca.DYNAMIC_DRAW;
jt.STREAM_DRAW = Ca.STREAM_DRAW;
jt.AttributeBuffer = Ca.AttributeBuffer;
jt.IndicesBuffer = Ca.IndicesBuffer;
jt.Attribute = kl;
const O_e = `vec3 calcAmbientSHLight(int idx, vec3 N) {
 int offset = 9 * idx;
 return ambientSHLightCoefficients[0]
 + ambientSHLightCoefficients[1] * N.x
 + ambientSHLightCoefficients[2] * N.y
 + ambientSHLightCoefficients[3] * N.z
 + ambientSHLightCoefficients[4] * N.x * N.z
 + ambientSHLightCoefficients[5] * N.z * N.y
 + ambientSHLightCoefficients[6] * N.y * N.x
 + ambientSHLightCoefficients[7] * (3.0 * N.z * N.z - 1.0)
 + ambientSHLightCoefficients[8] * (N.x * N.x - N.y * N.y);
}`;
var Os = "uniform vec3 ", D_ = "uniform float ", Xg = "@export clay.header.", Yg = "@end", _i = ":unconfigurable;";
const N_e = [
  Xg + "directional_light",
  Os + "directionalLightDirection[DIRECTIONAL_LIGHT_COUNT]" + _i,
  Os + "directionalLightColor[DIRECTIONAL_LIGHT_COUNT]" + _i,
  Yg,
  Xg + "ambient_light",
  Os + "ambientLightColor[AMBIENT_LIGHT_COUNT]" + _i,
  Yg,
  Xg + "ambient_sh_light",
  Os + "ambientSHLightColor[AMBIENT_SH_LIGHT_COUNT]" + _i,
  Os + "ambientSHLightCoefficients[AMBIENT_SH_LIGHT_COUNT * 9]" + _i,
  O_e,
  Yg,
  Xg + "ambient_cubemap_light",
  Os + "ambientCubemapLightColor[AMBIENT_CUBEMAP_LIGHT_COUNT]" + _i,
  "uniform samplerCube ambientCubemapLightCubemap[AMBIENT_CUBEMAP_LIGHT_COUNT]" + _i,
  "uniform sampler2D ambientCubemapLightBRDFLookup[AMBIENT_CUBEMAP_LIGHT_COUNT]" + _i,
  Yg,
  Xg + "point_light",
  Os + "pointLightPosition[POINT_LIGHT_COUNT]" + _i,
  D_ + "pointLightRange[POINT_LIGHT_COUNT]" + _i,
  Os + "pointLightColor[POINT_LIGHT_COUNT]" + _i,
  Yg,
  Xg + "spot_light",
  Os + "spotLightPosition[SPOT_LIGHT_COUNT]" + _i,
  Os + "spotLightDirection[SPOT_LIGHT_COUNT]" + _i,
  D_ + "spotLightRange[SPOT_LIGHT_COUNT]" + _i,
  D_ + "spotLightUmbraAngleCosine[SPOT_LIGHT_COUNT]" + _i,
  D_ + "spotLightPenumbraAngleCosine[SPOT_LIGHT_COUNT]" + _i,
  D_ + "spotLightFalloffFactor[SPOT_LIGHT_COUNT]" + _i,
  Os + "spotLightColor[SPOT_LIGHT_COUNT]" + _i,
  Yg
].join(`
`);
Ze.import(N_e);
var js = Kl.extend(
  function() {
    return (
      /** @lends clay.Light# */
      {
        /**
         * Light RGB color
         * @type {number[]}
         */
        color: [1, 1, 1],
        /**
         * Light intensity
         * @type {number}
         */
        intensity: 1,
        // Config for shadow map
        /**
         * If light cast shadow
         * @type {boolean}
         */
        castShadow: !0,
        /**
         * Shadow map size
         * @type {number}
         */
        shadowResolution: 512,
        /**
         * Light group, shader with same `lightGroup` will be affected
         *
         * Only useful in forward rendering
         * @type {number}
         */
        group: 0
      }
    );
  },
  /** @lends clay.Light.prototype. */
  {
    /**
     * Light type
     * @type {string}
     * @memberOf clay.Light#
     */
    type: "",
    /**
     * @return {clay.Light}
     * @memberOf clay.Light.prototype
     */
    clone: function() {
      var e = Kl.prototype.clone.call(this);
      return e.color = Array.prototype.slice.call(this.color), e.intensity = this.intensity, e.castShadow = this.castShadow, e.shadowResolution = this.shadowResolution, e;
    }
  }
), w1 = function(e, t) {
  this.normal = e || new Me(0, 1, 0), this.distance = t || 0;
};
w1.prototype = {
  constructor: w1,
  /**
   * Distance from a given point to the plane
   * @param  {clay.Vector3} point
   * @return {number}
   */
  distanceToPoint: function(e) {
    return ie.dot(e.array, this.normal.array) - this.distance;
  },
  /**
   * Calculate the projection point on the plane
   * @param  {clay.Vector3} point
   * @param  {clay.Vector3} out
   * @return {clay.Vector3}
   */
  projectPoint: function(e, t) {
    t || (t = new Me());
    var r = this.distanceToPoint(e);
    return ie.scaleAndAdd(t.array, e.array, this.normal.array, -r), t._dirty = !0, t;
  },
  /**
   * Normalize the plane's normal and calculate the distance
   */
  normalize: function() {
    var e = 1 / ie.len(this.normal.array);
    ie.scale(this.normal.array, e), this.distance *= e;
  },
  /**
   * If the plane intersect a frustum
   * @param  {clay.Frustum} Frustum
   * @return {boolean}
   */
  intersectFrustum: function(e) {
    for (var t = e.vertices, r = this.normal.array, n = ie.dot(t[0].array, r) > this.distance, i = 1; i < 8; i++)
      if (ie.dot(t[i].array, r) > this.distance != n)
        return !0;
  },
  /**
   * Calculate the intersection point between plane and a given line
   * @function
   * @param {clay.Vector3} start start point of line
   * @param {clay.Vector3} end end point of line
   * @param {clay.Vector3} [out]
   * @return {clay.Vector3}
   */
  intersectLine: (function() {
    var e = ie.create();
    return function(t, r, n) {
      var i = this.distanceToPoint(t), a = this.distanceToPoint(r);
      if (i > 0 && a > 0 || i < 0 && a < 0)
        return null;
      var o = this.normal.array, s = this.distance, l = t.array;
      ie.sub(e, r.array, t.array), ie.normalize(e, e);
      var u = ie.dot(o, e);
      if (u === 0)
        return null;
      n || (n = new Me());
      var f = (ie.dot(o, l) - s) / u;
      return ie.scaleAndAdd(n.array, l, e, -f), n._dirty = !0, n;
    };
  })(),
  /**
   * Apply an affine transform matrix to plane
   * @function
   * @return {clay.Matrix4}
   */
  applyTransform: (function() {
    var e = Oe.create(), t = Ie.create(), r = Ie.create();
    return r[3] = 1, function(n) {
      n = n.array, ie.scale(r, this.normal.array, this.distance), Ie.transformMat4(r, r, n), this.distance = ie.dot(r, this.normal.array), Oe.invert(e, n), Oe.transpose(e, e), t[3] = 0, ie.copy(t, this.normal.array), Ie.transformMat4(t, t, e), ie.copy(this.normal.array, t);
    };
  })(),
  /**
   * Copy from another plane
   * @param  {clay.Vector3} plane
   */
  copy: function(e) {
    ie.copy(this.normal.array, e.normal.array), this.normal._dirty = !0, this.distance = e.distance;
  },
  /**
   * Clone a new plane
   * @return {clay.Plane}
   */
  clone: function() {
    var e = new w1();
    return e.copy(this), e;
  }
};
var gn = ie.set, zV = ie.copy, FV = ie.transformMat4, JD = Math.min, eE = Math.max, QC = function() {
  this.planes = [];
  for (var e = 0; e < 6; e++)
    this.planes.push(new w1());
  this.boundingBox = new wi(), this.vertices = [];
  for (var e = 0; e < 8; e++)
    this.vertices[e] = ie.fromValues(0, 0, 0);
};
QC.prototype = {
  // http://web.archive.org/web/20120531231005/http://crazyjoke.free.fr/doc/3D/plane%20extraction.pdf
  /**
   * Set frustum from a projection matrix
   * @param {clay.Matrix4} projectionMatrix
   */
  setFromProjection: function(e) {
    var t = this.planes, r = e.array, n = r[0], i = r[1], a = r[2], o = r[3], s = r[4], l = r[5], u = r[6], f = r[7], c = r[8], h = r[9], v = r[10], d = r[11], g = r[12], y = r[13], x = r[14], S = r[15];
    gn(t[0].normal.array, o - n, f - s, d - c), t[0].distance = -(S - g), t[0].normalize(), gn(t[1].normal.array, o + n, f + s, d + c), t[1].distance = -(S + g), t[1].normalize(), gn(t[2].normal.array, o + i, f + l, d + h), t[2].distance = -(S + y), t[2].normalize(), gn(t[3].normal.array, o - i, f - l, d - h), t[3].distance = -(S - y), t[3].normalize(), gn(t[4].normal.array, o - a, f - u, d - v), t[4].distance = -(S - x), t[4].normalize(), gn(t[5].normal.array, o + a, f + u, d + v), t[5].distance = -(S + x), t[5].normalize();
    var T = this.boundingBox, C = this.vertices;
    if (S === 0) {
      var A = l / n, M = -x / (v - 1), E = -x / (v + 1), P = -E / l, R = -M / l;
      T.min.set(-P * A, -P, E), T.max.set(P * A, P, M), gn(C[0], -P * A, -P, E), gn(C[1], -P * A, P, E), gn(C[2], P * A, -P, E), gn(C[3], P * A, P, E), gn(C[4], -R * A, -R, M), gn(C[5], -R * A, R, M), gn(C[6], R * A, -R, M), gn(C[7], R * A, R, M);
    } else {
      var O = (-1 - g) / n, N = (1 - g) / n, G = (1 - y) / l, z = (-1 - y) / l, H = (-1 - x) / v, W = (1 - x) / v;
      T.min.set(Math.min(O, N), Math.min(z, G), Math.min(W, H)), T.max.set(Math.max(N, O), Math.max(G, z), Math.max(H, W));
      var Z = T.min.array, ee = T.max.array;
      gn(C[0], Z[0], Z[1], Z[2]), gn(C[1], Z[0], ee[1], Z[2]), gn(C[2], ee[0], Z[1], Z[2]), gn(C[3], ee[0], ee[1], Z[2]), gn(C[4], Z[0], Z[1], ee[2]), gn(C[5], Z[0], ee[1], ee[2]), gn(C[6], ee[0], Z[1], ee[2]), gn(C[7], ee[0], ee[1], ee[2]);
    }
  },
  /**
   * Apply a affine transform matrix and set to the given bounding box
   * @function
   * @param {clay.BoundingBox}
   * @param {clay.Matrix4}
   * @return {clay.BoundingBox}
   */
  getTransformedBoundingBox: (function() {
    var e = ie.create();
    return function(t, r) {
      var n = this.vertices, i = r.array, a = t.min, o = t.max, s = a.array, l = o.array, u = n[0];
      FV(e, u, i), zV(s, e), zV(l, e);
      for (var f = 1; f < 8; f++)
        u = n[f], FV(e, u, i), s[0] = JD(e[0], s[0]), s[1] = JD(e[1], s[1]), s[2] = JD(e[2], s[2]), l[0] = eE(e[0], l[0]), l[1] = eE(e[1], l[1]), l[2] = eE(e[2], l[2]);
      return a._dirty = !0, o._dirty = !0, t;
    };
  })()
};
var Fm = Kl.extend(
  function() {
    return (
      /** @lends clay.Camera# */
      {
        /**
         * Camera projection matrix
         * @type {clay.Matrix4}
         */
        projectionMatrix: new Ke(),
        /**
         * Inverse of camera projection matrix
         * @type {clay.Matrix4}
         */
        invProjectionMatrix: new Ke(),
        /**
         * View matrix, equal to inverse of camera's world matrix
         * @type {clay.Matrix4}
         */
        viewMatrix: new Ke(),
        /**
         * Camera frustum in view space
         * @type {clay.Frustum}
         */
        frustum: new QC()
      }
    );
  },
  function() {
    this.update(!0);
  },
  /** @lends clay.Camera.prototype */
  {
    update: function(e) {
      Kl.prototype.update.call(this, e), Ke.invert(this.viewMatrix, this.worldTransform), this.updateProjectionMatrix(), Ke.invert(this.invProjectionMatrix, this.projectionMatrix), this.frustum.setFromProjection(this.projectionMatrix);
    },
    /**
     * Set camera view matrix
     */
    setViewMatrix: function(e) {
      Ke.copy(this.viewMatrix, e), Ke.invert(this.worldTransform, e), this.decomposeWorldTransform();
    },
    /**
     * Decompose camera projection matrix
     */
    decomposeProjectionMatrix: function() {
    },
    /**
     * Set camera projection matrix
     * @param {clay.Matrix4} projectionMatrix
     */
    setProjectionMatrix: function(e) {
      Ke.copy(this.projectionMatrix, e), Ke.invert(this.invProjectionMatrix, e), this.decomposeProjectionMatrix();
    },
    /**
     * Update projection matrix, called after update
     */
    updateProjectionMatrix: function() {
    },
    /**
     * Cast a picking ray from camera near plane to far plane
     * @function
     * @param {clay.Vector2} ndc
     * @param {clay.Ray} [out]
     * @return {clay.Ray}
     */
    castRay: (function() {
      var e = Ie.create();
      return function(t, r) {
        var n = r !== void 0 ? r : new md(), i = t.array[0], a = t.array[1];
        return Ie.set(e, i, a, -1, 1), Ie.transformMat4(e, e, this.invProjectionMatrix.array), Ie.transformMat4(e, e, this.worldTransform.array), ie.scale(n.origin.array, e, 1 / e[3]), Ie.set(e, i, a, 1, 1), Ie.transformMat4(e, e, this.invProjectionMatrix.array), Ie.transformMat4(e, e, this.worldTransform.array), ie.scale(e, e, 1 / e[3]), ie.sub(n.direction.array, e, n.origin.array), ie.normalize(n.direction.array, n.direction.array), n.direction._dirty = !0, n.origin._dirty = !0, n;
      };
    })()
    /**
     * @function
     * @name clone
     * @return {clay.Camera}
     * @memberOf clay.Camera.prototype
     */
  }
), k_e = Oe.create(), GV = Oe.create(), tE = {};
function B_e(e) {
  var t = [], r = Object.keys(e);
  r.sort();
  for (var n = 0; n < r.length; n++) {
    var i = r[n];
    t.push(i + " " + e[i]);
  }
  var a = t.join(`
`);
  if (tE[a])
    return tE[a];
  var o = xn.genGUID();
  return tE[a] = o, o;
}
function JC() {
  this.opaque = [], this.transparent = [], this._opaqueCount = 0, this._transparentCount = 0;
}
JC.prototype.startCount = function() {
  this._opaqueCount = 0, this._transparentCount = 0;
};
JC.prototype.add = function(e, t) {
  t ? this.transparent[this._transparentCount++] = e : this.opaque[this._opaqueCount++] = e;
};
JC.prototype.endCount = function() {
  this.transparent.length = this._transparentCount, this.opaque.length = this._opaqueCount;
};
var sh = Kl.extend(
  function() {
    return (
      /** @lends clay.Scene# */
      {
        /**
         * Global material of scene
         * @type {clay.Material}
         */
        material: null,
        lights: [],
        /**
         * Scene bounding box in view space.
         * Used when camera needs to adujst the near and far plane automatically
         * so that the view frustum contains the visible objects as tightly as possible.
         * Notice:
         *  It is updated after rendering (in the step of frustum culling passingly). So may be not so accurate, but saves a lot of calculation
         *
         * @type {clay.BoundingBox}
         */
        viewBoundingBoxLastFrame: new wi(),
        // Uniforms for shadow map.
        shadowUniforms: {},
        _cameraList: [],
        // Properties to save the light information in the scene
        // Will be set in the render function
        _lightUniforms: {},
        _previousLightNumber: {},
        _lightNumber: {
          // groupId: {
          // POINT_LIGHT: 0,
          // DIRECTIONAL_LIGHT: 0,
          // SPOT_LIGHT: 0,
          // AMBIENT_LIGHT: 0,
          // AMBIENT_SH_LIGHT: 0
          // }
        },
        _lightProgramKeys: {},
        _nodeRepository: {},
        _renderLists: new Ud(20)
      }
    );
  },
  function() {
    this._scene = this;
  },
  /** @lends clay.Scene.prototype. */
  {
    // Add node to scene
    addToScene: function(e) {
      e instanceof Fm ? (this._cameraList.length > 0 && console.warn("Found multiple camera in one scene. Use the fist one."), this._cameraList.push(e)) : e instanceof js && this.lights.push(e), e.name && (this._nodeRepository[e.name] = e);
    },
    // Remove node from scene
    removeFromScene: function(e) {
      var t;
      e instanceof Fm ? (t = this._cameraList.indexOf(e), t >= 0 && this._cameraList.splice(t, 1)) : e instanceof js && (t = this.lights.indexOf(e), t >= 0 && this.lights.splice(t, 1)), e.name && delete this._nodeRepository[e.name];
    },
    /**
     * Get node by name
     * @param  {string} name
     * @return {Node}
     * @DEPRECATED
     */
    getNode: function(e) {
      return this._nodeRepository[e];
    },
    /**
     * Set main camera of the scene.
     * @param {claygl.Camera} camera
     */
    setMainCamera: function(e) {
      var t = this._cameraList.indexOf(e);
      t >= 0 && this._cameraList.splice(t, 1), this._cameraList.unshift(e);
    },
    /**
     * Get main camera of the scene.
     */
    getMainCamera: function() {
      return this._cameraList[0];
    },
    getLights: function() {
      return this.lights;
    },
    updateLights: function() {
      var e = this.lights;
      this._previousLightNumber = this._lightNumber;
      for (var t = {}, r = 0; r < e.length; r++) {
        var n = e[r];
        if (!n.invisible) {
          var i = n.group;
          t[i] || (t[i] = {}), t[i][n.type] = t[i][n.type] || 0, t[i][n.type]++;
        }
      }
      this._lightNumber = t;
      for (var a in t)
        this._lightProgramKeys[a] = B_e(t[a]);
      this._updateLightUniforms();
    },
    /**
     * Clone a node and it's children, including mesh, camera, light, etc.
     * Unlike using `Node#clone`. It will clone skeleton and remap the joints. Material will also be cloned.
     *
     * @param {clay.Node} node
     * @return {clay.Node}
     */
    cloneNode: function(e) {
      var t = e.clone(), r = {};
      function n(i, a) {
        r[i.__uid__] = a;
        for (var o = 0; o < i._children.length; o++) {
          var s = i._children[o], l = a._children[o];
          n(s, l);
        }
      }
      return n(e, t), t.traverse(function(i) {
        i.skeleton && (i.skeleton = i.skeleton.clone(r)), i.material && (i.material = i.material.clone());
      }), t;
    },
    /**
     * Traverse the scene and add the renderable object to the render list.
     * It needs camera for the frustum culling.
     *
     * @param {clay.Camera} camera
     * @param {boolean} updateSceneBoundingBox
     * @return {clay.Scene.RenderList}
     */
    updateRenderList: function(e, t) {
      var r = e.__uid__, n = this._renderLists.get(r);
      n || (n = new JC(), this._renderLists.put(r, n)), n.startCount(), t && (this.viewBoundingBoxLastFrame.min.set(1 / 0, 1 / 0, 1 / 0), this.viewBoundingBoxLastFrame.max.set(-1 / 0, -1 / 0, -1 / 0));
      var i = this.material && this.material.transparent || !1;
      return this._doUpdateRenderList(this, e, i, n, t), n.endCount(), n;
    },
    /**
     * Get render list. Used after {@link clay.Scene#updateRenderList}
     * @param {clay.Camera} camera
     * @return {clay.Scene.RenderList}
     */
    getRenderList: function(e) {
      return this._renderLists.get(e.__uid__);
    },
    _doUpdateRenderList: function(e, t, r, n, i) {
      if (!e.invisible)
        for (var a = 0; a < e._children.length; a++) {
          var o = e._children[a];
          if (o.isRenderable()) {
            var s = o.isSkinnedMesh() ? k_e : o.worldTransform.array, l = o.geometry;
            Oe.multiplyAffine(GV, t.viewMatrix.array, s), (i && !l.boundingBox || !this.isFrustumCulled(o, t, GV)) && n.add(o, o.material.transparent || r);
          }
          o._children.length > 0 && this._doUpdateRenderList(o, t, r, n, i);
        }
    },
    /**
     * If an scene object is culled by camera frustum
     *
     * Object can be a renderable or a light
     *
     * @param {clay.Node} object
     * @param {clay.Camera} camera
     * @param {Array.<number>} worldViewMat represented with array
     * @param {Array.<number>} projectionMat represented with array
     */
    isFrustumCulled: (function() {
      var e = new wi(), t = new Ke();
      return function(r, n, i) {
        var a = r.boundingBox;
        if (a || (r.skeleton && r.skeleton.boundingBox ? a = r.skeleton.boundingBox : a = r.geometry.boundingBox), !a)
          return !1;
        if (t.array = i, e.transformFrom(a, t), r.castShadow && this.viewBoundingBoxLastFrame.union(e), r.frustumCulling) {
          if (!e.intersectBoundingBox(n.frustum.boundingBox))
            return !0;
          t.array = n.projectionMatrix.array, e.max.array[2] > 0 && e.min.array[2] < 0 && (e.max.array[2] = -1e-20), e.applyProjection(t);
          var o = e.min.array, s = e.max.array;
          if (s[0] < -1 || o[0] > 1 || s[1] < -1 || o[1] > 1 || s[2] < -1 || o[2] > 1)
            return !0;
        }
        return !1;
      };
    })(),
    _updateLightUniforms: function() {
      var e = this.lights;
      e.sort(z_e);
      var t = this._lightUniforms;
      for (var r in t)
        for (var n in t[r])
          t[r][n].value.length = 0;
      for (var i = 0; i < e.length; i++) {
        var a = e[i];
        if (!a.invisible) {
          var r = a.group;
          for (var n in a.uniformTemplates) {
            var o = a.uniformTemplates[n], s = o.value(a);
            if (s != null) {
              t[r] || (t[r] = {}), t[r][n] || (t[r][n] = {
                type: "",
                value: []
              });
              var l = t[r][n];
              switch (l.type = o.type + "v", o.type) {
                case "1i":
                case "1f":
                case "t":
                  l.value.push(s);
                  break;
                case "2f":
                case "3f":
                case "4f":
                  for (var u = 0; u < s.length; u++)
                    l.value.push(s[u]);
                  break;
                default:
                  console.error("Unkown light uniform type " + o.type);
              }
            }
          }
        }
      }
    },
    getLightGroups: function() {
      var e = [];
      for (var t in this._lightNumber)
        e.push(t);
      return e;
    },
    getNumberChangedLightGroups: function() {
      var e = [];
      for (var t in this._lightNumber)
        this.isLightNumberChanged(t) && e.push(t);
      return e;
    },
    // Determine if light group is different with since last frame
    // Used to determine whether to update shader and scene's uniforms in Renderer.render
    isLightNumberChanged: function(e) {
      var t = this._previousLightNumber, r = this._lightNumber;
      for (var n in r[e])
        if (!t[e] || r[e][n] !== t[e][n])
          return !0;
      for (var n in t[e])
        if (!r[e] || r[e][n] !== t[e][n])
          return !0;
      return !1;
    },
    getLightsNumbers: function(e) {
      return this._lightNumber[e];
    },
    getProgramKey: function(e) {
      return this._lightProgramKeys[e];
    },
    setLightUniforms: /* @__PURE__ */ (function() {
      function e(t, r, n) {
        for (var i in t) {
          var a = t[i];
          if (a.type === "tv") {
            if (!r.hasUniform(i))
              continue;
            for (var o = [], s = 0; s < a.value.length; s++) {
              var l = a.value[s], u = r.takeCurrentTextureSlot(n, l);
              o.push(u);
            }
            r.setUniform(n.gl, "1iv", i, o);
          } else
            r.setUniform(n.gl, a.type, i, a.value);
        }
      }
      return function(t, r, n) {
        e(this._lightUniforms[r], t, n), e(this.shadowUniforms, t, n);
      };
    })(),
    /**
     * Dispose self, clear all the scene objects
     * But resources of gl like texuture, shader will not be disposed.
     * Mostly you should use disposeScene method in Renderer to do dispose.
     */
    dispose: function() {
      this.material = null, this._opaqueList = [], this._transparentList = [], this.lights = [], this._lightUniforms = {}, this._lightNumber = {}, this._nodeRepository = {};
    }
  }
);
function z_e(e, t) {
  if (t.castShadow && !e.castShadow)
    return !0;
}
var bY = /* @__PURE__ */ (function() {
  function e(t) {
    this.value = t;
  }
  return e;
})(), F_e = (function() {
  function e() {
    this._len = 0;
  }
  return e.prototype.insert = function(t) {
    var r = new bY(t);
    return this.insertEntry(r), r;
  }, e.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++;
  }, e.prototype.remove = function(t) {
    var r = t.prev, n = t.next;
    r ? r.next = n : this.head = n, n ? n.prev = r : this.tail = r, t.next = t.prev = null, this._len--;
  }, e.prototype.len = function() {
    return this._len;
  }, e.prototype.clear = function() {
    this.head = this.tail = null, this._len = 0;
  }, e;
})(), CY = (function() {
  function e(t) {
    this._list = new F_e(), this._maxSize = 10, this._map = {}, this._maxSize = t;
  }
  return e.prototype.put = function(t, r) {
    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 = r : s = new bY(r), s.key = t, n.insertEntry(s), i[t] = s;
    }
    return a;
  }, e.prototype.get = function(t) {
    var r = this._map[t], n = this._list;
    if (r != null)
      return r !== n.tail && (n.remove(r), n.insertEntry(r)), r.value;
  }, e.prototype.clear = function() {
    this._list.clear(), this._map = {};
  }, e.prototype.len = function() {
    return this._list.len();
  }, e;
})(), YT = Vx.isPowerOfTwo, G_e = ["px", "nx", "py", "ny", "pz", "nz"], Ed = We.extend(function() {
  return (
    /** @lends clay.TextureCube# */
    {
      /**
       * @type {boolean}
       * @default false
       */
      // PENDING cubemap should not flipY in default.
      // flipY: false,
      /**
       * @type {Object}
       * @property {?HTMLImageElement|HTMLCanvasElemnet} px
       * @property {?HTMLImageElement|HTMLCanvasElemnet} nx
       * @property {?HTMLImageElement|HTMLCanvasElemnet} py
       * @property {?HTMLImageElement|HTMLCanvasElemnet} ny
       * @property {?HTMLImageElement|HTMLCanvasElemnet} pz
       * @property {?HTMLImageElement|HTMLCanvasElemnet} nz
       */
      image: {
        px: null,
        nx: null,
        py: null,
        ny: null,
        pz: null,
        nz: null
      },
      /**
       * Pixels data of each side. Will be ignored if images are set.
       * @type {Object}
       * @property {?Uint8Array} px
       * @property {?Uint8Array} nx
       * @property {?Uint8Array} py
       * @property {?Uint8Array} ny
       * @property {?Uint8Array} pz
       * @property {?Uint8Array} nz
       */
      pixels: {
        px: null,
        nx: null,
        py: null,
        ny: null,
        pz: null,
        nz: null
      },
      /**
       * @type {Array.<Object>}
       */
      mipmaps: []
    }
  );
}, {
  textureType: "textureCube",
  update: function(e) {
    var t = e.gl;
    t.bindTexture(t.TEXTURE_CUBE_MAP, this._cache.get("webgl_texture")), this.updateCommon(e);
    var r = this.format, n = this.type;
    t.texParameteri(t.TEXTURE_CUBE_MAP, t.TEXTURE_WRAP_S, this.getAvailableWrapS()), t.texParameteri(t.TEXTURE_CUBE_MAP, t.TEXTURE_WRAP_T, this.getAvailableWrapT()), t.texParameteri(t.TEXTURE_CUBE_MAP, t.TEXTURE_MAG_FILTER, this.getAvailableMagFilter()), t.texParameteri(t.TEXTURE_CUBE_MAP, t.TEXTURE_MIN_FILTER, this.getAvailableMinFilter());
    var i = e.getGLExtension("EXT_texture_filter_anisotropic");
    if (i && this.anisotropic > 1 && t.texParameterf(t.TEXTURE_CUBE_MAP, i.TEXTURE_MAX_ANISOTROPY_EXT, this.anisotropic), n === 36193) {
      var a = e.getGLExtension("OES_texture_half_float");
      a || (n = Ee.FLOAT);
    }
    if (this.mipmaps.length)
      for (var o = this.width, s = this.height, l = 0; l < this.mipmaps.length; l++) {
        var u = this.mipmaps[l];
        this._updateTextureData(t, u, l, o, s, r, n), o /= 2, s /= 2;
      }
    else
      this._updateTextureData(t, this, 0, this.width, this.height, r, n), !this.NPOT && this.useMipmap && t.generateMipmap(t.TEXTURE_CUBE_MAP);
    t.bindTexture(t.TEXTURE_CUBE_MAP, null);
  },
  _updateTextureData: function(e, t, r, n, i, a, o) {
    for (var s = 0; s < 6; s++) {
      var l = G_e[s], u = t.image && t.image[l];
      u ? e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + s, r, a, a, o, u) : e.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X + s, r, a, n, i, 0, a, o, t.pixels && t.pixels[l]);
    }
  },
  /**
   * @param  {clay.Renderer} renderer
   * @memberOf clay.TextureCube.prototype
   */
  generateMipmap: function(e) {
    var t = e.gl;
    this.useMipmap && !this.NPOT && (t.bindTexture(t.TEXTURE_CUBE_MAP, this._cache.get("webgl_texture")), t.generateMipmap(t.TEXTURE_CUBE_MAP));
  },
  bind: function(e) {
    e.gl.bindTexture(e.gl.TEXTURE_CUBE_MAP, this.getWebGLTexture(e));
  },
  unbind: function(e) {
    e.gl.bindTexture(e.gl.TEXTURE_CUBE_MAP, null);
  },
  // Overwrite the isPowerOfTwo method
  isPowerOfTwo: function() {
    return this.image.px ? YT(this.image.px.width) && YT(this.image.px.height) : YT(this.width) && YT(this.height);
  },
  isRenderable: function() {
    return this.image.px ? Zg(this.image.px) && Zg(this.image.nx) && Zg(this.image.py) && Zg(this.image.ny) && Zg(this.image.pz) && Zg(this.image.nz) : !!(this.width && this.height);
  },
  load: function(e, t) {
    var r = 0, n = this;
    return xn.each(e, function(i, a) {
      var o = pr.createImage();
      t && (o.crossOrigin = t), o.onload = function() {
        r--, r === 0 && (n.dirty(), n.trigger("success", n));
      }, o.onerror = function() {
        r--;
      }, r++, o.src = i, n.image[a] = o;
    }), this;
  }
});
Object.defineProperty(Ed.prototype, "width", {
  get: function() {
    return this.image && this.image.px ? this.image.px.width : this._width;
  },
  set: function(e) {
    this.image && this.image.px ? console.warn("Texture from image can't set width") : (this._width !== e && this.dirty(), this._width = e);
  }
});
Object.defineProperty(Ed.prototype, "height", {
  get: function() {
    return this.image && this.image.px ? this.image.px.height : this._height;
  },
  set: function(e) {
    this.image && this.image.px ? console.warn("Texture from image can't set height") : (this._height !== e && this.dirty(), this._height = e);
  }
});
function Zg(e) {
  return e.width > 0 && e.height > 0;
}
var ei = Fm.extend(
  /** @lends clay.camera.Perspective# */
  {
    /**
     * Vertical field of view in degrees
     * @type {number}
     */
    fov: 50,
    /**
     * Aspect ratio, typically viewport width / height
     * @type {number}
     */
    aspect: 1,
    /**
     * Near bound of the frustum
     * @type {number}
     */
    near: 0.1,
    /**
     * Far bound of the frustum
     * @type {number}
     */
    far: 2e3
  },
  /** @lends clay.camera.Perspective.prototype */
  {
    updateProjectionMatrix: function() {
      var e = this.fov / 180 * Math.PI;
      this.projectionMatrix.perspective(e, this.aspect, this.near, this.far);
    },
    decomposeProjectionMatrix: function() {
      var e = this.projectionMatrix.array, t = Math.atan(1 / e[5]) * 2;
      this.fov = t / Math.PI * 180, this.aspect = e[5] / e[0], this.near = e[14] / (e[10] - 1), this.far = e[14] / (e[10] + 1);
    },
    /**
     * @return {clay.camera.Perspective}
     */
    clone: function() {
      var e = Fm.prototype.clone.call(this);
      return e.fov = this.fov, e.aspect = this.aspect, e.near = this.near, e.far = this.far, e;
    }
  }
), ZT = "framebuffer", ef = "renderbuffer", VV = ef + "_width", HV = ef + "_height", rE = ef + "_attached", nE = "depthtexture_attached", zv = Ee.FRAMEBUFFER, E_ = Ee.RENDERBUFFER, J_ = Ee.DEPTH_ATTACHMENT, AY = Ee.COLOR_ATTACHMENT0, Tn = Mi.extend(
  /** @lends clay.FrameBuffer# */
  {
    /**
     * If use depth buffer
     * @type {boolean}
     */
    depthBuffer: !0,
    /**
     * @type {Object}
     */
    viewport: null,
    _width: 0,
    _height: 0,
    _textures: null,
    _boundRenderer: null
  },
  function() {
    this._cache = new Bm(), this._textures = {};
  },
  /**@lends clay.FrameBuffer.prototype. */
  {
    /**
     * Get attached texture width
     * {number}
     */
    // FIXME Can't use before #bind
    getTextureWidth: function() {
      return this._width;
    },
    /**
     * Get attached texture height
     * {number}
     */
    getTextureHeight: function() {
      return this._height;
    },
    /**
     * Bind the framebuffer to given renderer before rendering
     * @param  {clay.Renderer} renderer
     */
    bind: function(e) {
      if (e.__currentFrameBuffer) {
        if (e.__currentFrameBuffer === this)
          return;
        console.warn("Renderer already bound with another framebuffer. Unbind it first");
      }
      e.__currentFrameBuffer = this;
      var t = e.gl;
      t.bindFramebuffer(zv, this._getFrameBufferGL(e)), this._boundRenderer = e;
      var r = this._cache;
      r.put("viewport", e.viewport);
      var n = !1, i, a;
      for (var o in this._textures) {
        n = !0;
        var s = this._textures[o];
        s && (i = s.texture.width, a = s.texture.height, this._doAttach(e, s.texture, o, s.target));
      }
      this._width = i, this._height = a, !n && this.depthBuffer && console.error("Must attach texture before bind, or renderbuffer may have incorrect width and height."), this.viewport ? e.setViewport(this.viewport) : e.setViewport(0, 0, i, a, 1);
      var l = r.get("attached_textures");
      if (l) {
        for (var o in l)
          if (!this._textures[o]) {
            var u = l[o];
            this._doDetach(t, o, u);
          }
      }
      if (!r.get(nE) && this.depthBuffer) {
        r.miss(ef) && r.put(ef, t.createRenderbuffer());
        var f = r.get(ef);
        (i !== r.get(VV) || a !== r.get(HV)) && (t.bindRenderbuffer(E_, f), t.renderbufferStorage(E_, t.DEPTH_COMPONENT16, i, a), r.put(VV, i), r.put(HV, a), t.bindRenderbuffer(E_, null)), r.get(rE) || (t.framebufferRenderbuffer(zv, J_, E_, f), r.put(rE, !0));
      }
    },
    /**
     * Unbind the frame buffer after rendering
     * @param  {clay.Renderer} renderer
     */
    unbind: function(e) {
      e.__currentFrameBuffer = null;
      var t = e.gl;
      t.bindFramebuffer(zv, null), this._boundRenderer = null, this._cache.use(e.__uid__);
      var r = this._cache.get("viewport");
      r && e.setViewport(r), this.updateMipmap(e);
    },
    // Because the data of texture is changed over time,
    // Here update the mipmaps of texture each time after rendered;
    updateMipmap: function(e) {
      var t = e.gl;
      for (var r in this._textures) {
        var n = this._textures[r];
        if (n) {
          var i = n.texture;
          if (!i.NPOT && i.useMipmap && i.minFilter === We.LINEAR_MIPMAP_LINEAR) {
            var a = i.textureType === "textureCube" ? Ee.TEXTURE_CUBE_MAP : Ee.TEXTURE_2D;
            t.bindTexture(a, i.getWebGLTexture(e)), t.generateMipmap(a), t.bindTexture(a, null);
          }
        }
      }
    },
    // 0x8CD5, 36053, FRAMEBUFFER_COMPLETE
    // 0x8CD6, 36054, FRAMEBUFFER_INCOMPLETE_ATTACHMENT
    // 0x8CD7, 36055, FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT
    // 0x8CD9, 36057, FRAMEBUFFER_INCOMPLETE_DIMENSIONS
    // 0x8CDD, 36061, FRAMEBUFFER_UNSUPPORTED
    checkStatus: function(e) {
      return e.checkFramebufferStatus(zv);
    },
    _getFrameBufferGL: function(e) {
      var t = this._cache;
      return t.use(e.__uid__), t.miss(ZT) && t.put(ZT, e.gl.createFramebuffer()), t.get(ZT);
    },
    /**
     * Attach a texture(RTT) to the framebuffer
     * @param  {clay.Texture} texture
     * @param  {number} [attachment=gl.COLOR_ATTACHMENT0]
     * @param  {number} [target=gl.TEXTURE_2D]
     */
    attach: function(e, t, r) {
      if (!e.width)
        throw new Error("The texture attached to color buffer is not a valid.");
      t = t || AY, r = r || Ee.TEXTURE_2D;
      var n = this._boundRenderer, i = n && n.gl, a;
      if (i) {
        var o = this._cache;
        o.use(n.__uid__), a = o.get("attached_textures");
      }
      var s = this._textures[t];
      if (!(s && s.target === r && s.texture === e && a && a[t] != null)) {
        var l = !0;
        n && (l = this._doAttach(n, e, t, r), this.viewport || n.setViewport(0, 0, e.width, e.height, 1)), l && (this._textures[t] = this._textures[t] || {}, this._textures[t].texture = e, this._textures[t].target = r);
      }
    },
    _doAttach: function(e, t, r, n) {
      var i = e.gl, a = t.getWebGLTexture(e), o = this._cache.get("attached_textures");
      if (o && o[r]) {
        var s = o[r];
        if (s.texture === t && s.target === n)
          return;
      }
      r = +r;
      var l = !0;
      if (r === J_ || r === Ee.DEPTH_STENCIL_ATTACHMENT) {
        var u = e.getGLExtension("WEBGL_depth_texture");
        if (u || (console.error("Depth texture is not supported by the browser"), l = !1), t.format !== Ee.DEPTH_COMPONENT && t.format !== Ee.DEPTH_STENCIL && (console.error("The texture attached to depth buffer is not a valid."), l = !1), l) {
          var f = this._cache.get(ef);
          f && (i.framebufferRenderbuffer(zv, J_, E_, null), i.deleteRenderbuffer(f), this._cache.put(ef, !1)), this._cache.put(rE, !1), this._cache.put(nE, !0);
        }
      }
      return i.framebufferTexture2D(zv, r, n, a, 0), o || (o = {}, this._cache.put("attached_textures", o)), o[r] = o[r] || {}, o[r].texture = t, o[r].target = n, l;
    },
    _doDetach: function(e, t, r) {
      e.framebufferTexture2D(zv, t, r, null, 0);
      var n = this._cache.get("attached_textures");
      n && n[t] && (n[t] = null), (t === J_ || t === Ee.DEPTH_STENCIL_ATTACHMENT) && this._cache.put(nE, !1);
    },
    /**
     * Detach a texture
     * @param  {number} [attachment=gl.COLOR_ATTACHMENT0]
     * @param  {number} [target=gl.TEXTURE_2D]
     */
    detach: function(e, t) {
      if (this._textures[e] = null, this._boundRenderer) {
        var r = this._cache;
        r.use(this._boundRenderer.__uid__), this._doDetach(this._boundRenderer.gl, e, t);
      }
    },
    /**
     * Dispose
     * @param  {WebGLRenderingContext} _gl
     */
    dispose: function(e) {
      var t = e.gl, r = this._cache;
      r.use(e.__uid__);
      var n = r.get(ef);
      n && t.deleteRenderbuffer(n);
      var i = r.get(ZT);
      i && t.deleteFramebuffer(i), r.deleteContext(e.__uid__), this._textures = {};
    }
  }
);
Tn.DEPTH_ATTACHMENT = J_;
Tn.COLOR_ATTACHMENT0 = AY;
Tn.STENCIL_ATTACHMENT = Ee.STENCIL_ATTACHMENT;
Tn.DEPTH_STENCIL_ATTACHMENT = Ee.DEPTH_STENCIL_ATTACHMENT;
var V_e = ["px", "nx", "py", "ny", "pz", "nz"], YN = Mi.extend(
  function() {
    var e = (
      /** @lends clay.prePass.EnvironmentMap# */
      {
        /**
         * Camera position
         * @type {clay.Vector3}
         * @memberOf clay.prePass.EnvironmentMap#
         */
        position: new Me(),
        /**
         * Camera far plane
         * @type {number}
         * @memberOf clay.prePass.EnvironmentMap#
         */
        far: 1e3,
        /**
         * Camera near plane
         * @type {number}
         * @memberOf clay.prePass.EnvironmentMap#
         */
        near: 0.1,
        /**
         * Environment cube map
         * @type {clay.TextureCube}
         * @memberOf clay.prePass.EnvironmentMap#
         */
        texture: null,
        /**
         * Used if you wan't have shadow in environment map
         * @type {clay.prePass.ShadowMap}
         */
        shadowMapPass: null
      }
    ), t = e._cameras = {
      px: new ei({ fov: 90 }),
      nx: new ei({ fov: 90 }),
      py: new ei({ fov: 90 }),
      ny: new ei({ fov: 90 }),
      pz: new ei({ fov: 90 }),
      nz: new ei({ fov: 90 })
    };
    return t.px.lookAt(Me.POSITIVE_X, Me.NEGATIVE_Y), t.nx.lookAt(Me.NEGATIVE_X, Me.NEGATIVE_Y), t.py.lookAt(Me.POSITIVE_Y, Me.POSITIVE_Z), t.ny.lookAt(Me.NEGATIVE_Y, Me.NEGATIVE_Z), t.pz.lookAt(Me.POSITIVE_Z, Me.NEGATIVE_Y), t.nz.lookAt(Me.NEGATIVE_Z, Me.NEGATIVE_Y), e._frameBuffer = new Tn(), e;
  },
  /** @lends clay.prePass.EnvironmentMap# */
  {
    /**
     * @param  {string} target
     * @return  {clay.Camera}
     */
    getCamera: function(e) {
      return this._cameras[e];
    },
    /**
     * @param  {clay.Renderer} renderer
     * @param  {clay.Scene} scene
     * @param  {boolean} [notUpdateScene=false]
     */
    render: function(e, t, r) {
      var n = e.gl;
      r || t.update();
      for (var i = this.texture.width, a = 2 * Math.atan(i / (i - 0.5)) / Math.PI * 180, o = 0; o < 6; o++) {
        var s = V_e[o], l = this._cameras[s];
        if (Me.copy(l.position, this.position), l.far = this.far, l.near = this.near, l.fov = a, this.shadowMapPass) {
          l.update();
          var u = t.getBoundingBox();
          u.applyTransform(l.viewMatrix), t.viewBoundingBoxLastFrame.copy(u), this.shadowMapPass.render(e, t, l, !0);
        }
        this._frameBuffer.attach(
          this.texture,
          n.COLOR_ATTACHMENT0,
          n.TEXTURE_CUBE_MAP_POSITIVE_X + o
        ), this._frameBuffer.bind(e), e.render(t, l, !0), this._frameBuffer.unbind(e);
      }
    },
    /**
     * @param {clay.Renderer} renderer
     */
    dispose: function(e) {
      this._frameBuffer.dispose(e);
    }
  }
), eA = jt.extend(
  /** @lends clay.geometry.Plane# */
  {
    dynamic: !1,
    /**
     * @type {number}
     */
    widthSegments: 1,
    /**
     * @type {number}
     */
    heightSegments: 1
  },
  function() {
    this.build();
  },
  /** @lends clay.geometry.Plane.prototype */
  {
    /**
     * Build plane geometry
     */
    build: function() {
      for (var e = this.heightSegments, t = this.widthSegments, r = this.attributes, n = [], i = [], a = [], o = [], s = 0; s <= e; s++)
        for (var l = s / e, u = 0; u <= t; u++) {
          var f = u / t;
          if (n.push([2 * f - 1, 2 * l - 1, 0]), i && i.push([f, l]), a && a.push([0, 0, 1]), u < t && s < e) {
            var c = u + s * (t + 1);
            o.push([c, c + 1, c + t + 1]), o.push([c + t + 1, c + 1, c + t + 2]);
          }
        }
      r.position.fromArray(n), r.texcoord0.fromArray(i), r.normal.fromArray(a), this.initIndicesFromArray(o), this.boundingBox = new wi(), this.boundingBox.min.set(-1, -1, 0), this.boundingBox.max.set(1, 1, 0);
    }
  }
), rn = new Ke(), MY = jt.extend(
  /**@lends clay.geometry.Cube# */
  {
    dynamic: !1,
    /**
     * @type {number}
     */
    widthSegments: 1,
    /**
     * @type {number}
     */
    heightSegments: 1,
    /**
     * @type {number}
     */
    depthSegments: 1,
    /**
     * @type {boolean}
     */
    inside: !1
  },
  function() {
    this.build();
  },
  /** @lends clay.geometry.Cube.prototype */
  {
    /**
     * Build cube geometry
     */
    build: function() {
      var e = {
        px: $g("px", this.depthSegments, this.heightSegments),
        nx: $g("nx", this.depthSegments, this.heightSegments),
        py: $g("py", this.widthSegments, this.depthSegments),
        ny: $g("ny", this.widthSegments, this.depthSegments),
        pz: $g("pz", this.widthSegments, this.heightSegments),
        nz: $g("nz", this.widthSegments, this.heightSegments)
      }, t = ["position", "texcoord0", "normal"], r = 0, n = 0;
      for (var i in e)
        r += e[i].vertexCount, n += e[i].indices.length;
      for (var a = 0; a < t.length; a++)
        this.attributes[t[a]].init(r);
      this.indices = new pr.Uint16Array(n);
      var o = 0, s = 0;
      for (var i in e) {
        for (var l = e[i], a = 0; a < t.length; a++)
          for (var u = t[a], f = l.attributes[u].value, c = l.attributes[u].size, h = u === "normal", v = 0; v < f.length; v++) {
            var d = f[v];
            this.inside && h && (d = -d), this.attributes[u].value[v + c * s] = d;
          }
        for (var g = l.indices.length, v = 0; v < l.indices.length; v++)
          this.indices[v + o] = s + l.indices[this.inside ? g - v - 1 : v];
        o += l.indices.length, s += l.vertexCount;
      }
      this.boundingBox = new wi(), this.boundingBox.max.set(1, 1, 1), this.boundingBox.min.set(-1, -1, -1);
    }
  }
);
function $g(e, t, r) {
  rn.identity();
  var n = new eA({
    widthSegments: t,
    heightSegments: r
  });
  switch (e) {
    case "px":
      Ke.translate(rn, rn, Me.POSITIVE_X), Ke.rotateY(rn, rn, Math.PI / 2);
      break;
    case "nx":
      Ke.translate(rn, rn, Me.NEGATIVE_X), Ke.rotateY(rn, rn, -Math.PI / 2);
      break;
    case "py":
      Ke.translate(rn, rn, Me.POSITIVE_Y), Ke.rotateX(rn, rn, -Math.PI / 2);
      break;
    case "ny":
      Ke.translate(rn, rn, Me.NEGATIVE_Y), Ke.rotateX(rn, rn, Math.PI / 2);
      break;
    case "pz":
      Ke.translate(rn, rn, Me.POSITIVE_Z);
      break;
    case "nz":
      Ke.translate(rn, rn, Me.NEGATIVE_Z), Ke.rotateY(rn, rn, Math.PI);
      break;
  }
  return n.applyTransform(rn), n;
}
const H_e = `@export clay.skybox.vertex
#define SHADER_NAME skybox
uniform mat4 world : WORLD;
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
attribute vec3 position : POSITION;
varying vec3 v_WorldPosition;
void main()
{
 v_WorldPosition = (world * vec4(position, 1.0)).xyz;
 gl_Position = worldViewProjection * vec4(position, 1.0);
}
@end
@export clay.skybox.fragment
#define PI 3.1415926
uniform mat4 viewInverse : VIEWINVERSE;
#ifdef EQUIRECTANGULAR
uniform sampler2D environmentMap;
#else
uniform samplerCube environmentMap;
#endif
uniform float lod: 0.0;
varying vec3 v_WorldPosition;
@import clay.util.rgbm
@import clay.util.srgb
@import clay.util.ACES
void main()
{
 vec3 eyePos = viewInverse[3].xyz;
 vec3 V = normalize(v_WorldPosition - eyePos);
#ifdef EQUIRECTANGULAR
 float phi = acos(V.y);
 float theta = atan(-V.x, V.z) + PI * 0.5;
 vec2 uv = vec2(theta / 2.0 / PI, phi / PI);
 vec4 texel = decodeHDR(texture2D(environmentMap, fract(uv)));
#else
 #if defined(LOD) || defined(SUPPORT_TEXTURE_LOD)
 vec4 texel = decodeHDR(textureCubeLodEXT(environmentMap, V, lod));
 #else
 vec4 texel = decodeHDR(textureCube(environmentMap, V));
 #endif
#endif
#ifdef SRGB_DECODE
 texel = sRGBToLinear(texel);
#endif
#ifdef TONEMAPPING
 texel.rgb = ACESToneMapping(texel.rgb);
#endif
#ifdef SRGB_ENCODE
 texel = linearTosRGB(texel);
#endif
 gl_FragColor = encodeHDR(vec4(texel.rgb, 1.0));
}
@end`;
Ze.import(H_e);
var lx = ri.extend(
  function() {
    var e = new Ze({
      vertex: Ze.source("clay.skybox.vertex"),
      fragment: Ze.source("clay.skybox.fragment")
    }), t = new ls({
      shader: e,
      depthMask: !1
    });
    return {
      /**
       * @type {clay.Scene}
       * @memberOf clay.plugin.Skybox.prototype
       */
      scene: null,
      geometry: new MY(),
      material: t,
      environmentMap: null,
      culling: !1,
      _dummyCamera: new ei()
    };
  },
  function() {
    var e = this.scene;
    e && this.attachScene(e), this.environmentMap && this.setEnvironmentMap(this.environmentMap);
  },
  /** @lends clay.plugin.Skybox# */
  {
    /**
     * Attach the skybox to the scene
     * @param  {clay.Scene} scene
     */
    attachScene: function(e) {
      this.scene && this.detachScene(), e.skybox = this, this.scene = e, e.on("beforerender", this._beforeRenderScene, this);
    },
    /**
     * Detach from scene
     */
    detachScene: function() {
      this.scene && (this.scene.off("beforerender", this._beforeRenderScene), this.scene.skybox = null), this.scene = null;
    },
    /**
     * Dispose skybox
     * @param  {clay.Renderer} renderer
     */
    dispose: function(e) {
      this.detachScene(), this.geometry.dispose(e);
    },
    /**
     * Set environment map
     * @param {clay.TextureCube} envMap
     */
    setEnvironmentMap: function(e) {
      e.textureType === "texture2D" ? (this.material.define("EQUIRECTANGULAR"), e.minFilter = We.LINEAR) : this.material.undefine("EQUIRECTANGULAR"), this.material.set("environmentMap", e);
    },
    /**
     * Get environment map
     * @return {clay.TextureCube}
     */
    getEnvironmentMap: function() {
      return this.material.get("environmentMap");
    },
    _beforeRenderScene: function(e, t, r) {
      this.renderSkybox(e, r);
    },
    renderSkybox: function(e, t) {
      var r = this._dummyCamera;
      r.aspect = e.getViewportAspect(), r.fov = t.fov || 50, r.updateProjectionMatrix(), Ke.invert(r.invProjectionMatrix, r.projectionMatrix), r.worldTransform.copy(t.worldTransform), r.viewMatrix.copy(t.viewMatrix), this.position.copy(t.getWorldPosition()), this.update(), e.gl.disable(e.gl.BLEND), this.material.get("lod") > 0 ? this.material.define("fragment", "LOD") : this.material.undefine("fragment", "LOD"), e.renderPass([this], r);
    }
  }
), U_e = 542327876, W_e = 131072, X_e = 512, Y_e = 4;
function ZN(e) {
  return e.charCodeAt(0) + (e.charCodeAt(1) << 8) + (e.charCodeAt(2) << 16) + (e.charCodeAt(3) << 24);
}
var Z_e = 31, $_e = ZN("DXT1"), q_e = ZN("DXT3"), j_e = ZN("DXT5"), K_e = 0, Q_e = 1, J_e = 2, e1e = 3, t1e = 4, r1e = 7, n1e = 20, i1e = 21, a1e = 28, o1e = {
  parse: function(e, t) {
    var r = new Int32Array(e, 0, Z_e);
    if (r[K_e] !== U_e || !r(n1e) & Y_e)
      return null;
    var n = r(i1e), i = r[t1e], a = r[e1e], o = r[a1e] & X_e, s = r[J_e] & W_e, l, u;
    switch (n) {
      case $_e:
        l = 8, u = We.COMPRESSED_RGB_S3TC_DXT1_EXT;
        break;
      case q_e:
        l = 16, u = We.COMPRESSED_RGBA_S3TC_DXT3_EXT;
        break;
      case j_e:
        l = 16, u = We.COMPRESSED_RGBA_S3TC_DXT5_EXT;
        break;
      default:
        return null;
    }
    var f = r[Q_e] + 4, c = o ? 6 : 1, h = 1;
    s && (h = Math.max(1, r[r1e]));
    for (var v = [], d = 0; d < c; d++) {
      var g = i, y = a;
      v[d] = new Vt({
        width: g,
        height: y,
        format: u
      });
      for (var x = [], S = 0; S < h; S++) {
        var T = Math.max(4, g) / 4 * Math.max(4, y) / 4 * l, C = new Uint8Array(e, f, T);
        f += T, g *= 0.5, y *= 0.5, x[S] = C;
      }
      v[d].pixels = x[0], s && (v[d].mipmaps = x);
    }
    if (t)
      t.width = v[0].width, t.height = v[0].height, t.format = v[0].format, t.pixels = v[0].pixels, t.mipmaps = v[0].mipmaps;
    else
      return v[0];
  }
}, R2 = String.fromCharCode, s1e = 8, l1e = 32767;
function u1e(e, t, r, n) {
  if (e[3] > 0) {
    var i = Math.pow(2, e[3] - 128 - 8 + n);
    t[r + 0] = e[0] * i, t[r + 1] = e[1] * i, t[r + 2] = e[2] * i;
  } else
    t[r + 0] = 0, t[r + 1] = 0, t[r + 2] = 0;
  return t[r + 3] = 1, t;
}
function f1e(e, t, r) {
  for (var n = "", i = t; i < r; i++)
    n += R2(e[i]);
  return n;
}
function c1e(e, t) {
  t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[3];
}
function UV(e, t, r, n) {
  for (var i = 0, a = 0, o = n; o > 0; )
    if (e[a][0] = t[r++], e[a][1] = t[r++], e[a][2] = t[r++], e[a][3] = t[r++], e[a][0] === 1 && e[a][1] === 1 && e[a][2] === 1) {
      for (var s = e[a][3] << i >>> 0; s > 0; s--)
        c1e(e[a - 1], e[a]), a++, o--;
      i += 8;
    } else
      a++, o--, i = 0;
  return r;
}
function h1e(e, t, r, n) {
  if (n < s1e | n > l1e)
    return UV(e, t, r, n);
  var i = t[r++];
  if (i != 2)
    return UV(e, t, r - 1, n);
  if (e[0][1] = t[r++], e[0][2] = t[r++], i = t[r++], (e[0][2] << 8 >>> 0 | i) >>> 0 !== n)
    return null;
  for (var i = 0; i < 4; i++)
    for (var a = 0; a < n; ) {
      var o = t[r++];
      if (o > 128) {
        o = (o & 127) >>> 0;
        for (var s = t[r++]; o--; )
          e[a++][i] = s;
      } else
        for (; o--; )
          e[a++][i] = t[r++];
    }
  return r;
}
var v1e = {
  // http://www.graphics.cornell.edu/~bjw/rgbe.html
  // Blender source
  // http://radsite.lbl.gov/radiance/refer/Notes/picture_format.html
  parseRGBE: function(e, t, r) {
    r == null && (r = 0);
    var n = new Uint8Array(e), i = n.length;
    if (f1e(n, 0, 2) === "#?") {
      for (var a = 2; a < i && !(R2(n[a]) === `
` && R2(n[a + 1]) === `
`); a++)
        ;
      if (!(a >= i)) {
        a += 2;
        for (var o = ""; a < i; a++) {
          var s = R2(n[a]);
          if (s === `
`)
            break;
          o += s;
        }
        var l = o.split(" "), u = parseInt(l[1]), f = parseInt(l[3]);
        if (!(!f || !u)) {
          for (var c = a + 1, h = [], v = 0; v < f; v++) {
            h[v] = [];
            for (var d = 0; d < 4; d++)
              h[v][d] = 0;
          }
          for (var g = new Float32Array(f * u * 4), y = 0, x = 0; x < u; x++) {
            var c = h1e(h, n, c, f);
            if (!c)
              return null;
            for (var v = 0; v < f; v++)
              u1e(h[v], g, y, r), y += 4;
          }
          return t || (t = new Vt()), t.width = f, t.height = u, t.pixels = g, t.type = We.FLOAT, t;
        }
      }
    }
  },
  parseRGBEFromPNG: function(e) {
  }
}, Ql = {
  /**
   * @param  {string|object} path
   * @param  {object} [option]
   * @param  {Function} [onsuccess]
   * @param  {Function} [onerror]
   * @return {clay.Texture}
   */
  loadTexture: function(e, t, r, n) {
    var i;
    if (typeof t == "function" ? (r = t, n = r, t = {}) : t = t || {}, typeof e == "string") {
      if (e.match(/.hdr$/) || t.fileType === "hdr")
        return i = new Vt({
          width: 0,
          height: 0,
          sRGB: !1
        }), Ql._fetchTexture(
          e,
          function(a) {
            v1e.parseRGBE(a, i, t.exposure), i.dirty(), r && r(i);
          },
          n
        ), i;
      e.match(/.dds$/) || t.fileType === "dds" ? (i = new Vt({
        width: 0,
        height: 0
      }), Ql._fetchTexture(
        e,
        function(a) {
          o1e.parse(a, i), i.dirty(), r && r(i);
        },
        n
      )) : (i = new Vt(), i.load(e), i.success(r), i.error(n));
    } else typeof e == "object" && typeof e.px < "u" && (i = new Ed(), i.load(e), i.success(r), i.error(n));
    return i;
  },
  /**
   * Load a panorama texture and render it to a cube map
   * @param  {clay.Renderer} renderer
   * @param  {string} path
   * @param  {clay.TextureCube} cubeMap
   * @param  {object} [option]
   * @param  {boolean} [option.encodeRGBM]
   * @param  {number} [option.exposure]
   * @param  {Function} [onsuccess]
   * @param  {Function} [onerror]
   */
  loadPanorama: function(e, t, r, n, i, a) {
    var o = this;
    typeof n == "function" ? (i = n, a = i, n = {}) : n = n || {}, Ql.loadTexture(t, n, function(s) {
      s.flipY = n.flipY || !1, o.panoramaToCubeMap(e, s, r, n), s.dispose(e), i && i(r);
    }, a);
  },
  /**
   * Render a panorama texture to a cube map
   * @param  {clay.Renderer} renderer
   * @param  {clay.Texture2D} panoramaMap
   * @param  {clay.TextureCube} cubeMap
   * @param  {Object} option
   * @param  {boolean} [option.encodeRGBM]
   */
  panoramaToCubeMap: function(e, t, r, n) {
    var i = new YN(), a = new lx({
      scene: new sh()
    });
    return a.setEnvironmentMap(t), n = n || {}, n.encodeRGBM && a.material.define("fragment", "RGBM_ENCODE"), r.sRGB = t.sRGB, i.texture = r, i.render(e, a.scene), i.texture = null, i.dispose(e), r;
  },
  /**
   * Convert height map to normal map
   * @param {HTMLImageElement|HTMLCanvasElement} image
   * @param {boolean} [checkBump=false]
   * @return {HTMLCanvasElement}
   */
  heightToNormal: function(e, t) {
    var r = document.createElement("canvas"), n = r.width = e.width, i = r.height = e.height, a = r.getContext("2d");
    a.drawImage(e, 0, 0, n, i), t = t || !1;
    for (var o = a.getImageData(0, 0, n, i), s = a.createImageData(n, i), l = 0; l < o.data.length; l += 4) {
      if (t) {
        var u = o.data[l], f = o.data[l + 1], c = o.data[l + 2], h = Math.abs(u - f) + Math.abs(f - c);
        if (h > 20)
          return console.warn("Given image is not a height map"), e;
      }
      var v, d, g, y;
      l % (n * 4) === 0 ? (v = o.data[l], g = o.data[l + 4]) : l % (n * 4) === (n - 1) * 4 ? (v = o.data[l - 4], g = o.data[l]) : (v = o.data[l - 4], g = o.data[l + 4]), l < n * 4 ? (d = o.data[l], y = o.data[l + n * 4]) : l > n * (i - 1) * 4 ? (d = o.data[l - n * 4], y = o.data[l]) : (d = o.data[l - n * 4], y = o.data[l + n * 4]), s.data[l] = v - g + 127, s.data[l + 1] = d - y + 127, s.data[l + 2] = 255, s.data[l + 3] = 255;
    }
    return a.putImageData(s, 0, 0), r;
  },
  /**
   * Convert height map to normal map
   * @param {HTMLImageElement|HTMLCanvasElement} image
   * @param {boolean} [checkBump=false]
   * @param {number} [threshold=20]
   * @return {HTMLCanvasElement}
   */
  isHeightImage: function(e, t, r) {
    if (!e || !e.width || !e.height)
      return !1;
    var n = document.createElement("canvas"), i = n.getContext("2d"), a = t || 32;
    r = r || 20, n.width = n.height = a, i.drawImage(e, 0, 0, a, a);
    for (var o = i.getImageData(0, 0, a, a), s = 0; s < o.data.length; s += 4) {
      var l = o.data[s], u = o.data[s + 1], f = o.data[s + 2], c = Math.abs(l - u) + Math.abs(u - f);
      if (c > r)
        return !1;
    }
    return !0;
  },
  _fetchTexture: function(e, t, r) {
    pr.request.get({
      url: e,
      responseType: "arraybuffer",
      onload: t,
      onerror: r
    });
  },
  /**
   * Create a chessboard texture
   * @param  {number} [size]
   * @param  {number} [unitSize]
   * @param  {string} [color1]
   * @param  {string} [color2]
   * @return {clay.Texture2D}
   */
  createChessboard: function(e, t, r, n) {
    e = e || 512, t = t || 64, r = r || "black", n = n || "white";
    var i = Math.ceil(e / t), a = document.createElement("canvas");
    a.width = e, a.height = e;
    var o = a.getContext("2d");
    o.fillStyle = n, o.fillRect(0, 0, e, e), o.fillStyle = r;
    for (var s = 0; s < i; s++)
      for (var l = 0; l < i; l++) {
        var u = l % 2 ? s % 2 : s % 2 - 1;
        u && o.fillRect(s * t, l * t, t, t);
      }
    var f = new Vt({
      image: a,
      anisotropic: 8
    });
    return f;
  },
  /**
   * Create a blank pure color 1x1 texture
   * @param  {string} color
   * @return {clay.Texture2D}
   */
  createBlank: function(e) {
    var t = document.createElement("canvas");
    t.width = 1, t.height = 1;
    var r = t.getContext("2d");
    r.fillStyle = e, r.fillRect(0, 0, 1, 1);
    var n = new Vt({
      image: t
    });
    return n;
  }
}, GI = ["mousedown", "mouseup", "mousemove", "mouseover", "mouseout", "click", "dblclick", "contextmenu"];
function VI(e) {
  return "_on" + e;
}
var HI = function(e) {
  var t = this;
  this._texture = new Vt({
    anisotropic: 32,
    flipY: !1,
    surface: this,
    dispose: function(r) {
      t.dispose(), Vt.prototype.dispose.call(this, r);
    }
  }), GI.forEach(function(r) {
    this[VI(r)] = function(n) {
      n.triangle && this._meshes.forEach(function(i) {
        this.dispatchEvent(r, i, n.triangle, n.point);
      }, this);
    };
  }, this), this._meshes = [], e && this.setECharts(e), this.onupdate = null;
};
HI.prototype = {
  constructor: HI,
  getTexture: function() {
    return this._texture;
  },
  setECharts: function(e) {
    this._chart = e;
    var t = e.getDom();
    if (!(t instanceof HTMLCanvasElement))
      console.error("ECharts must init on canvas if it is used as texture."), t = document.createElement("canvas");
    else {
      var r = this, n = e.getZr(), i = n.__oldRefreshImmediately || n.refreshImmediately;
      n.refreshImmediately = function() {
        i.call(this), r._texture.dirty(), r.onupdate && r.onupdate();
      }, n.__oldRefreshImmediately = i;
    }
    this._texture.image = t, this._texture.dirty(), this.onupdate && this.onupdate();
  },
  /**
   * @method
   * @param {clay.Mesh} attachedMesh
   * @param {Array.<number>} triangle Triangle indices
   * @param {clay.math.Vector3} point
   */
  dispatchEvent: (function() {
    var e = new Me(), t = new Me(), r = new Me(), n = new Pt(), i = new Pt(), a = new Pt(), o = new Pt(), s = new Me();
    return function(l, u, f, c) {
      var h = u.geometry, v = h.attributes.position, d = h.attributes.texcoord0, g = Me.dot, y = Me.cross;
      v.get(f[0], e.array), v.get(f[1], t.array), v.get(f[2], r.array), d.get(f[0], n.array), d.get(f[1], i.array), d.get(f[2], a.array), y(s, t, r);
      var x = g(e, s), S = g(c, s) / x;
      y(s, r, e);
      var T = g(c, s) / x;
      y(s, e, t);
      var C = g(c, s) / x;
      Pt.scale(o, n, S), Pt.scaleAndAdd(o, o, i, T), Pt.scaleAndAdd(o, o, a, C);
      var A = o.x * this._chart.getWidth(), M = o.y * this._chart.getHeight();
      this._chart.getZr().handler.dispatch(l, {
        zrX: A,
        zrY: M
      });
    };
  })(),
  attachToMesh: function(e) {
    this._meshes.indexOf(e) >= 0 || (GI.forEach(function(t) {
      e.on(t, this[VI(t)], this);
    }, this), this._meshes.push(e));
  },
  detachFromMesh: function(e) {
    var t = this._meshes.indexOf(e);
    t >= 0 && this._meshes.splice(t, 1), GI.forEach(function(r) {
      e.off(r, this[VI(r)]);
    }, this);
  },
  dispose: function() {
    this._meshes.forEach(function(e) {
      this.detachFromMesh(e);
    }, this);
  }
};
var Gm = Fm.extend(
  /** @lends clay.camera.Orthographic# */
  {
    /**
     * @type {number}
     */
    left: -1,
    /**
     * @type {number}
     */
    right: 1,
    /**
     * @type {number}
     */
    near: -1,
    /**
     * @type {number}
     */
    far: 1,
    /**
     * @type {number}
     */
    top: 1,
    /**
     * @type {number}
     */
    bottom: -1
  },
  /** @lends clay.camera.Orthographic.prototype */
  {
    updateProjectionMatrix: function() {
      this.projectionMatrix.ortho(this.left, this.right, this.bottom, this.top, this.near, this.far);
    },
    decomposeProjectionMatrix: function() {
      var e = this.projectionMatrix.array;
      this.left = (-1 - e[12]) / e[0], this.right = (1 - e[12]) / e[0], this.top = (1 - e[13]) / e[5], this.bottom = (-1 - e[13]) / e[5], this.near = -(-1 - e[14]) / e[10], this.far = -(1 - e[14]) / e[10];
    },
    /**
     * @return {clay.camera.Orthographic}
     */
    clone: function() {
      var e = Fm.prototype.clone.call(this);
      return e.left = this.left, e.right = this.right, e.near = this.near, e.far = this.far, e.top = this.top, e.bottom = this.bottom, e;
    }
  }
);
const d1e = `
@export clay.compositor.vertex
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
attribute vec3 position : POSITION;
attribute vec2 texcoord : TEXCOORD_0;
varying vec2 v_Texcoord;
void main()
{
 v_Texcoord = texcoord;
 gl_Position = worldViewProjection * vec4(position, 1.0);
}
@end`;
Ze.import(d1e);
var p1e = new eA(), WV = new ri({
  geometry: p1e,
  frustumCulling: !1
}), g1e = new Gm(), Pn = Mi.extend(
  function() {
    return (
      /** @lends clay.compositor.Pass# */
      {
        /**
         * Fragment shader string
         * @type {string}
         */
        // PENDING shader or fragment ?
        fragment: "",
        /**
         * @type {Object}
         */
        outputs: null,
        /**
         * @type {clay.Material}
         */
        material: null,
        /**
         * @type {Boolean}
         */
        blendWithPrevious: !1,
        /**
         * @type {Boolean}
         */
        clearColor: !1,
        /**
         * @type {Boolean}
         */
        clearDepth: !0
      }
    );
  },
  function() {
    var e = new Ze(Ze.source("clay.compositor.vertex"), this.fragment), t = new ls({
      shader: e
    });
    t.enableTexturesAll(), this.material = t;
  },
  /** @lends clay.compositor.Pass.prototype */
  {
    /**
     * @param {string} name
     * @param {} value
     */
    setUniform: function(e, t) {
      this.material.setUniform(e, t);
    },
    /**
     * @param  {string} name
     * @return {}
     */
    getUniform: function(e) {
      var t = this.material.uniforms[e];
      if (t)
        return t.value;
    },
    /**
     * @param  {clay.Texture} texture
     * @param  {number} attachment
     */
    attachOutput: function(e, t) {
      this.outputs || (this.outputs = {}), t = t || Ee.COLOR_ATTACHMENT0, this.outputs[t] = e;
    },
    /**
     * @param  {clay.Texture} texture
     */
    detachOutput: function(e) {
      for (var t in this.outputs)
        this.outputs[t] === e && (this.outputs[t] = null);
    },
    bind: function(e, t) {
      if (this.outputs)
        for (var r in this.outputs) {
          var n = this.outputs[r];
          n && t.attach(n, r);
        }
      t && t.bind(e);
    },
    unbind: function(e, t) {
      t.unbind(e);
    },
    /**
     * @param  {clay.Renderer} renderer
     * @param  {clay.FrameBuffer} [frameBuffer]
     */
    render: function(e, t) {
      var r = e.gl;
      if (t) {
        this.bind(e, t);
        var n = e.getGLExtension("EXT_draw_buffers");
        if (n && this.outputs) {
          var i = [];
          for (var a in this.outputs)
            a = +a, a >= r.COLOR_ATTACHMENT0 && a <= r.COLOR_ATTACHMENT0 + 8 && i.push(a);
          n.drawBuffersEXT(i);
        }
      }
      this.trigger("beforerender", this, e);
      var o = this.clearDepth ? r.DEPTH_BUFFER_BIT : 0;
      if (r.depthMask(!0), this.clearColor) {
        o = o | r.COLOR_BUFFER_BIT, r.colorMask(!0, !0, !0, !0);
        var s = this.clearColor;
        Array.isArray(s) && r.clearColor(s[0], s[1], s[2], s[3]);
      }
      r.clear(o), this.blendWithPrevious ? (r.enable(r.BLEND), this.material.transparent = !0) : (r.disable(r.BLEND), this.material.transparent = !1), this.renderQuad(e), this.trigger("afterrender", this, e), t && this.unbind(e, t);
    },
    /**
     * Simply do quad rendering
     */
    renderQuad: function(e) {
      WV.material = this.material, e.renderPass([WV], g1e);
    },
    /**
     * @param  {clay.Renderer} renderer
     */
    dispose: function(e) {
    }
  }
);
const m1e = `#define SAMPLE_NUMBER 1024
#define PI 3.14159265358979
uniform sampler2D normalDistribution;
uniform vec2 viewportSize : [512, 256];
const vec3 N = vec3(0.0, 0.0, 1.0);
const float fSampleNumber = float(SAMPLE_NUMBER);
vec3 importanceSampleNormal(float i, float roughness, vec3 N) {
 vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;
 vec3 upVector = abs(N.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);
 vec3 tangentX = normalize(cross(N, upVector));
 vec3 tangentZ = cross(N, tangentX);
 return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);
}
float G_Smith(float roughness, float NoV, float NoL) {
 float k = roughness * roughness / 2.0;
 float G1V = NoV / (NoV * (1.0 - k) + k);
 float G1L = NoL / (NoL * (1.0 - k) + k);
 return G1L * G1V;
}
void main() {
 vec2 uv = gl_FragCoord.xy / viewportSize;
 float NoV = uv.x;
 float roughness = uv.y;
 vec3 V;
 V.x = sqrt(1.0 - NoV * NoV);
 V.y = 0.0;
 V.z = NoV;
 float A = 0.0;
 float B = 0.0;
 for (int i = 0; i < SAMPLE_NUMBER; i++) {
 vec3 H = importanceSampleNormal(float(i) / fSampleNumber, roughness, N);
 vec3 L = reflect(-V, H);
 float NoL = clamp(L.z, 0.0, 1.0);
 float NoH = clamp(H.z, 0.0, 1.0);
 float VoH = clamp(dot(V, H), 0.0, 1.0);
 if (NoL > 0.0) {
 float G = G_Smith(roughness, NoV, NoL);
 float G_Vis = G * VoH / (NoH * NoV);
 float Fc = pow(1.0 - VoH, 5.0);
 A += (1.0 - Fc) * G_Vis;
 B += Fc * G_Vis;
 }
 }
 gl_FragColor = vec4(vec2(A, B) / fSampleNumber, 0.0, 1.0);
}
`, y1e = `#define SHADER_NAME prefilter
#define SAMPLE_NUMBER 1024
#define PI 3.14159265358979
uniform mat4 viewInverse : VIEWINVERSE;
uniform samplerCube environmentMap;
uniform sampler2D normalDistribution;
uniform float roughness : 0.5;
varying vec2 v_Texcoord;
varying vec3 v_WorldPosition;
@import clay.util.rgbm
vec3 importanceSampleNormal(float i, float roughness, vec3 N) {
 vec3 H = texture2D(normalDistribution, vec2(roughness, i)).rgb;
 vec3 upVector = abs(N.y) > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);
 vec3 tangentX = normalize(cross(N, upVector));
 vec3 tangentZ = cross(N, tangentX);
 return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);
}
void main() {
 vec3 eyePos = viewInverse[3].xyz;
 vec3 V = normalize(v_WorldPosition - eyePos);
 vec3 N = V;
 vec3 prefilteredColor = vec3(0.0);
 float totalWeight = 0.0;
 float fMaxSampleNumber = float(SAMPLE_NUMBER);
 for (int i = 0; i < SAMPLE_NUMBER; i++) {
 vec3 H = importanceSampleNormal(float(i) / fMaxSampleNumber, roughness, N);
 vec3 L = reflect(-V, H);
 float NoL = clamp(dot(N, L), 0.0, 1.0);
 if (NoL > 0.0) {
 prefilteredColor += decodeHDR(textureCube(environmentMap, L)).rgb * NoL;
 totalWeight += NoL;
 }
 }
 gl_FragColor = encodeHDR(vec4(prefilteredColor / totalWeight, 1.0));
}
`;
var Jl = {}, iE = ["px", "nx", "py", "ny", "pz", "nz"];
Jl.prefilterEnvironmentMap = function(e, t, r, n, i) {
  (!i || !n) && (n = Jl.generateNormalDistribution(), i = Jl.integrateBRDF(e, n)), r = r || {};
  var a = r.width || 64, o = r.height || 64, s = r.type || t.type, l = new Ed({
    width: a,
    height: o,
    type: s,
    flipY: !1,
    mipmaps: []
  });
  l.isPowerOfTwo() || console.warn("Width and height must be power of two to enable mipmap.");
  var u = Math.min(a, o), f = Math.log(u) / Math.log(2) + 1, c = new ls({
    shader: new Ze({
      vertex: Ze.source("clay.skybox.vertex"),
      fragment: y1e
    })
  });
  c.set("normalDistribution", n), r.encodeRGBM && c.define("fragment", "RGBM_ENCODE"), r.decodeRGBM && c.define("fragment", "RGBM_DECODE");
  var h = new sh(), v;
  if (t.textureType === "texture2D") {
    var d = new Ed({
      width: a,
      height: o,
      // FIXME FLOAT type will cause GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT error on iOS
      type: s === We.FLOAT ? We.HALF_FLOAT : s
    });
    Ql.panoramaToCubeMap(e, t, d, {
      // PENDING encodeRGBM so it can be decoded as RGBM
      encodeRGBM: r.decodeRGBM
    }), t = d;
  }
  v = new lx({
    scene: h,
    material: c
  }), v.material.set("environmentMap", t);
  var g = new YN({
    texture: l
  });
  r.encodeRGBM && (s = l.type = We.UNSIGNED_BYTE);
  for (var y = new Vt({
    width: a,
    height: o,
    type: s
  }), x = new Tn({
    depthBuffer: !1
  }), S = pr[s === We.UNSIGNED_BYTE ? "Uint8Array" : "Float32Array"], T = 0; T < f; T++) {
    l.mipmaps[T] = {
      pixels: {}
    }, v.material.set("roughness", T / (f - 1));
    for (var C = y.width, A = 2 * Math.atan(C / (C - 0.5)) / Math.PI * 180, M = 0; M < iE.length; M++) {
      var E = new S(y.width * y.height * 4);
      x.attach(y), x.bind(e);
      var P = g.getCamera(iE[M]);
      P.fov = A, e.render(h, P), e.gl.readPixels(
        0,
        0,
        y.width,
        y.height,
        We.RGBA,
        s,
        E
      ), x.unbind(e), l.mipmaps[T].pixels[iE[M]] = E;
    }
    y.width /= 2, y.height /= 2, y.dirty();
  }
  return x.dispose(e), y.dispose(e), v.dispose(e), n.dispose(e), {
    environmentMap: l,
    brdfLookup: i,
    normalDistribution: n,
    maxMipmapLevel: f
  };
};
Jl.integrateBRDF = function(e, t) {
  t = t || Jl.generateNormalDistribution();
  var r = new Tn({
    depthBuffer: !1
  }), n = new Pn({
    fragment: m1e
  }), i = new Vt({
    width: 512,
    height: 256,
    type: We.HALF_FLOAT,
    wrapS: We.CLAMP_TO_EDGE,
    wrapT: We.CLAMP_TO_EDGE,
    minFilter: We.NEAREST,
    magFilter: We.NEAREST,
    useMipmap: !1
  });
  return n.setUniform("normalDistribution", t), n.setUniform("viewportSize", [512, 256]), n.attachOutput(i), n.render(e, r), r.dispose(e), i;
};
Jl.generateNormalDistribution = function(r, n) {
  for (var r = r || 256, n = n || 1024, i = new Vt({
    width: r,
    height: n,
    type: We.FLOAT,
    minFilter: We.NEAREST,
    magFilter: We.NEAREST,
    wrapS: We.CLAMP_TO_EDGE,
    wrapT: We.CLAMP_TO_EDGE,
    useMipmap: !1
  }), a = new Float32Array(n * r * 4), o = [], s = 0; s < r; s++) {
    for (var l = s / r, u = l * l, f = 0; f < n; f++) {
      var c = (f << 16 | f >>> 16) >>> 0;
      c = ((c & 1431655765) << 1 | (c & 2863311530) >>> 1) >>> 0, c = ((c & 858993459) << 2 | (c & 3435973836) >>> 2) >>> 0, c = ((c & 252645135) << 4 | (c & 4042322160) >>> 4) >>> 0, c = (((c & 16711935) << 8 | (c & 4278255360) >>> 8) >>> 0) / 4294967296;
      var h = Math.sqrt((1 - c) / (1 + (u * u - 1) * c));
      o[f] = h;
    }
    for (var f = 0; f < n; f++) {
      var v = (f * r + s) * 4, h = o[f], d = Math.sqrt(1 - h * h), g = f / n, y = 2 * Math.PI * g;
      a[v] = d * Math.cos(y), a[v + 1] = h, a[v + 2] = d * Math.sin(y), a[v + 3] = 1;
    }
  }
  return i.pixels = a, i;
};
var _1e = js.extend(
  {
    /**
     * @type {clay.TextureCube}
     * @memberOf clay.light.AmbientCubemap#
     */
    cubemap: null,
    // TODO
    // range: 100,
    castShadow: !1,
    _normalDistribution: null,
    _brdfLookup: null
  },
  /** @lends clay.light.AmbientCubemap# */
  {
    type: "AMBIENT_CUBEMAP_LIGHT",
    /**
     * Do prefitering the cubemap
     * @param {clay.Renderer} renderer
     * @param {number} [size=32]
     */
    prefilter: function(e, t) {
      if (!e.getGLExtension("EXT_shader_texture_lod")) {
        console.warn("Device not support textureCubeLodEXT");
        return;
      }
      this._brdfLookup || (this._normalDistribution = Jl.generateNormalDistribution(), this._brdfLookup = Jl.integrateBRDF(e, this._normalDistribution));
      var r = this.cubemap;
      if (!r.__prefiltered) {
        var n = Jl.prefilterEnvironmentMap(
          e,
          r,
          {
            encodeRGBM: !0,
            width: t,
            height: t
          },
          this._normalDistribution,
          this._brdfLookup
        );
        this.cubemap = n.environmentMap, this.cubemap.__prefiltered = !0, r.dispose(e);
      }
    },
    getBRDFLookup: function() {
      return this._brdfLookup;
    },
    uniformTemplates: {
      ambientCubemapLightColor: {
        type: "3f",
        value: function(e) {
          var t = e.color, r = e.intensity;
          return [t[0] * r, t[1] * r, t[2] * r];
        }
      },
      ambientCubemapLightCubemap: {
        type: "t",
        value: function(e) {
          return e.cubemap;
        }
      },
      ambientCubemapLightBRDFLookup: {
        type: "t",
        value: function(e) {
          return e._brdfLookup;
        }
      }
    }
    /**
     * @function
     * @name clone
     * @return {clay.light.AmbientCubemap}
     * @memberOf clay.light.AmbientCubemap.prototype
     */
  }
), x1e = js.extend({
  castShadow: !1,
  /**
   * Spherical Harmonic Coefficients
   * @type {Array.<number>}
   * @memberOf clay.light.AmbientSH#
   */
  coefficients: []
}, function() {
  this._coefficientsTmpArr = new pr.Float32Array(27);
}, {
  type: "AMBIENT_SH_LIGHT",
  uniformTemplates: {
    ambientSHLightColor: {
      type: "3f",
      value: function(e) {
        var t = e.color, r = e.intensity;
        return [t[0] * r, t[1] * r, t[2] * r];
      }
    },
    ambientSHLightCoefficients: {
      type: "3f",
      value: function(e) {
        for (var t = e._coefficientsTmpArr, r = 0; r < e.coefficients.length; r++)
          t[r] = e.coefficients[r];
        return t;
      }
    }
  }
  /**
   * @function
   * @name clone
   * @return {clay.light.Ambient}
   * @memberOf clay.light.Ambient.prototype
   */
}), LY = {}, ld = ["px", "nx", "py", "ny", "pz", "nz"];
function S1e(e, t) {
  var r = e[0], n = e[1], i = e[2];
  return t === 0 ? 1 : t === 1 ? r : t === 2 ? n : t === 3 ? i : t === 4 ? r * i : t === 5 ? n * i : t === 6 ? r * n : t === 7 ? 3 * i * i - 1 : r * r - n * n;
}
var w1e = {
  px: [2, 1, 0, -1, -1, 1],
  nx: [2, 1, 0, 1, -1, -1],
  py: [0, 2, 1, 1, -1, -1],
  ny: [0, 2, 1, 1, 1, 1],
  pz: [0, 1, 2, -1, -1, -1],
  nz: [0, 1, 2, 1, -1, 1]
};
function T1e(e, t, r, n) {
  for (var i = new pr.Float32Array(27), a = ie.create(), o = ie.create(), s = ie.create(), l = 0; l < 9; l++) {
    for (var u = ie.create(), f = 0; f < ld.length; f++) {
      for (var c = t[ld[f]], h = ie.create(), v = 0, d = 0, g = w1e[ld[f]], y = 0; y < n; y++)
        for (var x = 0; x < r; x++) {
          a[0] = x / (r - 1) * 2 - 1, a[1] = y / (n - 1) * 2 - 1, a[2] = -1, ie.normalize(a, a), s[0] = a[g[0]] * g[3], s[1] = a[g[1]] * g[4], s[2] = a[g[2]] * g[5], o[0] = c[d++] / 255, o[1] = c[d++] / 255, o[2] = c[d++] / 255;
          var S = c[d++] / 255 * 8.12;
          o[0] *= S, o[1] *= S, o[2] *= S, ie.scaleAndAdd(h, h, o, S1e(s, l) * -a[2]), v += -a[2];
        }
      ie.scaleAndAdd(u, u, h, 1 / v);
    }
    i[l * 3] = u[0] / 6, i[l * 3 + 1] = u[1] / 6, i[l * 3 + 2] = u[2] / 6;
  }
  return i;
}
LY.projectEnvironmentMap = function(e, t, r) {
  r = r || {}, r.lod = r.lod || 0;
  var n, i = new sh(), a = 64;
  t.textureType === "texture2D" ? n = new lx({
    scene: i,
    environmentMap: t
  }) : (a = t.image && t.image.px ? t.image.px.width : t.width, n = new lx({
    scene: i,
    environmentMap: t
  }));
  var o = Math.ceil(a / Math.pow(2, r.lod)), s = Math.ceil(a / Math.pow(2, r.lod)), l = new Vt({
    width: o,
    height: s
  }), u = new Tn();
  n.material.define("fragment", "RGBM_ENCODE"), r.decodeRGBM && n.material.define("fragment", "RGBM_DECODE"), n.material.set("lod", r.lod);
  for (var f = new YN({
    texture: l
  }), c = {}, h = 0; h < ld.length; h++) {
    c[ld[h]] = new Uint8Array(o * s * 4);
    var v = f.getCamera(ld[h]);
    v.fov = 90, u.attach(l), u.bind(e), e.render(i, v), e.gl.readPixels(
      0,
      0,
      o,
      s,
      We.RGBA,
      We.UNSIGNED_BYTE,
      c[ld[h]]
    ), u.unbind(e);
  }
  return n.dispose(e), u.dispose(e), l.dispose(e), T1e(e, c, o, s);
};
var qt = {
  firstNotNull: function() {
    for (var e = 0, t = arguments.length; e < t; e++)
      if (arguments[e] != null)
        return arguments[e];
  },
  /**
   * @param {module:echarts/data/List} data
   * @param {Object} payload Contains dataIndex (means rawIndex) / dataIndexInside / name
   *                         each of which can be Array or primary type.
   * @return {number|Array.<number>} dataIndex If not found, return undefined/null.
   */
  queryDataIndex: function(e, t) {
    if (t.dataIndexInside != null)
      return t.dataIndexInside;
    if (t.dataIndex != null)
      return Se(t.dataIndex) ? Ce(t.dataIndex, function(r) {
        return e.indexOfRawIndex(r);
      }) : e.indexOfRawIndex(t.dataIndex);
    if (t.name != null)
      return Se(t.name) ? Ce(t.name, function(r) {
        return e.indexOfName(r);
      }) : e.indexOfName(t.name);
  }
}, b1e = jt.extend(
  /** @lends clay.geometry.Sphere# */
  {
    dynamic: !1,
    /**
     * @type {number}
     */
    widthSegments: 40,
    /**
     * @type {number}
     */
    heightSegments: 20,
    /**
     * @type {number}
     */
    phiStart: 0,
    /**
     * @type {number}
     */
    phiLength: Math.PI * 2,
    /**
     * @type {number}
     */
    thetaStart: 0,
    /**
     * @type {number}
     */
    thetaLength: Math.PI,
    /**
     * @type {number}
     */
    radius: 1
  },
  function() {
    this.build();
  },
  /** @lends clay.geometry.Sphere.prototype */
  {
    /**
     * Build sphere geometry
     */
    build: function() {
      var e = this.heightSegments, t = this.widthSegments, r = this.attributes.position, n = this.attributes.texcoord0, i = this.attributes.normal, a = (t + 1) * (e + 1);
      r.init(a), n.init(a), i.init(a);
      var o = a > 65535 ? Uint32Array : Uint16Array, s = this.indices = new o(t * e * 6), l, u, f, c, h, v, d, T = this.radius, g = this.phiStart, y = this.phiLength, x = this.thetaStart, S = this.thetaLength, T = this.radius, C = [], A = [], M = 0, E = 1 / T;
      for (d = 0; d <= e; d++)
        for (v = 0; v <= t; v++)
          c = v / t, h = d / e, l = -T * Math.cos(g + c * y) * Math.sin(x + h * S), u = T * Math.cos(x + h * S), f = T * Math.sin(g + c * y) * Math.sin(x + h * S), C[0] = l, C[1] = u, C[2] = f, A[0] = c, A[1] = h, r.set(M, C), n.set(M, A), C[0] *= E, C[1] *= E, C[2] *= E, i.set(M, C), M++;
      var P, R, O, N, G = t + 1, z = 0;
      for (d = 0; d < e; d++)
        for (v = 0; v < t; v++)
          R = d * G + v, P = d * G + v + 1, N = (d + 1) * G + v + 1, O = (d + 1) * G + v, s[z++] = P, s[z++] = R, s[z++] = N, s[z++] = R, s[z++] = O, s[z++] = N;
      this.boundingBox = new wi(), this.boundingBox.max.set(T, T, T), this.boundingBox.min.set(-T, -T, -T);
    }
  }
), C1e = js.extend({
  castShadow: !1
}, {
  type: "AMBIENT_LIGHT",
  uniformTemplates: {
    ambientLightColor: {
      type: "3f",
      value: function(e) {
        var t = e.color, r = e.intensity;
        return [t[0] * r, t[1] * r, t[2] * r];
      }
    }
  }
  /**
   * @function
   * @name clone
   * @return {clay.light.Ambient}
   * @memberOf clay.light.Ambient.prototype
   */
}), A1e = js.extend(
  /** @lends clay.light.Directional# */
  {
    /**
     * @type {number}
     */
    shadowBias: 1e-3,
    /**
     * @type {number}
     */
    shadowSlopeScale: 2,
    /**
     * Shadow cascade.
     * Use PSSM technique when it is larger than 1 and have a unique directional light in scene.
     * @type {number}
     */
    shadowCascade: 1,
    /**
     * Available when shadowCascade is larger than 1 and have a unique directional light in scene.
     * @type {number}
     */
    cascadeSplitLogFactor: 0.2
  },
  {
    type: "DIRECTIONAL_LIGHT",
    uniformTemplates: {
      directionalLightDirection: {
        type: "3f",
        value: function(e) {
          return e.__dir = e.__dir || new Me(), e.__dir.copy(e.worldTransform.z).normalize().negate().array;
        }
      },
      directionalLightColor: {
        type: "3f",
        value: function(e) {
          var t = e.color, r = e.intensity;
          return [t[0] * r, t[1] * r, t[2] * r];
        }
      }
    },
    /**
     * @return {clay.light.Directional}
     * @memberOf clay.light.Directional.prototype
     */
    clone: function() {
      var e = js.prototype.clone.call(this);
      return e.shadowBias = this.shadowBias, e.shadowSlopeScale = this.shadowSlopeScale, e;
    }
  }
), M1e = js.extend(
  /** @lends clay.light.Point# */
  {
    /**
     * @type {number}
     */
    range: 100,
    /**
     * @type {number}
     */
    castShadow: !1
  },
  {
    type: "POINT_LIGHT",
    uniformTemplates: {
      pointLightPosition: {
        type: "3f",
        value: function(e) {
          return e.getWorldPosition().array;
        }
      },
      pointLightRange: {
        type: "1f",
        value: function(e) {
          return e.range;
        }
      },
      pointLightColor: {
        type: "3f",
        value: function(e) {
          var t = e.color, r = e.intensity;
          return [t[0] * r, t[1] * r, t[2] * r];
        }
      }
    },
    /**
     * @return {clay.light.Point}
     * @memberOf clay.light.Point.prototype
     */
    clone: function() {
      var e = js.prototype.clone.call(this);
      return e.range = this.range, e;
    }
  }
), L1e = js.extend(
  /**@lends clay.light.Spot */
  {
    /**
     * @type {number}
     */
    range: 20,
    /**
     * @type {number}
     */
    umbraAngle: 30,
    /**
     * @type {number}
     */
    penumbraAngle: 45,
    /**
     * @type {number}
     */
    falloffFactor: 2,
    /**
     * @type {number}
     */
    shadowBias: 1e-3,
    /**
     * @type {number}
     */
    shadowSlopeScale: 2
  },
  {
    type: "SPOT_LIGHT",
    uniformTemplates: {
      spotLightPosition: {
        type: "3f",
        value: function(e) {
          return e.getWorldPosition().array;
        }
      },
      spotLightRange: {
        type: "1f",
        value: function(e) {
          return e.range;
        }
      },
      spotLightUmbraAngleCosine: {
        type: "1f",
        value: function(e) {
          return Math.cos(e.umbraAngle * Math.PI / 180);
        }
      },
      spotLightPenumbraAngleCosine: {
        type: "1f",
        value: function(e) {
          return Math.cos(e.penumbraAngle * Math.PI / 180);
        }
      },
      spotLightFalloffFactor: {
        type: "1f",
        value: function(e) {
          return e.falloffFactor;
        }
      },
      spotLightDirection: {
        type: "3f",
        value: function(e) {
          return e.__dir = e.__dir || new Me(), e.__dir.copy(e.worldTransform.z).negate().array;
        }
      },
      spotLightColor: {
        type: "3f",
        value: function(e) {
          var t = e.color, r = e.intensity;
          return [t[0] * r, t[1] * r, t[2] * r];
        }
      }
    },
    /**
     * @return {clay.light.Spot}
     * @memberOf clay.light.Spot.prototype
     */
    clone: function() {
      var e = js.prototype.clone.call(this);
      return e.range = this.range, e.umbraAngle = this.umbraAngle, e.penumbraAngle = this.penumbraAngle, e.falloffFactor = this.falloffFactor, e.shadowBias = this.shadowBias, e.shadowSlopeScale = this.shadowSlopeScale, e;
    }
  }
), sr = function(e, t, r, n) {
  e = e || 0, t = t || 0, r = r || 0, n = n || 0, this.array = Ie.fromValues(e, t, r, n), this._dirty = !0;
};
sr.prototype = {
  constructor: sr,
  /**
   * Add b to self
   * @param  {clay.Vector4} b
   * @return {clay.Vector4}
   */
  add: function(e) {
    return Ie.add(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Set x, y and z components
   * @param  {number}  x
   * @param  {number}  y
   * @param  {number}  z
   * @param  {number}  w
   * @return {clay.Vector4}
   */
  set: function(e, t, r, n) {
    return this.array[0] = e, this.array[1] = t, this.array[2] = r, this.array[3] = n, this._dirty = !0, this;
  },
  /**
   * Set x, y, z and w components from array
   * @param  {Float32Array|number[]} arr
   * @return {clay.Vector4}
   */
  setArray: function(e) {
    return this.array[0] = e[0], this.array[1] = e[1], this.array[2] = e[2], this.array[3] = e[3], this._dirty = !0, this;
  },
  /**
   * Clone a new Vector4
   * @return {clay.Vector4}
   */
  clone: function() {
    return new sr(this.x, this.y, this.z, this.w);
  },
  /**
   * Copy from b
   * @param  {clay.Vector4} b
   * @return {clay.Vector4}
   */
  copy: function(e) {
    return Ie.copy(this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Alias for distance
   * @param  {clay.Vector4} b
   * @return {number}
   */
  dist: function(e) {
    return Ie.dist(this.array, e.array);
  },
  /**
   * Distance between self and b
   * @param  {clay.Vector4} b
   * @return {number}
   */
  distance: function(e) {
    return Ie.distance(this.array, e.array);
  },
  /**
   * Alias for divide
   * @param  {clay.Vector4} b
   * @return {clay.Vector4}
   */
  div: function(e) {
    return Ie.div(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Divide self by b
   * @param  {clay.Vector4} b
   * @return {clay.Vector4}
   */
  divide: function(e) {
    return Ie.divide(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Dot product of self and b
   * @param  {clay.Vector4} b
   * @return {number}
   */
  dot: function(e) {
    return Ie.dot(this.array, e.array);
  },
  /**
   * Alias of length
   * @return {number}
   */
  len: function() {
    return Ie.len(this.array);
  },
  /**
   * Calculate the length
   * @return {number}
   */
  length: function() {
    return Ie.length(this.array);
  },
  /**
   * Linear interpolation between a and b
   * @param  {clay.Vector4} a
   * @param  {clay.Vector4} b
   * @param  {number}  t
   * @return {clay.Vector4}
   */
  lerp: function(e, t, r) {
    return Ie.lerp(this.array, e.array, t.array, r), this._dirty = !0, this;
  },
  /**
   * Minimum of self and b
   * @param  {clay.Vector4} b
   * @return {clay.Vector4}
   */
  min: function(e) {
    return Ie.min(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Maximum of self and b
   * @param  {clay.Vector4} b
   * @return {clay.Vector4}
   */
  max: function(e) {
    return Ie.max(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Alias for multiply
   * @param  {clay.Vector4} b
   * @return {clay.Vector4}
   */
  mul: function(e) {
    return Ie.mul(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Mutiply self and b
   * @param  {clay.Vector4} b
   * @return {clay.Vector4}
   */
  multiply: function(e) {
    return Ie.multiply(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Negate self
   * @return {clay.Vector4}
   */
  negate: function() {
    return Ie.negate(this.array, this.array), this._dirty = !0, this;
  },
  /**
   * Normalize self
   * @return {clay.Vector4}
   */
  normalize: function() {
    return Ie.normalize(this.array, this.array), this._dirty = !0, this;
  },
  /**
   * Generate random x, y, z, w components with a given scale
   * @param  {number} scale
   * @return {clay.Vector4}
   */
  random: function(e) {
    return Ie.random(this.array, e), this._dirty = !0, this;
  },
  /**
   * Scale self
   * @param  {number}  scale
   * @return {clay.Vector4}
   */
  scale: function(e) {
    return Ie.scale(this.array, this.array, e), this._dirty = !0, this;
  },
  /**
   * Scale b and add to self
   * @param  {clay.Vector4} b
   * @param  {number}  scale
   * @return {clay.Vector4}
   */
  scaleAndAdd: function(e, t) {
    return Ie.scaleAndAdd(this.array, this.array, e.array, t), this._dirty = !0, this;
  },
  /**
   * Alias for squaredDistance
   * @param  {clay.Vector4} b
   * @return {number}
   */
  sqrDist: function(e) {
    return Ie.sqrDist(this.array, e.array);
  },
  /**
   * Squared distance between self and b
   * @param  {clay.Vector4} b
   * @return {number}
   */
  squaredDistance: function(e) {
    return Ie.squaredDistance(this.array, e.array);
  },
  /**
   * Alias for squaredLength
   * @return {number}
   */
  sqrLen: function() {
    return Ie.sqrLen(this.array);
  },
  /**
   * Squared length of self
   * @return {number}
   */
  squaredLength: function() {
    return Ie.squaredLength(this.array);
  },
  /**
   * Alias for subtract
   * @param  {clay.Vector4} b
   * @return {clay.Vector4}
   */
  sub: function(e) {
    return Ie.sub(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Subtract b from self
   * @param  {clay.Vector4} b
   * @return {clay.Vector4}
   */
  subtract: function(e) {
    return Ie.subtract(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Transform self with a Matrix4 m
   * @param  {clay.Matrix4} m
   * @return {clay.Vector4}
   */
  transformMat4: function(e) {
    return Ie.transformMat4(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Transform self with a Quaternion q
   * @param  {clay.Quaternion} q
   * @return {clay.Vector4}
   */
  transformQuat: function(e) {
    return Ie.transformQuat(this.array, this.array, e.array), this._dirty = !0, this;
  },
  toString: function() {
    return "[" + Array.prototype.join.call(this.array, ",") + "]";
  },
  toArray: function() {
    return Array.prototype.slice.call(this.array);
  }
};
var P_ = Object.defineProperty;
if (P_) {
  var $T = sr.prototype;
  P_($T, "x", {
    get: function() {
      return this.array[0];
    },
    set: function(e) {
      this.array[0] = e, this._dirty = !0;
    }
  }), P_($T, "y", {
    get: function() {
      return this.array[1];
    },
    set: function(e) {
      this.array[1] = e, this._dirty = !0;
    }
  }), P_($T, "z", {
    get: function() {
      return this.array[2];
    },
    set: function(e) {
      this.array[2] = e, this._dirty = !0;
    }
  }), P_($T, "w", {
    get: function() {
      return this.array[3];
    },
    set: function(e) {
      this.array[3] = e, this._dirty = !0;
    }
  });
}
sr.add = function(e, t, r) {
  return Ie.add(e.array, t.array, r.array), e._dirty = !0, e;
};
sr.set = function(e, t, r, n, i) {
  Ie.set(e.array, t, r, n, i), e._dirty = !0;
};
sr.copy = function(e, t) {
  return Ie.copy(e.array, t.array), e._dirty = !0, e;
};
sr.dist = function(e, t) {
  return Ie.distance(e.array, t.array);
};
sr.distance = sr.dist;
sr.div = function(e, t, r) {
  return Ie.divide(e.array, t.array, r.array), e._dirty = !0, e;
};
sr.divide = sr.div;
sr.dot = function(e, t) {
  return Ie.dot(e.array, t.array);
};
sr.len = function(e) {
  return Ie.length(e.array);
};
sr.lerp = function(e, t, r, n) {
  return Ie.lerp(e.array, t.array, r.array, n), e._dirty = !0, e;
};
sr.min = function(e, t, r) {
  return Ie.min(e.array, t.array, r.array), e._dirty = !0, e;
};
sr.max = function(e, t, r) {
  return Ie.max(e.array, t.array, r.array), e._dirty = !0, e;
};
sr.mul = function(e, t, r) {
  return Ie.multiply(e.array, t.array, r.array), e._dirty = !0, e;
};
sr.multiply = sr.mul;
sr.negate = function(e, t) {
  return Ie.negate(e.array, t.array), e._dirty = !0, e;
};
sr.normalize = function(e, t) {
  return Ie.normalize(e.array, t.array), e._dirty = !0, e;
};
sr.random = function(e, t) {
  return Ie.random(e.array, t), e._dirty = !0, e;
};
sr.scale = function(e, t, r) {
  return Ie.scale(e.array, t.array, r), e._dirty = !0, e;
};
sr.scaleAndAdd = function(e, t, r, n) {
  return Ie.scaleAndAdd(e.array, t.array, r.array, n), e._dirty = !0, e;
};
sr.sqrDist = function(e, t) {
  return Ie.sqrDist(e.array, t.array);
};
sr.squaredDistance = sr.sqrDist;
sr.sqrLen = function(e) {
  return Ie.sqrLen(e.array);
};
sr.squaredLength = sr.sqrLen;
sr.sub = function(e, t, r) {
  return Ie.subtract(e.array, t.array, r.array), e._dirty = !0, e;
};
sr.subtract = sr.sub;
sr.transformMat4 = function(e, t, r) {
  return Ie.transformMat4(e.array, t.array, r.array), e._dirty = !0, e;
};
sr.transformQuat = function(e, t, r) {
  return Ie.transformQuat(e.array, t.array, r.array), e._dirty = !0, e;
};
var ur = {};
ur.create = function() {
  var e = new Li(4);
  return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 1, e;
};
ur.clone = function(e) {
  var t = new Li(4);
  return t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[3], t;
};
ur.copy = function(e, t) {
  return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e;
};
ur.identity = function(e) {
  return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 1, e;
};
ur.transpose = function(e, t) {
  if (e === t) {
    var r = t[1];
    e[1] = t[2], e[2] = r;
  } else
    e[0] = t[0], e[1] = t[2], e[2] = t[1], e[3] = t[3];
  return e;
};
ur.invert = function(e, t) {
  var r = t[0], n = t[1], i = t[2], a = t[3], o = r * a - i * n;
  return o ? (o = 1 / o, e[0] = a * o, e[1] = -n * o, e[2] = -i * o, e[3] = r * o, e) : null;
};
ur.adjoint = function(e, t) {
  var r = t[0];
  return e[0] = t[3], e[1] = -t[1], e[2] = -t[2], e[3] = r, e;
};
ur.determinant = function(e) {
  return e[0] * e[3] - e[2] * e[1];
};
ur.multiply = function(e, t, r) {
  var n = t[0], i = t[1], a = t[2], o = t[3], s = r[0], l = r[1], u = r[2], f = r[3];
  return e[0] = n * s + a * l, e[1] = i * s + o * l, e[2] = n * u + a * f, e[3] = i * u + o * f, e;
};
ur.mul = ur.multiply;
ur.rotate = function(e, t, r) {
  var n = t[0], i = t[1], a = t[2], o = t[3], s = Math.sin(r), l = Math.cos(r);
  return e[0] = n * l + a * s, e[1] = i * l + o * s, e[2] = n * -s + a * l, e[3] = i * -s + o * l, e;
};
ur.scale = function(e, t, r) {
  var n = t[0], i = t[1], a = t[2], o = t[3], s = r[0], l = r[1];
  return e[0] = n * s, e[1] = i * s, e[2] = a * l, e[3] = o * l, e;
};
ur.frob = function(e) {
  return Math.sqrt(Math.pow(e[0], 2) + Math.pow(e[1], 2) + Math.pow(e[2], 2) + Math.pow(e[3], 2));
};
ur.LDU = function(e, t, r, n) {
  return e[2] = n[2] / n[0], r[0] = n[0], r[1] = n[1], r[3] = n[3] - e[2] * r[1], [e, t, r];
};
var Sa = function() {
  this.array = ur.create(), this._dirty = !0;
};
Sa.prototype = {
  constructor: Sa,
  /**
   * Set components from array
   * @param  {Float32Array|number[]} arr
   */
  setArray: function(e) {
    for (var t = 0; t < this.array.length; t++)
      this.array[t] = e[t];
    return this._dirty = !0, this;
  },
  /**
   * Clone a new Matrix2
   * @return {clay.Matrix2}
   */
  clone: function() {
    return new Sa().copy(this);
  },
  /**
   * Copy from b
   * @param  {clay.Matrix2} b
   * @return {clay.Matrix2}
   */
  copy: function(e) {
    return ur.copy(this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Calculate the adjugate of self, in-place
   * @return {clay.Matrix2}
   */
  adjoint: function() {
    return ur.adjoint(this.array, this.array), this._dirty = !0, this;
  },
  /**
   * Calculate matrix determinant
   * @return {number}
   */
  determinant: function() {
    return ur.determinant(this.array);
  },
  /**
   * Set to a identity matrix
   * @return {clay.Matrix2}
   */
  identity: function() {
    return ur.identity(this.array), this._dirty = !0, this;
  },
  /**
   * Invert self
   * @return {clay.Matrix2}
   */
  invert: function() {
    return ur.invert(this.array, this.array), this._dirty = !0, this;
  },
  /**
   * Alias for mutiply
   * @param  {clay.Matrix2} b
   * @return {clay.Matrix2}
   */
  mul: function(e) {
    return ur.mul(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Alias for multiplyLeft
   * @param  {clay.Matrix2} a
   * @return {clay.Matrix2}
   */
  mulLeft: function(e) {
    return ur.mul(this.array, e.array, this.array), this._dirty = !0, this;
  },
  /**
   * Multiply self and b
   * @param  {clay.Matrix2} b
   * @return {clay.Matrix2}
   */
  multiply: function(e) {
    return ur.multiply(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Multiply a and self, a is on the left
   * @param  {clay.Matrix2} a
   * @return {clay.Matrix2}
   */
  multiplyLeft: function(e) {
    return ur.multiply(this.array, e.array, this.array), this._dirty = !0, this;
  },
  /**
   * Rotate self by a given radian
   * @param  {number}   rad
   * @return {clay.Matrix2}
   */
  rotate: function(e) {
    return ur.rotate(this.array, this.array, e), this._dirty = !0, this;
  },
  /**
   * Scale self by s
   * @param  {clay.Vector2}  s
   * @return {clay.Matrix2}
   */
  scale: function(e) {
    return ur.scale(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Transpose self, in-place.
   * @return {clay.Matrix2}
   */
  transpose: function() {
    return ur.transpose(this.array, this.array), this._dirty = !0, this;
  },
  toString: function() {
    return "[" + Array.prototype.join.call(this.array, ",") + "]";
  },
  toArray: function() {
    return Array.prototype.slice.call(this.array);
  }
};
Sa.adjoint = function(e, t) {
  return ur.adjoint(e.array, t.array), e._dirty = !0, e;
};
Sa.copy = function(e, t) {
  return ur.copy(e.array, t.array), e._dirty = !0, e;
};
Sa.determinant = function(e) {
  return ur.determinant(e.array);
};
Sa.identity = function(e) {
  return ur.identity(e.array), e._dirty = !0, e;
};
Sa.invert = function(e, t) {
  return ur.invert(e.array, t.array), e._dirty = !0, e;
};
Sa.mul = function(e, t, r) {
  return ur.mul(e.array, t.array, r.array), e._dirty = !0, e;
};
Sa.multiply = Sa.mul;
Sa.rotate = function(e, t, r) {
  return ur.rotate(e.array, t.array, r), e._dirty = !0, e;
};
Sa.scale = function(e, t, r) {
  return ur.scale(e.array, t.array, r.array), e._dirty = !0, e;
};
Sa.transpose = function(e, t) {
  return ur.transpose(e.array, t.array), e._dirty = !0, e;
};
var Sr = {};
Sr.create = function() {
  var e = new Li(6);
  return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 1, e[4] = 0, e[5] = 0, e;
};
Sr.clone = function(e) {
  var t = new Li(6);
  return t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[3], t[4] = e[4], t[5] = e[5], t;
};
Sr.copy = function(e, t) {
  return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[4] = t[4], e[5] = t[5], e;
};
Sr.identity = function(e) {
  return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 1, e[4] = 0, e[5] = 0, e;
};
Sr.invert = function(e, t) {
  var r = t[0], n = t[1], i = t[2], a = t[3], o = t[4], s = t[5], l = r * a - n * i;
  return l ? (l = 1 / l, e[0] = a * l, e[1] = -n * l, e[2] = -i * l, e[3] = r * l, e[4] = (i * s - a * o) * l, e[5] = (n * o - r * s) * l, e) : null;
};
Sr.determinant = function(e) {
  return e[0] * e[3] - e[1] * e[2];
};
Sr.multiply = function(e, t, r) {
  var n = t[0], i = t[1], a = t[2], o = t[3], s = t[4], l = t[5], u = r[0], f = r[1], c = r[2], h = r[3], v = r[4], d = r[5];
  return e[0] = n * u + a * f, e[1] = i * u + o * f, e[2] = n * c + a * h, e[3] = i * c + o * h, e[4] = n * v + a * d + s, e[5] = i * v + o * d + l, e;
};
Sr.mul = Sr.multiply;
Sr.rotate = function(e, t, r) {
  var n = t[0], i = t[1], a = t[2], o = t[3], s = t[4], l = t[5], u = Math.sin(r), f = Math.cos(r);
  return e[0] = n * f + a * u, e[1] = i * f + o * u, e[2] = n * -u + a * f, e[3] = i * -u + o * f, e[4] = s, e[5] = l, e;
};
Sr.scale = function(e, t, r) {
  var n = t[0], i = t[1], a = t[2], o = t[3], s = t[4], l = t[5], u = r[0], f = r[1];
  return e[0] = n * u, e[1] = i * u, e[2] = a * f, e[3] = o * f, e[4] = s, e[5] = l, e;
};
Sr.translate = function(e, t, r) {
  var n = t[0], i = t[1], a = t[2], o = t[3], s = t[4], l = t[5], u = r[0], f = r[1];
  return e[0] = n, e[1] = i, e[2] = a, e[3] = o, e[4] = n * u + a * f + s, e[5] = i * u + o * f + l, e;
};
Sr.frob = function(e) {
  return Math.sqrt(Math.pow(e[0], 2) + Math.pow(e[1], 2) + Math.pow(e[2], 2) + Math.pow(e[3], 2) + Math.pow(e[4], 2) + Math.pow(e[5], 2) + 1);
};
var qa = function() {
  this.array = Sr.create(), this._dirty = !0;
};
qa.prototype = {
  constructor: qa,
  /**
   * Set components from array
   * @param  {Float32Array|number[]} arr
   */
  setArray: function(e) {
    for (var t = 0; t < this.array.length; t++)
      this.array[t] = e[t];
    return this._dirty = !0, this;
  },
  /**
   * Clone a new Matrix2d
   * @return {clay.Matrix2d}
   */
  clone: function() {
    return new qa().copy(this);
  },
  /**
   * Copy from b
   * @param  {clay.Matrix2d} b
   * @return {clay.Matrix2d}
   */
  copy: function(e) {
    return Sr.copy(this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Calculate matrix determinant
   * @return {number}
   */
  determinant: function() {
    return Sr.determinant(this.array);
  },
  /**
   * Set to a identity matrix
   * @return {clay.Matrix2d}
   */
  identity: function() {
    return Sr.identity(this.array), this._dirty = !0, this;
  },
  /**
   * Invert self
   * @return {clay.Matrix2d}
   */
  invert: function() {
    return Sr.invert(this.array, this.array), this._dirty = !0, this;
  },
  /**
   * Alias for mutiply
   * @param  {clay.Matrix2d} b
   * @return {clay.Matrix2d}
   */
  mul: function(e) {
    return Sr.mul(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Alias for multiplyLeft
   * @param  {clay.Matrix2d} a
   * @return {clay.Matrix2d}
   */
  mulLeft: function(e) {
    return Sr.mul(this.array, e.array, this.array), this._dirty = !0, this;
  },
  /**
   * Multiply self and b
   * @param  {clay.Matrix2d} b
   * @return {clay.Matrix2d}
   */
  multiply: function(e) {
    return Sr.multiply(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Multiply a and self, a is on the left
   * @param  {clay.Matrix2d} a
   * @return {clay.Matrix2d}
   */
  multiplyLeft: function(e) {
    return Sr.multiply(this.array, e.array, this.array), this._dirty = !0, this;
  },
  /**
   * Rotate self by a given radian
   * @param  {number}   rad
   * @return {clay.Matrix2d}
   */
  rotate: function(e) {
    return Sr.rotate(this.array, this.array, e), this._dirty = !0, this;
  },
  /**
   * Scale self by s
   * @param  {clay.Vector2}  s
   * @return {clay.Matrix2d}
   */
  scale: function(e) {
    return Sr.scale(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Translate self by v
   * @param  {clay.Vector2}  v
   * @return {clay.Matrix2d}
   */
  translate: function(e) {
    return Sr.translate(this.array, this.array, e.array), this._dirty = !0, this;
  },
  toString: function() {
    return "[" + Array.prototype.join.call(this.array, ",") + "]";
  },
  toArray: function() {
    return Array.prototype.slice.call(this.array);
  }
};
qa.copy = function(e, t) {
  return Sr.copy(e.array, t.array), e._dirty = !0, e;
};
qa.determinant = function(e) {
  return Sr.determinant(e.array);
};
qa.identity = function(e) {
  return Sr.identity(e.array), e._dirty = !0, e;
};
qa.invert = function(e, t) {
  return Sr.invert(e.array, t.array), e._dirty = !0, e;
};
qa.mul = function(e, t, r) {
  return Sr.mul(e.array, t.array, r.array), e._dirty = !0, e;
};
qa.multiply = qa.mul;
qa.rotate = function(e, t, r) {
  return Sr.rotate(e.array, t.array, r), e._dirty = !0, e;
};
qa.scale = function(e, t, r) {
  return Sr.scale(e.array, t.array, r.array), e._dirty = !0, e;
};
qa.translate = function(e, t, r) {
  return Sr.translate(e.array, t.array, r.array), e._dirty = !0, e;
};
var Vn = function() {
  this.array = bt.create(), this._dirty = !0;
};
Vn.prototype = {
  constructor: Vn,
  /**
   * Set components from array
   * @param  {Float32Array|number[]} arr
   */
  setArray: function(e) {
    for (var t = 0; t < this.array.length; t++)
      this.array[t] = e[t];
    return this._dirty = !0, this;
  },
  /**
   * Calculate the adjugate of self, in-place
   * @return {clay.Matrix3}
   */
  adjoint: function() {
    return bt.adjoint(this.array, this.array), this._dirty = !0, this;
  },
  /**
   * Clone a new Matrix3
   * @return {clay.Matrix3}
   */
  clone: function() {
    return new Vn().copy(this);
  },
  /**
   * Copy from b
   * @param  {clay.Matrix3} b
   * @return {clay.Matrix3}
   */
  copy: function(e) {
    return bt.copy(this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Calculate matrix determinant
   * @return {number}
   */
  determinant: function() {
    return bt.determinant(this.array);
  },
  /**
   * Copy the values from Matrix2d a
   * @param  {clay.Matrix2d} a
   * @return {clay.Matrix3}
   */
  fromMat2d: function(e) {
    return bt.fromMat2d(this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Copies the upper-left 3x3 values of Matrix4
   * @param  {clay.Matrix4} a
   * @return {clay.Matrix3}
   */
  fromMat4: function(e) {
    return bt.fromMat4(this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Calculates a rotation matrix from the given quaternion
   * @param  {clay.Quaternion} q
   * @return {clay.Matrix3}
   */
  fromQuat: function(e) {
    return bt.fromQuat(this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Set to a identity matrix
   * @return {clay.Matrix3}
   */
  identity: function() {
    return bt.identity(this.array), this._dirty = !0, this;
  },
  /**
   * Invert self
   * @return {clay.Matrix3}
   */
  invert: function() {
    return bt.invert(this.array, this.array), this._dirty = !0, this;
  },
  /**
   * Alias for mutiply
   * @param  {clay.Matrix3} b
   * @return {clay.Matrix3}
   */
  mul: function(e) {
    return bt.mul(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Alias for multiplyLeft
   * @param  {clay.Matrix3} a
   * @return {clay.Matrix3}
   */
  mulLeft: function(e) {
    return bt.mul(this.array, e.array, this.array), this._dirty = !0, this;
  },
  /**
   * Multiply self and b
   * @param  {clay.Matrix3} b
   * @return {clay.Matrix3}
   */
  multiply: function(e) {
    return bt.multiply(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Multiply a and self, a is on the left
   * @param  {clay.Matrix3} a
   * @return {clay.Matrix3}
   */
  multiplyLeft: function(e) {
    return bt.multiply(this.array, e.array, this.array), this._dirty = !0, this;
  },
  /**
   * Rotate self by a given radian
   * @param  {number}   rad
   * @return {clay.Matrix3}
   */
  rotate: function(e) {
    return bt.rotate(this.array, this.array, e), this._dirty = !0, this;
  },
  /**
   * Scale self by s
   * @param  {clay.Vector2}  s
   * @return {clay.Matrix3}
   */
  scale: function(e) {
    return bt.scale(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Translate self by v
   * @param  {clay.Vector2}  v
   * @return {clay.Matrix3}
   */
  translate: function(e) {
    return bt.translate(this.array, this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix
   * @param {clay.Matrix4} a
   */
  normalFromMat4: function(e) {
    return bt.normalFromMat4(this.array, e.array), this._dirty = !0, this;
  },
  /**
   * Transpose self, in-place.
   * @return {clay.Matrix2}
   */
  transpose: function() {
    return bt.transpose(this.array, this.array), this._dirty = !0, this;
  },
  toString: function() {
    return "[" + Array.prototype.join.call(this.array, ",") + "]";
  },
  toArray: function() {
    return Array.prototype.slice.call(this.array);
  }
};
Vn.adjoint = function(e, t) {
  return bt.adjoint(e.array, t.array), e._dirty = !0, e;
};
Vn.copy = function(e, t) {
  return bt.copy(e.array, t.array), e._dirty = !0, e;
};
Vn.determinant = function(e) {
  return bt.determinant(e.array);
};
Vn.identity = function(e) {
  return bt.identity(e.array), e._dirty = !0, e;
};
Vn.invert = function(e, t) {
  return bt.invert(e.array, t.array), e;
};
Vn.mul = function(e, t, r) {
  return bt.mul(e.array, t.array, r.array), e._dirty = !0, e;
};
Vn.multiply = Vn.mul;
Vn.fromMat2d = function(e, t) {
  return bt.fromMat2d(e.array, t.array), e._dirty = !0, e;
};
Vn.fromMat4 = function(e, t) {
  return bt.fromMat4(e.array, t.array), e._dirty = !0, e;
};
Vn.fromQuat = function(e, t) {
  return bt.fromQuat(e.array, t.array), e._dirty = !0, e;
};
Vn.normalFromMat4 = function(e, t) {
  return bt.normalFromMat4(e.array, t.array), e._dirty = !0, e;
};
Vn.rotate = function(e, t, r) {
  return bt.rotate(e.array, t.array, r), e._dirty = !0, e;
};
Vn.scale = function(e, t, r) {
  return bt.scale(e.array, t.array, r.array), e._dirty = !0, e;
};
Vn.transpose = function(e, t) {
  return bt.transpose(e.array, t.array), e._dirty = !0, e;
};
Vn.translate = function(e, t, r) {
  return bt.translate(e.array, t.array, r.array), e._dirty = !0, e;
};
var T1 = {
  linear: function(e) {
    return e;
  },
  quadraticIn: function(e) {
    return e * e;
  },
  quadraticOut: function(e) {
    return e * (2 - e);
  },
  quadraticInOut: function(e) {
    return (e *= 2) < 1 ? 0.5 * e * e : -0.5 * (--e * (e - 2) - 1);
  },
  cubicIn: function(e) {
    return e * e * e;
  },
  cubicOut: function(e) {
    return --e * e * e + 1;
  },
  cubicInOut: function(e) {
    return (e *= 2) < 1 ? 0.5 * e * e * e : 0.5 * ((e -= 2) * e * e + 2);
  },
  quarticIn: function(e) {
    return e * e * e * e;
  },
  quarticOut: function(e) {
    return 1 - --e * e * e * e;
  },
  quarticInOut: function(e) {
    return (e *= 2) < 1 ? 0.5 * e * e * e * e : -0.5 * ((e -= 2) * e * e * e - 2);
  },
  quinticIn: function(e) {
    return e * e * e * e * e;
  },
  quinticOut: function(e) {
    return --e * e * e * e * e + 1;
  },
  quinticInOut: function(e) {
    return (e *= 2) < 1 ? 0.5 * e * e * e * e * e : 0.5 * ((e -= 2) * e * e * e * e + 2);
  },
  sinusoidalIn: function(e) {
    return 1 - Math.cos(e * Math.PI / 2);
  },
  sinusoidalOut: function(e) {
    return Math.sin(e * Math.PI / 2);
  },
  sinusoidalInOut: function(e) {
    return 0.5 * (1 - Math.cos(Math.PI * e));
  },
  exponentialIn: function(e) {
    return e === 0 ? 0 : Math.pow(1024, e - 1);
  },
  exponentialOut: function(e) {
    return e === 1 ? 1 : 1 - Math.pow(2, -10 * e);
  },
  exponentialInOut: function(e) {
    return e === 0 ? 0 : e === 1 ? 1 : (e *= 2) < 1 ? 0.5 * Math.pow(1024, e - 1) : 0.5 * (-Math.pow(2, -10 * (e - 1)) + 2);
  },
  circularIn: function(e) {
    return 1 - Math.sqrt(1 - e * e);
  },
  circularOut: function(e) {
    return Math.sqrt(1 - --e * e);
  },
  circularInOut: function(e) {
    return (e *= 2) < 1 ? -0.5 * (Math.sqrt(1 - e * e) - 1) : 0.5 * (Math.sqrt(1 - (e -= 2) * e) + 1);
  },
  elasticIn: function(e) {
    var t, r = 0.1, n = 0.4;
    return e === 0 ? 0 : e === 1 ? 1 : (!r || r < 1 ? (r = 1, t = n / 4) : t = n * Math.asin(1 / r) / (2 * Math.PI), -(r * Math.pow(2, 10 * (e -= 1)) * Math.sin((e - t) * (2 * Math.PI) / n)));
  },
  elasticOut: function(e) {
    var t, r = 0.1, n = 0.4;
    return e === 0 ? 0 : e === 1 ? 1 : (!r || r < 1 ? (r = 1, t = n / 4) : t = n * Math.asin(1 / r) / (2 * Math.PI), r * Math.pow(2, -10 * e) * Math.sin((e - t) * (2 * Math.PI) / n) + 1);
  },
  elasticInOut: function(e) {
    var t, r = 0.1, n = 0.4;
    return e === 0 ? 0 : e === 1 ? 1 : (!r || r < 1 ? (r = 1, t = n / 4) : t = n * Math.asin(1 / r) / (2 * Math.PI), (e *= 2) < 1 ? -0.5 * (r * Math.pow(2, 10 * (e -= 1)) * Math.sin((e - t) * (2 * Math.PI) / n)) : r * Math.pow(2, -10 * (e -= 1)) * Math.sin((e - t) * (2 * Math.PI) / n) * 0.5 + 1);
  },
  backIn: function(e) {
    var t = 1.70158;
    return e * e * ((t + 1) * e - t);
  },
  backOut: function(e) {
    var t = 1.70158;
    return --e * e * ((t + 1) * e + t) + 1;
  },
  backInOut: function(e) {
    var t = 2.5949095;
    return (e *= 2) < 1 ? 0.5 * (e * e * ((t + 1) * e - t)) : 0.5 * ((e -= 2) * e * ((t + 1) * e + t) + 2);
  },
  bounceIn: function(e) {
    return 1 - T1.bounceOut(1 - e);
  },
  bounceOut: function(e) {
    return e < 1 / 2.75 ? 7.5625 * e * e : e < 2 / 2.75 ? 7.5625 * (e -= 1.5 / 2.75) * e + 0.75 : e < 2.5 / 2.75 ? 7.5625 * (e -= 2.25 / 2.75) * e + 0.9375 : 7.5625 * (e -= 2.625 / 2.75) * e + 0.984375;
  },
  bounceInOut: function(e) {
    return e < 0.5 ? T1.bounceIn(e * 2) * 0.5 : T1.bounceOut(e * 2 - 1) * 0.5 + 0.5;
  }
};
PY([
  "Function",
  "RegExp",
  "Date",
  "Error",
  "CanvasGradient",
  "CanvasPattern",
  "Image",
  "Canvas"
], function(e, t) {
  return e["[object " + t + "]"] = !0, e;
}, {});
PY([
  "Int8",
  "Uint8",
  "Uint8Clamped",
  "Int16",
  "Uint16",
  "Int32",
  "Uint32",
  "Float32",
  "Float64"
], function(e, t) {
  return e["[object " + t + "Array]"] = !0, e;
}, {});
var DY = Array.prototype, EY = DY.slice, D1e = DY.map, XV = (function() {
}).constructor, qT = XV ? XV.prototype : null, E1e = "__proto__";
function P1e() {
  for (var e = [], t = 0; t < arguments.length; t++)
    e[t] = arguments[t];
  typeof console < "u" && console.error.apply(console, e);
}
function I1e(e, t) {
  if (Object.assign)
    Object.assign(e, t);
  else
    for (var r in t)
      t.hasOwnProperty(r) && r !== E1e && (e[r] = t[r]);
  return e;
}
function $b(e) {
  return !e || typeof e == "string" ? !1 : typeof e.length == "number";
}
function UI(e, t, r) {
  if (!e)
    return [];
  if (!t)
    return B1e(e);
  if (e.map && e.map === D1e)
    return e.map(t, r);
  for (var n = [], i = 0, a = e.length; i < a; i++)
    n.push(t.call(r, e[i], i, e));
  return n;
}
function PY(e, t, r, n) {
  if (e && t) {
    for (var i = 0, a = e.length; i < a; i++)
      r = t.call(n, r, e[i], i, e);
    return r;
  }
}
function YV(e) {
  if (!e)
    return [];
  if (Object.keys)
    return Object.keys(e);
  var t = [];
  for (var r in e)
    e.hasOwnProperty(r) && t.push(r);
  return t;
}
function R1e(e, t) {
  for (var r = [], n = 2; n < arguments.length; n++)
    r[n - 2] = arguments[n];
  return function() {
    return e.apply(t, r.concat(EY.call(arguments)));
  };
}
qT && tA(qT.bind) && qT.call.bind(qT.bind);
function tA(e) {
  return typeof e == "function";
}
function O1e(e) {
  return typeof e == "string";
}
function aE(e) {
  return typeof e == "number";
}
function N1e(e) {
  return e.colorStops != null;
}
function k1e(e) {
  return e !== e;
}
function B1e(e) {
  for (var t = [], r = 1; r < arguments.length; r++)
    t[r - 1] = arguments[r];
  return EY.apply(e, t);
}
function jT(e) {
  return e == null ? null : typeof e.trim == "function" ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
}
function ZV(e, t) {
  for (var r = new e.constructor(e.length + t.length), n = 0; n < e.length; n++)
    r[n] = e[n];
  for (var i = e.length, n = 0; n < t.length; n++)
    r[n + i] = t[n];
  return r;
}
function oE() {
}
function IY(e, t, r) {
  var n = t[0], i = t[1];
  return e[0] = r[0] * n + r[2] * i + r[4], e[1] = r[1] * n + r[3] * i + r[5], e;
}
var KT = Math.pow, O2 = Math.sqrt, $V = 1e-8, qV = O2(3), QT = 1 / 3;
function JT(e) {
  return e > -$V && e < $V;
}
function z1e(e, t, r, n, i) {
  var a = 1 - i;
  return a * a * (a * e + 3 * i * t) + i * i * (i * n + 3 * a * r);
}
function F1e(e, t, r, n, i, a) {
  var o = n + 3 * (t - r) - e, s = 3 * (r - t * 2 + e), l = 3 * (t - e), u = e - i, f = s * s - 3 * o * l, c = s * l - 9 * o * u, h = l * l - 3 * s * u, v = 0;
  if (JT(f) && JT(c))
    if (JT(s))
      a[0] = 0;
    else {
      var d = -l / s;
      d >= 0 && d <= 1 && (a[v++] = d);
    }
  else {
    var g = c * c - 4 * f * h;
    if (JT(g)) {
      var y = c / f, d = -s / o + y, x = -y / 2;
      d >= 0 && d <= 1 && (a[v++] = d), x >= 0 && x <= 1 && (a[v++] = x);
    } else if (g > 0) {
      var S = O2(g), T = f * s + 1.5 * o * (-c + S), C = f * s + 1.5 * o * (-c - S);
      T < 0 ? T = -KT(-T, QT) : T = KT(T, QT), C < 0 ? C = -KT(-C, QT) : C = KT(C, QT);
      var d = (-s - (T + C)) / (3 * o);
      d >= 0 && d <= 1 && (a[v++] = d);
    } else {
      var A = (2 * f * s - 3 * o * c) / (2 * O2(f * f * f)), M = Math.acos(A) / 3, E = O2(f), P = Math.cos(M), d = (-s - 2 * E * P) / (3 * o), x = (-s + E * (P + qV * Math.sin(M))) / (3 * o), R = (-s + E * (P - qV * Math.sin(M))) / (3 * o);
      d >= 0 && d <= 1 && (a[v++] = d), x >= 0 && x <= 1 && (a[v++] = x), R >= 0 && R <= 1 && (a[v++] = R);
    }
  }
  return v;
}
var G1e = /cubic-bezier\(([0-9,\.e ]+)\)/;
function RY(e) {
  var t = e && G1e.exec(e);
  if (t) {
    var r = t[1].split(","), n = +jT(r[0]), i = +jT(r[1]), a = +jT(r[2]), o = +jT(r[3]);
    if (isNaN(n + i + a + o))
      return;
    var s = [];
    return function(l) {
      return l <= 0 ? 0 : l >= 1 ? 1 : F1e(0, n, a, 1, l, s) && z1e(0, i, o, 1, s[0]);
    };
  }
}
var V1e = (function() {
  function e(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 || oE, this.ondestroy = t.ondestroy || oE, this.onrestart = t.onrestart || oE, t.easing && this.setEasing(t.easing);
  }
  return e.prototype.step = function(t, r) {
    if (this._inited || (this._startTime = t + this._delay, this._inited = !0), this._paused) {
      this._pausedTime += r;
      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;
  }, e.prototype.pause = function() {
    this._paused = !0;
  }, e.prototype.resume = function() {
    this._paused = !1;
  }, e.prototype.setEasing = function(t) {
    this.easing = t, this.easingFunc = tA(t) ? t : T1[t] || RY(t);
  }, e;
})(), jV = {
  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 b1(e) {
  return e = Math.round(e), e < 0 ? 0 : e > 255 ? 255 : e;
}
function KV(e) {
  return e < 0 ? 0 : e > 1 ? 1 : e;
}
function sE(e) {
  var t = e;
  return t.length && t.charAt(t.length - 1) === "%" ? b1(parseFloat(t) / 100 * 255) : b1(parseInt(t, 10));
}
function C1(e) {
  var t = e;
  return t.length && t.charAt(t.length - 1) === "%" ? KV(parseFloat(t) / 100) : KV(parseFloat(t));
}
function lE(e, t, r) {
  return r < 0 ? r += 1 : r > 1 && (r -= 1), r * 6 < 1 ? e + (t - e) * r * 6 : r * 2 < 1 ? t : r * 3 < 2 ? e + (t - e) * (2 / 3 - r) * 6 : e;
}
function jo(e, t, r, n, i) {
  return e[0] = t, e[1] = r, e[2] = n, e[3] = i, e;
}
function WI(e, t) {
  return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e;
}
var OY = new CY(20), e2 = null;
function qg(e, t) {
  e2 && WI(e2, t), e2 = OY.put(e, e2 || t.slice());
}
function uE(e, t) {
  if (e) {
    t = t || [];
    var r = OY.get(e);
    if (r)
      return WI(t, r);
    e = e + "";
    var n = e.replace(/ /g, "").toLowerCase();
    if (n in jV)
      return WI(t, jV[n]), qg(e, 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)) {
          jo(t, 0, 0, 0, 1);
          return;
        }
        return jo(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), qg(e, t), t;
      } else if (i === 7 || i === 9) {
        var a = parseInt(n.slice(1, 7), 16);
        if (!(a >= 0 && a <= 16777215)) {
          jo(t, 0, 0, 0, 1);
          return;
        }
        return jo(t, (a & 16711680) >> 16, (a & 65280) >> 8, a & 255, i === 9 ? parseInt(n.slice(7), 16) / 255 : 1), qg(e, 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(","), f = 1;
      switch (l) {
        case "rgba":
          if (u.length !== 4)
            return u.length === 3 ? jo(t, +u[0], +u[1], +u[2], 1) : jo(t, 0, 0, 0, 1);
          f = C1(u.pop());
        case "rgb":
          if (u.length >= 3)
            return jo(t, sE(u[0]), sE(u[1]), sE(u[2]), u.length === 3 ? f : C1(u[3])), qg(e, t), t;
          jo(t, 0, 0, 0, 1);
          return;
        case "hsla":
          if (u.length !== 4) {
            jo(t, 0, 0, 0, 1);
            return;
          }
          return u[3] = C1(u[3]), QV(u, t), qg(e, t), t;
        case "hsl":
          if (u.length !== 3) {
            jo(t, 0, 0, 0, 1);
            return;
          }
          return QV(u, t), qg(e, t), t;
        default:
          return;
      }
    }
    jo(t, 0, 0, 0, 1);
  }
}
function QV(e, t) {
  var r = (parseFloat(e[0]) % 360 + 360) % 360 / 360, n = C1(e[1]), i = C1(e[2]), a = i <= 0.5 ? i * (n + 1) : i + n - i * n, o = i * 2 - a;
  return t = t || [], jo(t, b1(lE(o, a, r + 1 / 3) * 255), b1(lE(o, a, r) * 255), b1(lE(o, a, r - 1 / 3) * 255), 1), e.length === 4 && (t[3] = e[3]), t;
}
var H1e = /* @__PURE__ */ (function() {
  function e() {
    this.firefox = !1, this.ie = !1, this.edge = !1, this.newEdge = !1, this.weChat = !1;
  }
  return e;
})(), U1e = /* @__PURE__ */ (function() {
  function e() {
    this.browser = new H1e(), 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 e;
})(), Qu = new U1e();
typeof wx == "object" && typeof wx.getSystemInfoSync == "function" ? (Qu.wxa = !0, Qu.touchEventsSupported = !0) : typeof document > "u" && typeof self < "u" ? Qu.worker = !0 : !Qu.hasGlobalWindow || "Deno" in window ? (Qu.node = !0, Qu.svgSupported = !0) : W1e(navigator.userAgent, Qu);
function W1e(e, t) {
  var r = t.browser, n = e.match(/Firefox\/([\d.]+)/), i = e.match(/MSIE\s([\d.]+)/) || e.match(/Trident\/.+?rv:(([\d.]+))/), a = e.match(/Edge?\/([\d.]+)/), o = /micromessenger/i.test(e);
  n && (r.firefox = !0, r.version = n[1]), i && (r.ie = !0, r.version = i[1]), a && (r.edge = !0, r.version = a[1], r.newEdge = +a[1].split(".")[0] > 18), o && (r.weChat = !0), t.svgSupported = typeof SVGRect < "u", t.touchEventsSupported = "ontouchstart" in window && !r.ie && !r.edge, t.pointerEventsSupported = "onpointerdown" in window && (r.edge || r.ie && +r.version >= 11), t.domSupported = typeof document < "u";
  var s = document.documentElement.style;
  t.transform3dSupported = (r.ie && "transition" in s || r.edge || "WebKitCSSMatrix" in window && "m11" in new WebKitCSSMatrix() || "MozPerspective" in s) && !("OTransition" in s), t.transformSupported = t.transform3dSupported || r.ie && +r.version >= 9;
}
function X1e(e) {
  return e.type === "linear";
}
function Y1e(e) {
  return e.type === "radial";
}
(function() {
  return Qu.hasGlobalWindow && tA(window.btoa) ? function(e) {
    return window.btoa(unescape(encodeURIComponent(e)));
  } : typeof Buffer < "u" ? function(e) {
    return Buffer.from(e).toString("base64");
  } : function(e) {
    return null;
  };
})();
var XI = Array.prototype.slice;
function Ju(e, t, r) {
  return (t - e) * r + e;
}
function fE(e, t, r, n) {
  for (var i = t.length, a = 0; a < i; a++)
    e[a] = Ju(t[a], r[a], n);
  return e;
}
function Z1e(e, t, r, n) {
  for (var i = t.length, a = i && t[0].length, o = 0; o < i; o++) {
    e[o] || (e[o] = []);
    for (var s = 0; s < a; s++)
      e[o][s] = Ju(t[o][s], r[o][s], n);
  }
  return e;
}
function t2(e, t, r, n) {
  for (var i = t.length, a = 0; a < i; a++)
    e[a] = t[a] + r[a] * n;
  return e;
}
function JV(e, t, r, n) {
  for (var i = t.length, a = i && t[0].length, o = 0; o < i; o++) {
    e[o] || (e[o] = []);
    for (var s = 0; s < a; s++)
      e[o][s] = t[o][s] + r[o][s] * n;
  }
  return e;
}
function $1e(e, t) {
  for (var r = e.length, n = t.length, i = r > n ? t : e, a = Math.min(r, n), o = i[a - 1] || { color: [0, 0, 0, 0], offset: 0 }, s = a; s < Math.max(r, n); s++)
    i.push({
      offset: o.offset,
      color: o.color.slice()
    });
}
function q1e(e, t, r) {
  var n = e, 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(r === 1 ? i[l] : XI.call(i[l]));
    }
    for (var u = n[0] && n[0].length, l = 0; l < n.length; l++)
      if (r === 1)
        isNaN(n[l]) && (n[l] = i[l]);
      else
        for (var f = 0; f < u; f++)
          isNaN(n[l][f]) && (n[l][f] = i[l][f]);
  }
}
function cE(e) {
  if ($b(e)) {
    var t = e.length;
    if ($b(e[0])) {
      for (var r = [], n = 0; n < t; n++)
        r.push(XI.call(e[n]));
      return r;
    }
    return XI.call(e);
  }
  return e;
}
function N2(e) {
  return e[0] = Math.floor(e[0]) || 0, e[1] = Math.floor(e[1]) || 0, e[2] = Math.floor(e[2]) || 0, e[3] = e[3] == null ? 1 : e[3], "rgba(" + e.join(",") + ")";
}
function j1e(e) {
  return $b(e && e[0]) ? 2 : 1;
}
var r2 = 0, k2 = 1, NY = 2, e1 = 3, YI = 4, ZI = 5, eH = 6;
function tH(e) {
  return e === YI || e === ZI;
}
function n2(e) {
  return e === k2 || e === NY;
}
var I_ = [0, 0, 0, 0], K1e = (function() {
  function e(t) {
    this.keyframes = [], this.discrete = !1, this._invalid = !1, this._needsSort = !1, this._lastFr = 0, this._lastFrP = 0, this.propName = t;
  }
  return e.prototype.isFinished = function() {
    return this._finished;
  }, e.prototype.setFinished = function() {
    this._finished = !0, this._additiveTrack && this._additiveTrack.setFinished();
  }, e.prototype.needsAnimate = function() {
    return this.keyframes.length >= 1;
  }, e.prototype.getAdditiveTrack = function() {
    return this._additiveTrack;
  }, e.prototype.addKeyframe = function(t, r, n) {
    this._needsSort = !0;
    var i = this.keyframes, a = i.length, o = !1, s = eH, l = r;
    if ($b(r)) {
      var u = j1e(r);
      s = u, (u === 1 && !aE(r[0]) || u === 2 && !aE(r[0][0])) && (o = !0);
    } else if (aE(r) && !k1e(r))
      s = r2;
    else if (O1e(r))
      if (!isNaN(+r))
        s = r2;
      else {
        var f = uE(r);
        f && (l = f, s = e1);
      }
    else if (N1e(r)) {
      var c = I1e({}, l);
      c.colorStops = UI(r.colorStops, function(v) {
        return {
          offset: v.offset,
          color: uE(v.color)
        };
      }), X1e(r) ? s = YI : Y1e(r) && (s = ZI), l = c;
    }
    a === 0 ? this.valType = s : (s !== this.valType || s === eH) && (o = !0), this.discrete = this.discrete || o;
    var h = {
      time: t,
      value: l,
      rawValue: r,
      percent: 0
    };
    return n && (h.easing = n, h.easingFunc = tA(n) ? n : T1[n] || RY(n)), i.push(h), h;
  }, e.prototype.prepare = function(t, r) {
    var n = this.keyframes;
    this._needsSort && n.sort(function(g, y) {
      return g.time - y.time;
    });
    for (var i = this.valType, a = n.length, o = n[a - 1], s = this.discrete, l = n2(i), u = tH(i), f = 0; f < a; f++) {
      var c = n[f], h = c.value, v = o.value;
      c.percent = c.time / t, s || (l && f !== a - 1 ? q1e(h, v, i) : u && $1e(h.colorStops, v.colorStops));
    }
    if (!s && i !== ZI && r && this.needsAnimate() && r.needsAnimate() && i === r.valType && !r._finished) {
      this._additiveTrack = r;
      for (var d = n[0].value, f = 0; f < a; f++)
        i === r2 ? n[f].additiveValue = n[f].value - d : i === e1 ? n[f].additiveValue = t2([], n[f].value, d, -1) : n2(i) && (n[f].additiveValue = i === k2 ? t2([], n[f].value, d, -1) : JV([], n[f].value, d, -1));
    }
  }, e.prototype.step = function(t, r) {
    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 === e1, f, c = this._lastFr, h = Math.min, v, d;
      if (s === 1)
        v = d = o[0];
      else {
        if (r < 0)
          f = 0;
        else if (r < this._lastFrP) {
          var g = h(c + 1, s - 1);
          for (f = g; f >= 0 && !(o[f].percent <= r); f--)
            ;
          f = h(f, s - 2);
        } else {
          for (f = c; f < s && !(o[f].percent > r); f++)
            ;
          f = h(f - 1, s - 2);
        }
        d = o[f + 1], v = o[f];
      }
      if (v && d) {
        this._lastFr = f, this._lastFrP = r;
        var y = d.percent - v.percent, x = y === 0 ? 1 : h((r - v.percent) / y, 1);
        d.easingFunc && (x = d.easingFunc(x));
        var S = n ? this._additiveValue : u ? I_ : t[l];
        if ((n2(a) || u) && !S && (S = this._additiveValue = []), this.discrete)
          t[l] = x < 1 ? v.rawValue : d.rawValue;
        else if (n2(a))
          a === k2 ? fE(S, v[i], d[i], x) : Z1e(S, v[i], d[i], x);
        else if (tH(a)) {
          var T = v[i], C = d[i], A = a === YI;
          t[l] = {
            type: A ? "linear" : "radial",
            x: Ju(T.x, C.x, x),
            y: Ju(T.y, C.y, x),
            colorStops: UI(T.colorStops, function(E, P) {
              var R = C.colorStops[P];
              return {
                offset: Ju(E.offset, R.offset, x),
                color: N2(fE([], E.color, R.color, x))
              };
            }),
            global: C.global
          }, A ? (t[l].x2 = Ju(T.x2, C.x2, x), t[l].y2 = Ju(T.y2, C.y2, x)) : t[l].r = Ju(T.r, C.r, x);
        } else if (u)
          fE(S, v[i], d[i], x), n || (t[l] = N2(S));
        else {
          var M = Ju(v[i], d[i], x);
          n ? this._additiveValue = M : t[l] = M;
        }
        n && this._addToTarget(t);
      }
    }
  }, e.prototype._addToTarget = function(t) {
    var r = this.valType, n = this.propName, i = this._additiveValue;
    r === r2 ? t[n] = t[n] + i : r === e1 ? (uE(t[n], I_), t2(I_, I_, i, 1), t[n] = N2(I_)) : r === k2 ? t2(t[n], t[n], i, 1) : r === NY && JV(t[n], t[n], i, 1);
  }, e;
})(), Q1e = (function() {
  function e(t, r, n, i) {
    if (this._tracks = {}, this._trackKeys = [], this._maxTime = 0, this._started = 0, this._clip = null, this._target = t, this._loop = r, r && i) {
      P1e("Can' use additive animation on looped animation.");
      return;
    }
    this._additiveAnimators = i, this._allowDiscrete = n;
  }
  return e.prototype.getMaxTime = function() {
    return this._maxTime;
  }, e.prototype.getDelay = function() {
    return this._delay;
  }, e.prototype.getLoop = function() {
    return this._loop;
  }, e.prototype.getTarget = function() {
    return this._target;
  }, e.prototype.changeTarget = function(t) {
    this._target = t;
  }, e.prototype.when = function(t, r, n) {
    return this.whenWithKeys(t, r, YV(r), n);
  }, e.prototype.whenWithKeys = function(t, r, 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 K1e(s);
        var u = void 0, f = this._getAdditiveTrack(s);
        if (f) {
          var c = f.keyframes, h = c[c.length - 1];
          u = h && h.value, f.valType === e1 && u && (u = N2(u));
        } else
          u = this._target[s];
        if (u == null)
          continue;
        t > 0 && l.addKeyframe(0, cE(u), i), this._trackKeys.push(s);
      }
      l.addKeyframe(t, cE(r[s]), i);
    }
    return this._maxTime = Math.max(this._maxTime, t), this;
  }, e.prototype.pause = function() {
    this._clip.pause(), this._paused = !0;
  }, e.prototype.resume = function() {
    this._clip.resume(), this._paused = !1;
  }, e.prototype.isPaused = function() {
    return !!this._paused;
  }, e.prototype.duration = function(t) {
    return this._maxTime = t, this._force = !0, this;
  }, e.prototype._doneCallback = function() {
    this._setTracksFinished(), this._clip = null;
    var t = this._doneCbs;
    if (t)
      for (var r = t.length, n = 0; n < r; n++)
        t[n].call(this);
  }, e.prototype._abortedCallback = function() {
    this._setTracksFinished();
    var t = this.animation, r = this._abortedCbs;
    if (t && t.removeClip(this._clip), this._clip = null, r)
      for (var n = 0; n < r.length; n++)
        r[n].call(this);
  }, e.prototype._setTracksFinished = function() {
    for (var t = this._tracks, r = this._trackKeys, n = 0; n < r.length; n++)
      t[r[n]].setFinished();
  }, e.prototype._getAdditiveTrack = function(t) {
    var r, n = this._additiveAnimators;
    if (n)
      for (var i = 0; i < n.length; i++) {
        var a = n[i].getTrack(t);
        a && (r = a);
      }
    return r;
  }, e.prototype.start = function(t) {
    if (!(this._started > 0)) {
      this._started = 1;
      for (var r = 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, f = u.length;
        if (s.prepare(i, l), s.needsAnimate())
          if (!this._allowDiscrete && s.discrete) {
            var c = u[f - 1];
            c && (r._target[s.propName] = c.rawValue), s.setFinished();
          } else
            n.push(s);
      }
      if (n.length || this._force) {
        var h = new V1e({
          life: i,
          loop: this._loop,
          delay: this._delay || 0,
          onframe: function(v) {
            r._started = 2;
            var d = r._additiveAnimators;
            if (d) {
              for (var g = !1, y = 0; y < d.length; y++)
                if (d[y]._clip) {
                  g = !0;
                  break;
                }
              g || (r._additiveAnimators = null);
            }
            for (var y = 0; y < n.length; y++)
              n[y].step(r._target, v);
            var x = r._onframeCbs;
            if (x)
              for (var y = 0; y < x.length; y++)
                x[y](r._target, v);
          },
          ondestroy: function() {
            r._doneCallback();
          }
        });
        this._clip = h, this.animation && this.animation.addClip(h), t && h.setEasing(t);
      } else
        this._doneCallback();
      return this;
    }
  }, e.prototype.stop = function(t) {
    if (this._clip) {
      var r = this._clip;
      t && r.onframe(1), this._abortedCallback();
    }
  }, e.prototype.delay = function(t) {
    return this._delay = t, this;
  }, e.prototype.during = function(t) {
    return t && (this._onframeCbs || (this._onframeCbs = []), this._onframeCbs.push(t)), this;
  }, e.prototype.done = function(t) {
    return t && (this._doneCbs || (this._doneCbs = []), this._doneCbs.push(t)), this;
  }, e.prototype.aborted = function(t) {
    return t && (this._abortedCbs || (this._abortedCbs = []), this._abortedCbs.push(t)), this;
  }, e.prototype.getClip = function() {
    return this._clip;
  }, e.prototype.getTrack = function(t) {
    return this._tracks[t];
  }, e.prototype.getTracks = function() {
    var t = this;
    return UI(this._trackKeys, function(r) {
      return t._tracks[r];
    });
  }, e.prototype.stopTracks = function(t, r) {
    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() && (r ? 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;
  }, e.prototype.saveTo = function(t, r, n) {
    if (t) {
      r = r || this._trackKeys;
      for (var i = 0; i < r.length; i++) {
        var a = r[i], o = this._tracks[a];
        if (!(!o || o.isFinished())) {
          var s = o.keyframes, l = s[n ? 0 : s.length - 1];
          l && (t[a] = cE(l.rawValue));
        }
      }
    }
  }, e.prototype.__changeFinalValue = function(t, r) {
    r = r || YV(t);
    for (var n = 0; n < r.length; n++) {
      var i = r[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());
        }
      }
    }
  }, e;
})(), J1e = {
  _animators: null,
  getAnimators: function() {
    return this._animators = this._animators || [], this._animators;
  },
  animate: function(e, t) {
    this._animators = this._animators || [];
    var r = this, n;
    if (e) {
      for (var i = e.split("."), a = r, o = 0, s = i.length; o < s; o++)
        a && (a = a[i[o]]);
      a && (n = a);
    } else
      n = r;
    if (n == null)
      throw new Error("Target " + e + " not exists");
    var l = this._animators, u = new Q1e(n, t), f = this;
    return u.during(function() {
      f.__zr && f.__zr.refresh();
    }).done(function() {
      var c = l.indexOf(u);
      c >= 0 && l.splice(c, 1);
    }), l.push(u), this.__zr && this.__zr.animation.addAnimator(u), u;
  },
  stopAnimation: function(e) {
    this._animators = this._animators || [];
    for (var t = this._animators, r = t.length, n = 0; n < r; n++)
      t[n].stop(e);
    return t.length = 0, this;
  },
  addAnimatorsToZr: function(e) {
    if (this._animators)
      for (var t = 0; t < this._animators.length; t++)
        e.animation.addAnimator(this._animators[t]);
  },
  removeAnimatorsFromZr: function(e) {
    if (this._animators)
      for (var t = 0; t < this._animators.length; t++)
        e.animation.removeAnimator(this._animators[t]);
  }
};
const kY = `
@export clay.util.rand
highp float rand(vec2 uv) {
 const highp float a = 12.9898, b = 78.233, c = 43758.5453;
 highp float dt = dot(uv.xy, vec2(a,b)), sn = mod(dt, 3.141592653589793);
 return fract(sin(sn) * c);
}
@end
@export clay.util.calculate_attenuation
uniform float attenuationFactor : 5.0;
float lightAttenuation(float dist, float range)
{
 float attenuation = 1.0;
 attenuation = dist*dist/(range*range+1.0);
 float att_s = attenuationFactor;
 attenuation = 1.0/(attenuation*att_s+1.0);
 att_s = 1.0/(att_s+1.0);
 attenuation = attenuation - att_s;
 attenuation /= 1.0 - att_s;
 return clamp(attenuation, 0.0, 1.0);
}
@end
@export clay.util.edge_factor
#ifdef SUPPORT_STANDARD_DERIVATIVES
float edgeFactor(float width)
{
 vec3 d = fwidth(v_Barycentric);
 vec3 a3 = smoothstep(vec3(0.0), d * width, v_Barycentric);
 return min(min(a3.x, a3.y), a3.z);
}
#else
float edgeFactor(float width)
{
 return 1.0;
}
#endif
@end
@export clay.util.encode_float
vec4 encodeFloat(const in float depth)
{
 const vec4 bitShifts = vec4(256.0*256.0*256.0, 256.0*256.0, 256.0, 1.0);
 const vec4 bit_mask = vec4(0.0, 1.0/256.0, 1.0/256.0, 1.0/256.0);
 vec4 res = fract(depth * bitShifts);
 res -= res.xxyz * bit_mask;
 return res;
}
@end
@export clay.util.decode_float
float decodeFloat(const in vec4 color)
{
 const vec4 bitShifts = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0);
 return dot(color, bitShifts);
}
@end
@export clay.util.float
@import clay.util.encode_float
@import clay.util.decode_float
@end
@export clay.util.rgbm_decode
vec3 RGBMDecode(vec4 rgbm, float range) {
 return range * rgbm.rgb * rgbm.a;
}
@end
@export clay.util.rgbm_encode
vec4 RGBMEncode(vec3 color, float range) {
 if (dot(color, color) == 0.0) {
 return vec4(0.0);
 }
 vec4 rgbm;
 color /= range;
 rgbm.a = clamp(max(max(color.r, color.g), max(color.b, 1e-6)), 0.0, 1.0);
 rgbm.a = ceil(rgbm.a * 255.0) / 255.0;
 rgbm.rgb = color / rgbm.a;
 return rgbm;
}
@end
@export clay.util.rgbm
@import clay.util.rgbm_decode
@import clay.util.rgbm_encode
vec4 decodeHDR(vec4 color)
{
#if defined(RGBM_DECODE) || defined(RGBM)
 return vec4(RGBMDecode(color, 8.12), 1.0);
#else
 return color;
#endif
}
vec4 encodeHDR(vec4 color)
{
#if defined(RGBM_ENCODE) || defined(RGBM)
 return RGBMEncode(color.xyz, 8.12);
#else
 return color;
#endif
}
@end
@export clay.util.srgb
vec4 sRGBToLinear(in vec4 value) {
 return vec4(mix(pow(value.rgb * 0.9478672986 + vec3(0.0521327014), vec3(2.4)), value.rgb * 0.0773993808, vec3(lessThanEqual(value.rgb, vec3(0.04045)))), value.w);
}
vec4 linearTosRGB(in vec4 value) {
 return vec4(mix(pow(value.rgb, vec3(0.41666)) * 1.055 - vec3(0.055), value.rgb * 12.92, vec3(lessThanEqual(value.rgb, vec3(0.0031308)))), value.w);
}
@end
@export clay.chunk.skinning_header
#ifdef SKINNING
attribute vec3 weight : WEIGHT;
attribute vec4 joint : JOINT;
#ifdef USE_SKIN_MATRICES_TEXTURE
uniform sampler2D skinMatricesTexture : ignore;
uniform float skinMatricesTextureSize: ignore;
mat4 getSkinMatrix(sampler2D tex, float idx) {
 float j = idx * 4.0;
 float x = mod(j, skinMatricesTextureSize);
 float y = floor(j / skinMatricesTextureSize) + 0.5;
 vec2 scale = vec2(skinMatricesTextureSize);
 return mat4(
 texture2D(tex, vec2(x + 0.5, y) / scale),
 texture2D(tex, vec2(x + 1.5, y) / scale),
 texture2D(tex, vec2(x + 2.5, y) / scale),
 texture2D(tex, vec2(x + 3.5, y) / scale)
 );
}
mat4 getSkinMatrix(float idx) {
 return getSkinMatrix(skinMatricesTexture, idx);
}
#else
uniform mat4 skinMatrix[JOINT_COUNT] : SKIN_MATRIX;
mat4 getSkinMatrix(float idx) {
 return skinMatrix[int(idx)];
}
#endif
#endif
@end
@export clay.chunk.skin_matrix
mat4 skinMatrixWS = getSkinMatrix(joint.x) * weight.x;
if (weight.y > 1e-4)
{
 skinMatrixWS += getSkinMatrix(joint.y) * weight.y;
}
if (weight.z > 1e-4)
{
 skinMatrixWS += getSkinMatrix(joint.z) * weight.z;
}
float weightW = 1.0-weight.x-weight.y-weight.z;
if (weightW > 1e-4)
{
 skinMatrixWS += getSkinMatrix(joint.w) * weightW;
}
@end
@export clay.chunk.instancing_header
#ifdef INSTANCING
attribute vec4 instanceMat1;
attribute vec4 instanceMat2;
attribute vec4 instanceMat3;
#endif
@end
@export clay.chunk.instancing_matrix
mat4 instanceMat = mat4(
 vec4(instanceMat1.xyz, 0.0),
 vec4(instanceMat2.xyz, 0.0),
 vec4(instanceMat3.xyz, 0.0),
 vec4(instanceMat1.w, instanceMat2.w, instanceMat3.w, 1.0)
);
@end
@export clay.util.parallax_correct
vec3 parallaxCorrect(in vec3 dir, in vec3 pos, in vec3 boxMin, in vec3 boxMax) {
 vec3 first = (boxMax - pos) / dir;
 vec3 second = (boxMin - pos) / dir;
 vec3 further = max(first, second);
 float dist = min(further.x, min(further.y, further.z));
 vec3 fixedPos = pos + dir * dist;
 vec3 boxCenter = (boxMax + boxMin) * 0.5;
 return normalize(fixedPos - boxCenter);
}
@end
@export clay.util.clamp_sample
vec4 clampSample(const in sampler2D texture, const in vec2 coord)
{
#ifdef STEREO
 float eye = step(0.5, coord.x) * 0.5;
 vec2 coordClamped = clamp(coord, vec2(eye, 0.0), vec2(0.5 + eye, 1.0));
#else
 vec2 coordClamped = clamp(coord, vec2(0.0), vec2(1.0));
#endif
 return texture2D(texture, coordClamped);
}
@end
@export clay.util.ACES
vec3 ACESToneMapping(vec3 color)
{
 const float A = 2.51;
 const float B = 0.03;
 const float C = 2.43;
 const float D = 0.59;
 const float E = 0.14;
 return (color * (A * color + B)) / (color * (C * color + D) + E);
}
@end`, exe = `
@export ecgl.common.transformUniforms
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
uniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;
uniform mat4 world : WORLD;
@end

@export ecgl.common.attributes
attribute vec3 position : POSITION;
attribute vec2 texcoord : TEXCOORD_0;
attribute vec3 normal : NORMAL;
@end

@export ecgl.common.uv.header
uniform vec2 uvRepeat : [1.0, 1.0];
uniform vec2 uvOffset : [0.0, 0.0];
uniform vec2 detailUvRepeat : [1.0, 1.0];
uniform vec2 detailUvOffset : [0.0, 0.0];

varying vec2 v_Texcoord;
varying vec2 v_DetailTexcoord;
@end

@export ecgl.common.uv.main
v_Texcoord = texcoord * uvRepeat + uvOffset;
v_DetailTexcoord = texcoord * detailUvRepeat + detailUvOffset;
@end

@export ecgl.common.uv.fragmentHeader
varying vec2 v_Texcoord;
varying vec2 v_DetailTexcoord;
@end


@export ecgl.common.albedo.main

 vec4 albedoTexel = vec4(1.0);
#ifdef DIFFUSEMAP_ENABLED
 albedoTexel = texture2D(diffuseMap, v_Texcoord);
 #ifdef SRGB_DECODE
 albedoTexel = sRGBToLinear(albedoTexel);
 #endif
#endif

#ifdef DETAILMAP_ENABLED
 vec4 detailTexel = texture2D(detailMap, v_DetailTexcoord);
 #ifdef SRGB_DECODE
 detailTexel = sRGBToLinear(detailTexel);
 #endif
 albedoTexel.rgb = mix(albedoTexel.rgb, detailTexel.rgb, detailTexel.a);
 albedoTexel.a = detailTexel.a + (1.0 - detailTexel.a) * albedoTexel.a;
#endif

@end

@export ecgl.common.wireframe.vertexHeader

#ifdef WIREFRAME_QUAD
attribute vec4 barycentric;
varying vec4 v_Barycentric;
#elif defined(WIREFRAME_TRIANGLE)
attribute vec3 barycentric;
varying vec3 v_Barycentric;
#endif

@end

@export ecgl.common.wireframe.vertexMain

#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)
 v_Barycentric = barycentric;
#endif

@end


@export ecgl.common.wireframe.fragmentHeader

uniform float wireframeLineWidth : 1;
uniform vec4 wireframeLineColor: [0, 0, 0, 0.5];

#ifdef WIREFRAME_QUAD
varying vec4 v_Barycentric;
float edgeFactor () {
 vec4 d = fwidth(v_Barycentric);
 vec4 a4 = smoothstep(vec4(0.0), d * wireframeLineWidth, v_Barycentric);
 return min(min(min(a4.x, a4.y), a4.z), a4.w);
}
#elif defined(WIREFRAME_TRIANGLE)
varying vec3 v_Barycentric;
float edgeFactor () {
 vec3 d = fwidth(v_Barycentric);
 vec3 a3 = smoothstep(vec3(0.0), d * wireframeLineWidth, v_Barycentric);
 return min(min(a3.x, a3.y), a3.z);
}
#endif

@end


@export ecgl.common.wireframe.fragmentMain

#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)
 if (wireframeLineWidth > 0.) {
 vec4 lineColor = wireframeLineColor;
#ifdef SRGB_DECODE
 lineColor = sRGBToLinear(lineColor);
#endif

 gl_FragColor.rgb = mix(gl_FragColor.rgb, lineColor.rgb, (1.0 - edgeFactor()) * lineColor.a);
 }
#endif
@end




@export ecgl.common.bumpMap.header

#ifdef BUMPMAP_ENABLED
uniform sampler2D bumpMap;
uniform float bumpScale : 1.0;


vec3 bumpNormal(vec3 surfPos, vec3 surfNormal, vec3 baseNormal)
{
 vec2 dSTdx = dFdx(v_Texcoord);
 vec2 dSTdy = dFdy(v_Texcoord);

 float Hll = bumpScale * texture2D(bumpMap, v_Texcoord).x;
 float dHx = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdx).x - Hll;
 float dHy = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdy).x - Hll;

 vec3 vSigmaX = dFdx(surfPos);
 vec3 vSigmaY = dFdy(surfPos);
 vec3 vN = surfNormal;

 vec3 R1 = cross(vSigmaY, vN);
 vec3 R2 = cross(vN, vSigmaX);

 float fDet = dot(vSigmaX, R1);

 vec3 vGrad = sign(fDet) * (dHx * R1 + dHy * R2);
 return normalize(abs(fDet) * baseNormal - vGrad);

}
#endif

@end

@export ecgl.common.normalMap.vertexHeader

#ifdef NORMALMAP_ENABLED
attribute vec4 tangent : TANGENT;
varying vec3 v_Tangent;
varying vec3 v_Bitangent;
#endif

@end

@export ecgl.common.normalMap.vertexMain

#ifdef NORMALMAP_ENABLED
 if (dot(tangent, tangent) > 0.0) {
 v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);
 v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);
 }
#endif

@end


@export ecgl.common.normalMap.fragmentHeader

#ifdef NORMALMAP_ENABLED
uniform sampler2D normalMap;
varying vec3 v_Tangent;
varying vec3 v_Bitangent;
#endif

@end

@export ecgl.common.normalMap.fragmentMain
#ifdef NORMALMAP_ENABLED
 if (dot(v_Tangent, v_Tangent) > 0.0) {
 vec3 normalTexel = texture2D(normalMap, v_DetailTexcoord).xyz;
 if (dot(normalTexel, normalTexel) > 0.0) { N = normalTexel * 2.0 - 1.0;
 mat3 tbn = mat3(v_Tangent, v_Bitangent, v_Normal);
 N = normalize(tbn * N);
 }
 }
#endif
@end



@export ecgl.common.vertexAnimation.header

#ifdef VERTEX_ANIMATION
attribute vec3 prevPosition;
attribute vec3 prevNormal;
uniform float percent;
#endif

@end

@export ecgl.common.vertexAnimation.main

#ifdef VERTEX_ANIMATION
 vec3 pos = mix(prevPosition, position, percent);
 vec3 norm = mix(prevNormal, normal, percent);
#else
 vec3 pos = position;
 vec3 norm = normal;
#endif

@end


@export ecgl.common.ssaoMap.header
#ifdef SSAOMAP_ENABLED
uniform sampler2D ssaoMap;
uniform vec4 viewport : VIEWPORT;
#endif
@end

@export ecgl.common.ssaoMap.main
 float ao = 1.0;
#ifdef SSAOMAP_ENABLED
 ao = texture2D(ssaoMap, (gl_FragCoord.xy - viewport.xy) / viewport.zw).r;
#endif
@end




@export ecgl.common.diffuseLayer.header

#if (LAYER_DIFFUSEMAP_COUNT > 0)
uniform float layerDiffuseIntensity[LAYER_DIFFUSEMAP_COUNT];
uniform sampler2D layerDiffuseMap[LAYER_DIFFUSEMAP_COUNT];
#endif

@end

@export ecgl.common.emissiveLayer.header

#if (LAYER_EMISSIVEMAP_COUNT > 0)
uniform float layerEmissionIntensity[LAYER_EMISSIVEMAP_COUNT];
uniform sampler2D layerEmissiveMap[LAYER_EMISSIVEMAP_COUNT];
#endif

@end

@export ecgl.common.layers.header
@import ecgl.common.diffuseLayer.header
@import ecgl.common.emissiveLayer.header
@end

@export ecgl.common.diffuseLayer.main

#if (LAYER_DIFFUSEMAP_COUNT > 0)
 for (int _idx_ = 0; _idx_ < LAYER_DIFFUSEMAP_COUNT; _idx_++) {{
 float intensity = layerDiffuseIntensity[_idx_];
 vec4 texel2 = texture2D(layerDiffuseMap[_idx_], v_Texcoord);
 #ifdef SRGB_DECODE
 texel2 = sRGBToLinear(texel2);
 #endif
 albedoTexel.rgb = mix(albedoTexel.rgb, texel2.rgb * intensity, texel2.a);
 albedoTexel.a = texel2.a + (1.0 - texel2.a) * albedoTexel.a;
 }}
#endif

@end

@export ecgl.common.emissiveLayer.main

#if (LAYER_EMISSIVEMAP_COUNT > 0)
 for (int _idx_ = 0; _idx_ < LAYER_EMISSIVEMAP_COUNT; _idx_++)
 {{
 vec4 texel2 = texture2D(layerEmissiveMap[_idx_], v_Texcoord) * layerEmissionIntensity[_idx_];
 #ifdef SRGB_DECODE
 texel2 = sRGBToLinear(texel2);
 #endif
 float intensity = layerEmissionIntensity[_idx_];
 gl_FragColor.rgb += texel2.rgb * texel2.a * intensity;
 }}
#endif

@end
`, txe = `@export ecgl.color.vertex

uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;

@import ecgl.common.uv.header

attribute vec2 texcoord : TEXCOORD_0;
attribute vec3 position: POSITION;

@import ecgl.common.wireframe.vertexHeader

#ifdef VERTEX_COLOR
attribute vec4 a_Color : COLOR;
varying vec4 v_Color;
#endif

#ifdef VERTEX_ANIMATION
attribute vec3 prevPosition;
uniform float percent : 1.0;
#endif

#ifdef ATMOSPHERE_ENABLED
attribute vec3 normal: NORMAL;
uniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;
varying vec3 v_Normal;
#endif

void main()
{
#ifdef VERTEX_ANIMATION
 vec3 pos = mix(prevPosition, position, percent);
#else
 vec3 pos = position;
#endif

 gl_Position = worldViewProjection * vec4(pos, 1.0);

 @import ecgl.common.uv.main

#ifdef VERTEX_COLOR
 v_Color = a_Color;
#endif

#ifdef ATMOSPHERE_ENABLED
 v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);
#endif

 @import ecgl.common.wireframe.vertexMain

}

@end

@export ecgl.color.fragment

#define LAYER_DIFFUSEMAP_COUNT 0
#define LAYER_EMISSIVEMAP_COUNT 0

uniform sampler2D diffuseMap;
uniform sampler2D detailMap;

uniform vec4 color : [1.0, 1.0, 1.0, 1.0];

#ifdef ATMOSPHERE_ENABLED
uniform mat4 viewTranspose: VIEWTRANSPOSE;
uniform vec3 glowColor;
uniform float glowPower;
varying vec3 v_Normal;
#endif

#ifdef VERTEX_COLOR
varying vec4 v_Color;
#endif

@import ecgl.common.layers.header

@import ecgl.common.uv.fragmentHeader

@import ecgl.common.wireframe.fragmentHeader

@import clay.util.srgb

void main()
{
#ifdef SRGB_DECODE
 gl_FragColor = sRGBToLinear(color);
#else
 gl_FragColor = color;
#endif

#ifdef VERTEX_COLOR
 gl_FragColor *= v_Color;
#endif

 @import ecgl.common.albedo.main

 @import ecgl.common.diffuseLayer.main

 gl_FragColor *= albedoTexel;

#ifdef ATMOSPHERE_ENABLED
 float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);
 gl_FragColor.rgb += glowColor * atmoIntensity;
#endif

 @import ecgl.common.emissiveLayer.main

 @import ecgl.common.wireframe.fragmentMain

}
@end`, rxe = `/**
 * http: */

@export ecgl.lambert.vertex

@import ecgl.common.transformUniforms

@import ecgl.common.uv.header


@import ecgl.common.attributes

@import ecgl.common.wireframe.vertexHeader

#ifdef VERTEX_COLOR
attribute vec4 a_Color : COLOR;
varying vec4 v_Color;
#endif


@import ecgl.common.vertexAnimation.header


varying vec3 v_Normal;
varying vec3 v_WorldPosition;

void main()
{
 @import ecgl.common.uv.main

 @import ecgl.common.vertexAnimation.main


 gl_Position = worldViewProjection * vec4(pos, 1.0);

 v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);
 v_WorldPosition = (world * vec4(pos, 1.0)).xyz;

#ifdef VERTEX_COLOR
 v_Color = a_Color;
#endif

 @import ecgl.common.wireframe.vertexMain
}

@end


@export ecgl.lambert.fragment

#define LAYER_DIFFUSEMAP_COUNT 0
#define LAYER_EMISSIVEMAP_COUNT 0

#define NORMAL_UP_AXIS 1
#define NORMAL_FRONT_AXIS 2

@import ecgl.common.uv.fragmentHeader

varying vec3 v_Normal;
varying vec3 v_WorldPosition;

uniform sampler2D diffuseMap;
uniform sampler2D detailMap;

@import ecgl.common.layers.header

uniform float emissionIntensity: 1.0;

uniform vec4 color : [1.0, 1.0, 1.0, 1.0];

uniform mat4 viewInverse : VIEWINVERSE;

#ifdef ATMOSPHERE_ENABLED
uniform mat4 viewTranspose: VIEWTRANSPOSE;
uniform vec3 glowColor;
uniform float glowPower;
#endif

#ifdef AMBIENT_LIGHT_COUNT
@import clay.header.ambient_light
#endif
#ifdef AMBIENT_SH_LIGHT_COUNT
@import clay.header.ambient_sh_light
#endif

#ifdef DIRECTIONAL_LIGHT_COUNT
@import clay.header.directional_light
#endif

#ifdef VERTEX_COLOR
varying vec4 v_Color;
#endif


@import ecgl.common.ssaoMap.header

@import ecgl.common.bumpMap.header

@import clay.util.srgb

@import ecgl.common.wireframe.fragmentHeader

@import clay.plugin.compute_shadow_map

void main()
{
#ifdef SRGB_DECODE
 gl_FragColor = sRGBToLinear(color);
#else
 gl_FragColor = color;
#endif

#ifdef VERTEX_COLOR
 #ifdef SRGB_DECODE
 gl_FragColor *= sRGBToLinear(v_Color);
 #else
 gl_FragColor *= v_Color;
 #endif
#endif

 @import ecgl.common.albedo.main

 @import ecgl.common.diffuseLayer.main

 gl_FragColor *= albedoTexel;

 vec3 N = v_Normal;
#ifdef DOUBLE_SIDED
 vec3 eyePos = viewInverse[3].xyz;
 vec3 V = normalize(eyePos - v_WorldPosition);

 if (dot(N, V) < 0.0) {
 N = -N;
 }
#endif

 float ambientFactor = 1.0;

#ifdef BUMPMAP_ENABLED
 N = bumpNormal(v_WorldPosition, v_Normal, N);
 ambientFactor = dot(v_Normal, N);
#endif

 vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);

 vec3 diffuseColor = vec3(0.0, 0.0, 0.0);

 @import ecgl.common.ssaoMap.main

#ifdef AMBIENT_LIGHT_COUNT
 for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)
 {
 diffuseColor += ambientLightColor[i] * ambientFactor * ao;
 }
#endif
#ifdef AMBIENT_SH_LIGHT_COUNT
 for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)
 {{
 diffuseColor += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;
 }}
#endif
#ifdef DIRECTIONAL_LIGHT_COUNT
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
 float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];
 if(shadowEnabled)
 {
 computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);
 }
#endif
 for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)
 {
 vec3 lightDirection = -directionalLightDirection[i];
 vec3 lightColor = directionalLightColor[i];

 float shadowContrib = 1.0;
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
 if (shadowEnabled)
 {
 shadowContrib = shadowContribsDir[i];
 }
#endif

 float ndl = dot(N, normalize(lightDirection)) * shadowContrib;

 diffuseColor += lightColor * clamp(ndl, 0.0, 1.0);
 }
#endif

 gl_FragColor.rgb *= diffuseColor;

#ifdef ATMOSPHERE_ENABLED
 float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);
 gl_FragColor.rgb += glowColor * atmoIntensity;
#endif

 @import ecgl.common.emissiveLayer.main

 @import ecgl.common.wireframe.fragmentMain
}

@end`, nxe = `@export ecgl.realistic.vertex

@import ecgl.common.transformUniforms

@import ecgl.common.uv.header

@import ecgl.common.attributes


@import ecgl.common.wireframe.vertexHeader

#ifdef VERTEX_COLOR
attribute vec4 a_Color : COLOR;
varying vec4 v_Color;
#endif

#ifdef NORMALMAP_ENABLED
attribute vec4 tangent : TANGENT;
varying vec3 v_Tangent;
varying vec3 v_Bitangent;
#endif

@import ecgl.common.vertexAnimation.header

varying vec3 v_Normal;
varying vec3 v_WorldPosition;

void main()
{

 @import ecgl.common.uv.main

 @import ecgl.common.vertexAnimation.main

 gl_Position = worldViewProjection * vec4(pos, 1.0);

 v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);
 v_WorldPosition = (world * vec4(pos, 1.0)).xyz;

#ifdef VERTEX_COLOR
 v_Color = a_Color;
#endif

#ifdef NORMALMAP_ENABLED
 v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);
 v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);
#endif

 @import ecgl.common.wireframe.vertexMain

}

@end



@export ecgl.realistic.fragment

#define LAYER_DIFFUSEMAP_COUNT 0
#define LAYER_EMISSIVEMAP_COUNT 0
#define PI 3.14159265358979
#define ROUGHNESS_CHANEL 0
#define METALNESS_CHANEL 1

#define NORMAL_UP_AXIS 1
#define NORMAL_FRONT_AXIS 2

#ifdef VERTEX_COLOR
varying vec4 v_Color;
#endif

@import ecgl.common.uv.fragmentHeader

varying vec3 v_Normal;
varying vec3 v_WorldPosition;

uniform sampler2D diffuseMap;

uniform sampler2D detailMap;
uniform sampler2D metalnessMap;
uniform sampler2D roughnessMap;

@import ecgl.common.layers.header

uniform float emissionIntensity: 1.0;

uniform vec4 color : [1.0, 1.0, 1.0, 1.0];

uniform float metalness : 0.0;
uniform float roughness : 0.5;

uniform mat4 viewInverse : VIEWINVERSE;

#ifdef ATMOSPHERE_ENABLED
uniform mat4 viewTranspose: VIEWTRANSPOSE;
uniform vec3 glowColor;
uniform float glowPower;
#endif

#ifdef AMBIENT_LIGHT_COUNT
@import clay.header.ambient_light
#endif

#ifdef AMBIENT_SH_LIGHT_COUNT
@import clay.header.ambient_sh_light
#endif

#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT
@import clay.header.ambient_cubemap_light
#endif

#ifdef DIRECTIONAL_LIGHT_COUNT
@import clay.header.directional_light
#endif

@import ecgl.common.normalMap.fragmentHeader

@import ecgl.common.ssaoMap.header

@import ecgl.common.bumpMap.header

@import clay.util.srgb

@import clay.util.rgbm

@import ecgl.common.wireframe.fragmentHeader

@import clay.plugin.compute_shadow_map

vec3 F_Schlick(float ndv, vec3 spec) {
 return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);
}

float D_Phong(float g, float ndh) {
 float a = pow(8192.0, g);
 return (a + 2.0) / 8.0 * pow(ndh, a);
}

void main()
{
 vec4 albedoColor = color;

 vec3 eyePos = viewInverse[3].xyz;
 vec3 V = normalize(eyePos - v_WorldPosition);
#ifdef VERTEX_COLOR
 #ifdef SRGB_DECODE
 albedoColor *= sRGBToLinear(v_Color);
 #else
 albedoColor *= v_Color;
 #endif
#endif

 @import ecgl.common.albedo.main

 @import ecgl.common.diffuseLayer.main

 albedoColor *= albedoTexel;

 float m = metalness;

#ifdef METALNESSMAP_ENABLED
 float m2 = texture2D(metalnessMap, v_DetailTexcoord)[METALNESS_CHANEL];
 m = clamp(m2 + (m - 0.5) * 2.0, 0.0, 1.0);
#endif

 vec3 baseColor = albedoColor.rgb;
 albedoColor.rgb = baseColor * (1.0 - m);
 vec3 specFactor = mix(vec3(0.04), baseColor, m);

 float g = 1.0 - roughness;

#ifdef ROUGHNESSMAP_ENABLED
 float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];
 g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);
#endif

 vec3 N = v_Normal;

#ifdef DOUBLE_SIDED
 if (dot(N, V) < 0.0) {
 N = -N;
 }
#endif

 float ambientFactor = 1.0;

#ifdef BUMPMAP_ENABLED
 N = bumpNormal(v_WorldPosition, v_Normal, N);
 ambientFactor = dot(v_Normal, N);
#endif

@import ecgl.common.normalMap.fragmentMain

 vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);

 vec3 diffuseTerm = vec3(0.0);
 vec3 specularTerm = vec3(0.0);

 float ndv = clamp(dot(N, V), 0.0, 1.0);
 vec3 fresnelTerm = F_Schlick(ndv, specFactor);

 @import ecgl.common.ssaoMap.main

#ifdef AMBIENT_LIGHT_COUNT
 for(int _idx_ = 0; _idx_ < AMBIENT_LIGHT_COUNT; _idx_++)
 {{
 diffuseTerm += ambientLightColor[_idx_] * ambientFactor * ao;
 }}
#endif

#ifdef AMBIENT_SH_LIGHT_COUNT
 for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)
 {{
 diffuseTerm += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;
 }}
#endif

#ifdef DIRECTIONAL_LIGHT_COUNT
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
 float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];
 if(shadowEnabled)
 {
 computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);
 }
#endif
 for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++)
 {{
 vec3 L = -directionalLightDirection[_idx_];
 vec3 lc = directionalLightColor[_idx_];

 vec3 H = normalize(L + V);
 float ndl = clamp(dot(N, normalize(L)), 0.0, 1.0);
 float ndh = clamp(dot(N, H), 0.0, 1.0);

 float shadowContrib = 1.0;
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
 if (shadowEnabled)
 {
 shadowContrib = shadowContribsDir[_idx_];
 }
#endif

 vec3 li = lc * ndl * shadowContrib;

 diffuseTerm += li;
 specularTerm += li * fresnelTerm * D_Phong(g, ndh);
 }}
#endif


#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT
 vec3 L = reflect(-V, N);
 L = vec3(L.x, L[NORMAL_UP_AXIS], L[NORMAL_FRONT_AXIS]);
 float rough2 = clamp(1.0 - g, 0.0, 1.0);
 float bias2 = rough2 * 5.0;
 vec2 brdfParam2 = texture2D(ambientCubemapLightBRDFLookup[0], vec2(rough2, ndv)).xy;
 vec3 envWeight2 = specFactor * brdfParam2.x + brdfParam2.y;
 vec3 envTexel2;
 for(int _idx_ = 0; _idx_ < AMBIENT_CUBEMAP_LIGHT_COUNT; _idx_++)
 {{
 envTexel2 = RGBMDecode(textureCubeLodEXT(ambientCubemapLightCubemap[_idx_], L, bias2), 8.12);
 specularTerm += ambientCubemapLightColor[_idx_] * envTexel2 * envWeight2 * ao;
 }}
#endif

 gl_FragColor.rgb = albedoColor.rgb * diffuseTerm + specularTerm;
 gl_FragColor.a = albedoColor.a;

#ifdef ATMOSPHERE_ENABLED
 float atmoIntensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);
 gl_FragColor.rgb += glowColor * atmoIntensity;
#endif

#ifdef SRGB_ENCODE
 gl_FragColor = linearTosRGB(gl_FragColor);
#endif

 @import ecgl.common.emissiveLayer.main

 @import ecgl.common.wireframe.fragmentMain
}

@end`, ixe = `@export ecgl.hatching.vertex

@import ecgl.realistic.vertex

@end


@export ecgl.hatching.fragment

#define NORMAL_UP_AXIS 1
#define NORMAL_FRONT_AXIS 2

@import ecgl.common.uv.fragmentHeader

varying vec3 v_Normal;
varying vec3 v_WorldPosition;

uniform vec4 color : [0.0, 0.0, 0.0, 1.0];
uniform vec4 paperColor : [1.0, 1.0, 1.0, 1.0];

uniform mat4 viewInverse : VIEWINVERSE;

#ifdef AMBIENT_LIGHT_COUNT
@import clay.header.ambient_light
#endif
#ifdef AMBIENT_SH_LIGHT_COUNT
@import clay.header.ambient_sh_light
#endif

#ifdef DIRECTIONAL_LIGHT_COUNT
@import clay.header.directional_light
#endif

#ifdef VERTEX_COLOR
varying vec4 v_Color;
#endif


@import ecgl.common.ssaoMap.header

@import ecgl.common.bumpMap.header

@import clay.util.srgb

@import ecgl.common.wireframe.fragmentHeader

@import clay.plugin.compute_shadow_map

uniform sampler2D hatch1;
uniform sampler2D hatch2;
uniform sampler2D hatch3;
uniform sampler2D hatch4;
uniform sampler2D hatch5;
uniform sampler2D hatch6;

float shade(in float tone) {
 vec4 c = vec4(1. ,1., 1., 1.);
 float step = 1. / 6.;
 vec2 uv = v_DetailTexcoord;
 if (tone <= step / 2.0) {
 c = mix(vec4(0.), texture2D(hatch6, uv), 12. * tone);
 }
 else if (tone <= step) {
 c = mix(texture2D(hatch6, uv), texture2D(hatch5, uv), 6. * tone);
 }
 if(tone > step && tone <= 2. * step){
 c = mix(texture2D(hatch5, uv), texture2D(hatch4, uv) , 6. * (tone - step));
 }
 if(tone > 2. * step && tone <= 3. * step){
 c = mix(texture2D(hatch4, uv), texture2D(hatch3, uv), 6. * (tone - 2. * step));
 }
 if(tone > 3. * step && tone <= 4. * step){
 c = mix(texture2D(hatch3, uv), texture2D(hatch2, uv), 6. * (tone - 3. * step));
 }
 if(tone > 4. * step && tone <= 5. * step){
 c = mix(texture2D(hatch2, uv), texture2D(hatch1, uv), 6. * (tone - 4. * step));
 }
 if(tone > 5. * step){
 c = mix(texture2D(hatch1, uv), vec4(1.), 6. * (tone - 5. * step));
 }

 return c.r;
}

const vec3 w = vec3(0.2125, 0.7154, 0.0721);

void main()
{
#ifdef SRGB_DECODE
 vec4 inkColor = sRGBToLinear(color);
#else
 vec4 inkColor = color;
#endif

#ifdef VERTEX_COLOR
 #ifdef SRGB_DECODE
 inkColor *= sRGBToLinear(v_Color);
 #else
 inkColor *= v_Color;
 #endif
#endif

 vec3 N = v_Normal;
#ifdef DOUBLE_SIDED
 vec3 eyePos = viewInverse[3].xyz;
 vec3 V = normalize(eyePos - v_WorldPosition);

 if (dot(N, V) < 0.0) {
 N = -N;
 }
#endif

 float tone = 0.0;

 float ambientFactor = 1.0;

#ifdef BUMPMAP_ENABLED
 N = bumpNormal(v_WorldPosition, v_Normal, N);
 ambientFactor = dot(v_Normal, N);
#endif

 vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);

 @import ecgl.common.ssaoMap.main

#ifdef AMBIENT_LIGHT_COUNT
 for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)
 {
 tone += dot(ambientLightColor[i], w) * ambientFactor * ao;
 }
#endif
#ifdef AMBIENT_SH_LIGHT_COUNT
 for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)
 {{
 tone += dot(calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_], w) * ao;
 }}
#endif
#ifdef DIRECTIONAL_LIGHT_COUNT
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
 float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];
 if(shadowEnabled)
 {
 computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);
 }
#endif
 for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)
 {
 vec3 lightDirection = -directionalLightDirection[i];
 float lightTone = dot(directionalLightColor[i], w);

 float shadowContrib = 1.0;
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
 if (shadowEnabled)
 {
 shadowContrib = shadowContribsDir[i];
 }
#endif

 float ndl = dot(N, normalize(lightDirection)) * shadowContrib;

 tone += lightTone * clamp(ndl, 0.0, 1.0);
 }
#endif

 gl_FragColor = mix(inkColor, paperColor, shade(clamp(tone, 0.0, 1.0)));
 }
@end
`, axe = `@export ecgl.sm.depth.vertex

uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;

attribute vec3 position : POSITION;
attribute vec2 texcoord : TEXCOORD_0;

#ifdef VERTEX_ANIMATION
attribute vec3 prevPosition;
uniform float percent : 1.0;
#endif

varying vec4 v_ViewPosition;
varying vec2 v_Texcoord;

void main(){

#ifdef VERTEX_ANIMATION
 vec3 pos = mix(prevPosition, position, percent);
#else
 vec3 pos = position;
#endif

 v_ViewPosition = worldViewProjection * vec4(pos, 1.0);
 gl_Position = v_ViewPosition;

 v_Texcoord = texcoord;

}
@end



@export ecgl.sm.depth.fragment

@import clay.sm.depth.fragment

@end`;
Object.assign(Kl.prototype, J1e);
Ze.import(kY);
Ze.import(xY);
Ze.import(exe);
Ze.import(txe);
Ze.import(rxe);
Ze.import(nxe);
Ze.import(ixe);
Ze.import(axe);
function oxe(e) {
  return !e || e === "none";
}
function BY(e) {
  return e instanceof HTMLCanvasElement || e instanceof HTMLImageElement || e instanceof Image;
}
function sxe(e) {
  return e.getZr && e.setOption;
}
var lxe = sh.prototype.addToScene, uxe = sh.prototype.removeFromScene;
sh.prototype.addToScene = function(e) {
  if (lxe.call(this, e), this.__zr) {
    var t = this.__zr;
    e.traverse(function(r) {
      r.__zr = t, r.addAnimatorsToZr && r.addAnimatorsToZr(t);
    });
  }
};
sh.prototype.removeFromScene = function(e) {
  uxe.call(this, e), e.traverse(function(t) {
    var r = t.__zr;
    t.__zr = null, r && t.removeAnimatorsFromZr && t.removeAnimatorsFromZr(r);
  });
};
ls.prototype.setTextureImage = function(e, t, r, n) {
  if (this.shader) {
    var i = r.getZr(), a = this, o;
    return a.autoUpdateTextureStatus = !1, a.disableTexture(e), oxe(t) || (o = J.loadTexture(t, r, n, function(s) {
      a.enableTexture(e), i && i.refresh();
    }), a.set(e, o)), o;
  }
};
var J = {};
J.Renderer = us;
J.Node = Kl;
J.Mesh = ri;
J.Shader = Ze;
J.Material = ls;
J.Texture = We;
J.Texture2D = Vt;
J.Geometry = jt;
J.SphereGeometry = b1e;
J.PlaneGeometry = eA;
J.CubeGeometry = MY;
J.AmbientLight = C1e;
J.DirectionalLight = A1e;
J.PointLight = M1e;
J.SpotLight = L1e;
J.PerspectiveCamera = ei;
J.OrthographicCamera = Gm;
J.Vector2 = Pt;
J.Vector3 = Me;
J.Vector4 = sr;
J.Quaternion = wr;
J.Matrix2 = Sa;
J.Matrix2d = qa;
J.Matrix3 = Vn;
J.Matrix4 = Ke;
J.Plane = w1;
J.Ray = md;
J.BoundingBox = wi;
J.Frustum = QC;
var i2 = null;
function fxe() {
  return i2 !== null || (i2 = Ql.createBlank("rgba(255,255,255,0)").image), i2;
}
function rH(e) {
  return Math.pow(2, Math.round(Math.log(e) / Math.LN2));
}
function nH(e) {
  if ((e.wrapS === We.REPEAT || e.wrapT === We.REPEAT) && e.image) {
    var t = rH(e.width), r = rH(e.height);
    if (t !== e.width || r !== e.height) {
      var n = document.createElement("canvas");
      n.width = t, n.height = r;
      var i = n.getContext("2d");
      i.drawImage(e.image, 0, 0, t, r), e.image = n;
    }
  }
}
J.loadTexture = function(e, t, r, n) {
  typeof r == "function" && (n = r, r = {}), r = r || {};
  for (var i = Object.keys(r).sort(), a = "", o = 0; o < i.length; o++)
    a += i[o] + "_" + r[i[o]] + "_";
  var s = t.__textureCache = t.__textureCache || new CY(20);
  if (sxe(e)) {
    var l = e.__textureid__, u = s.get(a + l);
    if (u)
      u.texture.surface.setECharts(e), n && n(u.texture);
    else {
      var f = new HI(e);
      f.onupdate = function() {
        t.getZr().refresh();
      }, u = {
        texture: f.getTexture()
      };
      for (var o = 0; o < i.length; o++)
        u.texture[i[o]] = r[i[o]];
      l = e.__textureid__ || "__ecgl_ec__" + u.texture.__uid__, e.__textureid__ = l, s.put(a + l, u), n && n(u.texture);
    }
    return u.texture;
  } else if (BY(e)) {
    var l = e.__textureid__, u = s.get(a + l);
    if (!u) {
      u = {
        texture: new J.Texture2D({
          image: e
        })
      };
      for (var o = 0; o < i.length; o++)
        u.texture[i[o]] = r[i[o]];
      l = e.__textureid__ || "__ecgl_image__" + u.texture.__uid__, e.__textureid__ = l, s.put(a + l, u), nH(u.texture), n && n(u.texture);
    }
    return u.texture;
  } else {
    var u = s.get(a + e);
    if (u)
      u.callbacks ? u.callbacks.push(n) : n && n(u.texture);
    else if (e.match(/.hdr$|^data:application\/octet-stream/)) {
      u = {
        callbacks: [n]
      };
      var c = Ql.loadTexture(e, {
        exposure: r.exposure,
        fileType: "hdr"
      }, function() {
        c.dirty(), u.callbacks.forEach(function(d) {
          d && d(c);
        }), u.callbacks = null;
      });
      u.texture = c, s.put(a + e, u);
    } else {
      for (var c = new J.Texture2D({
        image: new Image()
      }), o = 0; o < i.length; o++)
        c[i[o]] = r[i[o]];
      u = {
        texture: c,
        callbacks: [n]
      };
      var h = c.image;
      h.onload = function() {
        c.image = h, nH(c), c.dirty(), u.callbacks.forEach(function(g) {
          g && g(c);
        }), u.callbacks = null;
      }, h.crossOrigin = "Anonymous", h.src = e, c.image = fxe(), s.put(a + e, u);
    }
    return u.texture;
  }
};
J.createAmbientCubemap = function(e, t, r, n) {
  e = e || {};
  var i = e.texture, a = qt.firstNotNull(e.exposure, 1), o = new _1e({
    intensity: qt.firstNotNull(e.specularIntensity, 1)
  }), s = new x1e({
    intensity: qt.firstNotNull(e.diffuseIntensity, 1),
    coefficients: [0.844, 0.712, 0.691, -0.037, 0.083, 0.167, 0.343, 0.288, 0.299, -0.041, -0.021, -9e-3, -3e-3, -0.041, -0.064, -0.011, -7e-3, -4e-3, -0.031, 0.034, 0.081, -0.06, -0.049, -0.06, 0.046, 0.056, 0.05]
  });
  return o.cubemap = J.loadTexture(i, r, {
    exposure: a
  }, function() {
    o.cubemap.flipY = !1, o.prefilter(t, 32), s.coefficients = LY.projectEnvironmentMap(t, o.cubemap, {
      lod: 1
    }), n && n();
  }), {
    specular: o,
    diffuse: s
  };
};
J.createBlankTexture = Ql.createBlank;
J.isImage = BY;
J.additiveBlend = function(e) {
  e.blendEquation(e.FUNC_ADD), e.blendFunc(e.SRC_ALPHA, e.ONE);
};
J.parseColor = function(e, t) {
  return e instanceof Array ? (t || (t = []), t[0] = e[0], t[1] = e[1], t[2] = e[2], e.length > 3 ? t[3] = e[3] : t[3] = 1, t) : (t = bi(e || "#000", t) || [0, 0, 0, 0], t[0] /= 255, t[1] /= 255, t[2] /= 255, t);
};
J.directionFromAlphaBeta = function(e, t) {
  var r = e / 180 * Math.PI + Math.PI / 2, n = -t / 180 * Math.PI + Math.PI / 2, i = [], a = Math.sin(r);
  return i[0] = a * Math.cos(n), i[1] = -Math.cos(r), i[2] = a * Math.sin(n), i;
};
J.getShadowResolution = function(e) {
  var t = 1024;
  switch (e) {
    case "low":
      t = 512;
      break;
    case "medium":
      break;
    case "high":
      t = 2048;
      break;
    case "ultra":
      t = 4096;
      break;
  }
  return t;
};
J.COMMON_SHADERS = ["lambert", "color", "realistic", "hatching", "shadow"];
J.createShader = function(e) {
  e === "ecgl.shadow" && (e = "ecgl.displayShadow");
  var t = Ze.source(e + ".vertex"), r = Ze.source(e + ".fragment");
  t || console.error("Vertex shader of '%s' not exits", e), r || console.error("Fragment shader of '%s' not exits", e);
  var n = new Ze(t, r);
  return n.name = e, n;
};
J.createMaterial = function(e, t) {
  t instanceof Array || (t = [t]);
  var r = J.createShader(e), n = new ls({
    shader: r
  });
  return t.forEach(function(i) {
    typeof i == "string" && n.define(i);
  }), n;
};
J.setMaterialFromModel = function(e, t, r, n) {
  t.autoUpdateTextureStatus = !1;
  var i = r.getModel(e + "Material"), a = i.get("detailTexture"), o = qt.firstNotNull(i.get("textureTiling"), 1), s = qt.firstNotNull(i.get("textureOffset"), 0);
  typeof o == "number" && (o = [o, o]), typeof s == "number" && (s = [s, s]);
  var l = o[0] > 1 || o[1] > 1 ? J.Texture.REPEAT : J.Texture.CLAMP_TO_EDGE, u = {
    anisotropic: 8,
    wrapS: l,
    wrapT: l
  };
  if (e === "realistic") {
    var f = i.get("roughness"), c = i.get("metalness");
    c != null ? isNaN(c) && (t.setTextureImage("metalnessMap", c, n, u), c = qt.firstNotNull(i.get("metalnessAdjust"), 0.5)) : c = 0, f != null ? isNaN(f) && (t.setTextureImage("roughnessMap", f, n, u), f = qt.firstNotNull(i.get("roughnessAdjust"), 0.5)) : f = 0.5;
    var h = i.get("normalTexture");
    t.setTextureImage("detailMap", a, n, u), t.setTextureImage("normalMap", h, n, u), t.set({
      roughness: f,
      metalness: c,
      detailUvRepeat: o,
      detailUvOffset: s
    });
  } else if (e === "lambert")
    t.setTextureImage("detailMap", a, n, u), t.set({
      detailUvRepeat: o,
      detailUvOffset: s
    });
  else if (e === "color")
    t.setTextureImage("detailMap", a, n, u), t.set({
      detailUvRepeat: o,
      detailUvOffset: s
    });
  else if (e === "hatching") {
    var v = i.get("hatchingTextures") || [];
    v.length < 6;
    for (var d = 0; d < 6; d++)
      t.setTextureImage("hatch" + (d + 1), v[d], n, {
        anisotropic: 8,
        wrapS: J.Texture.REPEAT,
        wrapT: J.Texture.REPEAT
      });
    t.set({
      detailUvRepeat: o,
      detailUvOffset: s
    });
  }
};
J.updateVertexAnimation = function(e, t, r, n) {
  var i = n.get("animation"), a = n.get("animationDurationUpdate"), o = n.get("animationEasingUpdate"), s = r.shadowDepthMaterial;
  if (i && t && a > 0 && t.geometry.vertexCount === r.geometry.vertexCount) {
    r.material.define("vertex", "VERTEX_ANIMATION"), r.ignorePreZ = !0, s && s.define("vertex", "VERTEX_ANIMATION");
    for (var l = 0; l < e.length; l++)
      r.geometry.attributes[e[l][0]].value = t.geometry.attributes[e[l][1]].value;
    r.geometry.dirty(), r.__percent = 0, r.material.set("percent", 0), r.stopAnimation(), r.animate().when(a, {
      __percent: 1
    }).during(function() {
      r.material.set("percent", r.__percent), s && s.set("percent", r.__percent);
    }).done(function() {
      r.ignorePreZ = !1, r.material.undefine("vertex", "VERTEX_ANIMATION"), s && s.undefine("vertex", "VERTEX_ANIMATION");
    }).start(o);
  } else
    r.material.undefine("vertex", "VERTEX_ANIMATION"), s && s.undefine("vertex", "VERTEX_ANIMATION");
};
var qb;
qb = Qu.hasGlobalWindow && (window.requestAnimationFrame && window.requestAnimationFrame.bind(window) || window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window) || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame) || function(e) {
  return setTimeout(e, 16);
};
var Rr = function(e, t) {
  this.id = e, this.zr = t;
  try {
    this.renderer = new us({
      clearBit: 0,
      devicePixelRatio: t.painter.dpr,
      preserveDrawingBuffer: !0,
      // PENDING
      premultipliedAlpha: !0
    }), this.renderer.resize(t.painter.getWidth(), t.painter.getHeight());
  } catch (n) {
    this.renderer = null, this.dom = document.createElement("div"), this.dom.style.cssText = "position:absolute; left: 0; top: 0; right: 0; bottom: 0;", this.dom.className = "ecgl-nowebgl", this.dom.innerHTML = "Sorry, your browser does not support WebGL", console.error(n);
    return;
  }
  this.onglobalout = this.onglobalout.bind(this), t.on("globalout", this.onglobalout), this.dom = this.renderer.canvas;
  var r = this.dom.style;
  r.position = "absolute", r.left = "0", r.top = "0", this.views = [], this._picking = new XN({
    renderer: this.renderer
  }), this._viewsToDispose = [], this._accumulatingId = 0, this._zrEventProxy = new Mt({
    shape: {
      x: -1,
      y: -1,
      width: 2,
      height: 2
    },
    // FIXME Better solution.
    __isGLToZRProxy: !0
  }), this._backgroundColor = null, this._disposed = !1;
};
Rr.prototype.setUnpainted = function() {
};
Rr.prototype.addView = function(e) {
  if (e.layer !== this) {
    var t = this._viewsToDispose.indexOf(e);
    t >= 0 && this._viewsToDispose.splice(t, 1), this.views.push(e), e.layer = this;
    var r = this.zr;
    e.scene.traverse(function(n) {
      n.__zr = r, n.addAnimatorsToZr && n.addAnimatorsToZr(r);
    });
  }
};
function zY(e) {
  var t = e.__zr;
  e.__zr = null, t && e.removeAnimatorsFromZr && e.removeAnimatorsFromZr(t);
}
Rr.prototype.removeView = function(e) {
  if (e.layer === this) {
    var t = this.views.indexOf(e);
    t >= 0 && (this.views.splice(t, 1), e.scene.traverse(zY, this), e.layer = null, this._viewsToDispose.push(e));
  }
};
Rr.prototype.removeViewsAll = function() {
  this.views.forEach(function(e) {
    e.scene.traverse(zY, this), e.layer = null, this._viewsToDispose.push(e);
  }, this), this.views.length = 0;
};
Rr.prototype.resize = function(e, t) {
  var r = this.renderer;
  r.resize(e, t);
};
Rr.prototype.clear = function() {
  var e = this.renderer.gl, t = this._backgroundColor || [0, 0, 0, 0];
  e.clearColor(t[0], t[1], t[2], t[3]), e.depthMask(!0), e.colorMask(!0, !0, !0, !0), e.clear(e.DEPTH_BUFFER_BIT | e.COLOR_BUFFER_BIT);
};
Rr.prototype.clearDepth = function() {
  var e = this.renderer.gl;
  e.clear(e.DEPTH_BUFFER_BIT);
};
Rr.prototype.clearColor = function() {
  var e = this.renderer.gl;
  e.clearColor(0, 0, 0, 0), e.clear(e.COLOR_BUFFER_BIT);
};
Rr.prototype.needsRefresh = function() {
  this.zr.refresh();
};
Rr.prototype.refresh = function(e) {
  this._backgroundColor = e ? J.parseColor(e) : [0, 0, 0, 0], this.renderer.clearColor = this._backgroundColor;
  for (var t = 0; t < this.views.length; t++)
    this.views[t].prepareRender(this.renderer);
  this._doRender(!1), this._trackAndClean();
  for (var t = 0; t < this._viewsToDispose.length; t++)
    this._viewsToDispose[t].dispose(this.renderer);
  this._viewsToDispose.length = 0, this._startAccumulating();
};
Rr.prototype.renderToCanvas = function(e) {
  this._startAccumulating(!0), e.drawImage(this.dom, 0, 0, e.canvas.width, e.canvas.height);
};
Rr.prototype._doRender = function(e) {
  this.clear(), this.renderer.saveViewport();
  for (var t = 0; t < this.views.length; t++)
    this.views[t].render(this.renderer, e);
  this.renderer.restoreViewport();
};
Rr.prototype._stopAccumulating = function() {
  this._accumulatingId = 0, clearTimeout(this._accumulatingTimeout);
};
var cxe = 1;
Rr.prototype._startAccumulating = function(e) {
  var t = this;
  this._stopAccumulating();
  for (var r = !1, n = 0; n < this.views.length; n++)
    r = this.views[n].needsAccumulate() || r;
  if (!r)
    return;
  function i(a) {
    if (!(!t._accumulatingId || a !== t._accumulatingId)) {
      for (var o = !0, s = 0; s < t.views.length; s++)
        o = t.views[s].isAccumulateFinished() && r;
      o || (t._doRender(!0), e ? i(a) : qb(function() {
        i(a);
      }));
    }
  }
  this._accumulatingId = cxe++, e ? i(t._accumulatingId) : this._accumulatingTimeout = setTimeout(function() {
    i(t._accumulatingId);
  }, 50);
};
Rr.prototype._trackAndClean = function() {
  var e = [], t = [];
  this._textureList && (jb(this._textureList), jb(this._geometriesList));
  for (var r = 0; r < this.views.length; r++)
    hxe(this.views[r].scene, e, t);
  this._textureList && (Kb(this.renderer, this._textureList), Kb(this.renderer, this._geometriesList)), this._textureList = e, this._geometriesList = t;
};
function jb(e) {
  for (var t = 0; t < e.length; t++)
    e[t].__used__ = 0;
}
function Kb(e, t) {
  for (var r = 0; r < t.length; r++)
    t[r].__used__ || t[r].dispose(e);
}
function a2(e, t) {
  e.__used__ = e.__used__ || 0, e.__used__++, e.__used__ === 1 && t.push(e);
}
function hxe(e, t, r) {
  var n, i;
  e.traverse(function(o) {
    if (o.isRenderable()) {
      var s = o.geometry, l = o.material;
      if (l !== n)
        for (var u = l.getTextureUniforms(), f = 0; f < u.length; f++) {
          var c = u[f], h = l.uniforms[c].value;
          if (h) {
            if (h instanceof We)
              a2(h, t);
            else if (h instanceof Array)
              for (var v = 0; v < h.length; v++)
                h[v] instanceof We && a2(h[v], t);
          }
        }
      s !== i && a2(s, r), n = l, i = s;
    }
  });
  for (var a = 0; a < e.lights.length; a++)
    e.lights[a].cubemap && a2(e.lights[a].cubemap, t);
}
Rr.prototype.dispose = function() {
  this._disposed || (this._stopAccumulating(), this._textureList && (jb(this._textureList), jb(this._geometriesList), Kb(this.renderer, this._textureList), Kb(this.renderer, this._geometriesList)), this.zr.off("globalout", this.onglobalout), this._disposed = !0);
};
Rr.prototype.onmousedown = function(e) {
  if (!(e.target && e.target.__isGLToZRProxy)) {
    e = e.event;
    var t = this.pickObject(e.offsetX, e.offsetY);
    t && (this._dispatchEvent("mousedown", e, t), this._dispatchDataEvent("mousedown", e, t)), this._downX = e.offsetX, this._downY = e.offsetY;
  }
};
Rr.prototype.onmousemove = function(e) {
  if (!(e.target && e.target.__isGLToZRProxy)) {
    e = e.event;
    var t = this.pickObject(e.offsetX, e.offsetY), r = t && t.target, n = this._hovered;
    this._hovered = t, n && r !== n.target && (n.relatedTarget = r, this._dispatchEvent("mouseout", e, n), this.zr.setCursorStyle("default")), this._dispatchEvent("mousemove", e, t), t && (this.zr.setCursorStyle("pointer"), (!n || r !== n.target) && this._dispatchEvent("mouseover", e, t)), this._dispatchDataEvent("mousemove", e, t);
  }
};
Rr.prototype.onmouseup = function(e) {
  if (!(e.target && e.target.__isGLToZRProxy)) {
    e = e.event;
    var t = this.pickObject(e.offsetX, e.offsetY);
    t && (this._dispatchEvent("mouseup", e, t), this._dispatchDataEvent("mouseup", e, t)), this._upX = e.offsetX, this._upY = e.offsetY;
  }
};
Rr.prototype.onclick = Rr.prototype.dblclick = function(e) {
  if (!(e.target && e.target.__isGLToZRProxy)) {
    var t = this._upX - this._downX, r = this._upY - this._downY;
    if (!(Math.sqrt(t * t + r * r) > 20)) {
      e = e.event;
      var n = this.pickObject(e.offsetX, e.offsetY);
      n && (this._dispatchEvent(e.type, e, n), this._dispatchDataEvent(e.type, e, n));
      var i = this._clickToSetFocusPoint(e);
      if (i) {
        var a = i.view.setDOFFocusOnPoint(i.distance);
        a && this.zr.refresh();
      }
    }
  }
};
Rr.prototype._clickToSetFocusPoint = function(e) {
  for (var t = this.renderer, r = t.viewport, n = this.views.length - 1; n >= 0; n--) {
    var i = this.views[n];
    if (i.hasDOF() && i.containPoint(e.offsetX, e.offsetY)) {
      this._picking.scene = i.scene, this._picking.camera = i.camera, t.viewport = i.viewport;
      var a = this._picking.pick(e.offsetX, e.offsetY, !0);
      if (a)
        return a.view = i, a;
    }
  }
  t.viewport = r;
};
Rr.prototype.onglobalout = function(e) {
  var t = this._hovered;
  t && this._dispatchEvent("mouseout", e, {
    target: t.target
  });
};
Rr.prototype.pickObject = function(e, t) {
  for (var r = [], n = this.renderer, i = n.viewport, a = 0; a < this.views.length; a++) {
    var o = this.views[a];
    o.containPoint(e, t) && (this._picking.scene = o.scene, this._picking.camera = o.camera, n.viewport = o.viewport, this._picking.pickAll(e, t, r));
  }
  return n.viewport = i, r.sort(function(s, l) {
    return s.distance - l.distance;
  }), r[0];
};
Rr.prototype._dispatchEvent = function(e, t, r) {
  r || (r = {});
  var n = r.target;
  for (r.cancelBubble = !1, r.event = t, r.type = e, r.offsetX = t.offsetX, r.offsetY = t.offsetY; n && (n.trigger(e, r), n = n.getParent(), !r.cancelBubble); )
    ;
  this._dispatchToView(e, r);
};
Rr.prototype._dispatchDataEvent = function(e, t, r) {
  var n = r && r.target, i = n && n.dataIndex, a = n && n.seriesIndex, o = n && n.eventData, s = !1, l = this._zrEventProxy;
  l.x = t.offsetX, l.y = t.offsetY, l.update();
  var u = {
    target: l
  };
  const f = pt(l);
  e === "mousemove" && (i != null ? i !== this._lastDataIndex && (parseInt(this._lastDataIndex, 10) >= 0 && (f.dataIndex = this._lastDataIndex, f.seriesIndex = this._lastSeriesIndex, this.zr.handler.dispatchToElement(u, "mouseout", t)), s = !0) : o != null && o !== this._lastEventData && (this._lastEventData != null && (f.eventData = this._lastEventData, this.zr.handler.dispatchToElement(u, "mouseout", t)), s = !0), this._lastEventData = o, this._lastDataIndex = i, this._lastSeriesIndex = a), f.eventData = o, f.dataIndex = i, f.seriesIndex = a, (o != null || parseInt(i, 10) >= 0 && parseInt(a, 10) >= 0) && (this.zr.handler.dispatchToElement(u, e, t), s && this.zr.handler.dispatchToElement(u, "mouseover", t));
};
Rr.prototype._dispatchToView = function(e, t) {
  for (var r = 0; r < this.views.length; r++)
    this.views[r].containPoint(t.offsetX, t.offsetY) && this.views[r].trigger(e, t);
};
Object.assign(Rr.prototype, WN);
var vxe = ["bar3D", "line3D", "map3D", "scatter3D", "surface", "lines3D", "scatterGL", "scatter3D"];
function t1(e, t) {
  if (e && e[t] && (e[t].normal || e[t].emphasis)) {
    var r = e[t].normal, n = e[t].emphasis;
    r && (e[t] = r), n && (e.emphasis = e.emphasis || {}, e.emphasis[t] = n);
  }
}
function dxe(e) {
  t1(e, "itemStyle"), t1(e, "lineStyle"), t1(e, "areaStyle"), t1(e, "label");
}
function o2(e) {
  e && (e instanceof Array || (e = [e]), F(e, function(t) {
    if (t.axisLabel) {
      var r = t.axisLabel;
      Object.assign(r, r.textStyle), r.textStyle = null;
    }
  }));
}
function pxe(e) {
  F(e.series, function(t) {
    Tt(vxe, t.type) >= 0 && (dxe(t), t.coordinateSystem === "mapbox" && (t.coordinateSystem = "mapbox3D", e.mapbox3D = e.mapbox));
  }), o2(e.xAxis3D), o2(e.yAxis3D), o2(e.zAxis3D), o2(e.grid3D), t1(e.geo3D);
}
function FY(e) {
  this._layers = {}, this._zr = e;
}
FY.prototype.update = function(e, t) {
  var r = this, n = t.getZr();
  if (!n.getWidth() || !n.getHeight()) {
    console.warn("Dom has no width or height");
    return;
  }
  function i(s) {
    n.setSleepAfterStill(0);
    var l;
    s.coordinateSystem && s.coordinateSystem.model, l = s.get("zlevel");
    var u = r._layers, f = u[l];
    if (!f) {
      if (f = u[l] = new Rr("gl-" + l, n), n.painter.isSingleCanvas()) {
        f.virtual = !0;
        var c = new Xn({
          z: 1e4,
          style: {
            image: f.renderer.canvas
          },
          silent: !0
        });
        f.__hostImage = c, n.add(c);
      }
      n.painter.insertLayer(l, f);
    }
    return f.__hostImage && f.__hostImage.setStyle({
      width: f.renderer.getWidth(),
      height: f.renderer.getHeight()
    }), f;
  }
  function a(s, l) {
    s && s.traverse(function(u) {
      u.isRenderable && u.isRenderable() && (u.ignorePicking = u.$ignorePicking != null ? u.$ignorePicking : l);
    });
  }
  for (var o in this._layers)
    this._layers[o].removeViewsAll();
  e.eachComponent(function(s, l) {
    if (s !== "series") {
      var u = t.getViewOfComponentModel(l), f = l.coordinateSystem;
      if (u.__ecgl__) {
        var c;
        if (f) {
          if (!f.viewGL) {
            console.error("Can't find viewGL in coordinateSystem of component " + l.id);
            return;
          }
          c = f.viewGL;
        } else {
          if (!l.viewGL) {
            console.error("Can't find viewGL of component " + l.id);
            return;
          }
          c = f.viewGL;
        }
        var c = f.viewGL, h = i(l);
        h.addView(c), u.afterRender && u.afterRender(l, e, t, h), a(u.groupGL, l.get("silent"));
      }
    }
  }), e.eachSeries(function(s) {
    var l = t.getViewOfSeriesModel(s), u = s.coordinateSystem;
    if (l.__ecgl__) {
      if (u && !u.viewGL && !l.viewGL) {
        console.error("Can't find viewGL of series " + l.id);
        return;
      }
      var f = u && u.viewGL || l.viewGL, c = i(s);
      c.addView(f), l.afterRender && l.afterRender(s, e, t, c), a(l.groupGL, s.get("silent"));
    }
  });
};
dO(function(e) {
  var t = e.getZr(), r = t.painter.dispose;
  t.painter.dispose = function() {
    typeof this.eachOtherLayer == "function" && this.eachOtherLayer(function(n) {
      n instanceof Rr && n.dispose();
    }), r.call(this);
  }, t.painter.getRenderedCanvas = function(n) {
    if (n = n || {}, this._singleCanvas)
      return this._layers[0].dom;
    var i = document.createElement("canvas"), a = n.pixelRatio || this.dpr;
    i.width = this.getWidth() * a, i.height = this.getHeight() * a;
    var o = i.getContext("2d");
    o.dpr = a, o.clearRect(0, 0, i.width, i.height), n.backgroundColor && (o.fillStyle = n.backgroundColor, o.fillRect(0, 0, i.width, i.height));
    var s = this.storage.getDisplayList(!0), l = {}, u, f = this;
    function c(g, y) {
      var x = f._zlevelList;
      g == null && (g = -1 / 0);
      for (var S, T = 0; T < x.length; T++) {
        var C = x[T], A = f._layers[C];
        if (!A.__builtin__ && C > g && C < y) {
          S = A;
          break;
        }
      }
      S && S.renderToCanvas && (o.save(), S.renderToCanvas(o), o.restore());
    }
    for (var h = {
      ctx: o
    }, v = 0; v < s.length; v++) {
      var d = s[v];
      d.zlevel !== u && (c(u, d.zlevel), u = d.zlevel), this._doPaintEl(d, h, !0, null, l);
    }
    return c(u, 1 / 0), i;
  };
});
pO(function(e, t) {
  var r = t.getZr(), n = r.__egl = r.__egl || new FY(r);
  n.update(e, t);
});
Rx(pxe);
const rA = {
  defaultOption: {
    viewControl: {
      // perspective, orthographic.
      // TODO Isometric
      projection: "perspective",
      // If rotate on on init
      autoRotate: !1,
      // cw or ccw
      autoRotateDirection: "cw",
      // Degree per second
      autoRotateSpeed: 10,
      // Start rotating after still for a given time
      // default is 3 seconds
      autoRotateAfterStill: 3,
      // Rotate, zoom damping.
      damping: 0.8,
      // Sensitivities for operations.
      // Can be array to set x,y respectively
      rotateSensitivity: 1,
      zoomSensitivity: 1,
      // Can be array to set x,y respectively
      panSensitivity: 1,
      // Which mouse button do rotate or pan
      panMouseButton: "middle",
      rotateMouseButton: "left",
      // Distance to the target
      // Only available when camera is perspective.
      distance: 150,
      // Min distance mouse can zoom in
      minDistance: 40,
      // Max distance mouse can zoom out
      maxDistance: 400,
      // Size of viewing volume.
      // Only available when camera is orthographic
      orthographicSize: 150,
      maxOrthographicSize: 400,
      minOrthographicSize: 20,
      // Center view point
      center: [0, 0, 0],
      // Alpha angle for top-down rotation
      // Positive to rotate to top.
      alpha: 0,
      // beta angle for left-right rotation
      // Positive to rotate to right.
      beta: 0,
      minAlpha: -90,
      maxAlpha: 90
      // minBeta: -Infinity
      // maxBeta: -Infinity
    }
  },
  setView: function(e) {
    e = e || {}, this.option.viewControl = this.option.viewControl || {}, e.alpha != null && (this.option.viewControl.alpha = e.alpha), e.beta != null && (this.option.viewControl.beta = e.beta), e.distance != null && (this.option.viewControl.distance = e.distance), e.center != null && (this.option.viewControl.center = e.center);
  }
}, vy = {
  defaultOption: {
    // Post effect
    postEffect: {
      enable: !1,
      bloom: {
        enable: !0,
        intensity: 0.1
      },
      depthOfField: {
        enable: !1,
        focalRange: 20,
        focalDistance: 50,
        blurRadius: 10,
        fstop: 2.8,
        quality: "medium"
      },
      screenSpaceAmbientOcclusion: {
        enable: !1,
        radius: 2,
        // low, medium, high, ultra
        quality: "medium",
        intensity: 1
      },
      screenSpaceReflection: {
        enable: !1,
        quality: "medium",
        maxRoughness: 0.8
      },
      colorCorrection: {
        enable: !0,
        exposure: 0,
        brightness: 0,
        contrast: 1,
        saturation: 1,
        lookupTexture: ""
      },
      edge: {
        enable: !1
      },
      FXAA: {
        enable: !1
      }
    },
    // Temporal super sampling when the picture is still.
    temporalSuperSampling: {
      // Only enabled when postEffect is enabled
      enable: "auto"
    }
  }
}, dy = {
  defaultOption: {
    // Light is available when material.shading is not color
    light: {
      // Main light
      main: {
        shadow: !1,
        // low, medium, high, ultra
        shadowQuality: "high",
        color: "#fff",
        intensity: 1,
        alpha: 0,
        beta: 0
      },
      ambient: {
        color: "#fff",
        intensity: 0.2
      },
      ambientCubemap: {
        // Panorama environment texture,
        // Support .hdr and commmon web formats.
        texture: null,
        // Available when texture is hdr.
        exposure: 1,
        // Intensity for diffuse term
        diffuseIntensity: 0.5,
        // Intensity for specular term, only available when shading is realastic
        specularIntensity: 0.5
      }
    }
  }
};
var nA = At.extend({
  type: "grid3D",
  dependencies: ["xAxis3D", "yAxis3D", "zAxis3D"],
  defaultOption: {
    show: !0,
    zlevel: -10,
    // Layout used for viewport
    left: 0,
    top: 0,
    width: "100%",
    height: "100%",
    environment: "auto",
    // Dimension of grid3D
    boxWidth: 100,
    boxHeight: 100,
    boxDepth: 100,
    // Common axis options.
    axisPointer: {
      show: !0,
      lineStyle: {
        color: "rgba(0, 0, 0, 0.8)",
        width: 1
      },
      label: {
        show: !0,
        // (dimValue: number, value: Array) => string
        formatter: null,
        // TODO, Consider boxWidth
        margin: 8,
        // backgroundColor: '#ffbd67',
        // borderColor: '#000',
        // borderWidth: 0,
        textStyle: {
          fontSize: 14,
          color: "#fff",
          backgroundColor: "rgba(0,0,0,0.5)",
          padding: 3,
          borderRadius: 3
        }
      }
    },
    axisLine: {
      show: !0,
      lineStyle: {
        color: "#333",
        width: 2,
        type: "solid"
      }
    },
    axisTick: {
      show: !0,
      inside: !1,
      length: 3,
      lineStyle: {
        width: 1
      }
    },
    axisLabel: {
      show: !0,
      inside: !1,
      rotate: 0,
      margin: 8,
      textStyle: {
        fontSize: 12
      }
    },
    splitLine: {
      show: !0,
      lineStyle: {
        color: ["#ccc"],
        width: 1,
        type: "solid"
      }
    },
    splitArea: {
      show: !1,
      areaStyle: {
        color: ["rgba(250,250,250,0.3)", "rgba(200,200,200,0.3)"]
      }
    },
    // Light options
    light: {
      main: {
        // Alpha angle for top-down rotation
        // Positive to rotate to top.
        alpha: 30,
        // beta angle for left-right rotation
        // Positive to rotate to right.
        beta: 40
      },
      ambient: {
        intensity: 0.4
      }
    },
    viewControl: {
      // Small damping for precise control.
      // damping: 0.1,
      // Alpha angle for top-down rotation
      // Positive to rotate to top.
      alpha: 20,
      // beta angle for left-right rotation
      // Positive to rotate to right.
      beta: 40,
      autoRotate: !1,
      // Distance to the surface of grid3D.
      distance: 200,
      // Min distance to the surface of grid3D
      minDistance: 40,
      // Max distance to the surface of grid3D
      maxDistance: 400
    }
  }
});
je(nA.prototype, rA);
je(nA.prototype, vy);
je(nA.prototype, dy);
var R_ = qt.firstNotNull, iH = {
  left: 0,
  middle: 1,
  right: 2
};
function aH(e) {
  return e instanceof Array || (e = [e, e]), e;
}
var Hx = Mi.extend(function() {
  return {
    /**
     * @type {module:zrender~ZRender}
     */
    zr: null,
    /**
     * @type {module:echarts-gl/core/ViewGL}
     */
    viewGL: null,
    /**
     * @type {clay.math.Vector3}
     */
    _center: new Me(),
    /**
     * Minimum distance to the center
     * Only available when camera is perspective.
     * @type {number}
     * @default 0.5
     */
    minDistance: 0.5,
    /**
     * Maximum distance to the center
     * Only available when camera is perspective.
     * @type {number}
     * @default 2
     */
    maxDistance: 1.5,
    /**
     * Only available when camera is orthographic
     */
    maxOrthographicSize: 300,
    /**
     * Only available when camera is orthographic
     */
    minOrthographicSize: 30,
    /**
     * Minimum alpha rotation
     */
    minAlpha: -90,
    /**
     * Maximum alpha rotation
     */
    maxAlpha: 90,
    /**
     * Minimum beta rotation
     */
    minBeta: -1 / 0,
    /**
     * Maximum beta rotation
     */
    maxBeta: 1 / 0,
    /**
     * Start auto rotating after still for the given time
     */
    autoRotateAfterStill: 0,
    /**
     * Direction of autoRotate. cw or ccw when looking top down.
     */
    autoRotateDirection: "cw",
    /**
     * Degree per second
     */
    autoRotateSpeed: 60,
    /**
     * @param {number}
     */
    damping: 0.8,
    /**
     * @param {number}
     */
    rotateSensitivity: 1,
    /**
     * @param {number}
     */
    zoomSensitivity: 1,
    /**
     * @param {number}
     */
    panSensitivity: 1,
    panMouseButton: "middle",
    rotateMouseButton: "left",
    /**
     * Pan or rotate
     * @private
     * @type {String}
     */
    _mode: "rotate",
    /**
     * @private
     * @type {clay.Camera}
     */
    _camera: null,
    _needsUpdate: !1,
    _rotating: !1,
    // Rotation around yAxis in radian
    _phi: 0,
    // Rotation around xAxis in radian
    _theta: 0,
    _mouseX: 0,
    _mouseY: 0,
    _rotateVelocity: new Pt(),
    _panVelocity: new Pt(),
    _distance: 500,
    _zoomSpeed: 0,
    _stillTimeout: 0,
    _animators: []
  };
}, function() {
  ["_mouseDownHandler", "_mouseWheelHandler", "_mouseMoveHandler", "_mouseUpHandler", "_pinchHandler", "_contextMenuHandler", "_update"].forEach(function(e) {
    this[e] = this[e].bind(this);
  }, this);
}, {
  /**
   * Initialize.
   * Mouse event binding
   */
  init: function() {
    var e = this.zr;
    e && (e.on("mousedown", this._mouseDownHandler), e.on("globalout", this._mouseUpHandler), e.on("mousewheel", this._mouseWheelHandler), e.on("pinch", this._pinchHandler), e.animation.on("frame", this._update), e.dom.addEventListener("contextmenu", this._contextMenuHandler));
  },
  /**
   * Dispose.
   * Mouse event unbinding
   */
  dispose: function() {
    var e = this.zr;
    e && (e.off("mousedown", this._mouseDownHandler), e.off("mousemove", this._mouseMoveHandler), e.off("mouseup", this._mouseUpHandler), e.off("mousewheel", this._mouseWheelHandler), e.off("pinch", this._pinchHandler), e.off("globalout", this._mouseUpHandler), e.dom.removeEventListener("contextmenu", this._contextMenuHandler), e.animation.off("frame", this._update)), this.stopAllAnimation();
  },
  /**
   * Get distance
   * @return {number}
   */
  getDistance: function() {
    return this._distance;
  },
  /**
   * Set distance
   * @param {number} distance
   */
  setDistance: function(e) {
    this._distance = e, this._needsUpdate = !0;
  },
  /**
   * Get size of orthographic viewing volume
   * @return {number}
   */
  getOrthographicSize: function() {
    return this._orthoSize;
  },
  /**
   * Set size of orthographic viewing volume
   * @param {number} size
   */
  setOrthographicSize: function(e) {
    this._orthoSize = e, this._needsUpdate = !0;
  },
  /**
   * Get alpha rotation
   * Alpha angle for top-down rotation. Positive to rotate to top.
   *
   * Which means camera rotation around x axis.
   */
  getAlpha: function() {
    return this._theta / Math.PI * 180;
  },
  /**
   * Get beta rotation
   * Beta angle for left-right rotation. Positive to rotate to right.
   *
   * Which means camera rotation around y axis.
   */
  getBeta: function() {
    return -this._phi / Math.PI * 180;
  },
  /**
   * Get control center
   * @return {Array.<number>}
   */
  getCenter: function() {
    return this._center.toArray();
  },
  /**
   * Set alpha rotation angle
   * @param {number} alpha
   */
  setAlpha: function(e) {
    e = Math.max(Math.min(this.maxAlpha, e), this.minAlpha), this._theta = e / 180 * Math.PI, this._needsUpdate = !0;
  },
  /**
   * Set beta rotation angle
   * @param {number} beta
   */
  setBeta: function(e) {
    e = Math.max(Math.min(this.maxBeta, e), this.minBeta), this._phi = -e / 180 * Math.PI, this._needsUpdate = !0;
  },
  /**
   * Set control center
   * @param {Array.<number>} center
   */
  setCenter: function(e) {
    this._center.setArray(e);
  },
  /**
   * @param {module:echarts-gl/core/ViewGL} viewGL
   */
  setViewGL: function(e) {
    this.viewGL = e;
  },
  /**
   * @return {clay.Camera}
   */
  getCamera: function() {
    return this.viewGL.camera;
  },
  setFromViewControlModel: function(e, t) {
    t = t || {};
    var r = t.baseDistance || 0, n = t.baseOrthoSize || 1, i = e.get("projection");
    i !== "perspective" && i !== "orthographic" && i !== "isometric" && (i = "perspective"), this._projection = i, this.viewGL.setProjection(i);
    var a = e.get("distance") + r, o = e.get("orthographicSize") + n;
    [["damping", 0.8], ["autoRotate", !1], ["autoRotateAfterStill", 3], ["autoRotateDirection", "cw"], ["autoRotateSpeed", 10], ["minDistance", 30], ["maxDistance", 400], ["minOrthographicSize", 30], ["maxOrthographicSize", 300], ["minAlpha", -90], ["maxAlpha", 90], ["minBeta", -1 / 0], ["maxBeta", 1 / 0], ["rotateSensitivity", 1], ["zoomSensitivity", 1], ["panSensitivity", 1], ["panMouseButton", "left"], ["rotateMouseButton", "middle"]].forEach(function(h) {
      this[h[0]] = R_(e.get(h[0]), h[1]);
    }, this), this.minDistance += r, this.maxDistance += r, this.minOrthographicSize += n, this.maxOrthographicSize += n;
    var s = e.ecModel, l = {};
    ["animation", "animationDurationUpdate", "animationEasingUpdate"].forEach(function(h) {
      l[h] = R_(e.get(h), s && s.get(h));
    });
    var u = R_(t.alpha, e.get("alpha")) || 0, f = R_(t.beta, e.get("beta")) || 0, c = R_(t.center, e.get("center")) || [0, 0, 0];
    l.animation && l.animationDurationUpdate > 0 && this._notFirst ? this.animateTo({
      alpha: u,
      beta: f,
      center: c,
      distance: a,
      orthographicSize: o,
      easing: l.animationEasingUpdate,
      duration: l.animationDurationUpdate
    }) : (this.setDistance(a), this.setAlpha(u), this.setBeta(f), this.setCenter(c), this.setOrthographicSize(o)), this._notFirst = !0, this._validateProperties();
  },
  _validateProperties: function() {
  },
  /**
   * @param {Object} opts
   * @param {number} opts.distance
   * @param {number} opts.alpha
   * @param {number} opts.beta
   * @param {number} opts.orthographicSize
   * @param {number} [opts.duration=1000]
   * @param {number} [opts.easing='linear']
   */
  animateTo: function(e) {
    var t = this.zr, r = this, n = {}, i = {};
    return e.distance != null && (n.distance = this.getDistance(), i.distance = e.distance), e.orthographicSize != null && (n.orthographicSize = this.getOrthographicSize(), i.orthographicSize = e.orthographicSize), e.alpha != null && (n.alpha = this.getAlpha(), i.alpha = e.alpha), e.beta != null && (n.beta = this.getBeta(), i.beta = e.beta), e.center != null && (n.center = this.getCenter(), i.center = e.center), this._addAnimator(t.animation.animate(n).when(e.duration || 1e3, i).during(function() {
      n.alpha != null && r.setAlpha(n.alpha), n.beta != null && r.setBeta(n.beta), n.distance != null && r.setDistance(n.distance), n.center != null && r.setCenter(n.center), n.orthographicSize != null && r.setOrthographicSize(n.orthographicSize), r._needsUpdate = !0;
    })).start(e.easing || "linear");
  },
  /**
   * Stop all animation
   */
  stopAllAnimation: function() {
    for (var e = 0; e < this._animators.length; e++)
      this._animators[e].stop();
    this._animators.length = 0;
  },
  update: function() {
    this._needsUpdate = !0, this._update(20);
  },
  _isAnimating: function() {
    return this._animators.length > 0;
  },
  /**
   * Call update each frame
   * @param  {number} deltaTime Frame time
   */
  _update: function(e) {
    if (this._rotating) {
      var t = (this.autoRotateDirection === "cw" ? 1 : -1) * this.autoRotateSpeed / 180 * Math.PI;
      this._phi -= t * e / 1e3, this._needsUpdate = !0;
    } else this._rotateVelocity.len() > 0 && (this._needsUpdate = !0);
    (Math.abs(this._zoomSpeed) > 0.1 || this._panVelocity.len() > 0) && (this._needsUpdate = !0), this._needsUpdate && (e = Math.min(e, 50), this._updateDistanceOrSize(e), this._updatePan(e), this._updateRotate(e), this._updateTransform(), this.getCamera().update(), this.zr && this.zr.refresh(), this.trigger("update"), this._needsUpdate = !1);
  },
  _updateRotate: function(e) {
    var t = this._rotateVelocity;
    this._phi = t.y * e / 20 + this._phi, this._theta = t.x * e / 20 + this._theta, this.setAlpha(this.getAlpha()), this.setBeta(this.getBeta()), this._vectorDamping(t, Math.pow(this.damping, e / 16));
  },
  _updateDistanceOrSize: function(e) {
    this._projection === "perspective" ? this._setDistance(this._distance + this._zoomSpeed * e / 20) : this._setOrthoSize(this._orthoSize + this._zoomSpeed * e / 20), this._zoomSpeed *= Math.pow(this.damping, e / 16);
  },
  _setDistance: function(e) {
    this._distance = Math.max(Math.min(e, this.maxDistance), this.minDistance);
  },
  _setOrthoSize: function(e) {
    this._orthoSize = Math.max(Math.min(e, this.maxOrthographicSize), this.minOrthographicSize);
    var t = this.getCamera(), r = this._orthoSize, n = r / this.viewGL.viewport.height * this.viewGL.viewport.width;
    t.left = -n / 2, t.right = n / 2, t.top = r / 2, t.bottom = -r / 2;
  },
  _updatePan: function(e) {
    var t = this._panVelocity, r = this._distance, n = this.getCamera(), i = n.worldTransform.y, a = n.worldTransform.x;
    this._center.scaleAndAdd(a, -t.x * r / 200).scaleAndAdd(i, -t.y * r / 200), this._vectorDamping(t, 0);
  },
  _updateTransform: function() {
    var e = this.getCamera(), t = new Me(), r = this._theta + Math.PI / 2, n = this._phi + Math.PI / 2, i = Math.sin(r);
    t.x = i * Math.cos(n), t.y = -Math.cos(r), t.z = i * Math.sin(n), e.position.copy(this._center).scaleAndAdd(t, this._distance), e.rotation.identity().rotateY(-this._phi).rotateX(-this._theta);
  },
  _startCountingStill: function() {
    clearTimeout(this._stillTimeout);
    var e = this.autoRotateAfterStill, t = this;
    !isNaN(e) && e > 0 && (this._stillTimeout = setTimeout(function() {
      t._rotating = !0;
    }, e * 1e3));
  },
  _vectorDamping: function(e, t) {
    var r = e.len();
    r = r * t, r < 1e-4 && (r = 0), e.normalize().scale(r);
  },
  _decomposeTransform: function() {
    if (this.getCamera()) {
      this.getCamera().updateWorldTransform();
      var e = this.getCamera().worldTransform.z, t = Math.asin(e.y), r = Math.atan2(e.x, e.z);
      this._theta = t, this._phi = -r, this.setBeta(this.getBeta()), this.setAlpha(this.getAlpha()), this.getCamera().aspect ? this._setDistance(this.getCamera().position.dist(this._center)) : this._setOrthoSize(this.getCamera().top - this.getCamera().bottom);
    }
  },
  _mouseDownHandler: function(e) {
    if (!e.target && !this._isAnimating()) {
      var t = e.offsetX, r = e.offsetY;
      this.viewGL && !this.viewGL.containPoint(t, r) || (this.zr.on("mousemove", this._mouseMoveHandler), this.zr.on("mouseup", this._mouseUpHandler), e.event.targetTouches ? e.event.targetTouches.length === 1 && (this._mode = "rotate") : e.event.button === iH[this.rotateMouseButton] ? this._mode = "rotate" : e.event.button === iH[this.panMouseButton] ? this._mode = "pan" : this._mode = "", this._rotateVelocity.set(0, 0), this._rotating = !1, this.autoRotate && this._startCountingStill(), this._mouseX = e.offsetX, this._mouseY = e.offsetY);
    }
  },
  _mouseMoveHandler: function(e) {
    if (!(e.target && e.target.__isGLToZRProxy) && !this._isAnimating()) {
      var t = aH(this.panSensitivity), r = aH(this.rotateSensitivity);
      this._mode === "rotate" ? (this._rotateVelocity.y = (e.offsetX - this._mouseX) / this.zr.getHeight() * 2 * r[0], this._rotateVelocity.x = (e.offsetY - this._mouseY) / this.zr.getWidth() * 2 * r[1]) : this._mode === "pan" && (this._panVelocity.x = (e.offsetX - this._mouseX) / this.zr.getWidth() * t[0] * 400, this._panVelocity.y = (-e.offsetY + this._mouseY) / this.zr.getHeight() * t[1] * 400), this._mouseX = e.offsetX, this._mouseY = e.offsetY, e.event.preventDefault();
    }
  },
  _mouseWheelHandler: function(e) {
    if (!this._isAnimating()) {
      var t = e.event.wheelDelta || -e.event.detail;
      this._zoomHandler(e, t);
    }
  },
  _pinchHandler: function(e) {
    this._isAnimating() || (this._zoomHandler(e, e.pinchScale > 1 ? 1 : -1), this._mode = "");
  },
  _zoomHandler: function(e, t) {
    if (t !== 0) {
      var r = e.offsetX, n = e.offsetY;
      if (!(this.viewGL && !this.viewGL.containPoint(r, n))) {
        var i;
        this._projection === "perspective" ? i = Math.max(Math.max(Math.min(this._distance - this.minDistance, this.maxDistance - this._distance)) / 20, 0.5) : i = Math.max(Math.max(Math.min(this._orthoSize - this.minOrthographicSize, this.maxOrthographicSize - this._orthoSize)) / 20, 0.5), this._zoomSpeed = (t > 0 ? -1 : 1) * i * this.zoomSensitivity, this._rotating = !1, this.autoRotate && this._mode === "rotate" && this._startCountingStill(), e.event.preventDefault();
      }
    }
  },
  _mouseUpHandler: function() {
    this.zr.off("mousemove", this._mouseMoveHandler), this.zr.off("mouseup", this._mouseUpHandler);
  },
  _isRightMouseButtonUsed: function() {
    return this.rotateMouseButton === "right" || this.panMouseButton === "right";
  },
  _contextMenuHandler: function(e) {
    this._isRightMouseButtonUsed() && e.preventDefault();
  },
  _addAnimator: function(e) {
    var t = this._animators;
    return t.push(e), e.done(function() {
      var r = t.indexOf(e);
      r >= 0 && t.splice(r, 1);
    }), e;
  }
});
Object.defineProperty(Hx.prototype, "autoRotate", {
  get: function(e) {
    return this._autoRotate;
  },
  set: function(e) {
    this._autoRotate = e, this._rotating = e;
  }
});
const Ux = {
  convertToDynamicArray: function(e) {
    e && this.resetOffset();
    var t = this.attributes;
    for (var r in t)
      e || !t[r].value ? t[r].value = [] : t[r].value = Array.prototype.slice.call(t[r].value);
    e || !this.indices ? this.indices = [] : this.indices = Array.prototype.slice.call(this.indices);
  },
  convertToTypedArray: function() {
    var e = this.attributes;
    for (var t in e)
      e[t].value && e[t].value.length > 0 ? e[t].value = new Float32Array(e[t].value) : e[t].value = null;
    this.indices && this.indices.length > 0 && (this.indices = this.vertexCount > 65535 ? new Uint32Array(this.indices) : new Uint16Array(this.indices)), this.dirty();
  }
}, bn = {
  vec2: He,
  vec3: ie,
  vec4: Ie,
  mat3: bt,
  mat4: Oe
};
var hE = bn.vec3, oH = [[0, 0], [1, 1]], lh = jt.extend(
  function() {
    return {
      segmentScale: 1,
      dynamic: !0,
      /**
       * Need to use mesh to expand lines if lineWidth > MAX_LINE_WIDTH
       */
      useNativeLine: !0,
      attributes: {
        position: new jt.Attribute("position", "float", 3, "POSITION"),
        positionPrev: new jt.Attribute("positionPrev", "float", 3),
        positionNext: new jt.Attribute("positionNext", "float", 3),
        prevPositionPrev: new jt.Attribute("prevPositionPrev", "float", 3),
        prevPosition: new jt.Attribute("prevPosition", "float", 3),
        prevPositionNext: new jt.Attribute("prevPositionNext", "float", 3),
        offset: new jt.Attribute("offset", "float", 1),
        color: new jt.Attribute("color", "float", 4, "COLOR")
      }
    };
  },
  /** @lends module: echarts-gl/util/geometry/LinesGeometry.prototype */
  {
    /**
     * Reset offset
     */
    resetOffset: function() {
      this._vertexOffset = 0, this._triangleOffset = 0, this._itemVertexOffsets = [];
    },
    /**
     * @param {number} nVertex
     */
    setVertexCount: function(e) {
      var t = this.attributes;
      this.vertexCount !== e && (t.position.init(e), t.color.init(e), this.useNativeLine || (t.positionPrev.init(e), t.positionNext.init(e), t.offset.init(e)), e > 65535 ? this.indices instanceof Uint16Array && (this.indices = new Uint32Array(this.indices)) : this.indices instanceof Uint32Array && (this.indices = new Uint16Array(this.indices)));
    },
    /**
     * @param {number} nTriangle
     */
    setTriangleCount: function(e) {
      this.triangleCount !== e && (e === 0 ? this.indices = null : this.indices = this.vertexCount > 65535 ? new Uint32Array(e * 3) : new Uint16Array(e * 3));
    },
    _getCubicCurveApproxStep: function(e, t, r, n) {
      var i = hE.dist(e, t) + hE.dist(r, t) + hE.dist(n, r), a = 1 / (i + 1) * this.segmentScale;
      return a;
    },
    /**
     * Get vertex count of cubic curve
     * @param {Array.<number>} p0
     * @param {Array.<number>} p1
     * @param {Array.<number>} p2
     * @param {Array.<number>} p3
     * @return number
     */
    getCubicCurveVertexCount: function(e, t, r, n) {
      var i = this._getCubicCurveApproxStep(e, t, r, n), a = Math.ceil(1 / i);
      return this.useNativeLine ? a * 2 : a * 2 + 2;
    },
    /**
     * Get face count of cubic curve
     * @param {Array.<number>} p0
     * @param {Array.<number>} p1
     * @param {Array.<number>} p2
     * @param {Array.<number>} p3
     * @return number
     */
    getCubicCurveTriangleCount: function(e, t, r, n) {
      var i = this._getCubicCurveApproxStep(e, t, r, n), a = Math.ceil(1 / i);
      return this.useNativeLine ? 0 : a * 2;
    },
    /**
     * Get vertex count of line
     * @return {number}
     */
    getLineVertexCount: function() {
      return this.getPolylineVertexCount(oH);
    },
    /**
     * Get face count of line
     * @return {number}
     */
    getLineTriangleCount: function() {
      return this.getPolylineTriangleCount(oH);
    },
    /**
     * Get how many vertices will polyline take.
     * @type {number|Array} points Can be a 1d/2d list of points, or a number of points amount.
     * @return {number}
     */
    getPolylineVertexCount: function(e) {
      var t;
      if (typeof e == "number")
        t = e;
      else {
        var r = typeof e[0] != "number";
        t = r ? e.length : e.length / 3;
      }
      return this.useNativeLine ? (t - 1) * 2 : (t - 1) * 2 + 2;
    },
    /**
     * Get how many triangles will polyline take.
     * @type {number|Array} points Can be a 1d/2d list of points, or a number of points amount.
     * @return {number}
     */
    getPolylineTriangleCount: function(e) {
      var t;
      if (typeof e == "number")
        t = e;
      else {
        var r = typeof e[0] != "number";
        t = r ? e.length : e.length / 3;
      }
      return this.useNativeLine ? 0 : Math.max(t - 1, 0) * 2;
    },
    /**
     * Add a cubic curve
     * @param {Array.<number>} p0
     * @param {Array.<number>} p1
     * @param {Array.<number>} p2
     * @param {Array.<number>} p3
     * @param {Array.<number>} color
     * @param {number} [lineWidth=1]
     */
    addCubicCurve: function(e, t, r, n, i, a) {
      a == null && (a = 1);
      for (var o = e[0], s = e[1], l = e[2], u = t[0], f = t[1], c = t[2], h = r[0], v = r[1], d = r[2], g = n[0], y = n[1], x = n[2], S = this._getCubicCurveApproxStep(e, t, r, n), T = S * S, C = T * S, A = 3 * S, M = 3 * T, E = 6 * T, P = 6 * C, R = o - u * 2 + h, O = s - f * 2 + v, N = l - c * 2 + d, G = (u - h) * 3 - o + g, z = (f - v) * 3 - s + y, H = (c - d) * 3 - l + x, W = o, Z = s, ee = l, V = (u - o) * A + R * M + G * C, Q = (f - s) * A + O * M + z * C, q = (c - l) * A + N * M + H * C, X = R * E + G * P, K = O * E + z * P, ue = N * E + H * P, oe = G * P, te = z * P, pe = H * P, me = 0, de = 0, ve = Math.ceil(1 / S), Ae = new Float32Array((ve + 1) * 3), Ae = [], be = 0, de = 0; de < ve + 1; de++)
        Ae[be++] = W, Ae[be++] = Z, Ae[be++] = ee, W += V, Z += Q, ee += q, V += X, Q += K, q += ue, X += oe, K += te, ue += pe, me += S, me > 1 && (W = V > 0 ? Math.min(W, g) : Math.max(W, g), Z = Q > 0 ? Math.min(Z, y) : Math.max(Z, y), ee = q > 0 ? Math.min(ee, x) : Math.max(ee, x));
      return this.addPolyline(Ae, i, a);
    },
    /**
     * Add a straight line
     * @param {Array.<number>} p0
     * @param {Array.<number>} p1
     * @param {Array.<number>} color
     * @param {number} [lineWidth=1]
     */
    addLine: function(e, t, r, n) {
      return this.addPolyline([e, t], r, n);
    },
    /**
     * Add a straight line
     * @param {Array.<Array> | Array.<number>} points
     * @param {Array.<number> | Array.<Array>} color
     * @param {number} [lineWidth=1]
     * @param {number} [startOffset=0]
     * @param {number} [pointsCount] Default to be amount of points in the first argument
     */
    addPolyline: function(e, t, r, n, i) {
      if (e.length) {
        var a = typeof e[0] != "number";
        if (i == null && (i = a ? e.length : e.length / 3), !(i < 2)) {
          n == null && (n = 0), r == null && (r = 1), this._itemVertexOffsets.push(this._vertexOffset);
          var a = typeof e[0] != "number", o = a ? typeof t[0] != "number" : t.length / 4 === i, s = this.attributes.position, l = this.attributes.positionPrev, u = this.attributes.positionNext, f = this.attributes.color, c = this.attributes.offset, h = this.indices, v = this._vertexOffset, d, g;
          r = Math.max(r, 0.01);
          for (var y = n; y < i; y++) {
            if (a)
              d = e[y], o ? g = t[y] : g = t;
            else {
              var x = y * 3;
              if (d = d || [], d[0] = e[x], d[1] = e[x + 1], d[2] = e[x + 2], o) {
                var S = y * 4;
                g = g || [], g[0] = t[S], g[1] = t[S + 1], g[2] = t[S + 2], g[3] = t[S + 3];
              } else
                g = t;
            }
            if (this.useNativeLine ? y > 1 && (s.copy(v, v - 1), f.copy(v, v - 1), v++) : (y < i - 1 && (l.set(v + 2, d), l.set(v + 3, d)), y > 0 && (u.set(v - 2, d), u.set(v - 1, d)), s.set(v, d), s.set(v + 1, d), f.set(v, g), f.set(v + 1, g), c.set(v, r / 2), c.set(v + 1, -r / 2), v += 2), this.useNativeLine)
              f.set(v, g), s.set(v, d), v++;
            else if (y > 0) {
              var T = this._triangleOffset * 3, h = this.indices;
              h[T] = v - 4, h[T + 1] = v - 3, h[T + 2] = v - 2, h[T + 3] = v - 3, h[T + 4] = v - 1, h[T + 5] = v - 2, this._triangleOffset += 2;
            }
          }
          if (!this.useNativeLine) {
            var C = this._vertexOffset, A = this._vertexOffset + i * 2;
            l.copy(C, C + 2), l.copy(C + 1, C + 3), u.copy(A - 1, A - 3), u.copy(A - 2, A - 4);
          }
          return this._vertexOffset = v, this._vertexOffset;
        }
      }
    },
    /**
     * Set color of single line.
     */
    setItemColor: function(e, t) {
      for (var r = this._itemVertexOffsets[e], n = e < this._itemVertexOffsets.length - 1 ? this._itemVertexOffsets[e + 1] : this._vertexOffset, i = r; i < n; i++)
        this.attributes.color.set(i, t);
      this.dirty("color");
    },
    /**
     * @return {number}
     */
    currentTriangleOffset: function() {
      return this._triangleOffset;
    },
    /**
     * @return {number}
     */
    currentVertexOffset: function() {
      return this._vertexOffset;
    }
  }
);
tt(lh.prototype, Ux);
function Qb(e, t, r, n, i, a, o) {
  this._zr = e, this._x = 0, this._y = 0, this._rowHeight = 0, this.width = n, this.height = i, this.offsetX = t, this.offsetY = r, this.dpr = o, this.gap = a;
}
Qb.prototype = {
  constructor: Qb,
  clear: function() {
    this._x = 0, this._y = 0, this._rowHeight = 0;
  },
  /**
   * Add shape to atlas
   * @param {module:zrender/graphic/Displayable} shape
   * @param {number} width
   * @param {number} height
   * @return {Array}
   */
  add: function(e, t, r) {
    var n = e.getBoundingRect();
    t == null && (t = n.width), r == null && (r = n.height), t *= this.dpr, r *= this.dpr, this._fitElement(e, t, r);
    var i = this._x, a = this._y, o = this.width * this.dpr, s = this.height * this.dpr, l = this.gap;
    if (i + t + l > o && (i = this._x = 0, a += this._rowHeight + l, this._y = a, this._rowHeight = 0), this._x += t + l, this._rowHeight = Math.max(this._rowHeight, r), a + r + l > s)
      return null;
    e.x += this.offsetX * this.dpr + i, e.y += this.offsetY * this.dpr + a, this._zr.add(e);
    var u = [this.offsetX / this.width, this.offsetY / this.height], f = [[i / o + u[0], a / s + u[1]], [(i + t) / o + u[0], (a + r) / s + u[1]]];
    return f;
  },
  /**
   * Fit element size by correct its position and scaling
   * @param {module:zrender/graphic/Displayable} el
   * @param {number} spriteWidth
   * @param {number} spriteHeight
   */
  _fitElement: function(e, t, r) {
    var n = e.getBoundingRect(), i = t / n.width, a = r / n.height;
    e.x = -n.x * i, e.y = -n.y * a, e.scaleX = i, e.scaleY = a, e.update();
  }
};
function Jb(e) {
  e = e || {}, e.width = e.width || 512, e.height = e.height || 512, e.devicePixelRatio = e.devicePixelRatio || 1, e.gap = e.gap == null ? 2 : e.gap;
  var t = document.createElement("canvas");
  t.width = e.width * e.devicePixelRatio, t.height = e.height * e.devicePixelRatio, this._canvas = t, this._texture = new Vt({
    image: t,
    flipY: !1
  });
  var r = this;
  this._zr = q2(t);
  var n = this._zr.refreshImmediately;
  this._zr.refreshImmediately = function() {
    n.call(this), r._texture.dirty(), r.onupdate && r.onupdate();
  }, this._dpr = e.devicePixelRatio, this._coords = {}, this.onupdate = e.onupdate, this._gap = e.gap, this._textureAtlasNodes = [new Qb(this._zr, 0, 0, e.width, e.height, this._gap, this._dpr)], this._nodeWidth = e.width, this._nodeHeight = e.height, this._currentNodeIdx = 0;
}
Jb.prototype = {
  /**
   * Clear the texture atlas
   */
  clear: function() {
    for (var e = 0; e < this._textureAtlasNodes.length; e++)
      this._textureAtlasNodes[e].clear();
    this._currentNodeIdx = 0, this._zr.clear(), this._coords = {};
  },
  /**
   * @return {number}
   */
  getWidth: function() {
    return this._width;
  },
  /**
   * @return {number}
   */
  getHeight: function() {
    return this._height;
  },
  /**
   * @return {number}
   */
  getTexture: function() {
    return this._texture;
  },
  /**
   * @return {number}
   */
  getDevicePixelRatio: function() {
    return this._dpr;
  },
  getZr: function() {
    return this._zr;
  },
  _getCurrentNode: function() {
    return this._textureAtlasNodes[this._currentNodeIdx];
  },
  _expand: function() {
    if (this._currentNodeIdx++, this._textureAtlasNodes[this._currentNodeIdx])
      return this._textureAtlasNodes[this._currentNodeIdx];
    var e = 4096 / this._dpr, t = this._textureAtlasNodes, r = t.length, n = r * this._nodeWidth % e, i = Math.floor(r * this._nodeWidth / e) * this._nodeHeight;
    if (!(i >= e)) {
      var a = (n + this._nodeWidth) * this._dpr, o = (i + this._nodeHeight) * this._dpr;
      try {
        this._zr.resize({
          width: a,
          height: o
        });
      } catch {
        this._canvas.width = a, this._canvas.height = o;
      }
      var s = new Qb(this._zr, n, i, this._nodeWidth, this._nodeHeight, this._gap, this._dpr);
      return this._textureAtlasNodes.push(s), s;
    }
  },
  add: function(e, t, r) {
    if (this._coords[e.id])
      return this._coords[e.id];
    var n = this._getCurrentNode().add(e, t, r);
    if (!n) {
      var i = this._expand();
      if (!i)
        return;
      n = i.add(e, t, r);
    }
    return this._coords[e.id] = n, n;
  },
  /**
   * Get coord scale after texture atlas is expanded.
   * @return {Array.<number>}
   */
  getCoordsScale: function() {
    var e = this._dpr;
    return [this._nodeWidth / this._canvas.width * e, this._nodeHeight / this._canvas.height * e];
  },
  /**
   * Get texture coords of sprite image
   * @param  {string} id Image id
   * @return {Array}
   */
  getCoords: function(e) {
    return this._coords[e];
  },
  dispose: function() {
    this._zr.dispose();
  }
};
function Jc() {
}
Jc.prototype = {
  constructor: Jc,
  setScene: function(e) {
    this._scene = e, this._skybox && this._skybox.attachScene(this._scene);
  },
  initLight: function(e) {
    this._lightRoot = e, this.mainLight = new J.DirectionalLight({
      shadowBias: 5e-3
    }), this.ambientLight = new J.AmbientLight(), e.add(this.mainLight), e.add(this.ambientLight);
  },
  dispose: function() {
    this._lightRoot && (this._lightRoot.remove(this.mainLight), this._lightRoot.remove(this.ambientLight));
  },
  updateLight: function(e) {
    var t = this.mainLight, r = this.ambientLight, n = e.getModel("light"), i = n.getModel("main"), a = n.getModel("ambient");
    t.intensity = i.get("intensity"), r.intensity = a.get("intensity"), t.color = J.parseColor(i.get("color")).slice(0, 3), r.color = J.parseColor(a.get("color")).slice(0, 3);
    var o = i.get("alpha") || 0, s = i.get("beta") || 0;
    t.position.setArray(J.directionFromAlphaBeta(o, s)), t.lookAt(J.Vector3.ZERO), t.castShadow = i.get("shadow"), t.shadowResolution = J.getShadowResolution(i.get("shadowQuality"));
  },
  updateAmbientCubemap: function(e, t, r) {
    var n = t.getModel("light.ambientCubemap"), i = n.get("texture");
    if (i) {
      this._cubemapLightsCache = this._cubemapLightsCache || {};
      var a = this._cubemapLightsCache[i];
      if (!a) {
        var o = this;
        a = this._cubemapLightsCache[i] = J.createAmbientCubemap(n.option, e, r, function() {
          o._isSkyboxFromAmbientCubemap && o._skybox.setEnvironmentMap(a.specular.cubemap), r.getZr().refresh();
        });
      }
      this._lightRoot.add(a.diffuse), this._lightRoot.add(a.specular), this._currentCubemapLights = a;
    } else this._currentCubemapLights && (this._lightRoot.remove(this._currentCubemapLights.diffuse), this._lightRoot.remove(this._currentCubemapLights.specular), this._currentCubemapLights = null);
  },
  updateSkybox: function(e, t, r) {
    var n = t.get("environment"), i = this;
    function a() {
      return i._skybox = i._skybox || new lx(), i._skybox;
    }
    var o = a();
    if (n && n !== "none")
      if (n === "auto")
        if (this._isSkyboxFromAmbientCubemap = !0, this._currentCubemapLights) {
          var s = this._currentCubemapLights.specular.cubemap;
          o.setEnvironmentMap(s), this._scene && o.attachScene(this._scene), o.material.set("lod", 3);
        } else this._skybox && this._skybox.detachScene();
      else if (typeof n == "object" && n.colorStops || typeof n == "string" && bi(n)) {
        this._isSkyboxFromAmbientCubemap = !1;
        var l = new J.Texture2D({
          anisotropic: 8,
          flipY: !1
        });
        o.setEnvironmentMap(l);
        var u = l.image = document.createElement("canvas");
        u.width = u.height = 16;
        var f = u.getContext("2d"), c = new Mt({
          shape: {
            x: 0,
            y: 0,
            width: 16,
            height: 16
          },
          style: {
            fill: n
          }
        });
        Ix(f, c), o.attachScene(this._scene);
      } else {
        this._isSkyboxFromAmbientCubemap = !1;
        var l = J.loadTexture(n, r, {
          anisotropic: 8,
          flipY: !1
        });
        o.setEnvironmentMap(l), o.attachScene(this._scene);
      }
    else
      this._skybox && this._skybox.detachScene(this._scene), this._skybox = null;
    var h = t.coordinateSystem;
    if (this._skybox)
      if (h && h.viewGL && n !== "auto" && !(n.match && n.match(/.hdr$/))) {
        var v = h.viewGL.isLinearSpace() ? "define" : "undefine";
        this._skybox.material[v]("fragment", "SRGB_DECODE");
      } else
        this._skybox.material.undefine("fragment", "SRGB_DECODE");
  }
};
var Fv = bn.vec3, GY = jt.extend(
  function() {
    return {
      segmentScale: 1,
      /**
       * Need to use mesh to expand lines if lineWidth > MAX_LINE_WIDTH
       */
      useNativeLine: !0,
      attributes: {
        position: new jt.Attribute("position", "float", 3, "POSITION"),
        normal: new jt.Attribute("normal", "float", 3, "NORMAL"),
        color: new jt.Attribute("color", "float", 4, "COLOR")
      }
    };
  },
  /** @lends module: echarts-gl/util/geometry/QuadsGeometry.prototype */
  {
    /**
     * Reset offset
     */
    resetOffset: function() {
      this._vertexOffset = 0, this._faceOffset = 0;
    },
    /**
     * @param {number} nQuad
     */
    setQuadCount: function(e) {
      var t = this.attributes, r = this.getQuadVertexCount() * e, n = this.getQuadTriangleCount() * e;
      this.vertexCount !== r && (t.position.init(r), t.normal.init(r), t.color.init(r)), this.triangleCount !== n && (this.indices = r > 65535 ? new Uint32Array(n * 3) : new Uint16Array(n * 3));
    },
    getQuadVertexCount: function() {
      return 4;
    },
    getQuadTriangleCount: function() {
      return 2;
    },
    /**
     * Add a quad, which in following order:
     * 0-----1
     * 3-----2
     */
    addQuad: (function() {
      var e = Fv.create(), t = Fv.create(), r = Fv.create(), n = [0, 3, 1, 3, 2, 1];
      return function(i, a) {
        var o = this.attributes.position, s = this.attributes.normal, l = this.attributes.color;
        Fv.sub(e, i[1], i[0]), Fv.sub(t, i[2], i[1]), Fv.cross(r, e, t), Fv.normalize(r, r);
        for (var u = 0; u < 4; u++)
          o.set(this._vertexOffset + u, i[u]), l.set(this._vertexOffset + u, a), s.set(this._vertexOffset + u, r);
        for (var f = this._faceOffset * 3, u = 0; u < 6; u++)
          this.indices[f + u] = n[u] + this._vertexOffset;
        this._vertexOffset += 4, this._faceOffset += 2;
      };
    })()
  }
);
tt(GY.prototype, Ux);
var $I = qt.firstNotNull, gxe = {
  // Left to right
  x: 0,
  // Far to near
  y: 2,
  // Bottom to up
  z: 1
};
function mxe(e, t, r, n) {
  var i = [0, 0, 0], a = n < 0 ? r.getExtentMin() : r.getExtentMax();
  i[gxe[r.dim]] = a, e.position.setArray(i), e.rotation.identity(), t.distance = -Math.abs(a), t.normal.set(0, 0, 0), r.dim === "x" ? (e.rotation.rotateY(n * Math.PI / 2), t.normal.x = -n) : r.dim === "z" ? (e.rotation.rotateX(-n * Math.PI / 2), t.normal.y = -n) : (n > 0 && e.rotation.rotateY(Math.PI), t.normal.z = -n);
}
function iA(e, t, r) {
  this.rootNode = new J.Node();
  var n = new J.Mesh({
    geometry: new lh({
      useNativeLine: !1
    }),
    material: t,
    castShadow: !1,
    ignorePicking: !0,
    $ignorePicking: !0,
    renderOrder: 1
  }), i = new J.Mesh({
    geometry: new GY(),
    material: r,
    castShadow: !1,
    culling: !1,
    ignorePicking: !0,
    $ignorePicking: !0,
    renderOrder: 0
  });
  this.rootNode.add(i), this.rootNode.add(n), this.faceInfo = e, this.plane = new J.Plane(), this.linesMesh = n, this.quadsMesh = i;
}
iA.prototype.update = function(e, t, r) {
  var n = e.coordinateSystem, i = [n.getAxis(this.faceInfo[0]), n.getAxis(this.faceInfo[1])], a = this.linesMesh.geometry, o = this.quadsMesh.geometry;
  a.convertToDynamicArray(!0), o.convertToDynamicArray(!0), this._updateSplitLines(a, i, e, r), this._udpateSplitAreas(o, i, e, r), a.convertToTypedArray(), o.convertToTypedArray();
  var s = n.getAxis(this.faceInfo[2]);
  mxe(this.rootNode, this.plane, s, this.faceInfo[3]);
};
iA.prototype._updateSplitLines = function(e, t, r, n) {
  var i = n.getDevicePixelRatio();
  t.forEach(function(a, o) {
    var s = a.model, l = t[1 - o].getExtent();
    if (!a.scale.isBlank()) {
      var u = s.getModel("splitLine", r.getModel("splitLine"));
      if (u.get("show")) {
        var f = u.getModel("lineStyle"), c = f.get("color"), h = $I(f.get("opacity"), 1), v = $I(f.get("width"), 1);
        c = Se(c) ? c : [c];
        for (var d = a.getTicksCoords({
          tickModel: u
        }), g = 0, y = 0; y < d.length; y++) {
          var x = d[y].coord, S = J.parseColor(c[g % c.length]);
          S[3] *= h;
          var T = [0, 0, 0], C = [0, 0, 0];
          T[o] = C[o] = x, T[1 - o] = l[0], C[1 - o] = l[1], e.addLine(T, C, S, v * i), g++;
        }
      }
    }
  });
};
iA.prototype._udpateSplitAreas = function(e, t, r, n) {
  t.forEach(function(i, a) {
    var o = i.model, s = t[1 - a].getExtent();
    if (!i.scale.isBlank()) {
      var l = o.getModel("splitArea", r.getModel("splitArea"));
      if (l.get("show")) {
        var u = l.getModel("areaStyle"), f = u.get("color"), c = $I(u.get("opacity"), 1);
        f = Se(f) ? f : [f];
        for (var h = i.getTicksCoords({
          tickModel: l,
          clamp: !0
        }), v = 0, d = [0, 0, 0], g = [0, 0, 0], y = 0; y < h.length; y++) {
          var x = h[y].coord, S = [0, 0, 0], T = [0, 0, 0];
          if (S[a] = T[a] = x, S[1 - a] = s[0], T[1 - a] = s[1], y === 0) {
            d = S, g = T;
            continue;
          }
          var C = J.parseColor(f[v % f.length]);
          C[3] *= c, e.addQuad([d, S, T, g], C), d = S, g = T, v++;
        }
      }
    }
  });
};
var sH = [0, 1, 2, 0, 2, 3], VY = jt.extend(function() {
  return {
    attributes: {
      position: new jt.Attribute("position", "float", 3, "POSITION"),
      texcoord: new jt.Attribute("texcoord", "float", 2, "TEXCOORD_0"),
      offset: new jt.Attribute("offset", "float", 2),
      color: new jt.Attribute("color", "float", 4, "COLOR")
    }
  };
}, {
  resetOffset: function() {
    this._vertexOffset = 0, this._faceOffset = 0;
  },
  setSpriteCount: function(e) {
    this._spriteCount = e;
    var t = e * 4, r = e * 2;
    this.vertexCount !== t && (this.attributes.position.init(t), this.attributes.offset.init(t), this.attributes.color.init(t)), this.triangleCount !== r && (this.indices = t > 65535 ? new Uint32Array(r * 3) : new Uint16Array(r * 3));
  },
  setSpriteAlign: function(e, t, r, n, i) {
    r == null && (r = "left"), n == null && (n = "top");
    var a, o, s, l;
    switch (i = i || 0, r) {
      case "left":
        a = i, s = t[0] + i;
        break;
      case "center":
      case "middle":
        a = -t[0] / 2, s = t[0] / 2;
        break;
      case "right":
        a = -t[0] - i, s = -i;
        break;
    }
    switch (n) {
      case "bottom":
        o = i, l = t[1] + i;
        break;
      case "middle":
        o = -t[1] / 2, l = t[1] / 2;
        break;
      case "top":
        o = -t[1] - i, l = -i;
        break;
    }
    var u = e * 4, f = this.attributes.offset;
    f.set(u, [a, l]), f.set(u + 1, [s, l]), f.set(u + 2, [s, o]), f.set(u + 3, [a, o]);
  },
  /**
   * Add sprite
   * @param {Array.<number>} position
   * @param {Array.<number>} size [width, height]
   * @param {Array.<Array>} coords [leftBottom, rightTop]
   * @param {string} [align='left'] 'left' 'center' 'right'
   * @param {string} [verticalAlign='top'] 'top' 'middle' 'bottom'
   * @param {number} [screenMargin=0]
   */
  addSprite: function(e, t, r, n, i, a) {
    var o = this._vertexOffset;
    this.setSprite(this._vertexOffset / 4, e, t, r, n, i, a);
    for (var s = 0; s < sH.length; s++)
      this.indices[this._faceOffset * 3 + s] = sH[s] + o;
    return this._faceOffset += 2, this._vertexOffset += 4, o / 4;
  },
  setSprite: function(e, t, r, n, i, a, o) {
    for (var s = e * 4, l = this.attributes, u = 0; u < 4; u++)
      l.position.set(s + u, t);
    var f = l.texcoord;
    f.set(s, [n[0][0], n[0][1]]), f.set(s + 1, [n[1][0], n[0][1]]), f.set(s + 2, [n[1][0], n[1][1]]), f.set(s + 3, [n[0][0], n[1][1]]), this.setSpriteAlign(e, r, i, a, o);
  }
});
tt(VY.prototype, Ux);
const yxe = `@export ecgl.labels.vertex

attribute vec3 position: POSITION;
attribute vec2 texcoord: TEXCOORD_0;
attribute vec2 offset;
#ifdef VERTEX_COLOR
attribute vec4 a_Color : COLOR;
varying vec4 v_Color;
#endif

uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
uniform vec4 viewport : VIEWPORT;

varying vec2 v_Texcoord;

void main()
{
 vec4 proj = worldViewProjection * vec4(position, 1.0);

 vec2 screen = (proj.xy / abs(proj.w) + 1.0) * 0.5 * viewport.zw;

 screen += offset;

 proj.xy = (screen / viewport.zw - 0.5) * 2.0 * abs(proj.w);
 gl_Position = proj;
#ifdef VERTEX_COLOR
 v_Color = a_Color;
#endif
 v_Texcoord = texcoord;
}
@end


@export ecgl.labels.fragment

uniform vec3 color : [1.0, 1.0, 1.0];
uniform float alpha : 1.0;
uniform sampler2D textureAtlas;
uniform vec2 uvScale: [1.0, 1.0];

#ifdef VERTEX_COLOR
varying vec4 v_Color;
#endif
varying float v_Miter;

varying vec2 v_Texcoord;

void main()
{
 gl_FragColor = vec4(color, alpha) * texture2D(textureAtlas, v_Texcoord * uvScale);
#ifdef VERTEX_COLOR
 gl_FragColor *= v_Color;
#endif
}

@end`;
J.Shader.import(yxe);
const $N = J.Mesh.extend(function() {
  var e = new VY({
    dynamic: !0
  }), t = new J.Material({
    shader: J.createShader("ecgl.labels"),
    transparent: !0,
    depthMask: !1
  });
  return {
    geometry: e,
    material: t,
    culling: !1,
    castShadow: !1,
    ignorePicking: !0
  };
});
var Gv = qt.firstNotNull, Vv = {
  // Left to right
  x: 0,
  // Far to near
  y: 2,
  // Bottom to up
  z: 1
};
function qN(e, t) {
  var r = new J.Mesh({
    geometry: new lh({
      useNativeLine: !1
    }),
    material: t,
    castShadow: !1,
    ignorePicking: !0,
    renderOrder: 2
  }), n = new $N();
  n.material.depthMask = !1;
  var i = new J.Node();
  i.add(r), i.add(n), this.rootNode = i, this.dim = e, this.linesMesh = r, this.labelsMesh = n, this.axisLineCoords = null, this.labelElements = [];
}
var vE = {
  x: "y",
  y: "x",
  z: "y"
};
qN.prototype.update = function(e, t, r) {
  var n = e.coordinateSystem, i = n.getAxis(this.dim), a = this.linesMesh.geometry, o = this.labelsMesh.geometry;
  a.convertToDynamicArray(!0), o.convertToDynamicArray(!0);
  var s = i.model, l = i.getExtent(), N = r.getDevicePixelRatio(), u = s.getModel("axisLine", e.getModel("axisLine")), f = s.getModel("axisTick", e.getModel("axisTick")), c = s.getModel("axisLabel", e.getModel("axisLabel")), h = u.get("lineStyle.color");
  if (u.get("show")) {
    var v = u.getModel("lineStyle"), d = [0, 0, 0], g = [0, 0, 0], y = Vv[i.dim];
    d[y] = l[0], g[y] = l[1], this.axisLineCoords = [d, g];
    var x = J.parseColor(h), S = Gv(v.get("width"), 1), T = Gv(v.get("opacity"), 1);
    x[3] *= T, a.addLine(d, g, x, S * N);
  }
  if (f.get("show")) {
    var C = f.getModel("lineStyle"), A = J.parseColor(Gv(C.get("color"), h)), S = Gv(C.get("width"), 1);
    A[3] *= Gv(C.get("opacity"), 1);
    for (var M = i.getTicksCoords(), E = f.get("length"), P = 0; P < M.length; P++) {
      var R = M[P].coord, d = [0, 0, 0], g = [0, 0, 0], y = Vv[i.dim], O = Vv[vE[i.dim]];
      d[y] = g[y] = R, g[O] = E, a.addLine(d, g, A, S * N);
    }
  }
  this.labelElements = [];
  var N = r.getDevicePixelRatio();
  if (c.get("show"))
    for (var M = i.getTicksCoords(), G = s.get("data"), z = c.get("margin"), H = i.getViewLabels(), P = 0; P < H.length; P++) {
      var W = H[P].tickValue, Z = H[P].formattedLabel, ee = H[P].rawLabel, R = i.dataToCoord(W), V = [0, 0, 0], y = Vv[i.dim], O = Vv[vE[i.dim]];
      V[y] = V[y] = R, V[O] = z;
      var Q = c;
      G && G[W] && G[W].textStyle && (Q = new It(G[W].textStyle, c, s.ecModel));
      var q = Gv(Q.get("color"), h), X = new Rt({
        style: gr(Q, {
          text: Z,
          fill: typeof q == "function" ? q(
            // (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 returns labelStr.
            // But in interval scale labelStr is like '223,445', which maked
            // user repalce ','. So we modify it to return original val but remain
            // it as 'string' to avoid error in replacing.
            i.type === "category" ? ee : i.type === "value" ? W + "" : W,
            P
          ) : q,
          verticalAlign: "top",
          align: "left"
        })
      }), K = t.add(X), ue = X.getBoundingRect();
      o.addSprite(V, [ue.width * N, ue.height * N], K), this.labelElements.push(X);
    }
  if (s.get("name")) {
    var oe = s.getModel("nameTextStyle"), V = [0, 0, 0], y = Vv[i.dim], O = Vv[vE[i.dim]], te = Gv(oe.get("color"), h), pe = oe.get("borderColor"), S = oe.get("borderWidth");
    V[y] = V[y] = (l[0] + l[1]) / 2, V[O] = s.get("nameGap");
    var X = new Rt({
      style: gr(oe, {
        text: s.get("name"),
        fill: te,
        stroke: pe,
        lineWidth: S
      })
    }), K = t.add(X), ue = X.getBoundingRect();
    o.addSprite(V, [ue.width * N, ue.height * N], K), X.__idx = this.labelElements.length, this.nameLabelElement = X;
  }
  this.labelsMesh.material.set("textureAtlas", t.getTexture()), this.labelsMesh.material.set("uvScale", t.getCoordsScale()), a.convertToTypedArray(), o.convertToTypedArray();
};
qN.prototype.setSpriteAlign = function(e, t, r) {
  for (var n = r.getDevicePixelRatio(), i = this.labelsMesh.geometry, a = 0; a < this.labelElements.length; a++) {
    var o = this.labelElements[a], s = o.getBoundingRect();
    i.setSpriteAlign(a, [s.width * n, s.height * n], e, t);
  }
  var l = this.nameLabelElement;
  if (l) {
    var s = l.getBoundingRect();
    i.setSpriteAlign(l.__idx, [s.width * n, s.height * n], e, t), i.dirty();
  }
  this.textAlign = e, this.textVerticalAlign = t;
};
const aA = `@export ecgl.lines3D.vertex

uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;

attribute vec3 position: POSITION;
attribute vec4 a_Color : COLOR;
varying vec4 v_Color;

void main()
{
 gl_Position = worldViewProjection * vec4(position, 1.0);
 v_Color = a_Color;
}

@end

@export ecgl.lines3D.fragment

uniform vec4 color : [1.0, 1.0, 1.0, 1.0];

varying vec4 v_Color;

@import clay.util.srgb

void main()
{
#ifdef SRGB_DECODE
 gl_FragColor = sRGBToLinear(color * v_Color);
#else
 gl_FragColor = color * v_Color;
#endif
}
@end



@export ecgl.lines3D.clipNear

vec4 clipNear(vec4 p1, vec4 p2) {
 float n = (p1.w - near) / (p1.w - p2.w);
 return vec4(mix(p1.xy, p2.xy, n), -near, near);
}

@end

@export ecgl.lines3D.expandLine
#ifdef VERTEX_ANIMATION
 vec4 prevProj = worldViewProjection * vec4(mix(prevPositionPrev, positionPrev, percent), 1.0);
 vec4 currProj = worldViewProjection * vec4(mix(prevPosition, position, percent), 1.0);
 vec4 nextProj = worldViewProjection * vec4(mix(prevPositionNext, positionNext, percent), 1.0);
#else
 vec4 prevProj = worldViewProjection * vec4(positionPrev, 1.0);
 vec4 currProj = worldViewProjection * vec4(position, 1.0);
 vec4 nextProj = worldViewProjection * vec4(positionNext, 1.0);
#endif

 if (currProj.w < 0.0) {
 if (nextProj.w > 0.0) {
 currProj = clipNear(currProj, nextProj);
 }
 else if (prevProj.w > 0.0) {
 currProj = clipNear(currProj, prevProj);
 }
 }

 vec2 prevScreen = (prevProj.xy / abs(prevProj.w) + 1.0) * 0.5 * viewport.zw;
 vec2 currScreen = (currProj.xy / abs(currProj.w) + 1.0) * 0.5 * viewport.zw;
 vec2 nextScreen = (nextProj.xy / abs(nextProj.w) + 1.0) * 0.5 * viewport.zw;

 vec2 dir;
 float len = offset;
 if (position == positionPrev) {
 dir = normalize(nextScreen - currScreen);
 }
 else if (position == positionNext) {
 dir = normalize(currScreen - prevScreen);
 }
 else {
 vec2 dirA = normalize(currScreen - prevScreen);
 vec2 dirB = normalize(nextScreen - currScreen);

 vec2 tanget = normalize(dirA + dirB);

 float miter = 1.0 / max(dot(tanget, dirA), 0.5);
 len *= miter;
 dir = tanget;
 }

 dir = vec2(-dir.y, dir.x) * len;
 currScreen += dir;

 currProj.xy = (currScreen / viewport.zw - 0.5) * 2.0 * abs(currProj.w);
@end


@export ecgl.meshLines3D.vertex

attribute vec3 position: POSITION;
attribute vec3 positionPrev;
attribute vec3 positionNext;
attribute float offset;
attribute vec4 a_Color : COLOR;

#ifdef VERTEX_ANIMATION
attribute vec3 prevPosition;
attribute vec3 prevPositionPrev;
attribute vec3 prevPositionNext;
uniform float percent : 1.0;
#endif

uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
uniform vec4 viewport : VIEWPORT;
uniform float near : NEAR;

varying vec4 v_Color;

@import ecgl.common.wireframe.vertexHeader

@import ecgl.lines3D.clipNear

void main()
{
 @import ecgl.lines3D.expandLine

 gl_Position = currProj;

 v_Color = a_Color;

 @import ecgl.common.wireframe.vertexMain
}
@end


@export ecgl.meshLines3D.fragment

uniform vec4 color : [1.0, 1.0, 1.0, 1.0];

varying vec4 v_Color;

@import ecgl.common.wireframe.fragmentHeader

@import clay.util.srgb

void main()
{
#ifdef SRGB_DECODE
 gl_FragColor = sRGBToLinear(color * v_Color);
#else
 gl_FragColor = color * v_Color;
#endif

 @import ecgl.common.wireframe.fragmentMain
}

@end`;
var lH = qt.firstNotNull;
J.Shader.import(aA);
var Hv = {
  // Left to right
  x: 0,
  // Far to near
  y: 2,
  // Bottom to up
  z: 1
};
const _xe = fr.extend({
  type: "grid3D",
  __ecgl__: !0,
  init: function(e, t) {
    var r = [
      // planeDim0, planeDim1, offsetDim, dir on dim3 axis(gl), plane.
      ["y", "z", "x", -1, "left"],
      ["y", "z", "x", 1, "right"],
      ["x", "y", "z", -1, "bottom"],
      ["x", "y", "z", 1, "top"],
      ["x", "z", "y", -1, "far"],
      ["x", "z", "y", 1, "near"]
    ], n = ["x", "y", "z"], i = new J.Material({
      // transparent: true,
      shader: J.createShader("ecgl.color"),
      depthMask: !1,
      transparent: !0
    }), a = new J.Material({
      // transparent: true,
      shader: J.createShader("ecgl.meshLines3D"),
      depthMask: !1,
      transparent: !0
    });
    i.define("fragment", "DOUBLE_SIDED"), i.define("both", "VERTEX_COLOR"), this.groupGL = new J.Node(), this._control = new Hx({
      zr: t.getZr()
    }), this._control.init(), this._faces = r.map(function(s) {
      var l = new iA(s, a, i);
      return this.groupGL.add(l.rootNode), l;
    }, this), this._axes = n.map(function(s) {
      var l = new qN(s, a);
      return this.groupGL.add(l.rootNode), l;
    }, this);
    var o = t.getDevicePixelRatio();
    this._axisLabelSurface = new Jb({
      width: 256,
      height: 256,
      devicePixelRatio: o
    }), this._axisLabelSurface.onupdate = function() {
      t.getZr().refresh();
    }, this._axisPointerLineMesh = new J.Mesh({
      geometry: new lh({
        useNativeLine: !1
      }),
      material: a,
      castShadow: !1,
      // PENDING
      ignorePicking: !0,
      renderOrder: 3
    }), this.groupGL.add(this._axisPointerLineMesh), this._axisPointerLabelsSurface = new Jb({
      width: 128,
      height: 128,
      devicePixelRatio: o
    }), this._axisPointerLabelsMesh = new $N({
      ignorePicking: !0,
      renderOrder: 4,
      castShadow: !1
    }), this._axisPointerLabelsMesh.material.set("textureAtlas", this._axisPointerLabelsSurface.getTexture()), this.groupGL.add(this._axisPointerLabelsMesh), this._lightRoot = new J.Node(), this._sceneHelper = new Jc(), this._sceneHelper.initLight(this._lightRoot);
  },
  render: function(e, t, r) {
    this._model = e, this._api = r;
    var n = e.coordinateSystem;
    n.viewGL.add(this._lightRoot), e.get("show") ? n.viewGL.add(this.groupGL) : n.viewGL.remove(this.groupGL);
    var i = this._control;
    i.setViewGL(n.viewGL);
    var a = e.getModel("viewControl");
    i.setFromViewControlModel(a, 0), this._axisLabelSurface.clear(), i.off("update"), e.get("show") && (this._faces.forEach(function(o) {
      o.update(e, t, r);
    }, this), this._axes.forEach(function(o) {
      o.update(e, this._axisLabelSurface, r);
    }, this)), i.on("update", this._onCameraChange.bind(this, e, r), this), this._sceneHelper.setScene(n.viewGL.scene), this._sceneHelper.updateLight(e), n.viewGL.setPostEffect(e.getModel("postEffect"), r), n.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")), this._initMouseHandler(e);
  },
  afterRender: function(e, t, r, n) {
    var i = n.renderer;
    this._sceneHelper.updateAmbientCubemap(i, e, r), this._sceneHelper.updateSkybox(i, e, r);
  },
  /**
   * showAxisPointer will be triggered by action.
   */
  showAxisPointer: function(e, t, r, n) {
    this._doShowAxisPointer(), this._updateAxisPointer(n.value);
  },
  /**
   * hideAxisPointer will be triggered by action.
   */
  hideAxisPointer: function(e, t, r, n) {
    this._doHideAxisPointer();
  },
  _initMouseHandler: function(e) {
    var t = e.coordinateSystem, r = t.viewGL;
    e.get("show") && e.get("axisPointer.show") ? r.on("mousemove", this._updateAxisPointerOnMousePosition, this) : r.off("mousemove", this._updateAxisPointerOnMousePosition);
  },
  /**
   * Try find and show axisPointer on the intersect point
   * of mouse ray with grid plane.
   */
  _updateAxisPointerOnMousePosition: function(e) {
    if (!e.target) {
      for (var t = this._model, r = t.coordinateSystem, n = r.viewGL, i = n.castRay(e.offsetX, e.offsetY, new J.Ray()), a, o = 0; o < this._faces.length; o++) {
        var s = this._faces[o];
        if (!s.rootNode.invisible) {
          s.plane.normal.dot(n.camera.worldTransform.z) < 0 && s.plane.normal.negate();
          var l = i.intersectPlane(s.plane);
          if (l) {
            var u = r.getAxis(s.faceInfo[0]), f = r.getAxis(s.faceInfo[1]), c = Hv[s.faceInfo[0]], h = Hv[s.faceInfo[1]];
            u.contain(l.array[c]) && f.contain(l.array[h]) && (a = l);
          }
        }
      }
      if (a) {
        var v = r.pointToData(a.array, [], !0);
        this._updateAxisPointer(v), this._doShowAxisPointer();
      } else
        this._doHideAxisPointer();
    }
  },
  _onCameraChange: function(e, t) {
    e.get("show") && (this._updateFaceVisibility(), this._updateAxisLinePosition());
    var r = this._control;
    t.dispatchAction({
      type: "grid3DChangeCamera",
      alpha: r.getAlpha(),
      beta: r.getBeta(),
      distance: r.getDistance(),
      center: r.getCenter(),
      from: this.uid,
      grid3DId: e.id
    });
  },
  /**
   * Update visibility of each face when camera view changed, front face will be invisible.
   * @private
   */
  _updateFaceVisibility: function() {
    var e = this._control.getCamera(), t = new J.Vector3();
    e.update();
    for (var r = 0; r < this._faces.length / 2; r++) {
      for (var n = [], i = 0; i < 2; i++) {
        var a = this._faces[r * 2 + i];
        a.rootNode.getWorldPosition(t), t.transformMat4(e.viewMatrix), n[i] = t.z;
      }
      var o = n[0] > n[1] ? 0 : 1, s = this._faces[r * 2 + o], l = this._faces[r * 2 + 1 - o];
      s.rootNode.invisible = !0, l.rootNode.invisible = !1;
    }
  },
  /**
   * Update axis line position when camera view changed.
   * @private
   */
  _updateAxisLinePosition: function() {
    var e = this._model.coordinateSystem, t = e.getAxis("x"), r = e.getAxis("y"), n = e.getAxis("z"), i = n.getExtentMax(), a = n.getExtentMin(), o = t.getExtentMin(), s = t.getExtentMax(), l = r.getExtentMax(), u = r.getExtentMin(), f = this._axes[0].rootNode, c = this._axes[1].rootNode, h = this._axes[2].rootNode, v = this._faces, d = v[4].rootNode.invisible ? u : l, g = v[2].rootNode.invisible ? i : a, y = v[0].rootNode.invisible ? o : s, x = v[2].rootNode.invisible ? i : a, S = v[0].rootNode.invisible ? s : o, T = v[4].rootNode.invisible ? u : l;
    f.rotation.identity(), c.rotation.identity(), h.rotation.identity(), v[4].rootNode.invisible && (this._axes[0].flipped = !0, f.rotation.rotateX(Math.PI)), v[0].rootNode.invisible && (this._axes[1].flipped = !0, c.rotation.rotateZ(Math.PI)), v[4].rootNode.invisible && (this._axes[2].flipped = !0, h.rotation.rotateY(Math.PI)), f.position.set(0, g, d), c.position.set(y, x, 0), h.position.set(S, 0, T), f.update(), c.update(), h.update(), this._updateAxisLabelAlign();
  },
  /**
   * Update label align on axis when axisLine position changed.
   * @private
   */
  _updateAxisLabelAlign: function() {
    var e = this._control.getCamera(), t = [new J.Vector4(), new J.Vector4()], r = new J.Vector4();
    this.groupGL.getWorldPosition(r), r.w = 1, r.transformMat4(e.viewMatrix).transformMat4(e.projectionMatrix), r.x /= r.w, r.y /= r.w, this._axes.forEach(function(n) {
      var i = n.axisLineCoords;
      n.labelsMesh.geometry;
      for (var a = 0; a < t.length; a++)
        t[a].setArray(i[a]), t[a].w = 1, t[a].transformMat4(n.rootNode.worldTransform).transformMat4(e.viewMatrix).transformMat4(e.projectionMatrix), t[a].x /= t[a].w, t[a].y /= t[a].w;
      var o = t[1].x - t[0].x, s = t[1].y - t[0].y, l = (t[1].x + t[0].x) / 2, u = (t[1].y + t[0].y) / 2, f, c;
      Math.abs(s / o) < 0.5 ? (f = "center", c = u > r.y ? "bottom" : "top") : (c = "middle", f = l > r.x ? "left" : "right"), n.setSpriteAlign(f, c, this._api);
    }, this);
  },
  _doShowAxisPointer: function() {
    this._axisPointerLineMesh.invisible && (this._axisPointerLineMesh.invisible = !1, this._axisPointerLabelsMesh.invisible = !1, this._api.getZr().refresh());
  },
  _doHideAxisPointer: function() {
    this._axisPointerLineMesh.invisible || (this._axisPointerLineMesh.invisible = !0, this._axisPointerLabelsMesh.invisible = !0, this._api.getZr().refresh());
  },
  /**
   * @private updateAxisPointer.
   */
  _updateAxisPointer: function(e) {
    var t = this._model.coordinateSystem, r = t.dataToPoint(e), n = this._axisPointerLineMesh, i = n.geometry, a = this._model.getModel("axisPointer"), o = this._api.getDevicePixelRatio();
    i.convertToDynamicArray(!0);
    function s(P) {
      return qt.firstNotNull(P.model.get("axisPointer.show"), a.get("show"));
    }
    function l(P) {
      var R = P.model.getModel("axisPointer", a), O = R.getModel("lineStyle"), N = J.parseColor(O.get("color")), G = lH(O.get("width"), 1), z = lH(O.get("opacity"), 1);
      return N[3] *= z, {
        color: N,
        lineWidth: G
      };
    }
    for (var u = 0; u < this._faces.length; u++) {
      var f = this._faces[u];
      if (!f.rootNode.invisible) {
        for (var c = f.faceInfo, h = c[3] < 0 ? t.getAxis(c[2]).getExtentMin() : t.getAxis(c[2]).getExtentMax(), v = Hv[c[2]], d = 0; d < 2; d++) {
          var g = c[d], y = c[1 - d], x = t.getAxis(g), S = t.getAxis(y);
          if (s(x)) {
            var T = [0, 0, 0], C = [0, 0, 0], A = Hv[g], M = Hv[y];
            T[A] = C[A] = r[A], T[v] = C[v] = h, T[M] = S.getExtentMin(), C[M] = S.getExtentMax();
            var E = l(x);
            i.addLine(T, C, E.color, E.lineWidth * o);
          }
        }
        if (s(t.getAxis(c[2]))) {
          var T = r.slice(), C = r.slice();
          C[v] = h;
          var E = l(t.getAxis(c[2]));
          i.addLine(T, C, E.color, E.lineWidth * o);
        }
      }
    }
    i.convertToTypedArray(), this._updateAxisPointerLabelsMesh(e), this._api.getZr().refresh();
  },
  _updateAxisPointerLabelsMesh: function(e) {
    var t = this._model, r = this._axisPointerLabelsMesh, n = this._axisPointerLabelsSurface, i = t.coordinateSystem, a = t.getModel("axisPointer");
    r.geometry.convertToDynamicArray(!0), n.clear();
    var o = {
      x: "y",
      y: "x",
      z: "y"
    };
    this._axes.forEach(function(s, l) {
      var u = i.getAxis(s.dim), f = u.model, c = f.getModel("axisPointer", a), h = c.getModel("label"), v = c.get("lineStyle.color");
      if (!(!h.get("show") || !c.get("show"))) {
        var d = e[l], g = h.get("formatter"), y = u.scale.getLabel({
          value: d
        });
        if (g != null)
          y = g(y, e);
        else if (u.scale.type === "interval" || u.scale.type === "log") {
          var x = mC(u.scale.getTicks()[0]);
          y = d.toFixed(x + 2);
        }
        var S = h.get("color"), T = new Rt({
          style: gr(h, {
            text: y,
            fill: S || v,
            align: "left",
            verticalAlign: "top"
          })
        }), C = n.add(T), A = T.getBoundingRect(), M = this._api.getDevicePixelRatio(), E = s.rootNode.position.toArray(), P = Hv[o[s.dim]];
        E[P] += (s.flipped ? -1 : 1) * h.get("margin"), E[Hv[s.dim]] = u.dataToCoord(e[l]), r.geometry.addSprite(E, [A.width * M, A.height * M], C, s.textAlign, s.textVerticalAlign);
      }
    }, this), n.getZr().refreshImmediately(), r.material.set("uvScale", n.getCoordsScale()), r.geometry.convertToTypedArray();
  },
  dispose: function() {
    this.groupGL.removeAll(), this._control.dispose(), this._axisLabelSurface.dispose(), this._axisPointerLabelsSurface.dispose();
  }
});
function ux(e) {
  zO.call(this, e), this.type = "cartesian3D", this.dimensions = ["x", "y", "z"], this.size = [0, 0, 0];
}
ux.prototype = {
  constructor: ux,
  model: null,
  containPoint: function(e) {
    return this.getAxis("x").contain(e[0]) && this.getAxis("y").contain(e[2]) && this.getAxis("z").contain(e[1]);
  },
  containData: function(e) {
    return this.getAxis("x").containData(e[0]) && this.getAxis("y").containData(e[1]) && this.getAxis("z").containData(e[2]);
  },
  dataToPoint: function(e, t, r) {
    return t = t || [], t[0] = this.getAxis("x").dataToCoord(e[0], r), t[2] = this.getAxis("y").dataToCoord(e[1], r), t[1] = this.getAxis("z").dataToCoord(e[2], r), t;
  },
  pointToData: function(e, t, r) {
    return t = t || [], t[0] = this.getAxis("x").coordToData(e[0], r), t[1] = this.getAxis("y").coordToData(e[2], r), t[2] = this.getAxis("z").coordToData(e[1], r), t;
  }
};
mx(ux, zO);
function eC(e, t, r) {
  ra.call(this, e, t, r);
}
eC.prototype = {
  constructor: eC,
  getExtentMin: function() {
    var e = this._extent;
    return Math.min(e[0], e[1]);
  },
  getExtentMax: function() {
    var e = this._extent;
    return Math.max(e[0], e[1]);
  },
  calculateCategoryInterval: function() {
    return Math.floor(this.scale.count() / 8);
  }
};
mx(eC, ra);
var tC = function() {
  this._pool = {}, this._allocatedTextures = [];
};
tC.prototype = {
  constructor: tC,
  get: function(e) {
    var t = uH(e);
    this._pool.hasOwnProperty(t) || (this._pool[t] = []);
    var r = this._pool[t];
    if (!r.length) {
      var n = new Vt(e);
      return this._allocatedTextures.push(n), n;
    }
    return r.pop();
  },
  put: function(e) {
    var t = uH(e);
    this._pool.hasOwnProperty(t) || (this._pool[t] = []);
    var r = this._pool[t];
    r.push(e);
  },
  clear: function(e) {
    for (var t = 0; t < this._allocatedTextures.length; t++)
      this._allocatedTextures[t].dispose(e);
    this._pool = {}, this._allocatedTextures = [];
  }
};
var HY = {
  width: 512,
  height: 512,
  type: Ee.UNSIGNED_BYTE,
  format: Ee.RGBA,
  wrapS: Ee.CLAMP_TO_EDGE,
  wrapT: Ee.CLAMP_TO_EDGE,
  minFilter: Ee.LINEAR_MIPMAP_LINEAR,
  magFilter: Ee.LINEAR,
  useMipmap: !0,
  anisotropic: 1,
  flipY: !0,
  unpackAlignment: 4,
  premultiplyAlpha: !1
}, dE = Object.keys(HY);
function uH(e) {
  xn.defaultsWithPropList(e, HY, dE), xxe(e);
  for (var t = "", r = 0; r < dE.length; r++) {
    var n = dE[r], i = e[n].toString();
    t += i;
  }
  return t;
}
function xxe(e) {
  var t = Sxe(e.width, e.height);
  e.format === Ee.DEPTH_COMPONENT && (e.useMipmap = !1), (!t || !e.useMipmap) && (e.minFilter == Ee.NEAREST_MIPMAP_NEAREST || e.minFilter == Ee.NEAREST_MIPMAP_LINEAR ? e.minFilter = Ee.NEAREST : (e.minFilter == Ee.LINEAR_MIPMAP_LINEAR || e.minFilter == Ee.LINEAR_MIPMAP_NEAREST) && (e.minFilter = Ee.LINEAR)), t || (e.wrapS = Ee.CLAMP_TO_EDGE, e.wrapT = Ee.CLAMP_TO_EDGE);
}
function Sxe(e, t) {
  return (e & e - 1) === 0 && (t & t - 1) === 0;
}
const wxe = `@export clay.sm.depth.vertex
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
attribute vec3 position : POSITION;
attribute vec2 texcoord : TEXCOORD_0;
uniform vec2 uvRepeat = vec2(1.0, 1.0);
uniform vec2 uvOffset = vec2(0.0, 0.0);
@import clay.chunk.skinning_header
@import clay.chunk.instancing_header
varying vec4 v_ViewPosition;
varying vec2 v_Texcoord;
void main(){
 vec4 P = vec4(position, 1.0);
#ifdef SKINNING
 @import clay.chunk.skin_matrix
 P = skinMatrixWS * P;
#endif
#ifdef INSTANCING
 @import clay.chunk.instancing_matrix
 P = instanceMat * P;
#endif
 v_ViewPosition = worldViewProjection * P;
 gl_Position = v_ViewPosition;
 v_Texcoord = texcoord * uvRepeat + uvOffset;
}
@end
@export clay.sm.depth.fragment
varying vec4 v_ViewPosition;
varying vec2 v_Texcoord;
uniform float bias : 0.001;
uniform float slopeScale : 1.0;
uniform sampler2D alphaMap;
uniform float alphaCutoff: 0.0;
@import clay.util.encode_float
void main(){
 float depth = v_ViewPosition.z / v_ViewPosition.w;
 if (alphaCutoff > 0.0) {
 if (texture2D(alphaMap, v_Texcoord).a <= alphaCutoff) {
 discard;
 }
 }
#ifdef USE_VSM
 depth = depth * 0.5 + 0.5;
 float moment1 = depth;
 float moment2 = depth * depth;
 #ifdef SUPPORT_STANDARD_DERIVATIVES
 float dx = dFdx(depth);
 float dy = dFdy(depth);
 moment2 += 0.25*(dx*dx+dy*dy);
 #endif
 gl_FragColor = vec4(moment1, moment2, 0.0, 1.0);
#else
 #ifdef SUPPORT_STANDARD_DERIVATIVES
 float dx = dFdx(depth);
 float dy = dFdy(depth);
 depth += sqrt(dx*dx + dy*dy) * slopeScale + bias;
 #else
 depth += bias;
 #endif
 gl_FragColor = encodeFloat(depth * 0.5 + 0.5);
#endif
}
@end
@export clay.sm.debug_depth
uniform sampler2D depthMap;
varying vec2 v_Texcoord;
@import clay.util.decode_float
void main() {
 vec4 tex = texture2D(depthMap, v_Texcoord);
#ifdef USE_VSM
 gl_FragColor = vec4(tex.rgb, 1.0);
#else
 float depth = decodeFloat(tex);
 gl_FragColor = vec4(depth, depth, depth, 1.0);
#endif
}
@end
@export clay.sm.distance.vertex
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
uniform mat4 world : WORLD;
attribute vec3 position : POSITION;
@import clay.chunk.skinning_header
varying vec3 v_WorldPosition;
void main (){
 vec4 P = vec4(position, 1.0);
#ifdef SKINNING
 @import clay.chunk.skin_matrix
 P = skinMatrixWS * P;
#endif
#ifdef INSTANCING
 @import clay.chunk.instancing_matrix
 P = instanceMat * P;
#endif
 gl_Position = worldViewProjection * P;
 v_WorldPosition = (world * P).xyz;
}
@end
@export clay.sm.distance.fragment
uniform vec3 lightPosition;
uniform float range : 100;
varying vec3 v_WorldPosition;
@import clay.util.encode_float
void main(){
 float dist = distance(lightPosition, v_WorldPosition);
#ifdef USE_VSM
 gl_FragColor = vec4(dist, dist * dist, 0.0, 0.0);
#else
 dist = dist / range;
 gl_FragColor = encodeFloat(dist);
#endif
}
@end
@export clay.plugin.shadow_map_common
@import clay.util.decode_float
float tapShadowMap(sampler2D map, vec2 uv, float z){
 vec4 tex = texture2D(map, uv);
 return step(z, decodeFloat(tex) * 2.0 - 1.0);
}
float pcf(sampler2D map, vec2 uv, float z, float textureSize, vec2 scale) {
 float shadowContrib = tapShadowMap(map, uv, z);
 vec2 offset = vec2(1.0 / textureSize) * scale;
#ifdef PCF_KERNEL_SIZE
 for (int _idx_ = 0; _idx_ < PCF_KERNEL_SIZE; _idx_++) {{
 shadowContrib += tapShadowMap(map, uv + offset * pcfKernel[_idx_], z);
 }}
 return shadowContrib / float(PCF_KERNEL_SIZE + 1);
#else
 shadowContrib += tapShadowMap(map, uv+vec2(offset.x, 0.0), z);
 shadowContrib += tapShadowMap(map, uv+vec2(offset.x, offset.y), z);
 shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, offset.y), z);
 shadowContrib += tapShadowMap(map, uv+vec2(0.0, offset.y), z);
 shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, 0.0), z);
 shadowContrib += tapShadowMap(map, uv+vec2(-offset.x, -offset.y), z);
 shadowContrib += tapShadowMap(map, uv+vec2(offset.x, -offset.y), z);
 shadowContrib += tapShadowMap(map, uv+vec2(0.0, -offset.y), z);
 return shadowContrib / 9.0;
#endif
}
float pcf(sampler2D map, vec2 uv, float z, float textureSize) {
 return pcf(map, uv, z, textureSize, vec2(1.0));
}
float chebyshevUpperBound(vec2 moments, float z){
 float p = 0.0;
 z = z * 0.5 + 0.5;
 if (z <= moments.x) {
 p = 1.0;
 }
 float variance = moments.y - moments.x * moments.x;
 variance = max(variance, 0.0000001);
 float mD = moments.x - z;
 float pMax = variance / (variance + mD * mD);
 pMax = clamp((pMax-0.4)/(1.0-0.4), 0.0, 1.0);
 return max(p, pMax);
}
float computeShadowContrib(
 sampler2D map, mat4 lightVPM, vec3 position, float textureSize, vec2 scale, vec2 offset
) {
 vec4 posInLightSpace = lightVPM * vec4(position, 1.0);
 posInLightSpace.xyz /= posInLightSpace.w;
 float z = posInLightSpace.z;
 if(all(greaterThan(posInLightSpace.xyz, vec3(-0.99, -0.99, -1.0))) &&
 all(lessThan(posInLightSpace.xyz, vec3(0.99, 0.99, 1.0)))){
 vec2 uv = (posInLightSpace.xy+1.0) / 2.0;
 #ifdef USE_VSM
 vec2 moments = texture2D(map, uv * scale + offset).xy;
 return chebyshevUpperBound(moments, z);
 #else
 return pcf(map, uv * scale + offset, z, textureSize, scale);
 #endif
 }
 return 1.0;
}
float computeShadowContrib(sampler2D map, mat4 lightVPM, vec3 position, float textureSize) {
 return computeShadowContrib(map, lightVPM, position, textureSize, vec2(1.0), vec2(0.0));
}
float computeShadowContribOmni(samplerCube map, vec3 direction, float range)
{
 float dist = length(direction);
 vec4 shadowTex = textureCube(map, direction);
#ifdef USE_VSM
 vec2 moments = shadowTex.xy;
 float variance = moments.y - moments.x * moments.x;
 float mD = moments.x - dist;
 float p = variance / (variance + mD * mD);
 if(moments.x + 0.001 < dist){
 return clamp(p, 0.0, 1.0);
 }else{
 return 1.0;
 }
#else
 return step(dist, (decodeFloat(shadowTex) + 0.0002) * range);
#endif
}
@end
@export clay.plugin.compute_shadow_map
#if defined(SPOT_LIGHT_SHADOWMAP_COUNT) || defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT) || defined(POINT_LIGHT_SHADOWMAP_COUNT)
#ifdef SPOT_LIGHT_SHADOWMAP_COUNT
uniform sampler2D spotLightShadowMaps[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
uniform mat4 spotLightMatrices[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
uniform float spotLightShadowMapSizes[SPOT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
#endif
#ifdef DIRECTIONAL_LIGHT_SHADOWMAP_COUNT
#if defined(SHADOW_CASCADE)
uniform sampler2D directionalLightShadowMaps[1]:unconfigurable;
uniform mat4 directionalLightMatrices[SHADOW_CASCADE]:unconfigurable;
uniform float directionalLightShadowMapSizes[1]:unconfigurable;
uniform float shadowCascadeClipsNear[SHADOW_CASCADE]:unconfigurable;
uniform float shadowCascadeClipsFar[SHADOW_CASCADE]:unconfigurable;
#else
uniform sampler2D directionalLightShadowMaps[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
uniform mat4 directionalLightMatrices[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
uniform float directionalLightShadowMapSizes[DIRECTIONAL_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
#endif
#endif
#ifdef POINT_LIGHT_SHADOWMAP_COUNT
uniform samplerCube pointLightShadowMaps[POINT_LIGHT_SHADOWMAP_COUNT]:unconfigurable;
#endif
uniform bool shadowEnabled : true;
#ifdef PCF_KERNEL_SIZE
uniform vec2 pcfKernel[PCF_KERNEL_SIZE];
#endif
@import clay.plugin.shadow_map_common
#if defined(SPOT_LIGHT_SHADOWMAP_COUNT)
void computeShadowOfSpotLights(vec3 position, inout float shadowContribs[SPOT_LIGHT_COUNT] ) {
 float shadowContrib;
 for(int _idx_ = 0; _idx_ < SPOT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{
 shadowContrib = computeShadowContrib(
 spotLightShadowMaps[_idx_], spotLightMatrices[_idx_], position,
 spotLightShadowMapSizes[_idx_]
 );
 shadowContribs[_idx_] = shadowContrib;
 }}
 for(int _idx_ = SPOT_LIGHT_SHADOWMAP_COUNT; _idx_ < SPOT_LIGHT_COUNT; _idx_++){{
 shadowContribs[_idx_] = 1.0;
 }}
}
#endif
#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
#ifdef SHADOW_CASCADE
void computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){
 float depth = (2.0 * gl_FragCoord.z - gl_DepthRange.near - gl_DepthRange.far)
 / (gl_DepthRange.far - gl_DepthRange.near);
 float shadowContrib;
 shadowContribs[0] = 1.0;
 for (int _idx_ = 0; _idx_ < SHADOW_CASCADE; _idx_++) {{
 if (
 depth >= shadowCascadeClipsNear[_idx_] &&
 depth <= shadowCascadeClipsFar[_idx_]
 ) {
 shadowContrib = computeShadowContrib(
 directionalLightShadowMaps[0], directionalLightMatrices[_idx_], position,
 directionalLightShadowMapSizes[0],
 vec2(1.0 / float(SHADOW_CASCADE), 1.0),
 vec2(float(_idx_) / float(SHADOW_CASCADE), 0.0)
 );
 shadowContribs[0] = shadowContrib;
 }
 }}
 for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{
 shadowContribs[_idx_] = 1.0;
 }}
}
#else
void computeShadowOfDirectionalLights(vec3 position, inout float shadowContribs[DIRECTIONAL_LIGHT_COUNT]){
 float shadowContrib;
 for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_++) {{
 shadowContrib = computeShadowContrib(
 directionalLightShadowMaps[_idx_], directionalLightMatrices[_idx_], position,
 directionalLightShadowMapSizes[_idx_]
 );
 shadowContribs[_idx_] = shadowContrib;
 }}
 for(int _idx_ = DIRECTIONAL_LIGHT_SHADOWMAP_COUNT; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++) {{
 shadowContribs[_idx_] = 1.0;
 }}
}
#endif
#endif
#if defined(POINT_LIGHT_SHADOWMAP_COUNT)
void computeShadowOfPointLights(vec3 position, inout float shadowContribs[POINT_LIGHT_COUNT] ){
 vec3 lightPosition;
 vec3 direction;
 for(int _idx_ = 0; _idx_ < POINT_LIGHT_SHADOWMAP_COUNT; _idx_++) {{
 lightPosition = pointLightPosition[_idx_];
 direction = position - lightPosition;
 shadowContribs[_idx_] = computeShadowContribOmni(pointLightShadowMaps[_idx_], direction, pointLightRange[_idx_]);
 }}
 for(int _idx_ = POINT_LIGHT_SHADOWMAP_COUNT; _idx_ < POINT_LIGHT_COUNT; _idx_++) {{
 shadowContribs[_idx_] = 1.0;
 }}
}
#endif
#endif
@end`;
var wc = ["px", "nx", "py", "ny", "pz", "nz"];
Ze.import(wxe);
function pE(e, t, r) {
  if (r === "alphaMap")
    return e.material.get("diffuseMap");
  if (r === "alphaCutoff") {
    if (e.material.isDefined("fragment", "ALPHA_TEST") && e.material.get("diffuseMap")) {
      var n = e.material.get("alphaCutoff");
      return n || 0;
    }
    return 0;
  } else return r === "uvRepeat" ? e.material.get("uvRepeat") : r === "uvOffset" ? e.material.get("uvOffset") : t.get(r);
}
function fH(e, t) {
  var r = e.material, n = t.material;
  return r.get("diffuseMap") !== n.get("diffuseMap") || (r.get("alphaCutoff") || 0) !== (n.get("alphaCutoff") || 0);
}
var zl = Mi.extend(function() {
  return (
    /** @lends clay.prePass.ShadowMap# */
    {
      /**
       * Soft shadow technique.
       * Can be {@link clay.prePass.ShadowMap.PCF} or {@link clay.prePass.ShadowMap.VSM}
       * @type {number}
       */
      softShadow: zl.PCF,
      /**
       * Soft shadow blur size
       * @type {number}
       */
      shadowBlur: 1,
      lightFrustumBias: "auto",
      kernelPCF: new Float32Array([
        1,
        0,
        1,
        1,
        -1,
        1,
        0,
        1,
        -1,
        0,
        -1,
        -1,
        1,
        -1,
        0,
        -1
      ]),
      precision: "highp",
      _lastRenderNotCastShadow: !1,
      _frameBuffer: new Tn(),
      _textures: {},
      _shadowMapNumber: {
        POINT_LIGHT: 0,
        DIRECTIONAL_LIGHT: 0,
        SPOT_LIGHT: 0
      },
      _depthMaterials: {},
      _distanceMaterials: {},
      _receivers: [],
      _lightsCastShadow: [],
      _lightCameras: {},
      _lightMaterials: {},
      _texturePool: new tC()
    }
  );
}, function() {
  this._gaussianPassH = new Pn({
    fragment: Ze.source("clay.compositor.gaussian_blur")
  }), this._gaussianPassV = new Pn({
    fragment: Ze.source("clay.compositor.gaussian_blur")
  }), this._gaussianPassH.setUniform("blurSize", this.shadowBlur), this._gaussianPassH.setUniform("blurDir", 0), this._gaussianPassV.setUniform("blurSize", this.shadowBlur), this._gaussianPassV.setUniform("blurDir", 1), this._outputDepthPass = new Pn({
    fragment: Ze.source("clay.sm.debug_depth")
  });
}, {
  /**
   * Render scene to shadow textures
   * @param  {clay.Renderer} renderer
   * @param  {clay.Scene} scene
   * @param  {clay.Camera} sceneCamera
   * @param  {boolean} [notUpdateScene=false]
   * @memberOf clay.prePass.ShadowMap.prototype
   */
  render: function(e, t, r, n) {
    r || (r = t.getMainCamera()), this.trigger("beforerender", this, e, t, r), this._renderShadowPass(e, t, r, n), this.trigger("afterrender", this, e, t, r);
  },
  /**
   * Debug rendering of shadow textures
   * @param  {clay.Renderer} renderer
   * @param  {number} size
   * @memberOf clay.prePass.ShadowMap.prototype
   */
  renderDebug: function(e, t) {
    e.saveClear();
    var r = e.viewport, n = 0, i = 0, a = t || r.width / 4, o = a;
    this.softShadow === zl.VSM ? this._outputDepthPass.material.define("fragment", "USE_VSM") : this._outputDepthPass.material.undefine("fragment", "USE_VSM");
    for (var s in this._textures) {
      var l = this._textures[s];
      e.setViewport(n, i, a * l.width / l.height, o), this._outputDepthPass.setUniform("depthMap", l), this._outputDepthPass.render(e), n += a * l.width / l.height;
    }
    e.setViewport(r), e.restoreClear();
  },
  _updateReceivers: function(e, t) {
    if (t.receiveShadow ? (this._receivers.push(t), t.material.set("shadowEnabled", 1), t.material.set("pcfKernel", this.kernelPCF)) : t.material.set("shadowEnabled", 0), this.softShadow === zl.VSM)
      t.material.define("fragment", "USE_VSM"), t.material.undefine("fragment", "PCF_KERNEL_SIZE");
    else {
      t.material.undefine("fragment", "USE_VSM");
      var r = this.kernelPCF;
      r && r.length ? t.material.define("fragment", "PCF_KERNEL_SIZE", r.length / 2) : t.material.undefine("fragment", "PCF_KERNEL_SIZE");
    }
  },
  _update: function(e, t) {
    var r = this;
    t.traverse(function(a) {
      a.isRenderable() && r._updateReceivers(e, a);
    });
    for (var n = 0; n < t.lights.length; n++) {
      var i = t.lights[n];
      i.castShadow && !i.invisible && this._lightsCastShadow.push(i);
    }
  },
  _renderShadowPass: function(e, t, r, n) {
    for (var i in this._shadowMapNumber)
      this._shadowMapNumber[i] = 0;
    this._lightsCastShadow.length = 0, this._receivers.length = 0;
    var a = e.gl;
    if (n || t.update(), r && r.update(), t.updateLights(), this._update(e, t), !this._lightsCastShadow.length && this._lastRenderNotCastShadow)
      return;
    this._lastRenderNotCastShadow = this._lightsCastShadow === 0, a.enable(a.DEPTH_TEST), a.depthMask(!0), a.disable(a.BLEND), a.clearColor(1, 1, 1, 1);
    for (var o = [], s = [], l = [], u = [], f = [], c = [], h, v = 0; v < this._lightsCastShadow.length; v++) {
      var d = this._lightsCastShadow[v];
      if (d.type === "DIRECTIONAL_LIGHT") {
        if (h) {
          console.warn("Only one direectional light supported with shadow cascade");
          continue;
        }
        if (d.shadowCascade > 4) {
          console.warn("Support at most 4 cascade");
          continue;
        }
        d.shadowCascade > 1 && (h = d), this.renderDirectionalLightShadow(
          e,
          t,
          r,
          d,
          f,
          u,
          l
        );
      } else d.type === "SPOT_LIGHT" ? this.renderSpotLightShadow(
        e,
        t,
        d,
        s,
        o
      ) : d.type === "POINT_LIGHT" && this.renderPointLightShadow(
        e,
        t,
        d,
        c
      );
      this._shadowMapNumber[d.type]++;
    }
    for (var g in this._shadowMapNumber)
      for (var y = this._shadowMapNumber[g], x = g + "_SHADOWMAP_COUNT", v = 0; v < this._receivers.length; v++) {
        var S = this._receivers[v], T = S.material;
        T.fragmentDefines[x] !== y && (y > 0 ? T.define("fragment", x, y) : T.isDefined("fragment", x) && T.undefine("fragment", x));
      }
    for (var v = 0; v < this._receivers.length; v++) {
      var S = this._receivers[v], T = S.material;
      h ? T.define("fragment", "SHADOW_CASCADE", h.shadowCascade) : T.undefine("fragment", "SHADOW_CASCADE");
    }
    var C = t.shadowUniforms;
    function A(O) {
      return O.height;
    }
    if (l.length > 0) {
      var M = l.map(A);
      if (C.directionalLightShadowMaps = { value: l, type: "tv" }, C.directionalLightMatrices = { value: u, type: "m4v" }, C.directionalLightShadowMapSizes = { value: M, type: "1fv" }, h) {
        var E = f.slice(), P = f.slice();
        E.pop(), P.shift(), E.reverse(), P.reverse(), u.reverse(), C.shadowCascadeClipsNear = { value: E, type: "1fv" }, C.shadowCascadeClipsFar = { value: P, type: "1fv" };
      }
    }
    if (o.length > 0) {
      var R = o.map(A), C = t.shadowUniforms;
      C.spotLightShadowMaps = { value: o, type: "tv" }, C.spotLightMatrices = { value: s, type: "m4v" }, C.spotLightShadowMapSizes = { value: R, type: "1fv" };
    }
    c.length > 0 && (C.pointLightShadowMaps = { value: c, type: "tv" });
  },
  renderDirectionalLightShadow: (function() {
    var e = new QC(), t = new Ke(), r = new wi(), n = new Ke(), i = new Ke(), a = new Ke(), o = new Ke();
    return function(s, l, u, f, c, h, v) {
      var d = this._getDepthMaterial(f), g = {
        getMaterial: function(ue) {
          return ue.shadowDepthMaterial || d;
        },
        isMaterialChanged: fH,
        getUniform: pE,
        ifRender: function(ue) {
          return ue.castShadow;
        },
        sortCompare: us.opaqueSortCompare
      };
      if (!l.viewBoundingBoxLastFrame.isFinite()) {
        var y = l.getBoundingBox();
        l.viewBoundingBoxLastFrame.copy(y).applyTransform(u.viewMatrix);
      }
      var x = Math.min(-l.viewBoundingBoxLastFrame.min.z, u.far), S = Math.max(-l.viewBoundingBoxLastFrame.max.z, u.near), T = this._getDirectionalLightCamera(f, l, u), C = a.array;
      o.copy(T.projectionMatrix), Oe.invert(i.array, T.worldTransform.array), Oe.multiply(i.array, i.array, u.worldTransform.array), Oe.multiply(C, o.array, i.array);
      for (var A = [], M = u instanceof ei, E = (u.near + u.far) / (u.near - u.far), P = 2 * u.near * u.far / (u.near - u.far), R = 0; R <= f.shadowCascade; R++) {
        var O = S * Math.pow(x / S, R / f.shadowCascade), N = S + (x - S) * R / f.shadowCascade, G = O * f.cascadeSplitLogFactor + N * (1 - f.cascadeSplitLogFactor);
        A.push(G), c.push(-(-G * E + P) / -G);
      }
      var z = this._getTexture(f, f.shadowCascade);
      v.push(z);
      var H = s.viewport, W = s.gl;
      this._frameBuffer.attach(z), this._frameBuffer.bind(s), W.clear(W.COLOR_BUFFER_BIT | W.DEPTH_BUFFER_BIT);
      for (var R = 0; R < f.shadowCascade; R++) {
        var Z = A[R], ee = A[R + 1];
        M ? Oe.perspective(t.array, u.fov / 180 * Math.PI, u.aspect, Z, ee) : Oe.ortho(
          t.array,
          u.left,
          u.right,
          u.bottom,
          u.top,
          Z,
          ee
        ), e.setFromProjection(t), e.getTransformedBoundingBox(r, i), r.applyProjection(o);
        var V = r.min.array, Q = r.max.array;
        V[0] = Math.max(V[0], -1), V[1] = Math.max(V[1], -1), Q[0] = Math.min(Q[0], 1), Q[1] = Math.min(Q[1], 1), n.ortho(V[0], Q[0], V[1], Q[1], 1, -1), T.projectionMatrix.multiplyLeft(n);
        var q = f.shadowResolution || 512;
        s.setViewport((f.shadowCascade - R - 1) * q, 0, q, q, 1);
        var X = l.updateRenderList(T);
        s.renderPass(X.opaque, T, g), this.softShadow === zl.VSM && this._gaussianFilter(s, z, z.width);
        var K = new Ke();
        K.copy(T.viewMatrix).multiplyLeft(T.projectionMatrix), h.push(K.array), T.projectionMatrix.copy(o);
      }
      this._frameBuffer.unbind(s), s.setViewport(H);
    };
  })(),
  renderSpotLightShadow: function(e, t, r, n, i) {
    var a = this._getTexture(r), o = this._getSpotLightCamera(r), s = e.gl;
    this._frameBuffer.attach(a), this._frameBuffer.bind(e), s.clear(s.COLOR_BUFFER_BIT | s.DEPTH_BUFFER_BIT);
    var l = this._getDepthMaterial(r), u = {
      getMaterial: function(h) {
        return h.shadowDepthMaterial || l;
      },
      isMaterialChanged: fH,
      getUniform: pE,
      ifRender: function(h) {
        return h.castShadow;
      },
      sortCompare: us.opaqueSortCompare
    }, f = t.updateRenderList(o);
    e.renderPass(f.opaque, o, u), this._frameBuffer.unbind(e), this.softShadow === zl.VSM && this._gaussianFilter(e, a, a.width);
    var c = new Ke();
    c.copy(o.worldTransform).invert().multiplyLeft(o.projectionMatrix), i.push(a), n.push(c.array);
  },
  renderPointLightShadow: function(e, t, r, n) {
    var i = this._getTexture(r), a = e.gl;
    n.push(i);
    var o = this._getDepthMaterial(r), s = {
      getMaterial: function(S) {
        return S.shadowDepthMaterial || o;
      },
      getUniform: pE,
      sortCompare: us.opaqueSortCompare
    }, l = {
      px: [],
      py: [],
      pz: [],
      nx: [],
      ny: [],
      nz: []
    }, u = new wi(), f = r.getWorldPosition().array, c = new wi(), h = r.range;
    c.min.setArray(f), c.max.setArray(f);
    var v = new Me(h, h, h);
    c.max.add(v), c.min.sub(v);
    var d = { px: !1, py: !1, pz: !1, nx: !1, ny: !1, nz: !1 };
    t.traverse(function(S) {
      if (S.isRenderable() && S.castShadow) {
        var T = S.geometry;
        if (!T.boundingBox) {
          for (var C = 0; C < wc.length; C++)
            l[wc[C]].push(S);
          return;
        }
        if (u.transformFrom(T.boundingBox, S.worldTransform), !u.intersectBoundingBox(c))
          return;
        u.updateVertices();
        for (var C = 0; C < wc.length; C++)
          d[wc[C]] = !1;
        for (var C = 0; C < 8; C++) {
          var A = u.vertices[C], M = A[0] - f[0], E = A[1] - f[1], P = A[2] - f[2], R = Math.abs(M), O = Math.abs(E), N = Math.abs(P);
          R > O ? R > N ? d[M > 0 ? "px" : "nx"] = !0 : d[P > 0 ? "pz" : "nz"] = !0 : O > N ? d[E > 0 ? "py" : "ny"] = !0 : d[P > 0 ? "pz" : "nz"] = !0;
        }
        for (var C = 0; C < wc.length; C++)
          d[wc[C]] && l[wc[C]].push(S);
      }
    });
    for (var g = 0; g < 6; g++) {
      var y = wc[g], x = this._getPointLightCamera(r, y);
      this._frameBuffer.attach(i, a.COLOR_ATTACHMENT0, a.TEXTURE_CUBE_MAP_POSITIVE_X + g), this._frameBuffer.bind(e), a.clear(a.COLOR_BUFFER_BIT | a.DEPTH_BUFFER_BIT), e.renderPass(l[y], x, s);
    }
    this._frameBuffer.unbind(e);
  },
  _getDepthMaterial: function(e) {
    var t = this._lightMaterials[e.__uid__], r = e.type === "POINT_LIGHT";
    if (!t) {
      var n = r ? "clay.sm.distance." : "clay.sm.depth.";
      t = new ls({
        precision: this.precision,
        shader: new Ze(Ze.source(n + "vertex"), Ze.source(n + "fragment"))
      }), this._lightMaterials[e.__uid__] = t;
    }
    return e.shadowSlopeScale != null && t.setUniform("slopeScale", e.shadowSlopeScale), e.shadowBias != null && t.setUniform("bias", e.shadowBias), this.softShadow === zl.VSM ? t.define("fragment", "USE_VSM") : t.undefine("fragment", "USE_VSM"), r && (t.set("lightPosition", e.getWorldPosition().array), t.set("range", e.range)), t;
  },
  _gaussianFilter: function(e, t, r) {
    var n = {
      width: r,
      height: r,
      type: We.FLOAT
    }, i = this._texturePool.get(n);
    this._frameBuffer.attach(i), this._frameBuffer.bind(e), this._gaussianPassH.setUniform("texture", t), this._gaussianPassH.setUniform("textureWidth", r), this._gaussianPassH.render(e), this._frameBuffer.attach(t), this._gaussianPassV.setUniform("texture", i), this._gaussianPassV.setUniform("textureHeight", r), this._gaussianPassV.render(e), this._frameBuffer.unbind(e), this._texturePool.put(i);
  },
  _getTexture: function(e, t) {
    var r = e.__uid__, n = this._textures[r], i = e.shadowResolution || 512;
    return t = t || 1, n || (e.type === "POINT_LIGHT" ? n = new Ed() : n = new Vt(), n.width = i * t, n.height = i, this.softShadow === zl.VSM ? (n.type = We.FLOAT, n.anisotropic = 4) : (n.minFilter = Ee.NEAREST, n.magFilter = Ee.NEAREST, n.useMipmap = !1), this._textures[r] = n), n;
  },
  _getPointLightCamera: function(e, t) {
    this._lightCameras.point || (this._lightCameras.point = {
      px: new ei(),
      nx: new ei(),
      py: new ei(),
      ny: new ei(),
      pz: new ei(),
      nz: new ei()
    });
    var r = this._lightCameras.point[t];
    switch (r.far = e.range, r.fov = 90, r.position.set(0, 0, 0), t) {
      case "px":
        r.lookAt(Me.POSITIVE_X, Me.NEGATIVE_Y);
        break;
      case "nx":
        r.lookAt(Me.NEGATIVE_X, Me.NEGATIVE_Y);
        break;
      case "py":
        r.lookAt(Me.POSITIVE_Y, Me.POSITIVE_Z);
        break;
      case "ny":
        r.lookAt(Me.NEGATIVE_Y, Me.NEGATIVE_Z);
        break;
      case "pz":
        r.lookAt(Me.POSITIVE_Z, Me.NEGATIVE_Y);
        break;
      case "nz":
        r.lookAt(Me.NEGATIVE_Z, Me.NEGATIVE_Y);
        break;
    }
    return e.getWorldPosition(r.position), r.update(), r;
  },
  _getDirectionalLightCamera: (function() {
    var e = new Ke(), t = new wi(), r = new wi();
    return function(n, i, a) {
      this._lightCameras.directional || (this._lightCameras.directional = new Gm());
      var o = this._lightCameras.directional;
      t.copy(i.viewBoundingBoxLastFrame), t.intersection(a.frustum.boundingBox), o.position.copy(t.min).add(t.max).scale(0.5).transformMat4(a.worldTransform), o.rotation.copy(n.rotation), o.scale.copy(n.scale), o.updateWorldTransform(), Ke.invert(e, o.worldTransform), Ke.multiply(e, e, a.worldTransform), r.copy(t).applyTransform(e);
      var s = r.min.array, l = r.max.array;
      return o.position.set((s[0] + l[0]) / 2, (s[1] + l[1]) / 2, l[2]).transformMat4(o.worldTransform), o.near = 0, o.far = -s[2] + l[2], isNaN(this.lightFrustumBias) ? o.far *= 4 : o.far += this.lightFrustumBias, o.left = s[0], o.right = l[0], o.top = l[1], o.bottom = s[1], o.update(!0), o;
    };
  })(),
  _getSpotLightCamera: function(e) {
    this._lightCameras.spot || (this._lightCameras.spot = new ei());
    var t = this._lightCameras.spot;
    return t.fov = e.penumbraAngle * 2, t.far = e.range, t.worldTransform.copy(e.worldTransform), t.updateProjectionMatrix(), Oe.invert(t.viewMatrix.array, t.worldTransform.array), t;
  },
  /**
   * @param  {clay.Renderer|WebGLRenderingContext} [renderer]
   * @memberOf clay.prePass.ShadowMap.prototype
   */
  // PENDING Renderer or WebGLRenderingContext
  dispose: function(e) {
    var t = e.gl || e;
    this._frameBuffer && this._frameBuffer.dispose(t);
    for (var r in this._textures)
      this._textures[r].dispose(t);
    this._texturePool.clear(e.gl), this._depthMaterials = {}, this._distanceMaterials = {}, this._textures = {}, this._lightCameras = {}, this._shadowMapNumber = {
      POINT_LIGHT: 0,
      DIRECTIONAL_LIGHT: 0,
      SPOT_LIGHT: 0
    }, this._meshMaterials = {};
    for (var n = 0; n < this._receivers.length; n++) {
      var i = this._receivers[n];
      if (i.material) {
        var a = i.material;
        a.undefine("fragment", "POINT_LIGHT_SHADOW_COUNT"), a.undefine("fragment", "DIRECTIONAL_LIGHT_SHADOW_COUNT"), a.undefine("fragment", "AMBIENT_LIGHT_SHADOW_COUNT"), a.set("shadowEnabled", 0);
      }
    }
    this._receivers = [], this._lightsCastShadow = [];
  }
});
zl.VSM = 1;
zl.PCF = 2;
var fx = Mi.extend(
  function() {
    return (
      /** @lends clay.compositor.CompositorNode# */
      {
        /**
         * @type {string}
         */
        name: "",
        /**
         * Input links, will be updated by the graph
         * @example:
         *     inputName: {
         *         node: someNode,
         *         pin: 'xxxx'
         *     }
         * @type {Object}
         */
        inputLinks: {},
        /**
         * Output links, will be updated by the graph
         * @example:
         *     outputName: {
         *         node: someNode,
         *         pin: 'xxxx'
         *     }
         * @type {Object}
         */
        outputLinks: {},
        // Save the output texture of previous frame
        // Will be used when there exist a circular reference
        _prevOutputTextures: {},
        _outputTextures: {},
        // Example: { name: 2 }
        _outputReferences: {},
        _rendering: !1,
        // If rendered in this frame
        _rendered: !1,
        _compositor: null
      }
    );
  },
  /** @lends clay.compositor.CompositorNode.prototype */
  {
    // TODO Remove parameter function callback
    updateParameter: function(e, t) {
      var r = this.outputs[e], n = r.parameters, i = r._parametersCopy;
      if (i || (i = r._parametersCopy = {}), n)
        for (var a in n)
          a !== "width" && a !== "height" && (i[a] = n[a]);
      var o, s;
      return n.width instanceof Function ? o = n.width.call(this, t) : o = n.width, n.height instanceof Function ? s = n.height.call(this, t) : s = n.height, (i.width !== o || i.height !== s) && this._outputTextures[e] && this._outputTextures[e].dispose(t.gl), i.width = o, i.height = s, i;
    },
    /**
     * Set parameter
     * @param {string} name
     * @param {} value
     */
    setParameter: function(e, t) {
    },
    /**
     * Get parameter value
     * @param  {string} name
     * @return {}
     */
    getParameter: function(e) {
    },
    /**
     * Set parameters
     * @param {Object} obj
     */
    setParameters: function(e) {
      for (var t in e)
        this.setParameter(t, e[t]);
    },
    render: function() {
    },
    getOutput: function(e, t) {
      if (t == null)
        return t = e, this._outputTextures[t];
      var r = this.outputs[t];
      if (r)
        return this._rendered ? r.outputLastFrame ? this._prevOutputTextures[t] : this._outputTextures[t] : (
          // TODO
          this._rendering ? (this._prevOutputTextures[t] || (this._prevOutputTextures[t] = this._compositor.allocateTexture(r.parameters || {})), this._prevOutputTextures[t]) : (this.render(e), this._outputTextures[t])
        );
    },
    removeReference: function(e) {
      if (this._outputReferences[e]--, this._outputReferences[e] === 0) {
        var t = this.outputs[e];
        t.keepLastFrame ? (this._prevOutputTextures[e] && this._compositor.releaseTexture(this._prevOutputTextures[e]), this._prevOutputTextures[e] = this._outputTextures[e]) : this._compositor.releaseTexture(this._outputTextures[e]);
      }
    },
    link: function(e, t, r) {
      this.inputLinks[e] = {
        node: t,
        pin: r
      }, t.outputLinks[r] || (t.outputLinks[r] = []), t.outputLinks[r].push({
        node: this,
        pin: e
      }), this.pass.material.enableTexture(e);
    },
    clear: function() {
      this.inputLinks = {}, this.outputLinks = {};
    },
    updateReference: function(e) {
      if (!this._rendering) {
        this._rendering = !0;
        for (var t in this.inputLinks) {
          var r = this.inputLinks[t];
          r.node.updateReference(r.pin);
        }
        this._rendering = !1;
      }
      e && this._outputReferences[e]++;
    },
    beforeFrame: function() {
      this._rendered = !1;
      for (var e in this.outputLinks)
        this._outputReferences[e] = 0;
    },
    afterFrame: function() {
      for (var e in this.outputLinks)
        if (this._outputReferences[e] > 0) {
          var t = this.outputs[e];
          t.keepLastFrame ? (this._prevOutputTextures[e] && this._compositor.releaseTexture(this._prevOutputTextures[e]), this._prevOutputTextures[e] = this._outputTextures[e]) : this._compositor.releaseTexture(this._outputTextures[e]);
        }
    }
  }
), cH = Mi.extend(
  function() {
    return (
      /** @lends clay.compositor.Graph# */
      {
        /**
         * @type {Array.<clay.compositor.CompositorNode>}
         */
        nodes: []
      }
    );
  },
  /** @lends clay.compositor.Graph.prototype */
  {
    /**
     * Mark to update
     */
    dirty: function() {
      this._dirty = !0;
    },
    /**
     * @param {clay.compositor.CompositorNode} node
     */
    addNode: function(e) {
      this.nodes.indexOf(e) >= 0 || (this.nodes.push(e), this._dirty = !0);
    },
    /**
     * @param  {clay.compositor.CompositorNode|string} node
     */
    removeNode: function(e) {
      typeof e == "string" && (e = this.getNodeByName(e));
      var t = this.nodes.indexOf(e);
      t >= 0 && (this.nodes.splice(t, 1), this._dirty = !0);
    },
    /**
     * @param {string} name
     * @return {clay.compositor.CompositorNode}
     */
    getNodeByName: function(e) {
      for (var t = 0; t < this.nodes.length; t++)
        if (this.nodes[t].name === e)
          return this.nodes[t];
    },
    /**
     * Update links of graph
     */
    update: function() {
      for (var e = 0; e < this.nodes.length; e++)
        this.nodes[e].clear();
      for (var e = 0; e < this.nodes.length; e++) {
        var t = this.nodes[e];
        if (t.inputs) {
          for (var r in t.inputs)
            if (t.inputs[r]) {
              if (t.pass && !t.pass.material.isUniformEnabled(r)) {
                console.warn("Pin " + t.name + "." + r + " not used.");
                continue;
              }
              var n = t.inputs[r], i = this.findPin(n);
              i ? t.link(r, i.node, i.pin) : console.warn(typeof n == "string" ? "Node " + n + " not exist" : "Pin of " + n.node + "." + n.pin + " not exist");
            }
        }
      }
    },
    findPin: function(e) {
      var t;
      if ((typeof e == "string" || e instanceof fx) && (e = {
        node: e
      }), typeof e.node == "string")
        for (var r = 0; r < this.nodes.length; r++) {
          var n = this.nodes[r];
          n.name === e.node && (t = n);
        }
      else
        t = e.node;
      if (t) {
        var i = e.pin;
        if (i || t.outputs && (i = Object.keys(t.outputs)[0]), t.outputs[i])
          return {
            node: t,
            pin: i
          };
      }
    }
  }
), Txe = cH.extend(
  function() {
    return {
      // Output node
      _outputs: [],
      _texturePool: new tC(),
      _frameBuffer: new Tn({
        depthBuffer: !1
      })
    };
  },
  /** @lends clay.compositor.Compositor.prototype */
  {
    addNode: function(e) {
      cH.prototype.addNode.call(this, e), e._compositor = this;
    },
    /**
     * @param  {clay.Renderer} renderer
     */
    render: function(e, t) {
      if (this._dirty) {
        this.update(), this._dirty = !1, this._outputs.length = 0;
        for (var r = 0; r < this.nodes.length; r++)
          this.nodes[r].outputs || this._outputs.push(this.nodes[r]);
      }
      for (var r = 0; r < this.nodes.length; r++)
        this.nodes[r].beforeFrame();
      for (var r = 0; r < this._outputs.length; r++)
        this._outputs[r].updateReference();
      for (var r = 0; r < this._outputs.length; r++)
        this._outputs[r].render(e, t);
      for (var r = 0; r < this.nodes.length; r++)
        this.nodes[r].afterFrame();
    },
    allocateTexture: function(e) {
      return this._texturePool.get(e);
    },
    releaseTexture: function(e) {
      this._texturePool.put(e);
    },
    getFrameBuffer: function() {
      return this._frameBuffer;
    },
    /**
     * Dispose compositor
     * @param {clay.Renderer} renderer
     */
    dispose: function(e) {
      this._texturePool.clear(e);
    }
  }
), bxe = fx.extend(
  /** @lends clay.compositor.SceneNode# */
  {
    name: "scene",
    /**
     * @type {clay.Scene}
     */
    scene: null,
    /**
     * @type {clay.Camera}
     */
    camera: null,
    /**
     * @type {boolean}
     */
    autoUpdateScene: !0,
    /**
     * @type {boolean}
     */
    preZ: !1
  },
  function() {
    this.frameBuffer = new Tn();
  },
  {
    render: function(e) {
      this._rendering = !0;
      var t = e.gl;
      this.trigger("beforerender");
      var r;
      if (!this.outputs)
        r = e.render(this.scene, this.camera, !this.autoUpdateScene, this.preZ);
      else {
        var n = this.frameBuffer;
        for (var i in this.outputs) {
          var a = this.updateParameter(i, e), o = this.outputs[i], s = this._compositor.allocateTexture(a);
          this._outputTextures[i] = s;
          var l = o.attachment || t.COLOR_ATTACHMENT0;
          typeof l == "string" && (l = t[l]), n.attach(s, l);
        }
        n.bind(e);
        var u = e.getGLExtension("EXT_draw_buffers");
        if (u) {
          var f = [];
          for (var l in this.outputs)
            l = parseInt(l), l >= t.COLOR_ATTACHMENT0 && l <= t.COLOR_ATTACHMENT0 + 8 && f.push(l);
          u.drawBuffersEXT(f);
        }
        e.saveClear(), e.clearBit = Ee.DEPTH_BUFFER_BIT | Ee.COLOR_BUFFER_BIT, r = e.render(this.scene, this.camera, !this.autoUpdateScene, this.preZ), e.restoreClear(), n.unbind(e);
      }
      this.trigger("afterrender", r), this._rendering = !1, this._rendered = !0;
    }
  }
), Cxe = fx.extend(function() {
  return (
    /** @lends clay.compositor.TextureNode# */
    {
      /**
       * @type {clay.Texture2D}
       */
      texture: null,
      // Texture node must have output without parameters
      outputs: {
        color: {}
      }
    }
  );
}, function() {
}, {
  getOutput: function(e, t) {
    return this.texture;
  },
  // Do nothing
  beforeFrame: function() {
  },
  afterFrame: function() {
  }
}), Axe = fx.extend(
  function() {
    return (
      /** @lends clay.compositor.FilterNode# */
      {
        /**
         * @type {string}
         */
        name: "",
        /**
         * @type {Object}
         */
        inputs: {},
        /**
         * @type {Object}
         */
        outputs: null,
        /**
         * @type {string}
         */
        shader: "",
        /**
         * Input links, will be updated by the graph
         * @example:
         *     inputName: {
         *         node: someNode,
         *         pin: 'xxxx'
         *     }
         * @type {Object}
         */
        inputLinks: {},
        /**
         * Output links, will be updated by the graph
         * @example:
         *     outputName: {
         *         node: someNode,
         *         pin: 'xxxx'
         *     }
         * @type {Object}
         */
        outputLinks: {},
        /**
         * @type {clay.compositor.Pass}
         */
        pass: null,
        // Save the output texture of previous frame
        // Will be used when there exist a circular reference
        _prevOutputTextures: {},
        _outputTextures: {},
        // Example: { name: 2 }
        _outputReferences: {},
        _rendering: !1,
        // If rendered in this frame
        _rendered: !1,
        _compositor: null
      }
    );
  },
  function() {
    var e = new Pn({
      fragment: this.shader
    });
    this.pass = e;
  },
  /** @lends clay.compositor.FilterNode.prototype */
  {
    /**
     * @param  {clay.Renderer} renderer
     */
    render: function(e, t) {
      this.trigger("beforerender", e), this._rendering = !0;
      var r = e.gl;
      for (var n in this.inputLinks) {
        var i = this.inputLinks[n], a = i.node.getOutput(e, i.pin);
        this.pass.setUniform(n, a);
      }
      if (!this.outputs)
        this.pass.outputs = null, this._compositor.getFrameBuffer().unbind(e), this.pass.render(e, t);
      else {
        this.pass.outputs = {};
        var o = {};
        for (var s in this.outputs) {
          var l = this.updateParameter(s, e);
          isNaN(l.width) && this.updateParameter(s, e);
          var u = this.outputs[s], f = this._compositor.allocateTexture(l);
          this._outputTextures[s] = f;
          var c = u.attachment || r.COLOR_ATTACHMENT0;
          typeof c == "string" && (c = r[c]), o[c] = f;
        }
        this._compositor.getFrameBuffer().bind(e);
        for (var c in o)
          this._compositor.getFrameBuffer().attach(
            o[c],
            c
          );
        this.pass.render(e), this._compositor.getFrameBuffer().updateMipmap(e);
      }
      for (var n in this.inputLinks) {
        var i = this.inputLinks[n];
        i.node.removeReference(i.pin);
      }
      this._rendering = !1, this._rendered = !0, this.trigger("afterrender", e);
    },
    // TODO Remove parameter function callback
    updateParameter: function(e, t) {
      var r = this.outputs[e], n = r.parameters, i = r._parametersCopy;
      if (i || (i = r._parametersCopy = {}), n)
        for (var a in n)
          a !== "width" && a !== "height" && (i[a] = n[a]);
      var o, s;
      return typeof n.width == "function" ? o = n.width.call(this, t) : o = n.width, typeof n.height == "function" ? s = n.height.call(this, t) : s = n.height, o = Math.ceil(o), s = Math.ceil(s), (i.width !== o || i.height !== s) && this._outputTextures[e] && this._outputTextures[e].dispose(t), i.width = o, i.height = s, i;
    },
    /**
     * Set parameter
     * @param {string} name
     * @param {} value
     */
    setParameter: function(e, t) {
      this.pass.setUniform(e, t);
    },
    /**
     * Get parameter value
     * @param  {string} name
     * @return {}
     */
    getParameter: function(e) {
      return this.pass.getUniform(e);
    },
    /**
     * Set parameters
     * @param {Object} obj
     */
    setParameters: function(e) {
      for (var t in e)
        this.setParameter(t, e[t]);
    },
    // /**
    //  * Set shader code
    //  * @param {string} shaderStr
    //  */
    // setShader: function (shaderStr) {
    //     var material = this.pass.material;
    //     material.shader.setFragment(shaderStr);
    //     material.attachShader(material.shader, true);
    // },
    /**
     * Proxy of pass.material.define('fragment', xxx);
     * @param  {string} symbol
     * @param  {number} [val]
     */
    define: function(e, t) {
      this.pass.material.define("fragment", e, t);
    },
    /**
     * Proxy of pass.material.undefine('fragment', xxx)
     * @param  {string} symbol
     */
    undefine: function(e) {
      this.pass.material.undefine("fragment", e);
    },
    removeReference: function(e) {
      if (this._outputReferences[e]--, this._outputReferences[e] === 0) {
        var t = this.outputs[e];
        t.keepLastFrame ? (this._prevOutputTextures[e] && this._compositor.releaseTexture(this._prevOutputTextures[e]), this._prevOutputTextures[e] = this._outputTextures[e]) : this._compositor.releaseTexture(this._outputTextures[e]);
      }
    },
    clear: function() {
      fx.prototype.clear.call(this), this.pass.material.disableTexturesAll();
    }
  }
);
const Mxe = `@export clay.compositor.coloradjust
varying vec2 v_Texcoord;
uniform sampler2D texture;
uniform float brightness : 0.0;
uniform float contrast : 1.0;
uniform float exposure : 0.0;
uniform float gamma : 1.0;
uniform float saturation : 1.0;
const vec3 w = vec3(0.2125, 0.7154, 0.0721);
void main()
{
 vec4 tex = texture2D( texture, v_Texcoord);
 vec3 color = clamp(tex.rgb + vec3(brightness), 0.0, 1.0);
 color = clamp( (color-vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);
 color = clamp( color * pow(2.0, exposure), 0.0, 1.0);
 color = clamp( pow(color, vec3(gamma)), 0.0, 1.0);
 float luminance = dot( color, w );
 color = mix(vec3(luminance), color, saturation);
 gl_FragColor = vec4(color, tex.a);
}
@end
@export clay.compositor.brightness
varying vec2 v_Texcoord;
uniform sampler2D texture;
uniform float brightness : 0.0;
void main()
{
 vec4 tex = texture2D( texture, v_Texcoord);
 vec3 color = tex.rgb + vec3(brightness);
 gl_FragColor = vec4(color, tex.a);
}
@end
@export clay.compositor.contrast
varying vec2 v_Texcoord;
uniform sampler2D texture;
uniform float contrast : 1.0;
void main()
{
 vec4 tex = texture2D( texture, v_Texcoord);
 vec3 color = (tex.rgb-vec3(0.5))*contrast+vec3(0.5);
 gl_FragColor = vec4(color, tex.a);
}
@end
@export clay.compositor.exposure
varying vec2 v_Texcoord;
uniform sampler2D texture;
uniform float exposure : 0.0;
void main()
{
 vec4 tex = texture2D(texture, v_Texcoord);
 vec3 color = tex.rgb * pow(2.0, exposure);
 gl_FragColor = vec4(color, tex.a);
}
@end
@export clay.compositor.gamma
varying vec2 v_Texcoord;
uniform sampler2D texture;
uniform float gamma : 1.0;
void main()
{
 vec4 tex = texture2D(texture, v_Texcoord);
 vec3 color = pow(tex.rgb, vec3(gamma));
 gl_FragColor = vec4(color, tex.a);
}
@end
@export clay.compositor.saturation
varying vec2 v_Texcoord;
uniform sampler2D texture;
uniform float saturation : 1.0;
const vec3 w = vec3(0.2125, 0.7154, 0.0721);
void main()
{
 vec4 tex = texture2D(texture, v_Texcoord);
 vec3 color = tex.rgb;
 float luminance = dot(color, w);
 color = mix(vec3(luminance), color, saturation);
 gl_FragColor = vec4(color, tex.a);
}
@end`, UY = `@export clay.compositor.kernel.gaussian_9
float gaussianKernel[9];
gaussianKernel[0] = 0.07;
gaussianKernel[1] = 0.09;
gaussianKernel[2] = 0.12;
gaussianKernel[3] = 0.14;
gaussianKernel[4] = 0.16;
gaussianKernel[5] = 0.14;
gaussianKernel[6] = 0.12;
gaussianKernel[7] = 0.09;
gaussianKernel[8] = 0.07;
@end
@export clay.compositor.kernel.gaussian_13
float gaussianKernel[13];
gaussianKernel[0] = 0.02;
gaussianKernel[1] = 0.03;
gaussianKernel[2] = 0.06;
gaussianKernel[3] = 0.08;
gaussianKernel[4] = 0.11;
gaussianKernel[5] = 0.13;
gaussianKernel[6] = 0.14;
gaussianKernel[7] = 0.13;
gaussianKernel[8] = 0.11;
gaussianKernel[9] = 0.08;
gaussianKernel[10] = 0.06;
gaussianKernel[11] = 0.03;
gaussianKernel[12] = 0.02;
@end
@export clay.compositor.gaussian_blur
#define SHADER_NAME gaussian_blur
uniform sampler2D texture;varying vec2 v_Texcoord;
uniform float blurSize : 2.0;
uniform vec2 textureSize : [512.0, 512.0];
uniform float blurDir : 0.0;
@import clay.util.rgbm
@import clay.util.clamp_sample
void main (void)
{
 @import clay.compositor.kernel.gaussian_9
 vec2 off = blurSize / textureSize;
 off *= vec2(1.0 - blurDir, blurDir);
 vec4 sum = vec4(0.0);
 float weightAll = 0.0;
 for (int i = 0; i < 9; i++) {
 float w = gaussianKernel[i];
 vec4 texel = decodeHDR(clampSample(texture, v_Texcoord + float(i - 4) * off));
 sum += texel * w;
 weightAll += w;
 }
 gl_FragColor = encodeHDR(sum / max(weightAll, 0.01));
}
@end
`, Lxe = `@export clay.compositor.hdr.log_lum
varying vec2 v_Texcoord;
uniform sampler2D texture;
const vec3 w = vec3(0.2125, 0.7154, 0.0721);
@import clay.util.rgbm
void main()
{
 vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));
 float luminance = dot(tex.rgb, w);
 luminance = log(luminance + 0.001);
 gl_FragColor = encodeHDR(vec4(vec3(luminance), 1.0));
}
@end
@export clay.compositor.hdr.lum_adaption
varying vec2 v_Texcoord;
uniform sampler2D adaptedLum;
uniform sampler2D currentLum;
uniform float frameTime : 0.02;
@import clay.util.rgbm
void main()
{
 float fAdaptedLum = decodeHDR(texture2D(adaptedLum, vec2(0.5, 0.5))).r;
 float fCurrentLum = exp(encodeHDR(texture2D(currentLum, vec2(0.5, 0.5))).r);
 fAdaptedLum += (fCurrentLum - fAdaptedLum) * (1.0 - pow(0.98, 30.0 * frameTime));
 gl_FragColor = encodeHDR(vec4(vec3(fAdaptedLum), 1.0));
}
@end
@export clay.compositor.lum
varying vec2 v_Texcoord;
uniform sampler2D texture;
const vec3 w = vec3(0.2125, 0.7154, 0.0721);
void main()
{
 vec4 tex = texture2D( texture, v_Texcoord );
 float luminance = dot(tex.rgb, w);
 gl_FragColor = vec4(vec3(luminance), 1.0);
}
@end`, WY = `
@export clay.compositor.lut
varying vec2 v_Texcoord;
uniform sampler2D texture;
uniform sampler2D lookup;
void main()
{
 vec4 tex = texture2D(texture, v_Texcoord);
 float blueColor = tex.b * 63.0;
 vec2 quad1;
 quad1.y = floor(floor(blueColor) / 8.0);
 quad1.x = floor(blueColor) - (quad1.y * 8.0);
 vec2 quad2;
 quad2.y = floor(ceil(blueColor) / 8.0);
 quad2.x = ceil(blueColor) - (quad2.y * 8.0);
 vec2 texPos1;
 texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);
 texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);
 vec2 texPos2;
 texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.r);
 texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * tex.g);
 vec4 newColor1 = texture2D(lookup, texPos1);
 vec4 newColor2 = texture2D(lookup, texPos2);
 vec4 newColor = mix(newColor1, newColor2, fract(blueColor));
 gl_FragColor = vec4(newColor.rgb, tex.w);
}
@end`, Dxe = `@export clay.compositor.vignette
#define OUTPUT_ALPHA
varying vec2 v_Texcoord;
uniform sampler2D texture;
uniform float darkness: 1;
uniform float offset: 1;
@import clay.util.rgbm
void main()
{
 vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));
 gl_FragColor.rgb = texel.rgb;
 vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(offset);
 gl_FragColor = encodeHDR(vec4(mix(texel.rgb, vec3(1.0 - darkness), dot(uv, uv)), texel.a));
}
@end`, XY = `@export clay.compositor.output
#define OUTPUT_ALPHA
varying vec2 v_Texcoord;
uniform sampler2D texture;
@import clay.util.rgbm
void main()
{
 vec4 tex = decodeHDR(texture2D(texture, v_Texcoord));
 gl_FragColor.rgb = tex.rgb;
#ifdef OUTPUT_ALPHA
 gl_FragColor.a = tex.a;
#else
 gl_FragColor.a = 1.0;
#endif
 gl_FragColor = encodeHDR(gl_FragColor);
#ifdef PREMULTIPLY_ALPHA
 gl_FragColor.rgb *= gl_FragColor.a;
#endif
}
@end`, YY = `@export clay.compositor.bright
uniform sampler2D texture;
uniform float threshold : 1;
uniform float scale : 1.0;
uniform vec2 textureSize: [512, 512];
varying vec2 v_Texcoord;
const vec3 lumWeight = vec3(0.2125, 0.7154, 0.0721);
@import clay.util.rgbm
vec4 median(vec4 a, vec4 b, vec4 c)
{
 return a + b + c - min(min(a, b), c) - max(max(a, b), c);
}
void main()
{
 vec4 texel = decodeHDR(texture2D(texture, v_Texcoord));
#ifdef ANTI_FLICKER
 vec3 d = 1.0 / textureSize.xyx * vec3(1.0, 1.0, 0.0);
 vec4 s1 = decodeHDR(texture2D(texture, v_Texcoord - d.xz));
 vec4 s2 = decodeHDR(texture2D(texture, v_Texcoord + d.xz));
 vec4 s3 = decodeHDR(texture2D(texture, v_Texcoord - d.zy));
 vec4 s4 = decodeHDR(texture2D(texture, v_Texcoord + d.zy));
 texel = median(median(texel, s1, s2), s3, s4);
#endif
 float lum = dot(texel.rgb , lumWeight);
 vec4 color;
 if (lum > threshold && texel.a > 0.0)
 {
 color = vec4(texel.rgb * scale, texel.a * scale);
 }
 else
 {
 color = vec4(0.0);
 }
 gl_FragColor = encodeHDR(color);
}
@end
`, ZY = `@export clay.compositor.downsample
uniform sampler2D texture;
uniform vec2 textureSize : [512, 512];
varying vec2 v_Texcoord;
@import clay.util.rgbm
float brightness(vec3 c)
{
 return max(max(c.r, c.g), c.b);
}
@import clay.util.clamp_sample
void main()
{
 vec4 d = vec4(-1.0, -1.0, 1.0, 1.0) / textureSize.xyxy;
#ifdef ANTI_FLICKER
 vec3 s1 = decodeHDR(clampSample(texture, v_Texcoord + d.xy)).rgb;
 vec3 s2 = decodeHDR(clampSample(texture, v_Texcoord + d.zy)).rgb;
 vec3 s3 = decodeHDR(clampSample(texture, v_Texcoord + d.xw)).rgb;
 vec3 s4 = decodeHDR(clampSample(texture, v_Texcoord + d.zw)).rgb;
 float s1w = 1.0 / (brightness(s1) + 1.0);
 float s2w = 1.0 / (brightness(s2) + 1.0);
 float s3w = 1.0 / (brightness(s3) + 1.0);
 float s4w = 1.0 / (brightness(s4) + 1.0);
 float oneDivideSum = 1.0 / (s1w + s2w + s3w + s4w);
 vec4 color = vec4(
 (s1 * s1w + s2 * s2w + s3 * s3w + s4 * s4w) * oneDivideSum,
 1.0
 );
#else
 vec4 color = decodeHDR(clampSample(texture, v_Texcoord + d.xy));
 color += decodeHDR(clampSample(texture, v_Texcoord + d.zy));
 color += decodeHDR(clampSample(texture, v_Texcoord + d.xw));
 color += decodeHDR(clampSample(texture, v_Texcoord + d.zw));
 color *= 0.25;
#endif
 gl_FragColor = encodeHDR(color);
}
@end`, $Y = `
@export clay.compositor.upsample
#define HIGH_QUALITY
uniform sampler2D texture;
uniform vec2 textureSize : [512, 512];
uniform float sampleScale: 0.5;
varying vec2 v_Texcoord;
@import clay.util.rgbm
@import clay.util.clamp_sample
void main()
{
#ifdef HIGH_QUALITY
 vec4 d = vec4(1.0, 1.0, -1.0, 0.0) / textureSize.xyxy * sampleScale;
 vec4 s;
 s = decodeHDR(clampSample(texture, v_Texcoord - d.xy));
 s += decodeHDR(clampSample(texture, v_Texcoord - d.wy)) * 2.0;
 s += decodeHDR(clampSample(texture, v_Texcoord - d.zy));
 s += decodeHDR(clampSample(texture, v_Texcoord + d.zw)) * 2.0;
 s += decodeHDR(clampSample(texture, v_Texcoord )) * 4.0;
 s += decodeHDR(clampSample(texture, v_Texcoord + d.xw)) * 2.0;
 s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));
 s += decodeHDR(clampSample(texture, v_Texcoord + d.wy)) * 2.0;
 s += decodeHDR(clampSample(texture, v_Texcoord + d.xy));
 gl_FragColor = encodeHDR(s / 16.0);
#else
 vec4 d = vec4(-1.0, -1.0, +1.0, +1.0) / textureSize.xyxy;
 vec4 s;
 s = decodeHDR(clampSample(texture, v_Texcoord + d.xy));
 s += decodeHDR(clampSample(texture, v_Texcoord + d.zy));
 s += decodeHDR(clampSample(texture, v_Texcoord + d.xw));
 s += decodeHDR(clampSample(texture, v_Texcoord + d.zw));
 gl_FragColor = encodeHDR(s / 4.0);
#endif
}
@end`, qY = `@export clay.compositor.hdr.composite
#define TONEMAPPING
uniform sampler2D texture;
#ifdef BLOOM_ENABLED
uniform sampler2D bloom;
#endif
#ifdef LENSFLARE_ENABLED
uniform sampler2D lensflare;
uniform sampler2D lensdirt;
#endif
#ifdef LUM_ENABLED
uniform sampler2D lum;
#endif
#ifdef LUT_ENABLED
uniform sampler2D lut;
#endif
#ifdef COLOR_CORRECTION
uniform float brightness : 0.0;
uniform float contrast : 1.0;
uniform float saturation : 1.0;
#endif
#ifdef VIGNETTE
uniform float vignetteDarkness: 1.0;
uniform float vignetteOffset: 1.0;
#endif
uniform float exposure : 1.0;
uniform float bloomIntensity : 0.25;
uniform float lensflareIntensity : 1;
varying vec2 v_Texcoord;
@import clay.util.srgb
vec3 ACESToneMapping(vec3 color)
{
 const float A = 2.51;
 const float B = 0.03;
 const float C = 2.43;
 const float D = 0.59;
 const float E = 0.14;
 return (color * (A * color + B)) / (color * (C * color + D) + E);
}
float eyeAdaption(float fLum)
{
 return mix(0.2, fLum, 0.5);
}
#ifdef LUT_ENABLED
vec3 lutTransform(vec3 color) {
 float blueColor = color.b * 63.0;
 vec2 quad1;
 quad1.y = floor(floor(blueColor) / 8.0);
 quad1.x = floor(blueColor) - (quad1.y * 8.0);
 vec2 quad2;
 quad2.y = floor(ceil(blueColor) / 8.0);
 quad2.x = ceil(blueColor) - (quad2.y * 8.0);
 vec2 texPos1;
 texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);
 texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);
 vec2 texPos2;
 texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.r);
 texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * color.g);
 vec4 newColor1 = texture2D(lut, texPos1);
 vec4 newColor2 = texture2D(lut, texPos2);
 vec4 newColor = mix(newColor1, newColor2, fract(blueColor));
 return newColor.rgb;
}
#endif
@import clay.util.rgbm
void main()
{
 vec4 texel = vec4(0.0);
 vec4 originalTexel = vec4(0.0);
#ifdef TEXTURE_ENABLED
 texel = decodeHDR(texture2D(texture, v_Texcoord));
 originalTexel = texel;
#endif
#ifdef BLOOM_ENABLED
 vec4 bloomTexel = decodeHDR(texture2D(bloom, v_Texcoord));
 texel.rgb += bloomTexel.rgb * bloomIntensity;
 texel.a += bloomTexel.a * bloomIntensity;
#endif
#ifdef LENSFLARE_ENABLED
 texel += decodeHDR(texture2D(lensflare, v_Texcoord)) * texture2D(lensdirt, v_Texcoord) * lensflareIntensity;
#endif
 texel.a = min(texel.a, 1.0);
#ifdef LUM_ENABLED
 float fLum = texture2D(lum, vec2(0.5, 0.5)).r;
 float adaptedLumDest = 3.0 / (max(0.1, 1.0 + 10.0*eyeAdaption(fLum)));
 float exposureBias = adaptedLumDest * exposure;
#else
 float exposureBias = exposure;
#endif
#ifdef TONEMAPPING
 texel.rgb *= exposureBias;
 texel.rgb = ACESToneMapping(texel.rgb);
#endif
 texel = linearTosRGB(texel);
#ifdef LUT_ENABLED
 texel.rgb = lutTransform(clamp(texel.rgb,vec3(0.0),vec3(1.0)));
#endif
#ifdef COLOR_CORRECTION
 texel.rgb = clamp(texel.rgb + vec3(brightness), 0.0, 1.0);
 texel.rgb = clamp((texel.rgb - vec3(0.5))*contrast+vec3(0.5), 0.0, 1.0);
 float lum = dot(texel.rgb, vec3(0.2125, 0.7154, 0.0721));
 texel.rgb = mix(vec3(lum), texel.rgb, saturation);
#endif
#ifdef VIGNETTE
 vec2 uv = (v_Texcoord - vec2(0.5)) * vec2(vignetteOffset);
 texel.rgb = mix(texel.rgb, vec3(1.0 - vignetteDarkness), dot(uv, uv));
#endif
 gl_FragColor = encodeHDR(texel);
#ifdef DEBUG
 #if DEBUG == 1
 gl_FragColor = encodeHDR(decodeHDR(texture2D(texture, v_Texcoord)));
 #elif DEBUG == 2
 gl_FragColor = encodeHDR(decodeHDR(texture2D(bloom, v_Texcoord)) * bloomIntensity);
 #elif DEBUG == 3
 gl_FragColor = encodeHDR(decodeHDR(texture2D(lensflare, v_Texcoord) * lensflareIntensity));
 #endif
#endif
 if (originalTexel.a <= 0.01 && gl_FragColor.a > 1e-5) {
 gl_FragColor.a = dot(gl_FragColor.rgb, vec3(0.2125, 0.7154, 0.0721));
 }
#ifdef PREMULTIPLY_ALPHA
 gl_FragColor.rgb *= gl_FragColor.a;
#endif
}
@end`, Exe = `@export clay.compositor.lensflare
#define SAMPLE_NUMBER 8
uniform sampler2D texture;
uniform sampler2D lenscolor;
uniform vec2 textureSize : [512, 512];
uniform float dispersal : 0.3;
uniform float haloWidth : 0.4;
uniform float distortion : 1.0;
varying vec2 v_Texcoord;
@import clay.util.rgbm
vec4 textureDistorted(
 in vec2 texcoord,
 in vec2 direction,
 in vec3 distortion
) {
 return vec4(
 decodeHDR(texture2D(texture, texcoord + direction * distortion.r)).r,
 decodeHDR(texture2D(texture, texcoord + direction * distortion.g)).g,
 decodeHDR(texture2D(texture, texcoord + direction * distortion.b)).b,
 1.0
 );
}
void main()
{
 vec2 texcoord = -v_Texcoord + vec2(1.0); vec2 textureOffset = 1.0 / textureSize;
 vec2 ghostVec = (vec2(0.5) - texcoord) * dispersal;
 vec2 haloVec = normalize(ghostVec) * haloWidth;
 vec3 distortion = vec3(-textureOffset.x * distortion, 0.0, textureOffset.x * distortion);
 vec4 result = vec4(0.0);
 for (int i = 0; i < SAMPLE_NUMBER; i++)
 {
 vec2 offset = fract(texcoord + ghostVec * float(i));
 float weight = length(vec2(0.5) - offset) / length(vec2(0.5));
 weight = pow(1.0 - weight, 10.0);
 result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;
 }
 result *= texture2D(lenscolor, vec2(length(vec2(0.5) - texcoord)) / length(vec2(0.5)));
 float weight = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));
 weight = pow(1.0 - weight, 10.0);
 vec2 offset = fract(texcoord + haloVec);
 result += textureDistorted(offset, normalize(ghostVec), distortion) * weight;
 gl_FragColor = result;
}
@end`, jY = `@export clay.compositor.blend
#define SHADER_NAME blend
#ifdef TEXTURE1_ENABLED
uniform sampler2D texture1;
uniform float weight1 : 1.0;
#endif
#ifdef TEXTURE2_ENABLED
uniform sampler2D texture2;
uniform float weight2 : 1.0;
#endif
#ifdef TEXTURE3_ENABLED
uniform sampler2D texture3;
uniform float weight3 : 1.0;
#endif
#ifdef TEXTURE4_ENABLED
uniform sampler2D texture4;
uniform float weight4 : 1.0;
#endif
#ifdef TEXTURE5_ENABLED
uniform sampler2D texture5;
uniform float weight5 : 1.0;
#endif
#ifdef TEXTURE6_ENABLED
uniform sampler2D texture6;
uniform float weight6 : 1.0;
#endif
varying vec2 v_Texcoord;
@import clay.util.rgbm
void main()
{
 vec4 tex = vec4(0.0);
#ifdef TEXTURE1_ENABLED
 tex += decodeHDR(texture2D(texture1, v_Texcoord)) * weight1;
#endif
#ifdef TEXTURE2_ENABLED
 tex += decodeHDR(texture2D(texture2, v_Texcoord)) * weight2;
#endif
#ifdef TEXTURE3_ENABLED
 tex += decodeHDR(texture2D(texture3, v_Texcoord)) * weight3;
#endif
#ifdef TEXTURE4_ENABLED
 tex += decodeHDR(texture2D(texture4, v_Texcoord)) * weight4;
#endif
#ifdef TEXTURE5_ENABLED
 tex += decodeHDR(texture2D(texture5, v_Texcoord)) * weight5;
#endif
#ifdef TEXTURE6_ENABLED
 tex += decodeHDR(texture2D(texture6, v_Texcoord)) * weight6;
#endif
 gl_FragColor = encodeHDR(tex);
}
@end`, KY = `@export clay.compositor.fxaa
uniform sampler2D texture;
uniform vec4 viewport : VIEWPORT;
varying vec2 v_Texcoord;
#define FXAA_REDUCE_MIN (1.0/128.0)
#define FXAA_REDUCE_MUL (1.0/8.0)
#define FXAA_SPAN_MAX 8.0
@import clay.util.rgbm
void main()
{
 vec2 resolution = 1.0 / viewport.zw;
 vec3 rgbNW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ) ).xyz;
 vec3 rgbNE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ) ).xyz;
 vec3 rgbSW = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ) ).xyz;
 vec3 rgbSE = decodeHDR( texture2D( texture, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ) ).xyz;
 vec4 rgbaM = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution ) );
 vec3 rgbM = rgbaM.xyz;
 float opacity = rgbaM.w;
 vec3 luma = vec3( 0.299, 0.587, 0.114 );
 float lumaNW = dot( rgbNW, luma );
 float lumaNE = dot( rgbNE, luma );
 float lumaSW = dot( rgbSW, luma );
 float lumaSE = dot( rgbSE, luma );
 float lumaM = dot( rgbM, luma );
 float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );
 float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );
 vec2 dir;
 dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));
 dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));
 float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );
 float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );
 dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),
 max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),
 dir * rcpDirMin)) * resolution;
 vec3 rgbA = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 1.0 / 3.0 - 0.5 ) ) ).xyz;
 rgbA += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * ( 2.0 / 3.0 - 0.5 ) ) ).xyz;
 rgbA *= 0.5;
 vec3 rgbB = decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * -0.5 ) ).xyz;
 rgbB += decodeHDR( texture2D( texture, gl_FragCoord.xy * resolution + dir * 0.5 ) ).xyz;
 rgbB *= 0.25;
 rgbB += rgbA * 0.5;
 float lumaB = dot( rgbB, luma );
 if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) )
 {
 gl_FragColor = vec4( rgbA, opacity );
 }
 else {
 gl_FragColor = vec4( rgbB, opacity );
 }
}
@end`;
function Pxe(e) {
  e.import(Mxe), e.import(UY), e.import(Lxe), e.import(WY), e.import(Dxe), e.import(XY), e.import(YY), e.import(ZY), e.import($Y), e.import(qY), e.import(Exe), e.import(jY), e.import(KY);
}
Pxe(Ze);
var Ixe = /^#source\((.*?)\)/;
function Rxe(e, t) {
  var r = new Txe();
  t = t || {};
  var n = {
    textures: {},
    parameters: {}
  }, i = function(s, l) {
    for (var u = 0; u < e.nodes.length; u++) {
      var f = e.nodes[u], c = Oxe(f, n, t);
      c && r.addNode(c);
    }
  };
  for (var a in e.parameters) {
    var o = e.parameters[a];
    n.parameters[a] = jN(o);
  }
  return Bxe(e, n, t, function(s) {
    n.textures = s, i();
  }), r;
}
function Oxe(e, t, r) {
  var n = e.type || "filter", i, a, o;
  if (n === "filter") {
    var s = e.shader.trim(), l = Ixe.exec(s);
    if (l ? i = Ze.source(l[1].trim()) : s.charAt(0) === "#" && (i = t.shaders[s.substr(1)]), i || (i = s), !i)
      return;
  }
  if (e.inputs) {
    a = {};
    for (var u in e.inputs)
      typeof e.inputs[u] == "string" ? a[u] = e.inputs[u] : a[u] = {
        node: e.inputs[u].node,
        pin: e.inputs[u].pin
      };
  }
  if (e.outputs) {
    o = {};
    for (var u in e.outputs) {
      var f = e.outputs[u];
      o[u] = {}, f.attachment != null && (o[u].attachment = f.attachment), f.keepLastFrame != null && (o[u].keepLastFrame = f.keepLastFrame), f.outputLastFrame != null && (o[u].outputLastFrame = f.outputLastFrame), f.parameters && (o[u].parameters = jN(f.parameters));
    }
  }
  var c;
  if (n === "scene" ? c = new bxe({
    name: e.name,
    scene: r.scene,
    camera: r.camera,
    outputs: o
  }) : n === "texture" ? c = new Cxe({
    name: e.name,
    outputs: o
  }) : c = new Axe({
    name: e.name,
    shader: i,
    inputs: a,
    outputs: o
  }), c) {
    if (e.parameters)
      for (var u in e.parameters) {
        var h = e.parameters[u];
        typeof h == "string" ? (h = h.trim(), h.charAt(0) === "#" ? h = t.textures[h.substr(1)] : c.on(
          "beforerender",
          zxe(
            u,
            QY(h)
          )
        )) : typeof h == "function" && c.on("beforerender", h), c.setParameter(u, h);
      }
    if (e.defines && c.pass)
      for (var u in e.defines) {
        var h = e.defines[u];
        c.pass.material.define("fragment", u, h);
      }
  }
  return c;
}
function Nxe(e, t) {
  return e;
}
function kxe(e, t) {
  return t;
}
function jN(e) {
  var t = {};
  if (!e)
    return t;
  ["type", "minFilter", "magFilter", "wrapS", "wrapT", "flipY", "useMipmap"].forEach(function(n) {
    var i = e[n];
    i != null && (typeof i == "string" && (i = We[i]), t[n] = i);
  });
  var r = e.scale || 1;
  return ["width", "height"].forEach(function(n) {
    if (e[n] != null) {
      var i = e[n];
      typeof i == "string" ? (i = i.trim(), t[n] = Fxe(
        n,
        QY(i),
        r
      )) : t[n] = i;
    }
  }), t.width || (t.width = Nxe), t.height || (t.height = kxe), e.useMipmap != null && (t.useMipmap = e.useMipmap), t;
}
function Bxe(e, t, r, n) {
  if (!e.textures) {
    n({});
    return;
  }
  var i = {}, a = 0, o = !1, s = r.textureRootPath;
  xn.each(e.textures, function(l, u) {
    var f, c = l.path, h = jN(l.parameters);
    if (Array.isArray(c) && c.length === 6)
      s && (c = c.map(function(v) {
        return xn.relative2absolute(v, s);
      })), f = new Ed(h);
    else if (typeof c == "string")
      s && (c = xn.relative2absolute(c, s)), f = new Vt(h);
    else
      return;
    f.load(c), a++, f.once("success", function() {
      i[u] = f, a--, a === 0 && (n(i), o = !0);
    });
  }), a === 0 && !o && n(i);
}
function zxe(e, t) {
  return function(r) {
    var n = r.getDevicePixelRatio(), i = r.getWidth(), a = r.getHeight(), o = t(i, a, n);
    this.setParameter(e, o);
  };
}
function Fxe(e, t, r) {
  return r = r || 1, function(n) {
    var i = n.getDevicePixelRatio(), a = n.getWidth() * r, o = n.getHeight() * r;
    return t(a, o, i);
  };
}
function QY(e) {
  var t = /^expr\((.*)\)$/.exec(e);
  if (t)
    try {
      var r = new Function("width", "height", "dpr", "return " + t[1]);
      return r(1, 1), r;
    } catch {
      throw new Error("Invalid expression.");
    }
}
function Vm(e, t) {
  for (var r = 0, n = 1 / t, i = e; i > 0; )
    r = r + n * (i % t), i = Math.floor(i / t), n = n / t;
  return r;
}
const Gxe = `@export ecgl.ssao.estimate

uniform sampler2D depthTex;

uniform sampler2D normalTex;

uniform sampler2D noiseTex;

uniform vec2 depthTexSize;

uniform vec2 noiseTexSize;

uniform mat4 projection;

uniform mat4 projectionInv;

uniform mat4 viewInverseTranspose;

uniform vec3 kernel[KERNEL_SIZE];

uniform float radius : 1;

uniform float power : 1;

uniform float bias: 1e-2;

uniform float intensity: 1.0;

varying vec2 v_Texcoord;

float ssaoEstimator(in vec3 originPos, in mat3 kernelBasis) {
 float occlusion = 0.0;

 for (int i = 0; i < KERNEL_SIZE; i++) {
 vec3 samplePos = kernel[i];
#ifdef NORMALTEX_ENABLED
 samplePos = kernelBasis * samplePos;
#endif
 samplePos = samplePos * radius + originPos;

 vec4 texCoord = projection * vec4(samplePos, 1.0);
 texCoord.xy /= texCoord.w;

 vec4 depthTexel = texture2D(depthTex, texCoord.xy * 0.5 + 0.5);

 float sampleDepth = depthTexel.r * 2.0 - 1.0;
 if (projection[3][3] == 0.0) {
 sampleDepth = projection[3][2] / (sampleDepth * projection[2][3] - projection[2][2]);
 }
 else {
 sampleDepth = (sampleDepth - projection[3][2]) / projection[2][2];
 }
 
 float rangeCheck = smoothstep(0.0, 1.0, radius / abs(originPos.z - sampleDepth));
 occlusion += rangeCheck * step(samplePos.z, sampleDepth - bias);
 }
#ifdef NORMALTEX_ENABLED
 occlusion = 1.0 - occlusion / float(KERNEL_SIZE);
#else
 occlusion = 1.0 - clamp((occlusion / float(KERNEL_SIZE) - 0.6) * 2.5, 0.0, 1.0);
#endif
 return pow(occlusion, power);
}

void main()
{

 vec4 depthTexel = texture2D(depthTex, v_Texcoord);

#ifdef NORMALTEX_ENABLED
 vec4 tex = texture2D(normalTex, v_Texcoord);
 if (dot(tex.rgb, tex.rgb) == 0.0) {
 gl_FragColor = vec4(1.0);
 return;
 }
 vec3 N = tex.rgb * 2.0 - 1.0;
 N = (viewInverseTranspose * vec4(N, 0.0)).xyz;

 vec2 noiseTexCoord = depthTexSize / vec2(noiseTexSize) * v_Texcoord;
 vec3 rvec = texture2D(noiseTex, noiseTexCoord).rgb * 2.0 - 1.0;
 vec3 T = normalize(rvec - N * dot(rvec, N));
 vec3 BT = normalize(cross(N, T));
 mat3 kernelBasis = mat3(T, BT, N);
#else
 if (depthTexel.r > 0.99999) {
 gl_FragColor = vec4(1.0);
 return;
 }
 mat3 kernelBasis;
#endif

 float z = depthTexel.r * 2.0 - 1.0;

 vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);
 vec4 p4 = projectionInv * projectedPos;

 vec3 position = p4.xyz / p4.w;

 float ao = ssaoEstimator(position, kernelBasis);
 ao = clamp(1.0 - (1.0 - ao) * intensity, 0.0, 1.0);
 gl_FragColor = vec4(vec3(ao), 1.0);
}

@end


@export ecgl.ssao.blur
#define SHADER_NAME SSAO_BLUR

uniform sampler2D ssaoTexture;

#ifdef NORMALTEX_ENABLED
uniform sampler2D normalTex;
#endif

varying vec2 v_Texcoord;

uniform vec2 textureSize;
uniform float blurSize : 1.0;

uniform int direction: 0.0;

#ifdef DEPTHTEX_ENABLED
uniform sampler2D depthTex;
uniform mat4 projection;
uniform float depthRange : 0.5;

float getLinearDepth(vec2 coord)
{
 float depth = texture2D(depthTex, coord).r * 2.0 - 1.0;
 return projection[3][2] / (depth * projection[2][3] - projection[2][2]);
}
#endif

void main()
{
 float kernel[5];
 kernel[0] = 0.122581;
 kernel[1] = 0.233062;
 kernel[2] = 0.288713;
 kernel[3] = 0.233062;
 kernel[4] = 0.122581;

 vec2 off = vec2(0.0);
 if (direction == 0) {
 off[0] = blurSize / textureSize.x;
 }
 else {
 off[1] = blurSize / textureSize.y;
 }

 vec2 coord = v_Texcoord;

 float sum = 0.0;
 float weightAll = 0.0;

#ifdef NORMALTEX_ENABLED
 vec3 centerNormal = texture2D(normalTex, v_Texcoord).rgb * 2.0 - 1.0;
#endif
#if defined(DEPTHTEX_ENABLED)
 float centerDepth = getLinearDepth(v_Texcoord);
#endif

 for (int i = 0; i < 5; i++) {
 vec2 coord = clamp(v_Texcoord + vec2(float(i) - 2.0) * off, vec2(0.0), vec2(1.0));

 float w = kernel[i];
#ifdef NORMALTEX_ENABLED
 vec3 normal = texture2D(normalTex, coord).rgb * 2.0 - 1.0;
 w *= clamp(dot(normal, centerNormal), 0.0, 1.0);
#endif
#ifdef DEPTHTEX_ENABLED
 float d = getLinearDepth(coord);
 w *= (1.0 - smoothstep(abs(centerDepth - d) / depthRange, 0.0, 1.0));
#endif

 weightAll += w;
 sum += texture2D(ssaoTexture, coord).r * w;
 }

 gl_FragColor = vec4(vec3(sum / weightAll), 1.0);
}

@end
`;
Ze.import(Gxe);
function JY(e) {
  for (var t = new Uint8Array(e * e * 4), r = 0, n = new Me(), i = 0; i < e; i++)
    for (var a = 0; a < e; a++)
      n.set(Math.random() * 2 - 1, Math.random() * 2 - 1, 0).normalize(), t[r++] = (n.x * 0.5 + 0.5) * 255, t[r++] = (n.y * 0.5 + 0.5) * 255, t[r++] = 0, t[r++] = 255;
  return t;
}
function hH(e) {
  return new Vt({
    pixels: JY(e),
    wrapS: We.REPEAT,
    wrapT: We.REPEAT,
    width: e,
    height: e
  });
}
function Vxe(e, t, r) {
  var n = new Float32Array(e * 3);
  t = t || 0;
  for (var i = 0; i < e; i++) {
    var a = Vm(i + t, 2) * (r ? 1 : 2) * Math.PI, o = Vm(i + t, 3) * Math.PI, s = Math.random(), l = Math.cos(a) * Math.sin(o) * s, u = Math.cos(o) * s, f = Math.sin(a) * Math.sin(o) * s;
    n[i * 3] = l, n[i * 3 + 1] = u, n[i * 3 + 2] = f;
  }
  return n;
}
function Af(e) {
  e = e || {}, this._ssaoPass = new Pn({
    fragment: Ze.source("ecgl.ssao.estimate")
  }), this._blurPass = new Pn({
    fragment: Ze.source("ecgl.ssao.blur")
  }), this._framebuffer = new Tn({
    depthBuffer: !1
  }), this._ssaoTexture = new Vt(), this._blurTexture = new Vt(), this._blurTexture2 = new Vt(), this._depthTex = e.depthTexture, this._normalTex = e.normalTexture, this.setNoiseSize(4), this.setKernelSize(e.kernelSize || 12), e.radius != null && this.setParameter("radius", e.radius), e.power != null && this.setParameter("power", e.power), this._normalTex || (this._ssaoPass.material.disableTexture("normalTex"), this._blurPass.material.disableTexture("normalTex")), this._depthTex || this._blurPass.material.disableTexture("depthTex"), this._blurPass.material.setUniform("normalTex", this._normalTex), this._blurPass.material.setUniform("depthTex", this._depthTex);
}
Af.prototype.setDepthTexture = function(e) {
  this._depthTex = e;
};
Af.prototype.setNormalTexture = function(e) {
  this._normalTex = e, this._ssaoPass.material[e ? "enableTexture" : "disableTexture"]("normalTex"), this.setKernelSize(this._kernelSize);
};
Af.prototype.update = function(e, t, r) {
  var n = e.getWidth(), i = e.getHeight(), a = this._ssaoPass, o = this._blurPass;
  a.setUniform("kernel", this._kernels[r % this._kernels.length]), a.setUniform("depthTex", this._depthTex), this._normalTex != null && a.setUniform("normalTex", this._normalTex), a.setUniform("depthTexSize", [this._depthTex.width, this._depthTex.height]);
  var s = new Ke();
  Ke.transpose(s, t.worldTransform), a.setUniform("projection", t.projectionMatrix.array), a.setUniform("projectionInv", t.invProjectionMatrix.array), a.setUniform("viewInverseTranspose", s.array);
  var l = this._ssaoTexture, u = this._blurTexture, f = this._blurTexture2;
  l.width = n / 2, l.height = i / 2, u.width = n, u.height = i, f.width = n, f.height = i, this._framebuffer.attach(l), this._framebuffer.bind(e), e.gl.clearColor(1, 1, 1, 1), e.gl.clear(e.gl.COLOR_BUFFER_BIT), a.render(e), o.setUniform("textureSize", [n / 2, i / 2]), o.setUniform("projection", t.projectionMatrix.array), this._framebuffer.attach(u), o.setUniform("direction", 0), o.setUniform("ssaoTexture", l), o.render(e), this._framebuffer.attach(f), o.setUniform("textureSize", [n, i]), o.setUniform("direction", 1), o.setUniform("ssaoTexture", u), o.render(e), this._framebuffer.unbind(e);
  var c = e.clearColor;
  e.gl.clearColor(c[0], c[1], c[2], c[3]);
};
Af.prototype.getTargetTexture = function() {
  return this._blurTexture2;
};
Af.prototype.setParameter = function(e, t) {
  e === "noiseTexSize" ? this.setNoiseSize(t) : e === "kernelSize" ? this.setKernelSize(t) : e === "intensity" ? this._ssaoPass.material.set("intensity", t) : this._ssaoPass.setUniform(e, t);
};
Af.prototype.setKernelSize = function(e) {
  this._kernelSize = e, this._ssaoPass.material.define("fragment", "KERNEL_SIZE", e), this._kernels = this._kernels || [];
  for (var t = 0; t < 30; t++)
    this._kernels[t] = Vxe(e, t * e, !!this._normalTex);
};
Af.prototype.setNoiseSize = function(e) {
  var t = this._ssaoPass.getUniform("noiseTex");
  t ? (t.data = JY(e), t.width = t.height = e, t.dirty()) : (t = hH(e), this._ssaoPass.setUniform("noiseTex", hH(e))), this._ssaoPass.setUniform("noiseTexSize", [e, e]);
};
Af.prototype.dispose = function(e) {
  this._blurTexture.dispose(e), this._ssaoTexture.dispose(e), this._blurTexture2.dispose(e);
};
const Hxe = `@export ecgl.ssr.main

#define SHADER_NAME SSR
#define MAX_ITERATION 20;
#define SAMPLE_PER_FRAME 5;
#define TOTAL_SAMPLES 128;

uniform sampler2D sourceTexture;
uniform sampler2D gBufferTexture1;
uniform sampler2D gBufferTexture2;
uniform sampler2D gBufferTexture3;
uniform samplerCube specularCubemap;
uniform float specularIntensity: 1;

uniform mat4 projection;
uniform mat4 projectionInv;
uniform mat4 toViewSpace;
uniform mat4 toWorldSpace;

uniform float maxRayDistance: 200;

uniform float pixelStride: 16;
uniform float pixelStrideZCutoff: 50; 
uniform float screenEdgeFadeStart: 0.9; 
uniform float eyeFadeStart : 0.2; uniform float eyeFadeEnd: 0.8; 
uniform float minGlossiness: 0.2; uniform float zThicknessThreshold: 1;

uniform float nearZ;
uniform vec2 viewportSize : VIEWPORT_SIZE;

uniform float jitterOffset: 0;

varying vec2 v_Texcoord;

#ifdef DEPTH_DECODE
@import clay.util.decode_float
#endif

#ifdef PHYSICALLY_CORRECT
uniform sampler2D normalDistribution;
uniform float sampleOffset: 0;
uniform vec2 normalDistributionSize;

vec3 transformNormal(vec3 H, vec3 N) {
 vec3 upVector = N.y > 0.999 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0);
 vec3 tangentX = normalize(cross(N, upVector));
 vec3 tangentZ = cross(N, tangentX);
 return normalize(tangentX * H.x + N * H.y + tangentZ * H.z);
}
vec3 importanceSampleNormalGGX(float i, float roughness, vec3 N) {
 float p = fract((i + sampleOffset) / float(TOTAL_SAMPLES));
 vec3 H = texture2D(normalDistribution,vec2(roughness, p)).rgb;
 return transformNormal(H, N);
}
float G_Smith(float g, float ndv, float ndl) {
 float roughness = 1.0 - g;
 float k = roughness * roughness / 2.0;
 float G1V = ndv / (ndv * (1.0 - k) + k);
 float G1L = ndl / (ndl * (1.0 - k) + k);
 return G1L * G1V;
}
vec3 F_Schlick(float ndv, vec3 spec) {
 return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);
}
#endif

float fetchDepth(sampler2D depthTexture, vec2 uv)
{
 vec4 depthTexel = texture2D(depthTexture, uv);
 return depthTexel.r * 2.0 - 1.0;
}

float linearDepth(float depth)
{
 if (projection[3][3] == 0.0) {
 return projection[3][2] / (depth * projection[2][3] - projection[2][2]);
 }
 else {
 return (depth - projection[3][2]) / projection[2][2];
 }
}

bool rayIntersectDepth(float rayZNear, float rayZFar, vec2 hitPixel)
{
 if (rayZFar > rayZNear)
 {
 float t = rayZFar; rayZFar = rayZNear; rayZNear = t;
 }
 float cameraZ = linearDepth(fetchDepth(gBufferTexture2, hitPixel));
 return rayZFar <= cameraZ && rayZNear >= cameraZ - zThicknessThreshold;
}


bool traceScreenSpaceRay(
 vec3 rayOrigin, vec3 rayDir, float jitter,
 out vec2 hitPixel, out vec3 hitPoint, out float iterationCount
)
{
 float rayLength = ((rayOrigin.z + rayDir.z * maxRayDistance) > -nearZ)
 ? (-nearZ - rayOrigin.z) / rayDir.z : maxRayDistance;

 vec3 rayEnd = rayOrigin + rayDir * rayLength;

 vec4 H0 = projection * vec4(rayOrigin, 1.0);
 vec4 H1 = projection * vec4(rayEnd, 1.0);

 float k0 = 1.0 / H0.w, k1 = 1.0 / H1.w;

 vec3 Q0 = rayOrigin * k0, Q1 = rayEnd * k1;

 vec2 P0 = (H0.xy * k0 * 0.5 + 0.5) * viewportSize;
 vec2 P1 = (H1.xy * k1 * 0.5 + 0.5) * viewportSize;

 P1 += dot(P1 - P0, P1 - P0) < 0.0001 ? 0.01 : 0.0;
 vec2 delta = P1 - P0;

 bool permute = false;
 if (abs(delta.x) < abs(delta.y)) {
 permute = true;
 delta = delta.yx;
 P0 = P0.yx;
 P1 = P1.yx;
 }
 float stepDir = sign(delta.x);
 float invdx = stepDir / delta.x;

 vec3 dQ = (Q1 - Q0) * invdx;
 float dk = (k1 - k0) * invdx;

 vec2 dP = vec2(stepDir, delta.y * invdx);

 float strideScaler = 1.0 - min(1.0, -rayOrigin.z / pixelStrideZCutoff);
 float pixStride = 1.0 + strideScaler * pixelStride;

 dP *= pixStride; dQ *= pixStride; dk *= pixStride;

 vec4 pqk = vec4(P0, Q0.z, k0);
 vec4 dPQK = vec4(dP, dQ.z, dk);

 pqk += dPQK * jitter;
 float rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);
 float rayZNear;

 bool intersect = false;

 vec2 texelSize = 1.0 / viewportSize;

 iterationCount = 0.0;

 for (int i = 0; i < MAX_ITERATION; i++)
 {
 pqk += dPQK;

 rayZNear = rayZFar;
 rayZFar = (dPQK.z * 0.5 + pqk.z) / (dPQK.w * 0.5 + pqk.w);

 hitPixel = permute ? pqk.yx : pqk.xy;
 hitPixel *= texelSize;

 intersect = rayIntersectDepth(rayZNear, rayZFar, hitPixel);

 iterationCount += 1.0;

 dPQK *= 1.2;

 if (intersect) {
 break;
 }
 }

 Q0.xy += dQ.xy * iterationCount;
 Q0.z = pqk.z;
 hitPoint = Q0 / pqk.w;

 return intersect;
}

float calculateAlpha(
 float iterationCount, float reflectivity,
 vec2 hitPixel, vec3 hitPoint, float dist, vec3 rayDir
)
{
 float alpha = clamp(reflectivity, 0.0, 1.0);
 alpha *= 1.0 - (iterationCount / float(MAX_ITERATION));
 vec2 hitPixelNDC = hitPixel * 2.0 - 1.0;
 float maxDimension = min(1.0, max(abs(hitPixelNDC.x), abs(hitPixelNDC.y)));
 alpha *= 1.0 - max(0.0, maxDimension - screenEdgeFadeStart) / (1.0 - screenEdgeFadeStart);

 float _eyeFadeStart = eyeFadeStart;
 float _eyeFadeEnd = eyeFadeEnd;
 if (_eyeFadeStart > _eyeFadeEnd) {
 float tmp = _eyeFadeEnd;
 _eyeFadeEnd = _eyeFadeStart;
 _eyeFadeStart = tmp;
 }

 float eyeDir = clamp(rayDir.z, _eyeFadeStart, _eyeFadeEnd);
 alpha *= 1.0 - (eyeDir - _eyeFadeStart) / (_eyeFadeEnd - _eyeFadeStart);

 alpha *= 1.0 - clamp(dist / maxRayDistance, 0.0, 1.0);

 return alpha;
}

@import clay.util.rand

@import clay.util.rgbm

void main()
{
 vec4 normalAndGloss = texture2D(gBufferTexture1, v_Texcoord);

 if (dot(normalAndGloss.rgb, vec3(1.0)) == 0.0) {
 discard;
 }

 float g = normalAndGloss.a;
#if !defined(PHYSICALLY_CORRECT)
 if (g <= minGlossiness) {
 discard;
 }
#endif

 float reflectivity = (g - minGlossiness) / (1.0 - minGlossiness);

 vec3 N = normalize(normalAndGloss.rgb * 2.0 - 1.0);
 N = normalize((toViewSpace * vec4(N, 0.0)).xyz);

 vec4 projectedPos = vec4(v_Texcoord * 2.0 - 1.0, fetchDepth(gBufferTexture2, v_Texcoord), 1.0);
 vec4 pos = projectionInv * projectedPos;
 vec3 rayOrigin = pos.xyz / pos.w;
 vec3 V = -normalize(rayOrigin);

 float ndv = clamp(dot(N, V), 0.0, 1.0);
 float iterationCount;
 float jitter = rand(fract(v_Texcoord + jitterOffset));

#ifdef PHYSICALLY_CORRECT
 vec4 color = vec4(vec3(0.0), 1.0);
 vec4 albedoMetalness = texture2D(gBufferTexture3, v_Texcoord);
 vec3 albedo = albedoMetalness.rgb;
 float m = albedoMetalness.a;
 vec3 diffuseColor = albedo * (1.0 - m);
 vec3 spec = mix(vec3(0.04), albedo, m);

 float jitter2 = rand(fract(v_Texcoord)) * float(TOTAL_SAMPLES);

 for (int i = 0; i < SAMPLE_PER_FRAME; i++) {
 vec3 H = importanceSampleNormalGGX(float(i) + jitter2, 1.0 - g, N);
 vec3 rayDir = normalize(reflect(-V, H));
#else
 vec3 rayDir = normalize(reflect(-V, N));
#endif
 vec2 hitPixel;
 vec3 hitPoint;

 bool intersect = traceScreenSpaceRay(rayOrigin, rayDir, jitter, hitPixel, hitPoint, iterationCount);

 float dist = distance(rayOrigin, hitPoint);

 vec3 hitNormal = texture2D(gBufferTexture1, hitPixel).rgb * 2.0 - 1.0;
 hitNormal = normalize((toViewSpace * vec4(hitNormal, 0.0)).xyz);
#ifdef PHYSICALLY_CORRECT
 float ndl = clamp(dot(N, rayDir), 0.0, 1.0);
 float vdh = clamp(dot(V, H), 0.0, 1.0);
 float ndh = clamp(dot(N, H), 0.0, 1.0);
 vec3 litTexel = vec3(0.0);
 if (dot(hitNormal, rayDir) < 0.0 && intersect) {
 litTexel = texture2D(sourceTexture, hitPixel).rgb;
 litTexel *= pow(clamp(1.0 - dist / 200.0, 0.0, 1.0), 3.0);

 }
 else {
 #ifdef SPECULARCUBEMAP_ENABLED
 vec3 rayDirW = normalize(toWorldSpace * vec4(rayDir, 0.0)).rgb;
 litTexel = RGBMDecode(textureCubeLodEXT(specularCubemap, rayDirW, 0.0), 8.12).rgb * specularIntensity;
#endif
 }
 color.rgb += ndl * litTexel * (
 F_Schlick(ndl, spec) * G_Smith(g, ndv, ndl) * vdh / (ndh * ndv + 0.001)
 );
 }
 color.rgb /= float(SAMPLE_PER_FRAME);
#else
 #if !defined(SPECULARCUBEMAP_ENABLED)
 if (dot(hitNormal, rayDir) >= 0.0) {
 discard;
 }
 if (!intersect) {
 discard;
 }
#endif
 float alpha = clamp(calculateAlpha(iterationCount, reflectivity, hitPixel, hitPoint, dist, rayDir), 0.0, 1.0);
 vec4 color = texture2D(sourceTexture, hitPixel);
 color.rgb *= alpha;

#ifdef SPECULARCUBEMAP_ENABLED
 vec3 rayDirW = normalize(toWorldSpace * vec4(rayDir, 0.0)).rgb;
 alpha = alpha * (intersect ? 1.0 : 0.0);
 float bias = (1.0 -g) * 5.0;
 color.rgb += (1.0 - alpha)
 * RGBMDecode(textureCubeLodEXT(specularCubemap, rayDirW, bias), 8.12).rgb
 * specularIntensity;
#endif

#endif

 gl_FragColor = encodeHDR(color);
}
@end

@export ecgl.ssr.blur

uniform sampler2D texture;
uniform sampler2D gBufferTexture1;
uniform sampler2D gBufferTexture2;
uniform mat4 projection;
uniform float depthRange : 0.05;

varying vec2 v_Texcoord;

uniform vec2 textureSize;
uniform float blurSize : 1.0;

#ifdef BLEND
 #ifdef SSAOTEX_ENABLED
uniform sampler2D ssaoTex;
 #endif
uniform sampler2D sourceTexture;
#endif

float getLinearDepth(vec2 coord)
{
 float depth = texture2D(gBufferTexture2, coord).r * 2.0 - 1.0;
 return projection[3][2] / (depth * projection[2][3] - projection[2][2]);
}

@import clay.util.rgbm


void main()
{
 @import clay.compositor.kernel.gaussian_9

 vec4 centerNTexel = texture2D(gBufferTexture1, v_Texcoord);
 float g = centerNTexel.a;
 float maxBlurSize = clamp(1.0 - g, 0.0, 1.0) * blurSize;
#ifdef VERTICAL
 vec2 off = vec2(0.0, maxBlurSize / textureSize.y);
#else
 vec2 off = vec2(maxBlurSize / textureSize.x, 0.0);
#endif

 vec2 coord = v_Texcoord;

 vec4 sum = vec4(0.0);
 float weightAll = 0.0;

 vec3 cN = centerNTexel.rgb * 2.0 - 1.0;
 float cD = getLinearDepth(v_Texcoord);
 for (int i = 0; i < 9; i++) {
 vec2 coord = clamp((float(i) - 4.0) * off + v_Texcoord, vec2(0.0), vec2(1.0));
 float w = gaussianKernel[i]
 * clamp(dot(cN, texture2D(gBufferTexture1, coord).rgb * 2.0 - 1.0), 0.0, 1.0);
 float d = getLinearDepth(coord);
 w *= (1.0 - smoothstep(abs(cD - d) / depthRange, 0.0, 1.0));

 weightAll += w;
 sum += decodeHDR(texture2D(texture, coord)) * w;
 }

#ifdef BLEND
 float aoFactor = 1.0;
 #ifdef SSAOTEX_ENABLED
 aoFactor = texture2D(ssaoTex, v_Texcoord).r;
 #endif
 gl_FragColor = encodeHDR(
 sum / weightAll * aoFactor + decodeHDR(texture2D(sourceTexture, v_Texcoord))
 );
#else
 gl_FragColor = encodeHDR(sum / weightAll);
#endif
}

@end`;
Ze.import(Hxe);
function Mf(e) {
  e = e || {}, this._ssrPass = new Pn({
    fragment: Ze.source("ecgl.ssr.main"),
    clearColor: [0, 0, 0, 0]
  }), this._blurPass1 = new Pn({
    fragment: Ze.source("ecgl.ssr.blur"),
    clearColor: [0, 0, 0, 0]
  }), this._blurPass2 = new Pn({
    fragment: Ze.source("ecgl.ssr.blur"),
    clearColor: [0, 0, 0, 0]
  }), this._blendPass = new Pn({
    fragment: Ze.source("clay.compositor.blend")
  }), this._blendPass.material.disableTexturesAll(), this._blendPass.material.enableTexture(["texture1", "texture2"]), this._ssrPass.setUniform("gBufferTexture1", e.normalTexture), this._ssrPass.setUniform("gBufferTexture2", e.depthTexture), this._blurPass1.setUniform("gBufferTexture1", e.normalTexture), this._blurPass1.setUniform("gBufferTexture2", e.depthTexture), this._blurPass2.setUniform("gBufferTexture1", e.normalTexture), this._blurPass2.setUniform("gBufferTexture2", e.depthTexture), this._blurPass2.material.define("fragment", "VERTICAL"), this._blurPass2.material.define("fragment", "BLEND"), this._ssrTexture = new Vt({
    type: We.HALF_FLOAT
  }), this._texture2 = new Vt({
    type: We.HALF_FLOAT
  }), this._texture3 = new Vt({
    type: We.HALF_FLOAT
  }), this._prevTexture = new Vt({
    type: We.HALF_FLOAT
  }), this._currentTexture = new Vt({
    type: We.HALF_FLOAT
  }), this._frameBuffer = new Tn({
    depthBuffer: !1
  }), this._normalDistribution = null, this._totalSamples = 256, this._samplePerFrame = 4, this._ssrPass.material.define("fragment", "SAMPLE_PER_FRAME", this._samplePerFrame), this._ssrPass.material.define("fragment", "TOTAL_SAMPLES", this._totalSamples), this._downScale = 1;
}
Mf.prototype.setAmbientCubemap = function(e, t) {
  this._ssrPass.material.set("specularCubemap", e), this._ssrPass.material.set("specularIntensity", t);
  var r = e && t;
  this._ssrPass.material[r ? "enableTexture" : "disableTexture"]("specularCubemap");
};
Mf.prototype.update = function(e, t, r, n) {
  var i = e.getWidth(), a = e.getHeight(), o = this._ssrTexture, s = this._texture2, l = this._texture3;
  o.width = this._prevTexture.width = this._currentTexture.width = i / this._downScale, o.height = this._prevTexture.height = this._currentTexture.height = a / this._downScale, s.width = l.width = i, s.height = l.height = a;
  var u = this._frameBuffer, f = this._ssrPass, c = this._blurPass1, h = this._blurPass2, v = this._blendPass, d = new Ke(), g = new Ke();
  Ke.transpose(d, t.worldTransform), Ke.transpose(g, t.viewMatrix), f.setUniform("sourceTexture", r), f.setUniform("projection", t.projectionMatrix.array), f.setUniform("projectionInv", t.invProjectionMatrix.array), f.setUniform("toViewSpace", d.array), f.setUniform("toWorldSpace", g.array), f.setUniform("nearZ", t.near);
  var y = n / this._totalSamples * this._samplePerFrame;
  if (f.setUniform("jitterOffset", y), f.setUniform("sampleOffset", n * this._samplePerFrame), c.setUniform("textureSize", [o.width, o.height]), h.setUniform("textureSize", [i, a]), h.setUniform("sourceTexture", r), c.setUniform("projection", t.projectionMatrix.array), h.setUniform("projection", t.projectionMatrix.array), u.attach(o), u.bind(e), f.render(e), this._physicallyCorrect && (u.attach(this._currentTexture), v.setUniform("texture1", this._prevTexture), v.setUniform("texture2", o), v.material.set({
    weight1: n >= 1 ? 0.95 : 0,
    weight2: n >= 1 ? 0.05 : 1
    // weight1: frame >= 1 ? 1 : 0,
    // weight2: 1
  }), v.render(e)), u.attach(s), c.setUniform("texture", this._physicallyCorrect ? this._currentTexture : o), c.render(e), u.attach(l), h.setUniform("texture", s), h.render(e), u.unbind(e), this._physicallyCorrect) {
    var x = this._prevTexture;
    this._prevTexture = this._currentTexture, this._currentTexture = x;
  }
};
Mf.prototype.getTargetTexture = function() {
  return this._texture3;
};
Mf.prototype.setParameter = function(e, t) {
  e === "maxIteration" ? this._ssrPass.material.define("fragment", "MAX_ITERATION", t) : this._ssrPass.setUniform(e, t);
};
Mf.prototype.setPhysicallyCorrect = function(e) {
  e ? (this._normalDistribution || (this._normalDistribution = Jl.generateNormalDistribution(64, this._totalSamples)), this._ssrPass.material.define("fragment", "PHYSICALLY_CORRECT"), this._ssrPass.material.set("normalDistribution", this._normalDistribution), this._ssrPass.material.set("normalDistributionSize", [64, this._totalSamples])) : this._ssrPass.material.undefine("fragment", "PHYSICALLY_CORRECT"), this._physicallyCorrect = e;
};
Mf.prototype.setSSAOTexture = function(e) {
  var t = this._blurPass2;
  e ? (t.material.enableTexture("ssaoTex"), t.material.set("ssaoTex", e)) : t.material.disableTexture("ssaoTex");
};
Mf.prototype.isFinished = function(e) {
  return this._physicallyCorrect ? e > this._totalSamples / this._samplePerFrame : !0;
};
Mf.prototype.dispose = function(e) {
  this._ssrTexture.dispose(e), this._texture2.dispose(e), this._texture3.dispose(e), this._prevTexture.dispose(e), this._currentTexture.dispose(e), this._frameBuffer.dispose(e);
};
const vH = [0, 0, -0.321585265978, -0.154972575841, 0.458126042375, 0.188473391593, 0.842080129861, 0.527766490688, 0.147304551086, -0.659453822776, -0.331943915203, -0.940619700594, 0.0479226680259, 0.54812163202, 0.701581552186, -0.709825561388, -0.295436780218, 0.940589268233, -0.901489676764, 0.237713156085, 0.973570876096, -0.109899459384, -0.866792314779, -0.451805525005, 0.330975007087, 0.800048655954, -0.344275183665, 0.381779221166, -0.386139432542, -0.437418421534, -0.576478634965, -0.0148463392551, 0.385798197415, -0.262426961053, -0.666302061145, 0.682427250835, -0.628010632582, -0.732836215494, 0.10163141741, -0.987658134403, 0.711995289051, -0.320024291314, 0.0296005138058, 0.950296523438, 0.0130612307608, -0.351024443122, -0.879596633704, -0.10478487883, 0.435712737232, 0.504254490347, 0.779203817497, 0.206477676721, 0.388264289969, -0.896736162545, -0.153106280781, -0.629203242522, -0.245517550697, 0.657969239148, 0.126830499058, 0.26862328493, -0.634888119007, -0.302301223431, 0.617074219636, 0.779817204925], Uxe = `@export ecgl.normal.vertex

@import ecgl.common.transformUniforms

@import ecgl.common.uv.header

@import ecgl.common.attributes

varying vec3 v_Normal;
varying vec3 v_WorldPosition;

@import ecgl.common.normalMap.vertexHeader

@import ecgl.common.vertexAnimation.header

void main()
{

 @import ecgl.common.vertexAnimation.main

 @import ecgl.common.uv.main

 v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);
 v_WorldPosition = (world * vec4(pos, 1.0)).xyz;

 @import ecgl.common.normalMap.vertexMain

 gl_Position = worldViewProjection * vec4(pos, 1.0);

}


@end


@export ecgl.normal.fragment

#define ROUGHNESS_CHANEL 0

uniform bool useBumpMap;
uniform bool useRoughnessMap;
uniform bool doubleSide;
uniform float roughness;

@import ecgl.common.uv.fragmentHeader

varying vec3 v_Normal;
varying vec3 v_WorldPosition;

uniform mat4 viewInverse : VIEWINVERSE;

@import ecgl.common.normalMap.fragmentHeader
@import ecgl.common.bumpMap.header

uniform sampler2D roughnessMap;

void main()
{
 vec3 N = v_Normal;
 
 bool flipNormal = false;
 if (doubleSide) {
 vec3 eyePos = viewInverse[3].xyz;
 vec3 V = normalize(eyePos - v_WorldPosition);

 if (dot(N, V) < 0.0) {
 flipNormal = true;
 }
 }

 @import ecgl.common.normalMap.fragmentMain

 if (useBumpMap) {
 N = bumpNormal(v_WorldPosition, v_Normal, N);
 }

 float g = 1.0 - roughness;

 if (useRoughnessMap) {
 float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];
 g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);
 }

 if (flipNormal) {
 N = -N;
 }

 gl_FragColor.rgb = (N.xyz + 1.0) * 0.5;
 gl_FragColor.a = g;
}
@end`;
Ze.import(Uxe);
function gE(e, t, r, n, i) {
  var a = e.gl;
  t.setUniform(a, "1i", r, i), a.activeTexture(a.TEXTURE0 + i), n.isRenderable() ? n.bind(e) : n.unbind(e);
}
function Wxe(e, t, r, n, i) {
  var a, o, s, l, u = e.gl;
  return function(f, c, h) {
    if (!(l && l.material === f.material)) {
      var v = f.material, d = f.__program, g = v.get("roughness");
      g == null && (g = 1);
      var y = v.get("normalMap") || t, x = v.get("roughnessMap"), S = v.get("bumpMap"), T = v.get("uvRepeat"), C = v.get("uvOffset"), A = v.get("detailUvRepeat"), M = v.get("detailUvOffset"), E = !!S && v.isTextureEnabled("bumpMap"), P = !!x && v.isTextureEnabled("roughnessMap"), R = v.isDefined("fragment", "DOUBLE_SIDED");
      S = S || r, x = x || n, h !== c ? (c.set("normalMap", y), c.set("bumpMap", S), c.set("roughnessMap", x), c.set("useBumpMap", E), c.set("useRoughnessMap", P), c.set("doubleSide", R), T != null && c.set("uvRepeat", T), C != null && c.set("uvOffset", C), A != null && c.set("detailUvRepeat", A), M != null && c.set("detailUvOffset", M), c.set("roughness", g)) : (d.setUniform(u, "1f", "roughness", g), a !== y && gE(e, d, "normalMap", y, 0), o !== S && S && gE(e, d, "bumpMap", S, 1), s !== x && x && gE(e, d, "roughnessMap", x, 2), T != null && d.setUniform(u, "2f", "uvRepeat", T), C != null && d.setUniform(u, "2f", "uvOffset", C), A != null && d.setUniform(u, "2f", "detailUvRepeat", A), M != null && d.setUniform(u, "2f", "detailUvOffset", M), d.setUniform(u, "1i", "useBumpMap", +E), d.setUniform(u, "1i", "useRoughnessMap", +P), d.setUniform(u, "1i", "doubleSide", +R)), a = y, o = S, s = x, l = f;
    }
  };
}
function py(e) {
  this._depthTex = new Vt({
    format: We.DEPTH_COMPONENT,
    type: We.UNSIGNED_INT
  }), this._normalTex = new Vt({
    type: We.HALF_FLOAT
  }), this._framebuffer = new Tn(), this._framebuffer.attach(this._normalTex), this._framebuffer.attach(this._depthTex, Tn.DEPTH_ATTACHMENT), this._normalMaterial = new ls({
    shader: new Ze(Ze.source("ecgl.normal.vertex"), Ze.source("ecgl.normal.fragment"))
  }), this._normalMaterial.enableTexture(["normalMap", "bumpMap", "roughnessMap"]), this._defaultNormalMap = Ql.createBlank("#000"), this._defaultBumpMap = Ql.createBlank("#000"), this._defaultRoughessMap = Ql.createBlank("#000"), this._debugPass = new Pn({
    fragment: Ze.source("clay.compositor.output")
  }), this._debugPass.setUniform("texture", this._normalTex), this._debugPass.material.undefine("fragment", "OUTPUT_ALPHA");
}
py.prototype.getDepthTexture = function() {
  return this._depthTex;
};
py.prototype.getNormalTexture = function() {
  return this._normalTex;
};
py.prototype.update = function(e, t, r) {
  var n = e.getWidth(), i = e.getHeight(), a = this._depthTex, o = this._normalTex, s = this._normalMaterial;
  a.width = n, a.height = i, o.width = n, o.height = i;
  var l = t.getRenderList(r).opaque;
  this._framebuffer.bind(e), e.gl.clearColor(0, 0, 0, 0), e.gl.clear(e.gl.COLOR_BUFFER_BIT | e.gl.DEPTH_BUFFER_BIT), e.gl.disable(e.gl.BLEND), e.renderPass(l, r, {
    getMaterial: function() {
      return s;
    },
    ifRender: function(u) {
      return u.renderNormal;
    },
    beforeRender: Wxe(e, this._defaultNormalMap, this._defaultBumpMap, this._defaultRoughessMap, this._normalMaterial),
    sort: e.opaqueSortCompare
  }), this._framebuffer.unbind(e);
};
py.prototype.renderDebug = function(e) {
  this._debugPass.render(e);
};
py.prototype.dispose = function(e) {
  this._depthTex.dispose(e), this._normalTex.dispose(e);
};
function Wx(e) {
  e = e || {}, this._edgePass = new Pn({
    fragment: Ze.source("ecgl.edge")
  }), this._edgePass.setUniform("normalTexture", e.normalTexture), this._edgePass.setUniform("depthTexture", e.depthTexture), this._targetTexture = new Vt({
    type: We.HALF_FLOAT
  }), this._frameBuffer = new Tn(), this._frameBuffer.attach(this._targetTexture);
}
Wx.prototype.update = function(e, t, r, n) {
  var i = e.getWidth(), a = e.getHeight(), o = this._targetTexture;
  o.width = i, o.height = a;
  var s = this._frameBuffer;
  s.bind(e), this._edgePass.setUniform("projectionInv", t.invProjectionMatrix.array), this._edgePass.setUniform("textureSize", [i, a]), this._edgePass.setUniform("texture", r), this._edgePass.render(e), s.unbind(e);
};
Wx.prototype.getTargetTexture = function() {
  return this._targetTexture;
};
Wx.prototype.setParameter = function(e, t) {
  this._edgePass.setUniform(e, t);
};
Wx.prototype.dispose = function(e) {
  this._targetTexture.dispose(e), this._frameBuffer.dispose(e);
};
const Xxe = {
  nodes: [{
    name: "source",
    type: "texture",
    outputs: {
      color: {}
    }
  }, {
    name: "source_half",
    shader: "#source(clay.compositor.downsample)",
    inputs: {
      texture: "source"
    },
    outputs: {
      color: {
        parameters: {
          width: "expr(width * 1.0 / 2)",
          height: "expr(height * 1.0 / 2)",
          type: "HALF_FLOAT"
        }
      }
    },
    parameters: {
      textureSize: "expr( [width * 1.0, height * 1.0] )"
    }
  }, {
    name: "bright",
    shader: "#source(clay.compositor.bright)",
    inputs: {
      texture: "source_half"
    },
    outputs: {
      color: {
        parameters: {
          width: "expr(width * 1.0 / 2)",
          height: "expr(height * 1.0 / 2)",
          type: "HALF_FLOAT"
        }
      }
    },
    parameters: {
      threshold: 2,
      scale: 4,
      textureSize: "expr([width * 1.0 / 2, height / 2])"
    }
  }, {
    name: "bright_downsample_4",
    shader: "#source(clay.compositor.downsample)",
    inputs: {
      texture: "bright"
    },
    outputs: {
      color: {
        parameters: {
          width: "expr(width * 1.0 / 4)",
          height: "expr(height * 1.0 / 4)",
          type: "HALF_FLOAT"
        }
      }
    },
    parameters: {
      textureSize: "expr( [width * 1.0 / 2, height / 2] )"
    }
  }, {
    name: "bright_downsample_8",
    shader: "#source(clay.compositor.downsample)",
    inputs: {
      texture: "bright_downsample_4"
    },
    outputs: {
      color: {
        parameters: {
          width: "expr(width * 1.0 / 8)",
          height: "expr(height * 1.0 / 8)",
          type: "HALF_FLOAT"
        }
      }
    },
    parameters: {
      textureSize: "expr( [width * 1.0 / 4, height / 4] )"
    }
  }, {
    name: "bright_downsample_16",
    shader: "#source(clay.compositor.downsample)",
    inputs: {
      texture: "bright_downsample_8"
    },
    outputs: {
      color: {
        parameters: {
          width: "expr(width * 1.0 / 16)",
          height: "expr(height * 1.0 / 16)",
          type: "HALF_FLOAT"
        }
      }
    },
    parameters: {
      textureSize: "expr( [width * 1.0 / 8, height / 8] )"
    }
  }, {
    name: "bright_downsample_32",
    shader: "#source(clay.compositor.downsample)",
    inputs: {
      texture: "bright_downsample_16"
    },
    outputs: {
      color: {
        parameters: {
          width: "expr(width * 1.0 / 32)",
          height: "expr(height * 1.0 / 32)",
          type: "HALF_FLOAT"
        }
      }
    },
    parameters: {
      textureSize: "expr( [width * 1.0 / 16, height / 16] )"
    }
  }, {
    name: "bright_upsample_16_blur_h",
    shader: "#source(clay.compositor.gaussian_blur)",
    inputs: {
      texture: "bright_downsample_32"
    },
    outputs: {
      color: {
        parameters: {
          width: "expr(width * 1.0 / 16)",
          height: "expr(height * 1.0 / 16)",
          type: "HALF_FLOAT"
        }
      }
    },
    parameters: {
      blurSize: 1,
      blurDir: 0,
      textureSize: "expr( [width * 1.0 / 32, height / 32] )"
    }
  }, {
    name: "bright_upsample_16_blur_v",
    shader: "#source(clay.compositor.gaussian_blur)",
    inputs: {
      texture: "bright_upsample_16_blur_h"
    },
    outputs: {
      color: {
        parameters: {
          width: "expr(width * 1.0 / 16)",
          height: "expr(height * 1.0 / 16)",
          type: "HALF_FLOAT"
        }
      }
    },
    parameters: {
      blurSize: 1,
      blurDir: 1,
      textureSize: "expr( [width * 1.0 / 16, height * 1.0 / 16] )"
    }
  }, {
    name: "bright_upsample_8_blur_h",
    shader: "#source(clay.compositor.gaussian_blur)",
    inputs: {
      texture: "bright_downsample_16"
    },
    outputs: {
      color: {
        parameters: {
          width: "expr(width * 1.0 / 8)",
          height: "expr(height * 1.0 / 8)",
          type: "HALF_FLOAT"
        }
      }
    },
    parameters: {
      blurSize: 1,
      blurDir: 0,
      textureSize: "expr( [width * 1.0 / 16, height * 1.0 / 16] )"
    }
  }, {
    name: "bright_upsample_8_blur_v",
    shader: "#source(clay.compositor.gaussian_blur)",
    inputs: {
      texture: "bright_upsample_8_blur_h"
    },
    outputs: {
      color: {
        parameters: {
          width: "expr(width * 1.0 / 8)",
          height: "expr(height * 1.0 / 8)",
          type: "HALF_FLOAT"
        }
      }
    },
    parameters: {
      blurSize: 1,
      blurDir: 1,
      textureSize: "expr( [width * 1.0 / 8, height * 1.0 / 8] )"
    }
  }, {
    name: "bright_upsample_8_blend",
    shader: "#source(clay.compositor.blend)",
    inputs: {
      texture1: "bright_upsample_8_blur_v",
      texture2: "bright_upsample_16_blur_v"
    },
    outputs: {
      color: {
        parameters: {
          width: "expr(width * 1.0 / 8)",
          height: "expr(height * 1.0 / 8)",
          type: "HALF_FLOAT"
        }
      }
    },
    parameters: {
      weight1: 0.3,
      weight2: 0.7
    }
  }, {
    name: "bright_upsample_4_blur_h",
    shader: "#source(clay.compositor.gaussian_blur)",
    inputs: {
      texture: "bright_downsample_8"
    },
    outputs: {
      color: {
        parameters: {
          width: "expr(width * 1.0 / 4)",
          height: "expr(height * 1.0 / 4)",
          type: "HALF_FLOAT"
        }
      }
    },
    parameters: {
      blurSize: 1,
      blurDir: 0,
      textureSize: "expr( [width * 1.0 / 8, height * 1.0 / 8] )"
    }
  }, {
    name: "bright_upsample_4_blur_v",
    shader: "#source(clay.compositor.gaussian_blur)",
    inputs: {
      texture: "bright_upsample_4_blur_h"
    },
    outputs: {
      color: {
        parameters: {
          width: "expr(width * 1.0 / 4)",
          height: "expr(height * 1.0 / 4)",
          type: "HALF_FLOAT"
        }
      }
    },
    parameters: {
      blurSize: 1,
      blurDir: 1,
      textureSize: "expr( [width * 1.0 / 4, height * 1.0 / 4] )"
    }
  }, {
    name: "bright_upsample_4_blend",
    shader: "#source(clay.compositor.blend)",
    inputs: {
      texture1: "bright_upsample_4_blur_v",
      texture2: "bright_upsample_8_blend"
    },
    outputs: {
      color: {
        parameters: {
          width: "expr(width * 1.0 / 4)",
          height: "expr(height * 1.0 / 4)",
          type: "HALF_FLOAT"
        }
      }
    },
    parameters: {
      weight1: 0.3,
      weight2: 0.7
    }
  }, {
    name: "bright_upsample_2_blur_h",
    shader: "#source(clay.compositor.gaussian_blur)",
    inputs: {
      texture: "bright_downsample_4"
    },
    outputs: {
      color: {
        parameters: {
          width: "expr(width * 1.0 / 2)",
          height: "expr(height * 1.0 / 2)",
          type: "HALF_FLOAT"
        }
      }
    },
    parameters: {
      blurSize: 1,
      blurDir: 0,
      textureSize: "expr( [width * 1.0 / 4, height * 1.0 / 4] )"
    }
  }, {
    name: "bright_upsample_2_blur_v",
    shader: "#source(clay.compositor.gaussian_blur)",
    inputs: {
      texture: "bright_upsample_2_blur_h"
    },
    outputs: {
      color: {
        parameters: {
          width: "expr(width * 1.0 / 2)",
          height: "expr(height * 1.0 / 2)",
          type: "HALF_FLOAT"
        }
      }
    },
    parameters: {
      blurSize: 1,
      blurDir: 1,
      textureSize: "expr( [width * 1.0 / 2, height * 1.0 / 2] )"
    }
  }, {
    name: "bright_upsample_2_blend",
    shader: "#source(clay.compositor.blend)",
    inputs: {
      texture1: "bright_upsample_2_blur_v",
      texture2: "bright_upsample_4_blend"
    },
    outputs: {
      color: {
        parameters: {
          width: "expr(width * 1.0 / 2)",
          height: "expr(height * 1.0 / 2)",
          type: "HALF_FLOAT"
        }
      }
    },
    parameters: {
      weight1: 0.3,
      weight2: 0.7
    }
  }, {
    name: "bright_upsample_full_blur_h",
    shader: "#source(clay.compositor.gaussian_blur)",
    inputs: {
      texture: "bright"
    },
    outputs: {
      color: {
        parameters: {
          width: "expr(width * 1.0)",
          height: "expr(height * 1.0)",
          type: "HALF_FLOAT"
        }
      }
    },
    parameters: {
      blurSize: 1,
      blurDir: 0,
      textureSize: "expr( [width * 1.0 / 2, height * 1.0 / 2] )"
    }
  }, {
    name: "bright_upsample_full_blur_v",
    shader: "#source(clay.compositor.gaussian_blur)",
    inputs: {
      texture: "bright_upsample_full_blur_h"
    },
    outputs: {
      color: {
        parameters: {
          width: "expr(width * 1.0)",
          height: "expr(height * 1.0)",
          type: "HALF_FLOAT"
        }
      }
    },
    parameters: {
      blurSize: 1,
      blurDir: 1,
      textureSize: "expr( [width * 1.0, height * 1.0] )"
    }
  }, {
    name: "bloom_composite",
    shader: "#source(clay.compositor.blend)",
    inputs: {
      texture1: "bright_upsample_full_blur_v",
      texture2: "bright_upsample_2_blend"
    },
    outputs: {
      color: {
        parameters: {
          width: "expr(width * 1.0)",
          height: "expr(height * 1.0)",
          type: "HALF_FLOAT"
        }
      }
    },
    parameters: {
      weight1: 0.3,
      weight2: 0.7
    }
  }, {
    name: "coc",
    shader: "#source(ecgl.dof.coc)",
    outputs: {
      color: {
        parameters: {
          minFilter: "NEAREST",
          magFilter: "NEAREST",
          width: "expr(width * 1.0)",
          height: "expr(height * 1.0)"
        }
      }
    },
    parameters: {
      focalDist: 50,
      focalRange: 30
    }
  }, {
    name: "dof_far_blur",
    shader: "#source(ecgl.dof.diskBlur)",
    inputs: {
      texture: "source",
      coc: "coc"
    },
    outputs: {
      color: {
        parameters: {
          width: "expr(width * 1.0)",
          height: "expr(height * 1.0)",
          type: "HALF_FLOAT"
        }
      }
    },
    parameters: {
      textureSize: "expr( [width * 1.0, height * 1.0] )"
    }
  }, {
    name: "dof_near_blur",
    shader: "#source(ecgl.dof.diskBlur)",
    inputs: {
      texture: "source",
      coc: "coc"
    },
    outputs: {
      color: {
        parameters: {
          width: "expr(width * 1.0)",
          height: "expr(height * 1.0)",
          type: "HALF_FLOAT"
        }
      }
    },
    parameters: {
      textureSize: "expr( [width * 1.0, height * 1.0] )"
    },
    defines: {
      BLUR_NEARFIELD: null
    }
  }, {
    name: "dof_coc_blur",
    shader: "#source(ecgl.dof.diskBlur)",
    inputs: {
      texture: "coc"
    },
    outputs: {
      color: {
        parameters: {
          minFilter: "NEAREST",
          magFilter: "NEAREST",
          width: "expr(width * 1.0)",
          height: "expr(height * 1.0)"
        }
      }
    },
    parameters: {
      textureSize: "expr( [width * 1.0, height * 1.0] )"
    },
    defines: {
      BLUR_COC: null
    }
  }, {
    name: "dof_composite",
    shader: "#source(ecgl.dof.composite)",
    inputs: {
      original: "source",
      blurred: "dof_far_blur",
      nearfield: "dof_near_blur",
      coc: "coc",
      nearcoc: "dof_coc_blur"
    },
    outputs: {
      color: {
        parameters: {
          width: "expr(width * 1.0)",
          height: "expr(height * 1.0)",
          type: "HALF_FLOAT"
        }
      }
    }
  }, {
    name: "composite",
    shader: "#source(clay.compositor.hdr.composite)",
    inputs: {
      texture: "source",
      bloom: "bloom_composite"
    },
    outputs: {
      color: {
        parameters: {
          width: "expr(width * 1.0)",
          height: "expr(height * 1.0)"
        }
      }
    },
    defines: {
      // Images are all premultiplied alpha before composite because of blending.
      // 'PREMULTIPLY_ALPHA': null,
      // 'DEBUG': 2
    }
  }, {
    name: "FXAA",
    shader: "#source(clay.compositor.fxaa)",
    inputs: {
      texture: "composite"
    }
  }]
}, Yxe = `@export ecgl.dof.coc

uniform sampler2D depth;

uniform float zNear: 0.1;
uniform float zFar: 2000;

uniform float focalDistance: 3;
uniform float focalRange: 1;
uniform float focalLength: 30;
uniform float fstop: 2.8;

varying vec2 v_Texcoord;

@import clay.util.encode_float

void main()
{
 float z = texture2D(depth, v_Texcoord).r * 2.0 - 1.0;

 float dist = 2.0 * zNear * zFar / (zFar + zNear - z * (zFar - zNear));

 float aperture = focalLength / fstop;

 float coc;

 float uppper = focalDistance + focalRange;
 float lower = focalDistance - focalRange;
 if (dist <= uppper && dist >= lower) {
 coc = 0.5;
 }
 else {
 float focalAdjusted = dist > uppper ? uppper : lower;

 coc = abs(aperture * (focalLength * (dist - focalAdjusted)) / (dist * (focalAdjusted - focalLength)));
 coc = clamp(coc, 0.0, 2.0) / 2.00001;

 if (dist < lower) {
 coc = -coc;
 }
 coc = coc * 0.5 + 0.5;
 }

 gl_FragColor = encodeFloat(coc);
}
@end


@export ecgl.dof.composite

#define DEBUG 0

uniform sampler2D original;
uniform sampler2D blurred;
uniform sampler2D nearfield;
uniform sampler2D coc;
uniform sampler2D nearcoc;
varying vec2 v_Texcoord;

@import clay.util.rgbm
@import clay.util.float

void main()
{
 vec4 blurredColor = texture2D(blurred, v_Texcoord);
 vec4 originalColor = texture2D(original, v_Texcoord);

 float fCoc = decodeFloat(texture2D(coc, v_Texcoord));

 fCoc = abs(fCoc * 2.0 - 1.0);

 float weight = smoothstep(0.0, 1.0, fCoc);
 
#ifdef NEARFIELD_ENABLED
 vec4 nearfieldColor = texture2D(nearfield, v_Texcoord);
 float fNearCoc = decodeFloat(texture2D(nearcoc, v_Texcoord));
 fNearCoc = abs(fNearCoc * 2.0 - 1.0);

 gl_FragColor = encodeHDR(
 mix(
 nearfieldColor, mix(originalColor, blurredColor, weight),
 pow(1.0 - fNearCoc, 4.0)
 )
 );
#else
 gl_FragColor = encodeHDR(mix(originalColor, blurredColor, weight));
#endif

}

@end



@export ecgl.dof.diskBlur

#define POISSON_KERNEL_SIZE 16;

uniform sampler2D texture;
uniform sampler2D coc;
varying vec2 v_Texcoord;

uniform float blurRadius : 10.0;
uniform vec2 textureSize : [512.0, 512.0];

uniform vec2 poissonKernel[POISSON_KERNEL_SIZE];

uniform float percent;

float nrand(const in vec2 n) {
 return fract(sin(dot(n.xy ,vec2(12.9898,78.233))) * 43758.5453);
}

@import clay.util.rgbm
@import clay.util.float


void main()
{
 vec2 offset = blurRadius / textureSize;

 float rnd = 6.28318 * nrand(v_Texcoord + 0.07 * percent );
 float cosa = cos(rnd);
 float sina = sin(rnd);
 vec4 basis = vec4(cosa, -sina, sina, cosa);

#if !defined(BLUR_NEARFIELD) && !defined(BLUR_COC)
 offset *= abs(decodeFloat(texture2D(coc, v_Texcoord)) * 2.0 - 1.0);
#endif

#ifdef BLUR_COC
 float cocSum = 0.0;
#else
 vec4 color = vec4(0.0);
#endif


 float weightSum = 0.0;

 for (int i = 0; i < POISSON_KERNEL_SIZE; i++) {
 vec2 ofs = poissonKernel[i];

 ofs = vec2(dot(ofs, basis.xy), dot(ofs, basis.zw));

 vec2 uv = v_Texcoord + ofs * offset;
 vec4 texel = texture2D(texture, uv);

 float w = 1.0;
#ifdef BLUR_COC
 float fCoc = decodeFloat(texel) * 2.0 - 1.0;
 cocSum += clamp(fCoc, -1.0, 0.0) * w;
#else
 texel = texel;
 #if !defined(BLUR_NEARFIELD)
 float fCoc = decodeFloat(texture2D(coc, uv)) * 2.0 - 1.0;
 w *= abs(fCoc);
 #endif
 texel.rgb *= texel.a;
 color += texel * w;
#endif

 weightSum += w;
 }

#ifdef BLUR_COC
 gl_FragColor = encodeFloat(clamp(cocSum / weightSum, -1.0, 0.0) * 0.5 + 0.5);
#else
 color /= weightSum;
 color.rgb /= (color.a + 0.0001);
 gl_FragColor = color;
#endif
}

@end`, Zxe = `@export ecgl.edge

uniform sampler2D texture;

uniform sampler2D normalTexture;
uniform sampler2D depthTexture;

uniform mat4 projectionInv;

uniform vec2 textureSize;

uniform vec4 edgeColor: [0,0,0,0.8];

varying vec2 v_Texcoord;

vec3 packColor(vec2 coord) {
 float z = texture2D(depthTexture, coord).r * 2.0 - 1.0;
 vec4 p = vec4(v_Texcoord * 2.0 - 1.0, z, 1.0);
 vec4 p4 = projectionInv * p;

 return vec3(
 texture2D(normalTexture, coord).rg,
 -p4.z / p4.w / 5.0
 );
}

void main() {
 vec2 cc = v_Texcoord;
 vec3 center = packColor(cc);

 float size = clamp(1.0 - (center.z - 10.0) / 100.0, 0.0, 1.0) * 0.5;
 float dx = size / textureSize.x;
 float dy = size / textureSize.y;

 vec2 coord;
 vec3 topLeft = packColor(cc+vec2(-dx, -dy));
 vec3 top = packColor(cc+vec2(0.0, -dy));
 vec3 topRight = packColor(cc+vec2(dx, -dy));
 vec3 left = packColor(cc+vec2(-dx, 0.0));
 vec3 right = packColor(cc+vec2(dx, 0.0));
 vec3 bottomLeft = packColor(cc+vec2(-dx, dy));
 vec3 bottom = packColor(cc+vec2(0.0, dy));
 vec3 bottomRight = packColor(cc+vec2(dx, dy));

 vec3 v = -topLeft-2.0*top-topRight+bottomLeft+2.0*bottom+bottomRight;
 vec3 h = -bottomLeft-2.0*left-topLeft+bottomRight+2.0*right+topRight;

 float edge = sqrt(dot(h, h) + dot(v, v));

 edge = smoothstep(0.8, 1.0, edge);

 gl_FragColor = mix(texture2D(texture, v_Texcoord), vec4(edgeColor.rgb, 1.0), edgeColor.a * edge);
}
@end`;
Ze.import(UY);
Ze.import(WY);
Ze.import(XY);
Ze.import(YY);
Ze.import(ZY);
Ze.import($Y);
Ze.import(qY);
Ze.import(jY);
Ze.import(KY);
Ze.import(Yxe);
Ze.import(Zxe);
function eZ(e, t) {
  return {
    color: {
      parameters: {
        width: e,
        height: t
      }
    }
  };
}
var KN = ["composite", "FXAA"];
function rr() {
  this._width, this._height, this._dpr, this._sourceTexture = new Vt({
    type: We.HALF_FLOAT
  }), this._depthTexture = new Vt({
    format: We.DEPTH_COMPONENT,
    type: We.UNSIGNED_INT
  }), this._framebuffer = new Tn(), this._framebuffer.attach(this._sourceTexture), this._framebuffer.attach(this._depthTexture, Tn.DEPTH_ATTACHMENT), this._normalPass = new py(), this._compositor = Rxe(Xxe);
  var e = this._compositor.getNodeByName("source");
  e.texture = this._sourceTexture;
  var t = this._compositor.getNodeByName("coc");
  this._sourceNode = e, this._cocNode = t, this._compositeNode = this._compositor.getNodeByName("composite"), this._fxaaNode = this._compositor.getNodeByName("FXAA"), this._dofBlurNodes = ["dof_far_blur", "dof_near_blur", "dof_coc_blur"].map(function(n) {
    return this._compositor.getNodeByName(n);
  }, this), this._dofBlurKernel = 0, this._dofBlurKernelSize = new Float32Array(0), this._finalNodesChain = KN.map(function(n) {
    return this._compositor.getNodeByName(n);
  }, this);
  var r = {
    normalTexture: this._normalPass.getNormalTexture(),
    depthTexture: this._normalPass.getDepthTexture()
  };
  this._ssaoPass = new Af(r), this._ssrPass = new Mf(r), this._edgePass = new Wx(r);
}
rr.prototype.resize = function(n, i, r) {
  r = r || 1;
  var n = n * r, i = i * r, a = this._sourceTexture, o = this._depthTexture;
  a.width = n, a.height = i, o.width = n, o.height = i;
  var s = {
    getWidth: function() {
      return n;
    },
    getHeight: function() {
      return i;
    },
    getDevicePixelRatio: function() {
      return r;
    }
  };
  function l(u, f) {
    if (typeof u[f] == "function") {
      var c = u[f].__original || u[f];
      u[f] = function(h) {
        return c.call(this, s);
      }, u[f].__original = c;
    }
  }
  this._compositor.nodes.forEach(function(u) {
    for (var f in u.outputs) {
      var c = u.outputs[f].parameters;
      c && (l(c, "width"), l(c, "height"));
    }
    for (var h in u.parameters)
      l(u.parameters, h);
  }), this._width = n, this._height = i, this._dpr = r;
};
rr.prototype.getWidth = function() {
  return this._width;
};
rr.prototype.getHeight = function() {
  return this._height;
};
rr.prototype._ifRenderNormalPass = function() {
  return this._enableSSAO || this._enableEdge || this._enableSSR;
};
rr.prototype._getPrevNode = function(e) {
  for (var t = KN.indexOf(e.name) - 1, r = this._finalNodesChain[t]; r && !this._compositor.getNodeByName(r.name); )
    t -= 1, r = this._finalNodesChain[t];
  return r;
};
rr.prototype._getNextNode = function(e) {
  for (var t = KN.indexOf(e.name) + 1, r = this._finalNodesChain[t]; r && !this._compositor.getNodeByName(r.name); )
    t += 1, r = this._finalNodesChain[t];
  return r;
};
rr.prototype._addChainNode = function(e) {
  var t = this._getPrevNode(e), r = this._getNextNode(e);
  t && (e.inputs.texture = t.name, r ? (e.outputs = eZ(this.getWidth.bind(this), this.getHeight.bind(this)), r.inputs.texture = e.name) : e.outputs = null, this._compositor.addNode(e));
};
rr.prototype._removeChainNode = function(e) {
  var t = this._getPrevNode(e), r = this._getNextNode(e);
  t && (r ? (t.outputs = eZ(this.getWidth.bind(this), this.getHeight.bind(this)), r.inputs.texture = t.name) : t.outputs = null, this._compositor.removeNode(e));
};
rr.prototype.updateNormal = function(e, t, r, n) {
  this._ifRenderNormalPass() && this._normalPass.update(e, t, r);
};
rr.prototype.updateSSAO = function(e, t, r, n) {
  this._ssaoPass.update(e, r, n);
};
rr.prototype.enableSSAO = function() {
  this._enableSSAO = !0;
};
rr.prototype.disableSSAO = function() {
  this._enableSSAO = !1;
};
rr.prototype.enableSSR = function() {
  this._enableSSR = !0;
};
rr.prototype.disableSSR = function() {
  this._enableSSR = !1;
};
rr.prototype.getSSAOTexture = function() {
  return this._ssaoPass.getTargetTexture();
};
rr.prototype.getSourceFrameBuffer = function() {
  return this._framebuffer;
};
rr.prototype.getSourceTexture = function() {
  return this._sourceTexture;
};
rr.prototype.disableFXAA = function() {
  this._removeChainNode(this._fxaaNode);
};
rr.prototype.enableFXAA = function() {
  this._addChainNode(this._fxaaNode);
};
rr.prototype.enableBloom = function() {
  this._compositeNode.inputs.bloom = "bloom_composite", this._compositor.dirty();
};
rr.prototype.disableBloom = function() {
  this._compositeNode.inputs.bloom = null, this._compositor.dirty();
};
rr.prototype.enableDOF = function() {
  this._compositeNode.inputs.texture = "dof_composite", this._compositor.dirty();
};
rr.prototype.disableDOF = function() {
  this._compositeNode.inputs.texture = "source", this._compositor.dirty();
};
rr.prototype.enableColorCorrection = function() {
  this._compositeNode.define("COLOR_CORRECTION"), this._enableColorCorrection = !0;
};
rr.prototype.disableColorCorrection = function() {
  this._compositeNode.undefine("COLOR_CORRECTION"), this._enableColorCorrection = !1;
};
rr.prototype.enableEdge = function() {
  this._enableEdge = !0;
};
rr.prototype.disableEdge = function() {
  this._enableEdge = !1;
};
rr.prototype.setBloomIntensity = function(e) {
  this._compositeNode.setParameter("bloomIntensity", e);
};
rr.prototype.setSSAOParameter = function(e, t) {
  switch (e) {
    case "quality":
      var r = {
        low: 6,
        medium: 12,
        high: 32,
        ultra: 62
      }[t] || 12;
      this._ssaoPass.setParameter("kernelSize", r);
      break;
    case "radius":
      this._ssaoPass.setParameter(e, t), this._ssaoPass.setParameter("bias", t / 200);
      break;
    case "intensity":
      this._ssaoPass.setParameter(e, t);
      break;
  }
};
rr.prototype.setDOFParameter = function(e, t) {
  switch (e) {
    case "focalDistance":
    case "focalRange":
    case "fstop":
      this._cocNode.setParameter(e, t);
      break;
    case "blurRadius":
      for (var r = 0; r < this._dofBlurNodes.length; r++)
        this._dofBlurNodes[r].setParameter("blurRadius", t);
      break;
    case "quality":
      var n = {
        low: 4,
        medium: 8,
        high: 16,
        ultra: 32
      }[t] || 8;
      this._dofBlurKernelSize = n;
      for (var r = 0; r < this._dofBlurNodes.length; r++)
        this._dofBlurNodes[r].pass.material.define("POISSON_KERNEL_SIZE", n);
      this._dofBlurKernel = new Float32Array(n * 2);
      break;
  }
};
rr.prototype.setSSRParameter = function(e, t) {
  if (t != null)
    switch (e) {
      case "quality":
        var r = {
          low: 10,
          medium: 15,
          high: 30,
          ultra: 80
        }[t] || 20, n = {
          low: 32,
          medium: 16,
          high: 8,
          ultra: 4
        }[t] || 16;
        this._ssrPass.setParameter("maxIteration", r), this._ssrPass.setParameter("pixelStride", n);
        break;
      case "maxRoughness":
        this._ssrPass.setParameter("minGlossiness", Math.max(Math.min(1 - t, 1), 0));
        break;
      case "physical":
        this.setPhysicallyCorrectSSR(t);
        break;
      default:
        console.warn("Unkown SSR parameter " + e);
    }
};
rr.prototype.setPhysicallyCorrectSSR = function(e) {
  this._ssrPass.setPhysicallyCorrect(e);
};
rr.prototype.setEdgeColor = function(e) {
  var t = J.parseColor(e);
  this._edgePass.setParameter("edgeColor", t);
};
rr.prototype.setExposure = function(e) {
  this._compositeNode.setParameter("exposure", Math.pow(2, e));
};
rr.prototype.setColorLookupTexture = function(e, t) {
  this._compositeNode.pass.material.setTextureImage("lut", this._enableColorCorrection ? e : "none", t, {
    minFilter: J.Texture.NEAREST,
    magFilter: J.Texture.NEAREST,
    flipY: !1
  });
};
rr.prototype.setColorCorrection = function(e, t) {
  this._compositeNode.setParameter(e, t);
};
rr.prototype.isSSREnabled = function() {
  return this._enableSSR;
};
rr.prototype.composite = function(e, t, r, n, i) {
  var a = this._sourceTexture, o = a;
  this._enableEdge && (this._edgePass.update(e, r, a, i), a = o = this._edgePass.getTargetTexture()), this._enableSSR && (this._ssrPass.update(e, r, a, i), o = this._ssrPass.getTargetTexture(), this._ssrPass.setSSAOTexture(this._enableSSAO ? this._ssaoPass.getTargetTexture() : null)), this._sourceNode.texture = o, this._cocNode.setParameter("depth", this._depthTexture);
  for (var s = this._dofBlurKernel, l = this._dofBlurKernelSize, u = Math.floor(vH.length / 2 / l), f = i % u, c = 0; c < l * 2; c++)
    s[c] = vH[c + f * l * 2];
  for (var c = 0; c < this._dofBlurNodes.length; c++)
    this._dofBlurNodes[c].setParameter("percent", i / 30), this._dofBlurNodes[c].setParameter("poissonKernel", s);
  this._cocNode.setParameter("zNear", r.near), this._cocNode.setParameter("zFar", r.far), this._compositor.render(e, n);
};
rr.prototype.dispose = function(e) {
  this._sourceTexture.dispose(e), this._depthTexture.dispose(e), this._framebuffer.dispose(e), this._compositor.dispose(e), this._normalPass.dispose(e), this._ssaoPass.dispose(e);
};
function qI(e) {
  for (var t = [], r = 0; r < 30; r++)
    t.push([Vm(r, 2), Vm(r, 3)]);
  this._haltonSequence = t, this._frame = 0, this._sourceTex = new Vt(), this._sourceFb = new Tn(), this._sourceFb.attach(this._sourceTex), this._prevFrameTex = new Vt(), this._outputTex = new Vt();
  var n = this._blendPass = new Pn({
    fragment: Ze.source("clay.compositor.blend")
  });
  n.material.disableTexturesAll(), n.material.enableTexture(["texture1", "texture2"]), this._blendFb = new Tn({
    depthBuffer: !1
  }), this._outputPass = new Pn({
    fragment: Ze.source("clay.compositor.output"),
    // TODO, alpha is premultiplied?
    blendWithPrevious: !0
  }), this._outputPass.material.define("fragment", "OUTPUT_ALPHA"), this._outputPass.material.blend = function(i) {
    i.blendEquationSeparate(i.FUNC_ADD, i.FUNC_ADD), i.blendFuncSeparate(i.ONE, i.ONE_MINUS_SRC_ALPHA, i.ONE, i.ONE_MINUS_SRC_ALPHA);
  };
}
qI.prototype = {
  constructor: qI,
  /**
   * Jitter camera projectionMatrix
   * @parma {clay.Renderer} renderer
   * @param {clay.Camera} camera
   */
  jitterProjection: function(e, t) {
    var r = e.viewport, n = r.devicePixelRatio || e.getDevicePixelRatio(), i = r.width * n, a = r.height * n, o = this._haltonSequence[this._frame % this._haltonSequence.length], s = new Ke();
    s.array[12] = (o[0] * 2 - 1) / i, s.array[13] = (o[1] * 2 - 1) / a, Ke.mul(t.projectionMatrix, s, t.projectionMatrix), Ke.invert(t.invProjectionMatrix, t.projectionMatrix);
  },
  /**
   * Reset accumulating frame
   */
  resetFrame: function() {
    this._frame = 0;
  },
  /**
   * Return current frame
   */
  getFrame: function() {
    return this._frame;
  },
  /**
   * Get source framebuffer for usage
   */
  getSourceFrameBuffer: function() {
    return this._sourceFb;
  },
  getOutputTexture: function() {
    return this._outputTex;
  },
  resize: function(e, t) {
    this._prevFrameTex.width = e, this._prevFrameTex.height = t, this._outputTex.width = e, this._outputTex.height = t, this._sourceTex.width = e, this._sourceTex.height = t, this._prevFrameTex.dirty(), this._outputTex.dirty(), this._sourceTex.dirty();
  },
  isFinished: function() {
    return this._frame >= this._haltonSequence.length;
  },
  render: function(e, t, r) {
    var n = this._blendPass;
    this._frame === 0 ? (n.setUniform("weight1", 0), n.setUniform("weight2", 1)) : (n.setUniform("weight1", 0.9), n.setUniform("weight2", 0.1)), n.setUniform("texture1", this._prevFrameTex), n.setUniform("texture2", t || this._sourceTex), this._blendFb.attach(this._outputTex), this._blendFb.bind(e), n.render(e), this._blendFb.unbind(e), r || (this._outputPass.setUniform("texture", this._outputTex), this._outputPass.render(e));
    var i = this._prevFrameTex;
    this._prevFrameTex = this._outputTex, this._outputTex = i, this._frame++;
  },
  dispose: function(e) {
    this._sourceFb.dispose(e), this._blendFb.dispose(e), this._prevFrameTex.dispose(e), this._outputTex.dispose(e), this._sourceTex.dispose(e), this._outputPass.dispose(e), this._blendPass.dispose(e);
  }
};
function Cr(e) {
  e = e || "perspective", this.layer = null, this.scene = new sh(), this.rootNode = this.scene, this.viewport = {
    x: 0,
    y: 0,
    width: 0,
    height: 0
  }, this.setProjection(e), this._compositor = new rr(), this._temporalSS = new qI(), this._shadowMapPass = new zl();
  for (var t = [], r = 0, n = 0; n < 30; n++) {
    for (var i = [], a = 0; a < 6; a++)
      i.push(Vm(r, 2) * 4 - 2), i.push(Vm(r, 3) * 4 - 2), r++;
    t.push(i);
  }
  this._pcfKernels = t, this.scene.on("beforerender", function(o, s, l) {
    this.needsTemporalSS() && this._temporalSS.jitterProjection(o, l);
  }, this);
}
Cr.prototype.setProjection = function(e) {
  var t = this.camera;
  t && t.update(), e === "perspective" ? this.camera instanceof ei || (this.camera = new ei(), t && this.camera.setLocalTransform(t.localTransform)) : this.camera instanceof Gm || (this.camera = new Gm(), t && this.camera.setLocalTransform(t.localTransform)), this.camera.near = 0.1, this.camera.far = 2e3;
};
Cr.prototype.setViewport = function(e, t, r, n, i) {
  this.camera instanceof ei && (this.camera.aspect = r / n), i = i || 1, this.viewport.x = e, this.viewport.y = t, this.viewport.width = r, this.viewport.height = n, this.viewport.devicePixelRatio = i, this._compositor.resize(r * i, n * i), this._temporalSS.resize(r * i, n * i);
};
Cr.prototype.containPoint = function(e, t) {
  var r = this.viewport, n = this.layer.renderer.getHeight();
  return t = n - t, e >= r.x && t >= r.y && e <= r.x + r.width && t <= r.y + r.height;
};
var dH = new Pt();
Cr.prototype.castRay = function(e, t, r) {
  var n = this.layer.renderer, i = n.viewport;
  return n.viewport = this.viewport, n.screenToNDC(e, t, dH), this.camera.castRay(dH, r), n.viewport = i, r;
};
Cr.prototype.prepareRender = function() {
  this.scene.update(), this.camera.update(), this.scene.updateLights();
  var e = this.scene.updateRenderList(this.camera);
  this._needsSortProgressively = !1;
  for (var t = 0; t < e.transparent.length; t++) {
    var r = e.transparent[t], n = r.geometry;
    n.needsSortVerticesProgressively && n.needsSortVerticesProgressively() && (this._needsSortProgressively = !0), n.needsSortTrianglesProgressively && n.needsSortTrianglesProgressively() && (this._needsSortProgressively = !0);
  }
  this._frame = 0, this._temporalSS.resetFrame();
};
Cr.prototype.render = function(e, t) {
  this._doRender(e, t, this._frame), this._frame++;
};
Cr.prototype.needsAccumulate = function() {
  return this.needsTemporalSS() || this._needsSortProgressively;
};
Cr.prototype.needsTemporalSS = function() {
  var e = this._enableTemporalSS;
  return e === "auto" && (e = this._enablePostEffect), e;
};
Cr.prototype.hasDOF = function() {
  return this._enableDOF;
};
Cr.prototype.isAccumulateFinished = function() {
  return this.needsTemporalSS() ? this._temporalSS.isFinished() : this._frame > 30;
};
Cr.prototype._doRender = function(e, t, r) {
  var n = this.scene, i = this.camera;
  r = r || 0, this._updateTransparent(e, n, i, r), t || (this._shadowMapPass.kernelPCF = this._pcfKernels[0], this._shadowMapPass.render(e, n, i, !0)), this._updateShadowPCFKernel(r);
  var a = e.clearColor;
  if (e.gl.clearColor(a[0], a[1], a[2], a[3]), this._enablePostEffect && (this.needsTemporalSS() && this._temporalSS.jitterProjection(e, i), this._compositor.updateNormal(e, n, i, this._temporalSS.getFrame())), this._updateSSAO(e, n, i, this._temporalSS.getFrame()), this._enablePostEffect) {
    var o = this._compositor.getSourceFrameBuffer();
    o.bind(e), e.gl.clear(e.gl.DEPTH_BUFFER_BIT | e.gl.COLOR_BUFFER_BIT), e.render(n, i, !0, !0), o.unbind(e), this.needsTemporalSS() && t ? (this._compositor.composite(e, n, i, this._temporalSS.getSourceFrameBuffer(), this._temporalSS.getFrame()), e.setViewport(this.viewport), this._temporalSS.render(e)) : (e.setViewport(this.viewport), this._compositor.composite(e, n, i, null, 0));
  } else if (this.needsTemporalSS() && t) {
    var o = this._temporalSS.getSourceFrameBuffer();
    o.bind(e), e.saveClear(), e.clearBit = e.gl.DEPTH_BUFFER_BIT | e.gl.COLOR_BUFFER_BIT, e.render(n, i, !0, !0), e.restoreClear(), o.unbind(e), e.setViewport(this.viewport), this._temporalSS.render(e);
  } else
    e.setViewport(this.viewport), e.render(n, i, !0, !0);
};
Cr.prototype._updateTransparent = function(e, t, r, n) {
  for (var i = new Me(), a = new Ke(), o = r.getWorldPosition(), s = t.getRenderList(r).transparent, l = 0; l < s.length; l++) {
    var u = s[l], f = u.geometry;
    Ke.invert(a, u.worldTransform), Me.transformMat4(i, o, a), f.needsSortTriangles && f.needsSortTriangles() && f.doSortTriangles(i, n), f.needsSortVertices && f.needsSortVertices() && f.doSortVertices(i, n);
  }
};
Cr.prototype._updateSSAO = function(e, t, r) {
  var n = this._enableSSAO && this._enablePostEffect;
  n && this._compositor.updateSSAO(e, t, r, this._temporalSS.getFrame());
  for (var i = t.getRenderList(r), a = 0; a < i.opaque.length; a++) {
    var o = i.opaque[a];
    o.renderNormal && o.material[n ? "enableTexture" : "disableTexture"]("ssaoMap"), n && o.material.set("ssaoMap", this._compositor.getSSAOTexture());
  }
};
Cr.prototype._updateShadowPCFKernel = function(e) {
  for (var t = this._pcfKernels[e % this._pcfKernels.length], r = this.scene.getRenderList(this.camera), n = r.opaque, i = 0; i < n.length; i++)
    n[i].receiveShadow && (n[i].material.set("pcfKernel", t), n[i].material.define("fragment", "PCF_KERNEL_SIZE", t.length / 2));
};
Cr.prototype.dispose = function(e) {
  this._compositor.dispose(e.gl), this._temporalSS.dispose(e.gl), this._shadowMapPass.dispose(e);
};
Cr.prototype.setPostEffect = function(e, t) {
  var r = this._compositor;
  this._enablePostEffect = e.get("enable");
  var n = e.getModel("bloom"), i = e.getModel("edge"), a = e.getModel("DOF", e.getModel("depthOfField")), o = e.getModel("SSAO", e.getModel("screenSpaceAmbientOcclusion")), s = e.getModel("SSR", e.getModel("screenSpaceReflection")), l = e.getModel("FXAA"), u = e.getModel("colorCorrection");
  n.get("enable") ? r.enableBloom() : r.disableBloom(), a.get("enable") ? r.enableDOF() : r.disableDOF(), s.get("enable") ? r.enableSSR() : r.disableSSR(), u.get("enable") ? r.enableColorCorrection() : r.disableColorCorrection(), i.get("enable") ? r.enableEdge() : r.disableEdge(), l.get("enable") ? r.enableFXAA() : r.disableFXAA(), this._enableDOF = a.get("enable"), this._enableSSAO = o.get("enable"), this._enableSSAO ? r.enableSSAO() : r.disableSSAO(), r.setBloomIntensity(n.get("intensity")), r.setEdgeColor(i.get("color")), r.setColorLookupTexture(u.get("lookupTexture"), t), r.setExposure(u.get("exposure")), ["radius", "quality", "intensity"].forEach(function(f) {
    r.setSSAOParameter(f, o.get(f));
  }), ["quality", "maxRoughness", "physical"].forEach(function(f) {
    r.setSSRParameter(f, s.get(f));
  }), ["quality", "focalDistance", "focalRange", "blurRadius", "fstop"].forEach(function(f) {
    r.setDOFParameter(f, a.get(f));
  }), ["brightness", "contrast", "saturation"].forEach(function(f) {
    r.setColorCorrection(f, u.get(f));
  });
};
Cr.prototype.setDOFFocusOnPoint = function(e) {
  if (this._enablePostEffect)
    return e > this.camera.far || e < this.camera.near ? void 0 : (this._compositor.setDOFParameter("focalDistance", e), !0);
};
Cr.prototype.setTemporalSuperSampling = function(e) {
  this._enableTemporalSS = e.get("enable");
};
Cr.prototype.isLinearSpace = function() {
  return this._enablePostEffect;
};
Cr.prototype.setRootNode = function(e) {
  if (this.rootNode !== e) {
    for (var t = this.rootNode.children(), r = 0; r < t.length; r++)
      e.add(t[r]);
    e !== this.scene && this.scene.add(e), this.rootNode = e;
  }
};
Cr.prototype.add = function(e) {
  this.rootNode.add(e);
};
Cr.prototype.remove = function(e) {
  this.rootNode.remove(e);
};
Cr.prototype.removeAll = function(e) {
  this.rootNode.removeAll(e);
};
Object.assign(Cr.prototype, WN);
function $xe(e, t) {
  var r = e.getBoxLayoutParams(), n = Tr(r, {
    width: t.getWidth(),
    height: t.getHeight()
  });
  n.y = t.getHeight() - n.y - n.height, this.viewGL.setViewport(n.x, n.y, n.width, n.height, t.getDevicePixelRatio());
  var i = e.get("boxWidth"), a = e.get("boxHeight"), o = e.get("boxDepth");
  this.getAxis("x").setExtent(-i / 2, i / 2), this.getAxis("y").setExtent(o / 2, -o / 2), this.getAxis("z").setExtent(-a / 2, a / 2), this.size = [i, a, o];
}
function qxe(e, t) {
  var r = {};
  function n(i, a) {
    r[i] = r[i] || [1 / 0, -1 / 0], r[i][0] = Math.min(a[0], r[i][0]), r[i][1] = Math.max(a[1], r[i][1]);
  }
  e.eachSeries(function(i) {
    if (i.coordinateSystem === this) {
      var a = i.getData();
      ["x", "y", "z"].forEach(function(o) {
        a.mapDimensionsAll(o, !0).forEach(function(s) {
          n(o, a.getDataExtent(s, !0));
        });
      });
    }
  }, this), ["xAxis3D", "yAxis3D", "zAxis3D"].forEach(function(i) {
    e.eachComponent(i, function(a) {
      var o = i.charAt(0), s = a.getReferringComponents("grid3D").models[0], l = s.coordinateSystem;
      if (l === this) {
        var u = l.getAxis(o);
        if (!u) {
          var f = GC(r[o] || [1 / 0, -1 / 0], a);
          u = new eC(o, f), u.type = a.get("type");
          var c = u.type === "category";
          u.onBand = c && a.get("boundaryGap"), u.inverse = a.get("inverse"), a.axis = u, u.model = a, u.getLabelModel = function() {
            return a.getModel("axisLabel", s.getModel("axisLabel"));
          }, u.getTickModel = function() {
            return a.getModel("axisTick", s.getModel("axisTick"));
          }, l.addAxis(u);
        }
      }
    }, this);
  }, this), this.resize(this.model, t);
}
var jxe = {
  dimensions: ux.prototype.dimensions,
  create: function(e, t) {
    var r = [];
    e.eachComponent("grid3D", function(a) {
      a.__viewGL = a.__viewGL || new Cr();
      var o = new ux();
      o.model = a, o.viewGL = a.__viewGL, a.coordinateSystem = o, r.push(o), o.resize = $xe, o.update = qxe;
    });
    var n = ["xAxis3D", "yAxis3D", "zAxis3D"];
    function i(a, o) {
      return n.map(function(s) {
        var l = a.getReferringComponents(s).models[0];
        return l == null && (l = o.getComponent(s)), l;
      });
    }
    return e.eachSeries(function(a) {
      if (a.get("coordinateSystem") === "cartesian3D") {
        var o = a.getReferringComponents("grid3D").models[0];
        if (o == null) {
          var s = i(a, e), o = s[0].getCoordSysModel();
          s.forEach(function(f) {
            f.getCoordSysModel();
          });
        }
        var l = o.coordinateSystem;
        a.coordinateSystem = l;
      }
    }), r;
  }
}, tZ = At.extend({
  type: "cartesian3DAxis",
  axis: null,
  /**
   * @override
   */
  getCoordSysModel: function() {
    return this.ecModel.queryComponents({
      mainType: "grid3D",
      index: this.option.gridIndex,
      id: this.option.gridId
    })[0];
  }
});
R6(tZ);
var rZ = {
  show: !0,
  grid3DIndex: 0,
  // 反向坐标轴
  inverse: !1,
  // 坐标轴名字
  name: "",
  // 坐标轴名字位置
  nameLocation: "middle",
  nameTextStyle: {
    fontSize: 16
  },
  // 文字与轴线距离
  nameGap: 20,
  axisPointer: {},
  axisLine: {},
  // 坐标轴小标记
  axisTick: {},
  axisLabel: {},
  // 分隔区域
  splitArea: {}
}, Kxe = je({
  // 类目起始和结束两端空白策略
  boundaryGap: !0,
  // splitArea: {
  // show: false
  // },
  // 坐标轴小标记
  axisTick: {
    // If tick is align with label when boundaryGap is true
    // Default with axisTick
    alignWithLabel: !1,
    interval: "auto"
  },
  // 坐标轴文本标签，详见axis.axisLabel
  axisLabel: {
    interval: "auto"
  },
  axisPointer: {
    label: {
      show: !1
    }
  }
}, rZ), QN = je({
  // 数值起始和结束两端空白策略
  boundaryGap: [0, 0],
  // 最小值, 设置成 'dataMin' 则从数据中计算最小值
  // min: null,
  // 最大值，设置成 'dataMax' 则从数据中计算最大值
  // max: null,
  // 脱离0值比例，放大聚焦到最终_min，_max区间
  // scale: false,
  // 分割段数，默认为5
  splitNumber: 5,
  // Minimum interval
  // minInterval: null
  axisPointer: {
    label: {}
  }
}, rZ), Qxe = tt({
  scale: !0,
  min: "dataMin",
  max: "dataMax"
}, QN), nZ = tt({
  logBase: 10
}, QN);
nZ.scale = !0;
const Jxe = {
  categoryAxis3D: Kxe,
  valueAxis3D: QN,
  timeAxis3D: Qxe,
  logAxis3D: nZ
};
var eSe = ["value", "category", "time", "log"];
function tSe(e, t, r, n, i) {
  eSe.forEach(function(a) {
    var o = r.extend({
      type: t + "Axis3D." + a,
      /**
       * @type readOnly
       */
      __ordinalMeta: null,
      mergeDefaultAndTheme: function(s, l) {
        var u = l.getTheme();
        je(s, u.get(a + "Axis3D")), je(s, this.getDefaultOption()), s.type = n(t, s);
      },
      /**
       * @override
       */
      optionUpdated: function() {
        var s = this.option;
        s.type === "category" && (this.__ordinalMeta = Mm.createByAxisModel(this));
      },
      getCategories: function() {
        if (this.option.type === "category")
          return this.__ordinalMeta.categories;
      },
      getOrdinalMeta: function() {
        return this.__ordinalMeta;
      },
      defaultOption: je(it(Jxe[a + "Axis3D"]), i || {}, !0)
    });
    e.registerComponentModel(o);
  }), e.registerSubTypeDefaulter(t + "Axis3D", St(n, t));
}
function rSe(e, t) {
  return t.type || (t.data ? "category" : "value");
}
function nSe(e) {
  e.registerComponentModel(nA), e.registerComponentView(_xe), e.registerCoordinateSystem("grid3D", jxe), ["x", "y", "z"].forEach(function(t) {
    tSe(e, t, tZ, rSe, {
      name: t.toUpperCase()
    });
    const r = e.ComponentView.extend({
      type: t + "Axis3D"
    });
    e.registerComponentView(r);
  }), e.registerAction({
    type: "grid3DChangeCamera",
    event: "grid3dcamerachanged",
    update: "series:updateCamera"
  }, function(t, r) {
    r.eachComponent({
      mainType: "grid3D",
      query: t
    }, function(n) {
      n.setView(t);
    });
  }), e.registerAction({
    type: "grid3DShowAxisPointer",
    event: "grid3dshowaxispointer",
    update: "grid3D:showAxisPointer"
  }, function(t, r) {
  }), e.registerAction({
    type: "grid3DHideAxisPointer",
    event: "grid3dhideaxispointer",
    update: "grid3D:hideAxisPointer"
  }, function(t, r) {
  });
}
ft(nSe);
const gy = {
  defaultOption: {
    shading: null,
    realisticMaterial: {
      textureTiling: 1,
      textureOffset: 0,
      detailTexture: null
    },
    lambertMaterial: {
      textureTiling: 1,
      textureOffset: 0,
      detailTexture: null
    },
    colorMaterial: {
      textureTiling: 1,
      textureOffset: 0,
      detailTexture: null
    },
    hatchingMaterial: {
      textureTiling: 1,
      textureOffset: 0,
      paperColor: "#fff"
    }
  }
}, iZ = {
  getFilledRegions: function(e, t) {
    var r = (e || []).slice(), n;
    if (typeof t == "string" ? (t = db(t), n = t && t.geoJson) : t && t.features && (n = t), !n)
      return [];
    for (var i = {}, a = n.features, o = 0; o < r.length; o++)
      i[r[o].name] = r[o];
    for (var o = 0; o < a.length; o++) {
      var s = a[o].properties.name;
      i[s] || r.push({
        name: s
      });
    }
    return r;
  },
  defaultOption: {
    show: !0,
    zlevel: -10,
    // geoJson used by geo3D
    map: "",
    // Layout used for viewport
    left: 0,
    top: 0,
    width: "100%",
    height: "100%",
    boxWidth: 100,
    boxHeight: 10,
    boxDepth: "auto",
    regionHeight: 3,
    environment: "auto",
    groundPlane: {
      show: !1,
      color: "#aaa"
    },
    shading: "lambert",
    light: {
      main: {
        alpha: 40,
        beta: 30
      }
    },
    viewControl: {
      alpha: 40,
      beta: 0,
      distance: 100,
      orthographicSize: 60,
      minAlpha: 5,
      minBeta: -80,
      maxBeta: 80
    },
    label: {
      show: !1,
      // Distance in 3d space.
      distance: 2,
      textStyle: {
        fontSize: 20,
        color: "#000",
        backgroundColor: "rgba(255,255,255,0.7)",
        padding: 3,
        borderRadius: 4
      }
    },
    // TODO
    // altitude: {
    //     min: 'auto',
    //     max: 'auto',
    //     height: []
    // },
    // labelLine
    // light
    // postEffect
    // temporalSuperSampling
    itemStyle: {
      color: "#fff",
      borderWidth: 0,
      borderColor: "#333"
    },
    emphasis: {
      itemStyle: {
        // color: '#f94b59'
        color: "#639fc0"
      },
      label: {
        show: !0
      }
    }
  }
};
var my = At.extend({
  type: "geo3D",
  layoutMode: "box",
  coordinateSystem: null,
  optionUpdated: function() {
    var e = this.option;
    e.regions = this.getFilledRegions(e.regions, e.map);
    var t = ah(e.data || [], {
      coordDimensions: ["value"],
      encodeDefine: this.get("encode"),
      dimensionsDefine: this.get("dimensions")
    }), r = new zr(t, this);
    r.initData(e.regions);
    var n = {};
    r.each(function(i) {
      var a = r.getName(i), o = r.getItemModel(i);
      n[a] = o;
    }), this._regionModelMap = n, this._data = r;
  },
  getData: function() {
    return this._data;
  },
  getRegionModel: function(e) {
    var t = this.getData().getName(e);
    return this._regionModelMap[t] || new It(null, this);
  },
  getRegionPolygonCoords: function(e) {
    var t = this.getData().getName(e), r = this.coordinateSystem.getRegion(t);
    return r ? r.geometries : [];
  },
  /**
   * Format label
   * @param {string} name Region name
   * @param {string} [status='normal'] 'normal' or 'emphasis'
   * @return {string}
   */
  getFormattedLabel: function(e, t) {
    var r = this._data.getName(e), n = this.getRegionModel(e), i = n.get(t === "normal" ? ["label", "formatter"] : ["emphasis", "label", "formatter"]);
    i == null && (i = n.get(["label", "formatter"]));
    var a = {
      name: r
    };
    if (typeof i == "function")
      return a.status = t, i(a);
    if (typeof i == "string") {
      var o = a.seriesName;
      return i.replace("{a}", o ?? "");
    } else
      return r;
  },
  defaultOption: {
    // itemStyle: {},
    // height,
    // label: {}
    // realisticMaterial
    regions: []
  }
});
je(my.prototype, iZ);
je(my.prototype, rA);
je(my.prototype, vy);
je(my.prototype, dy);
je(my.prototype, gy);
function aZ(e, t, r) {
  r = r || 2;
  var n = t && t.length, i = n ? t[0] * r : e.length, a = oZ(e, 0, i, r, !0), o = [];
  if (!a) return o;
  var s, l, u, f, c, h, v;
  if (n && (a = lSe(e, t, a, r)), e.length > 80 * r) {
    s = u = e[0], l = f = e[1];
    for (var d = r; d < i; d += r)
      c = e[d], h = e[d + 1], c < s && (s = c), h < l && (l = h), c > u && (u = c), h > f && (f = h);
    v = Math.max(u - s, f - l);
  }
  return hx(a, o, r, s, l, v), o;
}
function oZ(e, t, r, n, i) {
  var a, o;
  if (i === QI(e, t, r, n) > 0)
    for (a = t; a < r; a += n) o = pH(a, e[a], e[a + 1], o);
  else
    for (a = r - n; a >= t; a -= n) o = pH(a, e[a], e[a + 1], o);
  return o && ud(o, o.next) && (dx(o), o = o.next), o;
}
function cx(e, t) {
  if (!e) return e;
  t || (t = e);
  var r = e, n;
  do
    if (n = !1, !r.steiner && (ud(r, r.next) || _a(r.prev, r, r.next) === 0)) {
      if (dx(r), r = t = r.prev, r === r.next) return null;
      n = !0;
    } else
      r = r.next;
  while (n || r !== t);
  return t;
}
function hx(e, t, r, n, i, a, o) {
  if (e) {
    !o && a && hSe(e, n, i, a);
    for (var s = e, l, u; e.prev !== e.next; ) {
      if (l = e.prev, u = e.next, a ? aSe(e, n, i, a) : iSe(e)) {
        t.push(l.i / r), t.push(e.i / r), t.push(u.i / r), dx(e), e = u.next, s = u.next;
        continue;
      }
      if (e = u, e === s) {
        o ? o === 1 ? (e = oSe(e, t, r), hx(e, t, r, n, i, a, 2)) : o === 2 && sSe(e, t, r, n, i, a) : hx(cx(e), t, r, n, i, a, 1);
        break;
      }
    }
  }
}
function iSe(e) {
  var t = e.prev, r = e, n = e.next;
  if (_a(t, r, n) >= 0) return !1;
  for (var i = e.next.next; i !== e.prev; ) {
    if (rC(t.x, t.y, r.x, r.y, n.x, n.y, i.x, i.y) && _a(i.prev, i, i.next) >= 0) return !1;
    i = i.next;
  }
  return !0;
}
function aSe(e, t, r, n) {
  var i = e.prev, a = e, o = e.next;
  if (_a(i, a, o) >= 0) return !1;
  for (var s = i.x < a.x ? i.x < o.x ? i.x : o.x : a.x < o.x ? a.x : o.x, l = i.y < a.y ? i.y < o.y ? i.y : o.y : a.y < o.y ? a.y : o.y, u = i.x > a.x ? i.x > o.x ? i.x : o.x : a.x > o.x ? a.x : o.x, f = i.y > a.y ? i.y > o.y ? i.y : o.y : a.y > o.y ? a.y : o.y, c = jI(s, l, t, r, n), h = jI(u, f, t, r, n), v = e.nextZ; v && v.z <= h; ) {
    if (v !== e.prev && v !== e.next && rC(i.x, i.y, a.x, a.y, o.x, o.y, v.x, v.y) && _a(v.prev, v, v.next) >= 0) return !1;
    v = v.nextZ;
  }
  for (v = e.prevZ; v && v.z >= c; ) {
    if (v !== e.prev && v !== e.next && rC(i.x, i.y, a.x, a.y, o.x, o.y, v.x, v.y) && _a(v.prev, v, v.next) >= 0) return !1;
    v = v.prevZ;
  }
  return !0;
}
function oSe(e, t, r) {
  var n = e;
  do {
    var i = n.prev, a = n.next.next;
    !ud(i, a) && sZ(i, n, n.next, a) && vx(i, a) && vx(a, i) && (t.push(i.i / r), t.push(n.i / r), t.push(a.i / r), dx(n), dx(n.next), n = e = a), n = n.next;
  } while (n !== e);
  return n;
}
function sSe(e, t, r, n, i, a) {
  var o = e;
  do {
    for (var s = o.next.next; s !== o.prev; ) {
      if (o.i !== s.i && pSe(o, s)) {
        var l = lZ(o, s);
        o = cx(o, o.next), l = cx(l, l.next), hx(o, t, r, n, i, a), hx(l, t, r, n, i, a);
        return;
      }
      s = s.next;
    }
    o = o.next;
  } while (o !== e);
}
function lSe(e, t, r, n) {
  var i = [], a, o, s, l, u;
  for (a = 0, o = t.length; a < o; a++)
    s = t[a] * n, l = a < o - 1 ? t[a + 1] * n : e.length, u = oZ(e, s, l, n, !1), u === u.next && (u.steiner = !0), i.push(dSe(u));
  for (i.sort(uSe), a = 0; a < i.length; a++)
    fSe(i[a], r), r = cx(r, r.next);
  return r;
}
function uSe(e, t) {
  return e.x - t.x;
}
function fSe(e, t) {
  if (t = cSe(e, t), t) {
    var r = lZ(t, e);
    cx(r, r.next);
  }
}
function cSe(e, t) {
  var r = t, n = e.x, i = e.y, a = -1 / 0, o;
  do {
    if (i <= r.y && i >= r.next.y && r.next.y !== r.y) {
      var s = r.x + (i - r.y) * (r.next.x - r.x) / (r.next.y - r.y);
      if (s <= n && s > a) {
        if (a = s, s === n) {
          if (i === r.y) return r;
          if (i === r.next.y) return r.next;
        }
        o = r.x < r.next.x ? r : r.next;
      }
    }
    r = r.next;
  } while (r !== t);
  if (!o) return null;
  if (n === a) return o.prev;
  var l = o, u = o.x, f = o.y, c = 1 / 0, h;
  for (r = o.next; r !== l; )
    n >= r.x && r.x >= u && n !== r.x && rC(i < f ? n : a, i, u, f, i < f ? a : n, i, r.x, r.y) && (h = Math.abs(i - r.y) / (n - r.x), (h < c || h === c && r.x > o.x) && vx(r, e) && (o = r, c = h)), r = r.next;
  return o;
}
function hSe(e, t, r, n) {
  var i = e;
  do
    i.z === null && (i.z = jI(i.x, i.y, t, r, n)), i.prevZ = i.prev, i.nextZ = i.next, i = i.next;
  while (i !== e);
  i.prevZ.nextZ = null, i.prevZ = null, vSe(i);
}
function vSe(e) {
  var t, r, n, i, a, o, s, l, u = 1;
  do {
    for (r = e, e = null, a = null, o = 0; r; ) {
      for (o++, n = r, s = 0, t = 0; t < u && (s++, n = n.nextZ, !!n); t++)
        ;
      for (l = u; s > 0 || l > 0 && n; )
        s !== 0 && (l === 0 || !n || r.z <= n.z) ? (i = r, r = r.nextZ, s--) : (i = n, n = n.nextZ, l--), a ? a.nextZ = i : e = i, i.prevZ = a, a = i;
      r = n;
    }
    a.nextZ = null, u *= 2;
  } while (o > 1);
  return e;
}
function jI(e, t, r, n, i) {
  return e = 32767 * (e - r) / i, t = 32767 * (t - n) / i, e = (e | e << 8) & 16711935, e = (e | e << 4) & 252645135, e = (e | e << 2) & 858993459, e = (e | e << 1) & 1431655765, t = (t | t << 8) & 16711935, t = (t | t << 4) & 252645135, t = (t | t << 2) & 858993459, t = (t | t << 1) & 1431655765, e | t << 1;
}
function dSe(e) {
  var t = e, r = e;
  do
    t.x < r.x && (r = t), t = t.next;
  while (t !== e);
  return r;
}
function rC(e, t, r, n, i, a, o, s) {
  return (i - o) * (t - s) - (e - o) * (a - s) >= 0 && (e - o) * (n - s) - (r - o) * (t - s) >= 0 && (r - o) * (a - s) - (i - o) * (n - s) >= 0;
}
function pSe(e, t) {
  return e.next.i !== t.i && e.prev.i !== t.i && !gSe(e, t) && vx(e, t) && vx(t, e) && mSe(e, t);
}
function _a(e, t, r) {
  return (t.y - e.y) * (r.x - t.x) - (t.x - e.x) * (r.y - t.y);
}
function ud(e, t) {
  return e.x === t.x && e.y === t.y;
}
function sZ(e, t, r, n) {
  return ud(e, t) && ud(r, n) || ud(e, n) && ud(r, t) ? !0 : _a(e, t, r) > 0 != _a(e, t, n) > 0 && _a(r, n, e) > 0 != _a(r, n, t) > 0;
}
function gSe(e, t) {
  var r = e;
  do {
    if (r.i !== e.i && r.next.i !== e.i && r.i !== t.i && r.next.i !== t.i && sZ(r, r.next, e, t)) return !0;
    r = r.next;
  } while (r !== e);
  return !1;
}
function vx(e, t) {
  return _a(e.prev, e, e.next) < 0 ? _a(e, t, e.next) >= 0 && _a(e, e.prev, t) >= 0 : _a(e, t, e.prev) < 0 || _a(e, e.next, t) < 0;
}
function mSe(e, t) {
  var r = e, n = !1, i = (e.x + t.x) / 2, a = (e.y + t.y) / 2;
  do
    r.y > a != r.next.y > a && r.next.y !== r.y && i < (r.next.x - r.x) * (a - r.y) / (r.next.y - r.y) + r.x && (n = !n), r = r.next;
  while (r !== e);
  return n;
}
function lZ(e, t) {
  var r = new KI(e.i, e.x, e.y), n = new KI(t.i, t.x, t.y), i = e.next, a = t.prev;
  return e.next = t, t.prev = e, r.next = i, i.prev = r, n.next = r, r.prev = n, a.next = n, n.prev = a, n;
}
function pH(e, t, r, n) {
  var i = new KI(e, t, r);
  return n ? (i.next = n.next, i.prev = n, n.next.prev = i, n.next = i) : (i.prev = i, i.next = i), i;
}
function dx(e) {
  e.next.prev = e.prev, e.prev.next = e.next, e.prevZ && (e.prevZ.nextZ = e.nextZ), e.nextZ && (e.nextZ.prevZ = e.prevZ);
}
function KI(e, t, r) {
  this.i = e, this.x = t, this.y = r, this.prev = null, this.next = null, this.z = null, this.prevZ = null, this.nextZ = null, this.steiner = !1;
}
aZ.deviation = function(e, t, r, n) {
  var i = t && t.length, a = i ? t[0] * r : e.length, o = Math.abs(QI(e, 0, a, r));
  if (i)
    for (var s = 0, l = t.length; s < l; s++) {
      var u = t[s] * r, f = s < l - 1 ? t[s + 1] * r : e.length;
      o -= Math.abs(QI(e, u, f, r));
    }
  var c = 0;
  for (s = 0; s < n.length; s += 3) {
    var h = n[s] * r, v = n[s + 1] * r, d = n[s + 2] * r;
    c += Math.abs((e[h] - e[d]) * (e[v + 1] - e[h + 1]) - (e[h] - e[v]) * (e[d + 1] - e[h + 1]));
  }
  return o === 0 && c === 0 ? 0 : Math.abs((c - o) / o);
};
function QI(e, t, r, n) {
  for (var i = 0, a = t, o = r - n; a < r; a += n)
    i += (e[o] - e[a]) * (e[a + 1] + e[o + 1]), o = a;
  return i;
}
function mE(e, t, r) {
  var n = e[t];
  e[t] = e[r], e[r] = n;
}
function uZ(e, t, r, n, i) {
  var a = r, o = e[t];
  mE(e, t, n);
  for (var s = r; s < n; s++)
    i(e[s], o) < 0 && (mE(e, s, a), a++);
  return mE(e, n, a), a;
}
function nC(e, t, r, n) {
  if (r < n) {
    var i = Math.floor((r + n) / 2), a = uZ(e, i, r, n, t);
    nC(e, t, r, a - 1), nC(e, t, a + 1, n);
  }
}
function Hm() {
  this._parts = [];
}
Hm.prototype.step = function(e, t, r) {
  var n = e.length;
  if (r === 0) {
    this._parts = [], this._sorted = !1;
    var i = Math.floor(n / 2);
    this._parts.push({
      pivot: i,
      left: 0,
      right: n - 1
    }), this._currentSortPartIdx = 0;
  }
  if (!this._sorted) {
    var a = this._parts;
    if (a.length === 0)
      return this._sorted = !0, !0;
    if (a.length < 512) {
      for (var o = 0; o < a.length; o++)
        a[o].pivot = uZ(e, a[o].pivot, a[o].left, a[o].right, t);
      for (var s = [], o = 0; o < a.length; o++) {
        var l = a[o].left, u = a[o].pivot - 1;
        u > l && s.push({
          pivot: Math.floor((u + l) / 2),
          left: l,
          right: u
        });
        var l = a[o].pivot + 1, u = a[o].right;
        u > l && s.push({
          pivot: Math.floor((u + l) / 2),
          left: l,
          right: u
        });
      }
      a = this._parts = s;
    } else
      for (var o = 0; o < Math.floor(a.length / 10); o++) {
        var f = a.length - 1 - this._currentSortPartIdx;
        if (nC(e, t, a[f].left, a[f].right), this._currentSortPartIdx++, this._currentSortPartIdx === a.length)
          return this._sorted = !0, !0;
      }
    return !1;
  }
};
Hm.sort = nC;
var ym = bn.vec3, gH = ym.create(), mH = ym.create(), yH = ym.create();
const JN = {
  needsSortTriangles: function() {
    return this.indices && this.sortTriangles;
  },
  needsSortTrianglesProgressively: function() {
    return this.needsSortTriangles() && this.triangleCount >= 2e4;
  },
  doSortTriangles: function(e, t) {
    var r = this.indices;
    if (t === 0) {
      var n = this.attributes.position, e = e.array;
      (!this._triangleZList || this._triangleZList.length !== this.triangleCount) && (this._triangleZList = new Float32Array(this.triangleCount), this._sortedTriangleIndices = new Uint32Array(this.triangleCount), this._indicesTmp = new r.constructor(r.length), this._triangleZListTmp = new Float32Array(this.triangleCount));
      for (var i = 0, a, o = 0; o < r.length; ) {
        n.get(r[o++], gH), n.get(r[o++], mH), n.get(r[o++], yH);
        var s = ym.sqrDist(gH, e), l = ym.sqrDist(mH, e), u = ym.sqrDist(yH, e), f = Math.min(s, l);
        f = Math.min(f, u), o === 3 ? (a = f, f = 0) : f = f - a, this._triangleZList[i++] = f;
      }
    }
    for (var c = this._sortedTriangleIndices, o = 0; o < c.length; o++)
      c[o] = o;
    if (this.triangleCount < 2e4)
      t === 0 && this._simpleSort(!0);
    else
      for (var o = 0; o < 3; o++)
        this._progressiveQuickSort(t * 3 + o);
    for (var h = this._indicesTmp, v = this._triangleZListTmp, d = this._triangleZList, o = 0; o < this.triangleCount; o++) {
      var g = c[o] * 3, y = o * 3;
      h[y++] = r[g++], h[y++] = r[g++], h[y] = r[g], v[o] = d[c[o]];
    }
    var x = this._indicesTmp;
    this._indicesTmp = this.indices, this.indices = x;
    var x = this._triangleZListTmp;
    this._triangleZListTmp = this._triangleZList, this._triangleZList = x, this.dirtyIndices();
  },
  _simpleSort: function(e) {
    var t = this._triangleZList, r = this._sortedTriangleIndices;
    function n(i, a) {
      return t[a] - t[i];
    }
    e ? Array.prototype.sort.call(r, n) : Hm.sort(r, n, 0, r.length - 1);
  },
  _progressiveQuickSort: function(e) {
    var t = this._triangleZList, r = this._sortedTriangleIndices;
    this._quickSort = this._quickSort || new Hm(), this._quickSort.step(r, function(n, i) {
      return t[i] - t[n];
    }, e);
  }
};
function ySe(e) {
  const t = e.getVisual("style");
  if (t) {
    const r = e.getVisual("drawType");
    return t[r];
  }
}
function _Se(e) {
  return e.getVisual("style").opacity;
}
function oi(e, t) {
  const r = e.getItemVisual(t, "style");
  if (r) {
    const n = e.getVisual("drawType");
    return r[n];
  }
}
function ni(e, t) {
  const r = e.getItemVisual(t, "style");
  return r && r.opacity;
}
var fZ = 1, cZ = 2;
function Lf(e, t, r) {
  this._labelsMesh = new $N(), this._labelTextureSurface = new Jb({
    width: 512,
    height: 512,
    devicePixelRatio: r.getDevicePixelRatio(),
    onupdate: function() {
      r.getZr().refresh();
    }
  }), this._api = r, this._labelsMesh.material.set("textureAtlas", this._labelTextureSurface.getTexture());
}
Lf.prototype.getLabelPosition = function(e, t, r) {
  return [0, 0, 0];
};
Lf.prototype.getLabelDistance = function(e, t, r) {
  return 0;
};
Lf.prototype.getMesh = function() {
  return this._labelsMesh;
};
Lf.prototype.updateData = function(e, t, r) {
  t == null && (t = 0), r == null && (r = e.count()), (!this._labelsVisibilitiesBits || this._labelsVisibilitiesBits.length !== r - t) && (this._labelsVisibilitiesBits = new Uint8Array(r - t));
  for (var n = ["label", "show"], i = ["emphasis", "label", "show"], a = t; a < r; a++) {
    var o = e.getItemModel(a), s = o.get(n), l = o.get(i);
    l == null && (l = s);
    var u = (s ? fZ : 0) | (l ? cZ : 0);
    this._labelsVisibilitiesBits[a - t] = u;
  }
  this._start = t, this._end = r, this._data = e;
};
Lf.prototype.updateLabels = function(e) {
  if (this._data) {
    e = e || [];
    for (var t = e.length > 0, r = {}, n = 0; n < e.length; n++)
      r[e[n]] = !0;
    this._labelsMesh.geometry.convertToDynamicArray(!0), this._labelTextureSurface.clear();
    for (var i = ["label"], a = ["emphasis", "label"], o = this._data.hostModel, s = this._data, l = o.getModel(i), u = o.getModel(a, l), f = {
      left: "right",
      right: "left",
      top: "center",
      bottom: "center"
    }, c = {
      left: "middle",
      right: "middle",
      top: "bottom",
      bottom: "top"
    }, h = this._start; h < this._end; h++) {
      var v = !1;
      t && r[h] && (v = !0);
      var d = this._labelsVisibilitiesBits[h - this._start] & (v ? cZ : fZ);
      if (d) {
        var g = s.getItemModel(h), y = g.getModel(v ? a : i, v ? u : l), x = y.get("distance") || 0, S = y.get("position"), T = this._api.getDevicePixelRatio(), C = o.getFormattedLabel(h, v ? "emphasis" : "normal");
        if (C == null || C === "")
          return;
        var A = new Rt({
          style: gr(y, {
            text: C,
            fill: y.get("color") || oi(s, h) || "#000",
            align: "left",
            verticalAlign: "top",
            opacity: qt.firstNotNull(y.get("opacity"), ni(s, h), 1)
          })
        }), M = A.getBoundingRect(), E = 1.2;
        M.height *= E;
        var P = this._labelTextureSurface.add(A), R = f[S] || "center", O = c[S] || "bottom";
        this._labelsMesh.geometry.addSprite(this.getLabelPosition(h, S, x), [M.width * T, M.height * T], P, R, O, this.getLabelDistance(h, S, x) * T);
      }
    }
    this._labelsMesh.material.set("uvScale", this._labelTextureSurface.getCoordsScale()), this._labelTextureSurface.getZr().refreshImmediately(), this._labelsMesh.geometry.convertToTypedArray(), this._labelsMesh.geometry.dirty();
  }
};
Lf.prototype.dispose = function() {
  this._labelTextureSurface.dispose();
};
var Ua = bn.vec3;
J.Shader.import(aA);
function Um(e) {
  this.rootNode = new J.Node(), this._triangulationResults = {}, this._shadersMap = J.COMMON_SHADERS.filter(function(r) {
    return r !== "shadow";
  }).reduce(function(r, n) {
    return r[n] = J.createShader("ecgl." + n), r;
  }, {}), this._linesShader = J.createShader("ecgl.meshLines3D");
  var t = {};
  J.COMMON_SHADERS.forEach(function(r) {
    t[r] = new J.Material({
      shader: J.createShader("ecgl." + r)
    });
  }), this._groundMaterials = t, this._groundMesh = new J.Mesh({
    geometry: new J.PlaneGeometry({
      dynamic: !0
    }),
    castShadow: !1,
    renderNormal: !0,
    $ignorePicking: !0
  }), this._groundMesh.rotation.rotateX(-Math.PI / 2), this._labelsBuilder = new Lf(512, 512, e), this._labelsBuilder.getMesh().renderOrder = 100, this._labelsBuilder.getMesh().material.depthTest = !1, this.rootNode.add(this._labelsBuilder.getMesh()), this._initMeshes(), this._api = e;
}
Um.prototype = {
  constructor: Um,
  // Which dimension to extrude. Y or Z
  extrudeY: !0,
  update: function(e, t, r, n, i) {
    var a = e.getData();
    n == null && (n = 0), i == null && (i = a.count()), this._startIndex = n, this._endIndex = i - 1, this._triangulation(e, n, i);
    var o = this._getShader(e.get("shading"));
    this._prepareMesh(e, o, r, n, i), this.rootNode.updateWorldTransform(), this._updateRegionMesh(e, r, n, i);
    var s = e.coordinateSystem;
    s.type === "geo3D" && this._updateGroundPlane(e, s, r);
    var l = this;
    this._labelsBuilder.updateData(a, n, i), this._labelsBuilder.getLabelPosition = function(u, f, c) {
      var h = a.getName(u), v, d = c;
      if (s.type === "geo3D") {
        var g = s.getRegion(h);
        if (!g)
          return [NaN, NaN, NaN];
        v = g.getCenter();
        var y = s.dataToPoint([v[0], v[1], d]);
        return y;
      } else
        var x = l._triangulationResults[u - l._startIndex], v = l.extrudeY ? [(x.max[0] + x.min[0]) / 2, x.max[1] + d, (x.max[2] + x.min[2]) / 2] : [(x.max[0] + x.min[0]) / 2, (x.max[1] + x.min[1]) / 2, x.max[2] + d];
    }, this._data = a, this._labelsBuilder.updateLabels(), this._updateDebugWireframe(e), this._lastHoverDataIndex = 0;
  },
  _initMeshes: function() {
    var e = this;
    function t() {
      var i = new J.Mesh({
        name: "Polygon",
        material: new J.Material({
          shader: e._shadersMap.lambert
        }),
        geometry: new J.Geometry({
          sortTriangles: !0,
          dynamic: !0
        }),
        // TODO Disable culling
        culling: !1,
        ignorePicking: !0,
        // Render normal in normal pass
        renderNormal: !0
      });
      return Object.assign(i.geometry, JN), i;
    }
    var r = t(), n = new J.Mesh({
      material: new J.Material({
        shader: this._linesShader
      }),
      castShadow: !1,
      ignorePicking: !0,
      $ignorePicking: !0,
      geometry: new lh({
        useNativeLine: !1
      })
    });
    this.rootNode.add(r), this.rootNode.add(n), r.material.define("both", "VERTEX_COLOR"), r.material.define("fragment", "DOUBLE_SIDED"), this._polygonMesh = r, this._linesMesh = n, this.rootNode.add(this._groundMesh);
  },
  _getShader: function(e) {
    var t = this._shadersMap[e];
    return t || (t = this._shadersMap.lambert), t.__shading = e, t;
  },
  _prepareMesh: function(e, t, r, n, i) {
    for (var a = 0, o = 0, s = 0, l = 0, u = n; u < i; u++) {
      var f = this._getRegionPolygonInfo(u), c = this._getRegionLinesInfo(u, e, this._linesMesh.geometry);
      a += f.vertexCount, o += f.triangleCount, s += c.vertexCount, l += c.triangleCount;
    }
    var h = this._polygonMesh, v = h.geometry;
    ["position", "normal", "texcoord0", "color"].forEach(function(d) {
      v.attributes[d].init(a);
    }), v.indices = a > 65535 ? new Uint32Array(o * 3) : new Uint16Array(o * 3), h.material.shader !== t && h.material.attachShader(t, !0), J.setMaterialFromModel(t.__shading, h.material, e, r), s > 0 && (this._linesMesh.geometry.resetOffset(), this._linesMesh.geometry.setVertexCount(s), this._linesMesh.geometry.setTriangleCount(l)), this._dataIndexOfVertex = new Uint32Array(a), this._vertexRangeOfDataIndex = new Uint32Array((i - n) * 2);
  },
  _updateRegionMesh: function(e, t, r, n) {
    for (var i = e.getData(), a = 0, o = 0, s = !1, M = this._polygonMesh, l = this._linesMesh, u = r; u < n; u++) {
      var f = e.getRegionModel(u), c = f.getModel("itemStyle"), h = qt.firstNotNull(oi(i, u), c.get("color"), "#fff"), v = qt.firstNotNull(ni(i, u), c.get("opacity"), 1), d = J.parseColor(h), g = J.parseColor(c.get("borderColor"));
      d[3] *= v, g[3] *= v;
      var y = d[3] < 0.99;
      M.material.set("color", [1, 1, 1, 1]), s = s || y;
      for (var x = qt.firstNotNull(f.get("height", !0), e.get("regionHeight")), S = this._updatePolygonGeometry(e, M.geometry, u, x, a, o, d), T = a; T < S.vertexOffset; T++)
        this._dataIndexOfVertex[T] = u;
      this._vertexRangeOfDataIndex[(u - r) * 2] = a, this._vertexRangeOfDataIndex[(u - r) * 2 + 1] = S.vertexOffset, a = S.vertexOffset, o = S.triangleOffset;
      var C = c.get("borderWidth"), A = C > 0;
      A && (C *= t.getDevicePixelRatio(), this._updateLinesGeometry(l.geometry, e, u, x, C, e.coordinateSystem.transform)), l.invisible = !A, l.material.set({
        color: g
      });
    }
    var M = this._polygonMesh;
    M.material.transparent = s, M.material.depthMask = !s, M.geometry.updateBoundingBox(), M.frontFace = this.extrudeY ? J.Mesh.CCW : J.Mesh.CW, M.material.get("normalMap") && M.geometry.generateTangents(), M.seriesIndex = e.seriesIndex, M.on("mousemove", this._onmousemove, this), M.on("mouseout", this._onmouseout, this);
  },
  _updateDebugWireframe: function(e) {
    var t = e.getModel("debug.wireframe");
    if (t.get("show")) {
      var r = J.parseColor(t.get("lineStyle.color") || "rgba(0,0,0,0.5)"), n = qt.firstNotNull(t.get("lineStyle.width"), 1), i = this._polygonMesh;
      i.geometry.generateBarycentric(), i.material.define("both", "WIREFRAME_TRIANGLE"), i.material.set("wireframeLineColor", r), i.material.set("wireframeLineWidth", n);
    }
  },
  _onmousemove: function(e) {
    var t = this._dataIndexOfVertex[e.triangle[0]];
    t == null && (t = -1), t !== this._lastHoverDataIndex && (this.downplay(this._lastHoverDataIndex), this.highlight(t), this._labelsBuilder.updateLabels([t])), this._lastHoverDataIndex = t, this._polygonMesh.dataIndex = t;
  },
  _onmouseout: function(e) {
    e.target && (this.downplay(this._lastHoverDataIndex), this._lastHoverDataIndex = -1, this._polygonMesh.dataIndex = -1), this._labelsBuilder.updateLabels([]);
  },
  _updateGroundPlane: function(e, t, r) {
    var n = e.getModel("groundPlane", e);
    if (this._groundMesh.invisible = !n.get("show", !0), !this._groundMesh.invisible) {
      var i = e.get("shading"), a = this._groundMaterials[i];
      a || (a = this._groundMaterials.lambert), J.setMaterialFromModel(i, a, n, r), a.get("normalMap") && this._groundMesh.geometry.generateTangents(), this._groundMesh.material = a, this._groundMesh.material.set("color", J.parseColor(n.get("color"))), this._groundMesh.scale.set(t.size[0], t.size[2], 1);
    }
  },
  _triangulation: function(e, t, r) {
    this._triangulationResults = [];
    for (var n = [1 / 0, 1 / 0, 1 / 0], i = [-1 / 0, -1 / 0, -1 / 0], a = e.coordinateSystem, o = t; o < r; o++) {
      for (var s = [], l = e.getRegionPolygonCoords(o), u = 0; u < l.length; u++) {
        var f = l[u].exterior, c = l[u].interiors, h = [], v = [];
        if (!(f.length < 3)) {
          for (var d = 0, g = 0; g < f.length; g++) {
            var y = f[g];
            h[d++] = y[0], h[d++] = y[1];
          }
          for (var g = 0; g < c.length; g++)
            if (!(c[g].length < 3)) {
              for (var x = h.length / 2, S = 0; S < c[g].length; S++) {
                var y = c[g][S];
                h.push(y[0]), h.push(y[1]);
              }
              v.push(x);
            }
          for (var T = aZ(h, v), C = new Float64Array(h.length / 2 * 3), A = [], M = [1 / 0, 1 / 0, 1 / 0], E = [-1 / 0, -1 / 0, -1 / 0], P = 0, g = 0; g < h.length; )
            Ua.set(A, h[g++], 0, h[g++]), a && a.transform && Ua.transformMat4(A, A, a.transform), Ua.min(M, M, A), Ua.max(E, E, A), C[P++] = A[0], C[P++] = A[1], C[P++] = A[2];
          Ua.min(n, n, M), Ua.max(i, i, E), s.push({
            points: C,
            indices: T,
            min: M,
            max: E
          });
        }
      }
      this._triangulationResults.push(s);
    }
    this._geoBoundingBox = [n, i];
  },
  /**
   * Get region vertex and triangle count
   */
  _getRegionPolygonInfo: function(e) {
    for (var t = this._triangulationResults[e - this._startIndex], r = 0, n = 0, i = 0; i < t.length; i++)
      r += t[i].points.length / 3, n += t[i].indices.length / 3;
    var a = r * 2 + r * 4, o = n * 2 + r * 2;
    return {
      vertexCount: a,
      triangleCount: o
    };
  },
  _updatePolygonGeometry: function(e, t, r, n, i, a, o) {
    var s = e.get("projectUVOnGround"), l = t.attributes.position, u = t.attributes.normal, f = t.attributes.texcoord0, c = t.attributes.color, h = this._triangulationResults[r - this._startIndex], v = c.value && o, d = t.indices, g = this.extrudeY ? 1 : 2, y = this.extrudeY ? 2 : 1, x = [this.rootNode.worldTransform.x.len(), this.rootNode.worldTransform.y.len(), this.rootNode.worldTransform.z.len()], S = Ua.mul([], this._geoBoundingBox[0], x), T = Ua.mul([], this._geoBoundingBox[1], x), C = Math.max(T[0] - S[0], T[2] - S[2]);
    function A(de, ve, Ae) {
      for (var be = de.points, De = be.length, Ue = [], Xe = [], $e = 0; $e < De; $e += 3)
        Ue[0] = be[$e], Ue[g] = ve, Ue[y] = be[$e + 2], Xe[0] = (be[$e] * x[0] - S[0]) / C, Xe[1] = (be[$e + 2] * x[y] - S[2]) / C, l.set(i, Ue), v && c.set(i, o), f.set(i++, Xe);
    }
    function M(de, ve, Ae) {
      var be = i;
      A(de, ve);
      for (var De = de.indices.length, Ue = 0; Ue < De; Ue++)
        d[a * 3 + Ue] = de.indices[Ue] + be;
      a += de.indices.length / 3;
    }
    for (var E = this.extrudeY ? [0, 1, 0] : [0, 0, 1], P = Ua.negate([], E), R = 0; R < h.length; R++) {
      var O = i, N = h[R];
      M(N, 0), M(N, n);
      for (var G = N.points.length / 3, z = 0; z < G; z++)
        u.set(O + z, P), u.set(O + z + G, E);
      for (var H = [0, 3, 1, 1, 3, 2], W = [[], [], [], []], Z = [], ee = [], V = [], Q = [], q = 0, z = 0; z < G; z++) {
        for (var X = (z + 1) % G, K = (N.points[X * 3] - N.points[z * 3]) * x[0], ue = (N.points[X * 3 + 2] - N.points[z * 3 + 2]) * x[y], oe = Math.sqrt(K * K + ue * ue), te = 0; te < 4; te++) {
          var pe = te === 0 || te === 3, me = (pe ? z : X) * 3;
          W[te][0] = N.points[me], W[te][g] = te > 1 ? n : 0, W[te][y] = N.points[me + 2], l.set(i + te, W[te]), s ? (Q[0] = (N.points[me] * x[0] - S[0]) / C, Q[1] = (N.points[me + 2] * x[y] - S[y]) / C) : (Q[0] = (pe ? q : q + oe) / C, Q[1] = (W[te][g] * x[g] - S[g]) / C), f.set(i + te, Q);
        }
        Ua.sub(Z, W[1], W[0]), Ua.sub(ee, W[3], W[0]), Ua.cross(V, Z, ee), Ua.normalize(V, V);
        for (var te = 0; te < 4; te++)
          u.set(i + te, V), v && c.set(i + te, o);
        for (var te = 0; te < 6; te++)
          d[a * 3 + te] = H[te] + i;
        i += 4, a += 2, q += oe;
      }
    }
    return t.dirty(), {
      vertexOffset: i,
      triangleOffset: a
    };
  },
  _getRegionLinesInfo: function(e, t, r) {
    var n = 0, i = 0, a = t.getRegionModel(e), o = a.getModel("itemStyle"), s = o.get("borderWidth");
    if (s > 0) {
      var l = t.getRegionPolygonCoords(e);
      l.forEach(function(u) {
        var f = u.exterior, c = u.interiors;
        n += r.getPolylineVertexCount(f), i += r.getPolylineTriangleCount(f);
        for (var h = 0; h < c.length; h++)
          n += r.getPolylineVertexCount(c[h]), i += r.getPolylineTriangleCount(c[h]);
      }, this);
    }
    return {
      vertexCount: n,
      triangleCount: i
    };
  },
  _updateLinesGeometry: function(e, t, r, n, i, a) {
    function o(u) {
      for (var f = new Float64Array(u.length * 3), c = 0, h = [], v = 0; v < u.length; v++)
        h[0] = u[v][0], h[1] = n + 0.1, h[2] = u[v][1], a && Ua.transformMat4(h, h, a), f[c++] = h[0], f[c++] = h[1], f[c++] = h[2];
      return f;
    }
    var s = [1, 1, 1, 1], l = t.getRegionPolygonCoords(r);
    l.forEach(function(u) {
      var f = u.exterior, c = u.interiors;
      e.addPolyline(o(f), s, i);
      for (var h = 0; h < c.length; h++)
        e.addPolyline(o(c[h]), s, i);
    });
  },
  highlight: function(e) {
    var t = this._data;
    if (t) {
      var r = t.getItemModel(e), n = r.getModel(["emphasis", "itemStyle"]), i = n.get("color"), a = qt.firstNotNull(n.get("opacity"), ni(t, e), 1);
      if (i == null) {
        var o = oi(t, e);
        i = _d(o, -0.4);
      }
      a == null && (a = ni(t, e));
      var s = J.parseColor(i);
      s[3] *= a, this._setColorOfDataIndex(t, e, s);
    }
  },
  downplay: function(e) {
    var t = this._data;
    if (t) {
      var r = t.getItemModel(e), n = qt.firstNotNull(oi(t, e), r.get(["itemStyle", "color"]), "#fff"), i = qt.firstNotNull(ni(t, e), r.get(["itemStyle", "opacity"]), 1), a = J.parseColor(n);
      a[3] *= i, this._setColorOfDataIndex(t, e, a);
    }
  },
  dispose: function() {
    this._labelsBuilder.dispose();
  },
  _setColorOfDataIndex: function(e, t, r) {
    if (!(t < this._startIndex && t > this._endIndex)) {
      t -= this._startIndex;
      for (var n = this._vertexRangeOfDataIndex[t * 2]; n < this._vertexRangeOfDataIndex[t * 2 + 1]; n++)
        this._polygonMesh.geometry.attributes.color.set(n, r);
      this._polygonMesh.geometry.dirty(), this._api.getZr().refresh();
    }
  }
};
const xSe = fr.extend({
  type: "geo3D",
  __ecgl__: !0,
  init: function(e, t) {
    this._geo3DBuilder = new Um(t), this.groupGL = new J.Node(), this._lightRoot = new J.Node(), this._sceneHelper = new Jc(this._lightRoot), this._sceneHelper.initLight(this._lightRoot), this._control = new Hx({
      zr: t.getZr()
    }), this._control.init();
  },
  render: function(e, t, r) {
    this.groupGL.add(this._geo3DBuilder.rootNode);
    var n = e.coordinateSystem;
    if (!(!n || !n.viewGL)) {
      n.viewGL.add(this._lightRoot), e.get("show") ? n.viewGL.add(this.groupGL) : n.viewGL.remove(this.groupGL);
      var i = this._control;
      i.setViewGL(n.viewGL);
      var a = e.getModel("viewControl");
      i.setFromViewControlModel(a, 0), this._sceneHelper.setScene(n.viewGL.scene), this._sceneHelper.updateLight(e), n.viewGL.setPostEffect(e.getModel("postEffect"), r), n.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")), this._geo3DBuilder.update(e, t, r, 0, e.getData().count());
      var o = n.viewGL.isLinearSpace() ? "define" : "undefine";
      this._geo3DBuilder.rootNode.traverse(function(s) {
        s.material && s.material[o]("fragment", "SRGB_DECODE");
      }), i.off("update"), i.on("update", function() {
        r.dispatchAction({
          type: "geo3DChangeCamera",
          alpha: i.getAlpha(),
          beta: i.getBeta(),
          distance: i.getDistance(),
          center: i.getCenter(),
          from: this.uid,
          geo3DId: e.id
        });
      }), i.update();
    }
  },
  afterRender: function(e, t, r, n) {
    var i = n.renderer;
    this._sceneHelper.updateAmbientCubemap(i, e, r), this._sceneHelper.updateSkybox(i, e, r);
  },
  dispose: function() {
    this._control.dispose(), this._geo3DBuilder.dispose();
  }
});
var SSe = {
  Russia: [100, 60],
  "United States": [-99, 38],
  "United States of America": [-99, 38]
};
function wSe(e, t) {
  if (e === "world") {
    var r = SSe[t.name];
    if (r) {
      var n = [r[0], r[1]];
      t.setCenter(n);
    }
  }
}
var TSe = bn.vec3, cm = bn.mat4, bSe = [r7, wSe];
function iC(e, t, r, n, i) {
  this.name = e, this.map = t, this.regionHeight = 0, this.regions = [], this._nameCoordMap = {}, this.loadGeoJson(r, n, i), this.transform = cm.identity(new Float64Array(16)), this.invTransform = cm.identity(new Float64Array(16)), this.extrudeY = !0, this.altitudeAxis;
}
iC.prototype = {
  constructor: iC,
  type: "geo3D",
  dimensions: ["lng", "lat", "alt"],
  containPoint: function() {
  },
  loadGeoJson: function(e, t, r) {
    var n = $1 || $1;
    try {
      this.regions = e ? n(e) : [];
    } catch (u) {
      throw `Invalid geoJson format
` + u;
    }
    t = t || {}, r = r || {};
    for (var i = this.regions, a = {}, o = 0; o < i.length; o++) {
      var s = i[o].name;
      s = r[s] || s, i[o].name = s, a[s] = i[o], this.addGeoCoord(s, i[o].getCenter());
      var l = t[s];
      l && i[o].transformTo(l.left, l.top, l.width, l.height);
    }
    this._regionsMap = a, this._geoRect = null, bSe.forEach(function(u) {
      u(this);
    }, this);
  },
  getGeoBoundingRect: function() {
    if (this._geoRect)
      return this._geoRect;
    for (var e, t = this.regions, r = 0; r < t.length; r++) {
      var n = t[r].getBoundingRect();
      e = e || n.clone(), e.union(n);
    }
    return this._geoRect = e || new st(0, 0, 0, 0);
  },
  /**
   * Add geoCoord for indexing by name
   * @param {string} name
   * @param {Array.<number>} geoCoord
   */
  addGeoCoord: function(e, t) {
    this._nameCoordMap[e] = t;
  },
  /**
   * @param {string} name
   * @return {module:echarts/coord/geo/Region}
   */
  getRegion: function(e) {
    return this._regionsMap[e];
  },
  getRegionByCoord: function(e) {
    for (var t = this.regions, r = 0; r < t.length; r++)
      if (t[r].contain(e))
        return t[r];
  },
  setSize: function(e, t, r) {
    this.size = [e, t, r];
    var n = this.getGeoBoundingRect(), i = e / n.width, a = -r / n.height, o = -e / 2 - n.x * i, s = r / 2 - n.y * a, l = this.extrudeY ? [o, 0, s] : [o, s, 0], u = this.extrudeY ? [i, 1, a] : [i, a, 1], f = this.transform;
    cm.identity(f), cm.translate(f, f, l), cm.scale(f, f, u), cm.invert(this.invTransform, f);
  },
  dataToPoint: function(e, t) {
    t = t || [];
    var r = this.extrudeY ? 1 : 2, n = this.extrudeY ? 2 : 1, i = e[2];
    return isNaN(i) && (i = 0), t[0] = e[0], t[n] = e[1], this.altitudeAxis ? t[r] = this.altitudeAxis.dataToCoord(i) : t[r] = 0, t[r] += this.regionHeight, TSe.transformMat4(t, t, this.transform), t;
  },
  pointToData: function(e, t) {
  }
};
function CSe(e, t) {
  var r = e.getBoxLayoutParams(), n = Tr(r, {
    width: t.getWidth(),
    height: t.getHeight()
  });
  n.y = t.getHeight() - n.y - n.height, this.viewGL.setViewport(n.x, n.y, n.width, n.height, t.getDevicePixelRatio());
  var i = this.getGeoBoundingRect(), a = i.width / i.height * (e.get("aspectScale") || 0.75), o = e.get("boxWidth"), s = e.get("boxDepth"), l = e.get("boxHeight");
  l == null && (l = 5), isNaN(o) && isNaN(s) && (o = 100), isNaN(s) ? s = o / a : isNaN(o) && (o = s / a), this.setSize(o, l, s), this.regionHeight = e.get("regionHeight"), this.altitudeAxis && this.altitudeAxis.setExtent(0, Math.max(l - this.regionHeight, 0));
}
function ASe(e, t) {
  var r = [1 / 0, -1 / 0];
  if (e.eachSeries(function(i) {
    if (i.coordinateSystem === this && i.type !== "series.map3D") {
      var a = i.getData(), o = i.coordDimToDataDim("alt"), s = o && o[0];
      if (s) {
        var l = a.getDataExtent(s, !0);
        r[0] = Math.min(r[0], l[0]), r[1] = Math.max(r[1], l[1]);
      }
    }
  }, this), r && isFinite(r[1] - r[0])) {
    var n = GC(r, {
      type: "value",
      // PENDING
      min: "dataMin",
      max: "dataMax"
    });
    this.altitudeAxis = new ra("altitude", n), this.resize(this.model, t);
  }
}
var _H = 0, e3 = {
  dimensions: iC.prototype.dimensions,
  create: function(e, t) {
    var r = [];
    if (!db)
      throw new Error("geo3D component depends on geo component");
    function n(i, a) {
      var o = e3.createGeo3D(i);
      i.__viewGL = i.__viewGL || new Cr(), o.viewGL = i.__viewGL, i.coordinateSystem = o, o.model = i, r.push(o), o.resize = CSe, o.resize(i, t), o.update = ASe;
    }
    return e.eachComponent("geo3D", function(i, a) {
      n(i);
    }), e.eachSeriesByType("map3D", function(i, a) {
      var o = i.get("coordinateSystem");
      o == null && (o = "geo3D"), o === "geo3D" && n(i);
    }), e.eachSeries(function(i) {
      if (i.get("coordinateSystem") === "geo3D") {
        if (i.type === "series.map3D")
          return;
        var a = i.getReferringComponents("geo3D").models[0];
        if (a || (a = e.getComponent("geo3D")), !a)
          throw new Error('geo "' + qt.firstNotNull(i.get("geo3DIndex"), i.get("geo3DId"), 0) + '" not found');
        i.coordinateSystem = a.coordinateSystem;
      }
    }), r;
  },
  createGeo3D: function(e) {
    var t = e.get("map"), r;
    return typeof t == "string" ? (r = t, t = db(t)) : t && t.features && (t = {
      geoJson: t
    }), r == null && (r = "GEO_ANONYMOUS_" + _H++), new iC(r + _H++, r, t && t.geoJson, t && t.specialAreas, e.get("nameMap"));
  }
};
function hZ(e) {
  e.registerComponentModel(my), e.registerComponentView(xSe), e.registerAction({
    type: "geo3DChangeCamera",
    event: "geo3dcamerachanged",
    update: "series:updateCamera"
  }, function(t, r) {
    r.eachComponent({
      mainType: "geo3D",
      query: t
    }, function(n) {
      n.setView(t);
    });
  }), e.registerCoordinateSystem("geo3D", e3);
}
ft(hZ);
function xH(e, t) {
  e.id = e.id || e.name || t + "";
}
var Pd = At.extend({
  type: "globe",
  layoutMode: "box",
  coordinateSystem: null,
  init: function() {
    Pd.superApply(this, "init", arguments), F(this.option.layers, function(e, t) {
      je(e, this.defaultLayerOption), xH(e, t);
    }, this);
  },
  mergeOption: function(e) {
    var t = this.option.layers;
    this.option.layers = null, Pd.superApply(this, "mergeOption", arguments);
    function r(o) {
      return bo(o, function(s, l, u) {
        return xH(l, u), s[l.id] = l, s;
      }, {});
    }
    if (t && t.length) {
      var n = r(e.layers), i = r(t);
      for (var a in n)
        i[a] ? je(i[a], n[a], !0) : t.push(e.layers[a]);
      this.option.layers = t;
    }
    F(this.option.layers, function(o) {
      je(o, this.defaultLayerOption);
    }, this);
  },
  optionUpdated: function() {
    this.updateDisplacementHash();
  },
  defaultLayerOption: {
    show: !0,
    type: "overlay"
  },
  defaultOption: {
    show: !0,
    zlevel: -10,
    // Layout used for viewport
    left: 0,
    top: 0,
    width: "100%",
    height: "100%",
    environment: "auto",
    baseColor: "#fff",
    // Base albedo texture
    baseTexture: "",
    // Height texture for bump mapping and vertex displacement
    heightTexture: "",
    // Texture for vertex displacement, default use heightTexture
    displacementTexture: "",
    // Scale of vertex displacement, available only if displacementTexture is set.
    displacementScale: 0,
    // Detail of displacement. 'low', 'medium', 'high', 'ultra'
    displacementQuality: "medium",
    // Globe radius
    globeRadius: 100,
    // Globe outer radius. Which is max of altitude.
    globeOuterRadius: 150,
    // Shading of globe
    shading: "lambert",
    // Extend light
    light: {
      // Main sun light
      main: {
        // Time, default it will use system time
        time: ""
      }
    },
    // atmosphere
    atmosphere: {
      show: !1,
      offset: 5,
      color: "#ffffff",
      glowPower: 6,
      innerGlowPower: 2
    },
    // light
    // postEffect
    // temporalSuperSampling
    viewControl: {
      autoRotate: !0,
      panSensitivity: 0,
      targetCoord: null
    },
    // {
    //     show: true,
    //     name: 'cloud',
    //     type: 'overlay',
    //     shading: 'lambert',
    //     distance: 10,
    //     texture: ''
    // }
    // {
    //     type: 'blend',
    //     blendTo: 'albedo'
    //     blendType: 'source-over'
    // }
    layers: []
  },
  setDisplacementData: function(e, t, r) {
    this.displacementData = e, this.displacementWidth = t, this.displacementHeight = r;
  },
  getDisplacementTexture: function() {
    return this.get("displacementTexture") || this.get("heightTexture");
  },
  getDisplacemenScale: function() {
    var e = this.getDisplacementTexture(), t = this.get("displacementScale");
    return (!e || e === "none") && (t = 0), t;
  },
  hasDisplacement: function() {
    return this.getDisplacemenScale() > 0;
  },
  _displacementChanged: !0,
  _displacementScale: 0,
  updateDisplacementHash: function() {
    var e = this.getDisplacementTexture(), t = this.getDisplacemenScale();
    this._displacementChanged = this._displacementTexture !== e || this._displacementScale !== t, this._displacementTexture = e, this._displacementScale = t;
  },
  isDisplacementChanged: function() {
    return this._displacementChanged;
  }
});
je(Pd.prototype, rA);
je(Pd.prototype, vy);
je(Pd.prototype, dy);
je(Pd.prototype, gy);
var vZ = Math.PI, fs = Math.sin, df = Math.cos, dZ = Math.tan, pZ = Math.asin, gZ = Math.atan2, Id = vZ / 180, MSe = 1e3 * 60 * 60 * 24, LSe = 2440588, DSe = 2451545;
function ESe(e) {
  return e.valueOf() / MSe - 0.5 + LSe;
}
function PSe(e) {
  return ESe(e) - DSe;
}
var aC = Id * 23.4397;
function ISe(e, t) {
  return gZ(fs(e) * df(aC) - dZ(t) * fs(aC), df(e));
}
function RSe(e, t) {
  return pZ(fs(t) * df(aC) + df(t) * fs(aC) * fs(e));
}
function OSe(e, t, r) {
  return gZ(fs(e), df(e) * fs(t) - dZ(r) * df(t));
}
function NSe(e, t, r) {
  return pZ(fs(t) * fs(r) + df(t) * df(r) * df(e));
}
function kSe(e, t) {
  return Id * (280.16 + 360.9856235 * e) - t;
}
function BSe(e) {
  return Id * (357.5291 + 0.98560028 * e);
}
function zSe(e) {
  var t = Id * (1.9148 * fs(e) + 0.02 * fs(2 * e) + 3e-4 * fs(3 * e)), r = Id * 102.9372;
  return e + t + r + vZ;
}
function FSe(e) {
  var t = BSe(e), r = zSe(t);
  return {
    dec: RSe(r, 0),
    ra: ISe(r, 0)
  };
}
var mZ = {};
mZ.getPosition = function(e, t, r) {
  var n = Id * -r, i = Id * t, a = PSe(e), o = FSe(a), s = kSe(a, n) - o.ra;
  return {
    azimuth: OSe(s, i, o.dec),
    altitude: NSe(s, i, o.dec)
  };
};
const GSe = `@export ecgl.atmosphere.vertex
attribute vec3 position: POSITION;
attribute vec3 normal : NORMAL;
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
uniform mat4 normalMatrix : WORLDINVERSETRANSPOSE;

varying vec3 v_Normal;

void main() {
 v_Normal = normalize((normalMatrix * vec4(normal, 0.0)).xyz);
 gl_Position = worldViewProjection * vec4(position, 1.0);
}
@end


@export ecgl.atmosphere.fragment
uniform mat4 viewTranspose: VIEWTRANSPOSE;
uniform float glowPower;
uniform vec3 glowColor;

varying vec3 v_Normal;

void main() {
 float intensity = pow(1.0 - dot(v_Normal, (viewTranspose * vec4(0.0, 0.0, 1.0, 0.0)).xyz), glowPower);
 gl_FragColor = vec4(glowColor, intensity * intensity);
}
@end`;
J.Shader.import(kY);
J.Shader.import(GSe);
const VSe = fr.extend({
  type: "globe",
  __ecgl__: !0,
  _displacementScale: 0,
  init: function(e, t) {
    this.groupGL = new J.Node(), this._sphereGeometry = new J.SphereGeometry({
      widthSegments: 200,
      heightSegments: 100,
      dynamic: !0
    }), this._overlayGeometry = new J.SphereGeometry({
      widthSegments: 80,
      heightSegments: 40
    }), this._planeGeometry = new J.PlaneGeometry(), this._earthMesh = new J.Mesh({
      renderNormal: !0
    }), this._atmosphereMesh = new J.Mesh(), this._atmosphereGeometry = new J.SphereGeometry({
      widthSegments: 80,
      heightSegments: 40
    }), this._atmosphereMaterial = new J.Material({
      shader: new J.Shader(J.Shader.source("ecgl.atmosphere.vertex"), J.Shader.source("ecgl.atmosphere.fragment")),
      transparent: !0
    }), this._atmosphereMesh.geometry = this._atmosphereGeometry, this._atmosphereMesh.material = this._atmosphereMaterial, this._atmosphereMesh.frontFace = J.Mesh.CW, this._lightRoot = new J.Node(), this._sceneHelper = new Jc(), this._sceneHelper.initLight(this._lightRoot), this.groupGL.add(this._atmosphereMesh), this.groupGL.add(this._earthMesh), this._control = new Hx({
      zr: t.getZr()
    }), this._control.init(), this._layerMeshes = {};
  },
  render: function(e, t, r) {
    var n = e.coordinateSystem, i = e.get("shading");
    n.viewGL.add(this._lightRoot), e.get("show") ? n.viewGL.add(this.groupGL) : n.viewGL.remove(this.groupGL), this._sceneHelper.setScene(n.viewGL.scene), n.viewGL.setPostEffect(e.getModel("postEffect"), r), n.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling"));
    var a = this._earthMesh;
    a.geometry = this._sphereGeometry;
    var o = "ecgl." + i;
    (!a.material || a.material.shader.name !== o) && (a.material = J.createMaterial(o)), J.setMaterialFromModel(i, a.material, e, r), ["roughnessMap", "metalnessMap", "detailMap", "normalMap"].forEach(function(c) {
      var h = a.material.get(c);
      h && (h.flipY = !1);
    }), a.material.set("color", J.parseColor(e.get("baseColor")));
    var s = n.radius * 0.99;
    if (a.scale.set(s, s, s), e.get("atmosphere.show")) {
      a.material.define("both", "ATMOSPHERE_ENABLED"), this._atmosphereMesh.invisible = !1, this._atmosphereMaterial.setUniforms({
        glowPower: e.get("atmosphere.glowPower") || 6,
        glowColor: e.get("atmosphere.color") || "#ffffff"
      }), a.material.setUniforms({
        glowPower: e.get("atmosphere.innerGlowPower") || 2,
        glowColor: e.get("atmosphere.color") || "#ffffff"
      });
      var l = e.get("atmosphere.offset") || 5;
      this._atmosphereMesh.scale.set(s + l, s + l, s + l);
    } else
      a.material.undefine("both", "ATMOSPHERE_ENABLED"), this._atmosphereMesh.invisible = !0;
    var u = a.material.setTextureImage("diffuseMap", e.get("baseTexture"), r, {
      flipY: !1,
      anisotropic: 8
    });
    u && u.surface && u.surface.attachToMesh(a);
    var f = a.material.setTextureImage("bumpMap", e.get("heightTexture"), r, {
      flipY: !1,
      anisotropic: 8
    });
    f && f.surface && f.surface.attachToMesh(a), a.material[e.get("postEffect.enable") ? "define" : "undefine"]("fragment", "SRGB_DECODE"), this._updateLight(e, r), this._displaceVertices(e, r), this._updateViewControl(e, r), this._updateLayers(e, r);
  },
  afterRender: function(e, t, r, n) {
    var i = n.renderer;
    this._sceneHelper.updateAmbientCubemap(i, e, r), this._sceneHelper.updateSkybox(i, e, r);
  },
  _updateLayers: function(e, t) {
    var r = e.coordinateSystem, n = e.get("layers"), i = r.radius, a = [], o = [], s = [], l = [];
    F(n, function(v) {
      var d = new It(v), g = d.get("type"), y = J.loadTexture(d.get("texture"), t, {
        flipY: !1,
        anisotropic: 8
      });
      if (y.surface && y.surface.attachToMesh(this._earthMesh), g === "blend") {
        var x = d.get("blendTo"), S = qt.firstNotNull(d.get("intensity"), 1);
        x === "emission" ? (s.push(y), l.push(S)) : (a.push(y), o.push(S));
      } else {
        var T = d.get("id"), C = this._layerMeshes[T];
        C || (C = this._layerMeshes[T] = new J.Mesh({
          geometry: this._overlayGeometry,
          castShadow: !1,
          ignorePicking: !0
        }));
        var A = d.get("shading");
        A === "lambert" ? (C.material = C.__lambertMaterial || new J.Material({
          autoUpdateTextureStatus: !1,
          shader: J.createShader("ecgl.lambert"),
          transparent: !0,
          depthMask: !1
        }), C.__lambertMaterial = C.material) : (C.material = C.__colorMaterial || new J.Material({
          autoUpdateTextureStatus: !1,
          shader: J.createShader("ecgl.color"),
          transparent: !0,
          depthMask: !1
        }), C.__colorMaterial = C.material), C.material.enableTexture("diffuseMap");
        var M = d.get("distance"), E = i + (M ?? r.radius / 100);
        C.scale.set(E, E, E), i = E;
        var P = this._blankTexture || (this._blankTexture = J.createBlankTexture("rgba(255, 255, 255, 0)"));
        C.material.set("diffuseMap", P), J.loadTexture(d.get("texture"), t, {
          flipY: !1,
          anisotropic: 8
        }, function(R) {
          R.surface && R.surface.attachToMesh(C), C.material.set("diffuseMap", R), t.getZr().refresh();
        }), d.get("show") ? this.groupGL.add(C) : this.groupGL.remove(C);
      }
    }, this);
    var u = this._earthMesh.material;
    u.define("fragment", "LAYER_DIFFUSEMAP_COUNT", a.length), u.define("fragment", "LAYER_EMISSIVEMAP_COUNT", s.length), u.set("layerDiffuseMap", a), u.set("layerDiffuseIntensity", o), u.set("layerEmissiveMap", s), u.set("layerEmissionIntensity", l);
    var f = e.getModel("debug.wireframe");
    if (f.get("show")) {
      u.define("both", "WIREFRAME_TRIANGLE");
      var c = J.parseColor(f.get("lineStyle.color") || "rgba(0,0,0,0.5)"), h = qt.firstNotNull(f.get("lineStyle.width"), 1);
      u.set("wireframeLineWidth", h), u.set("wireframeLineColor", c);
    } else
      u.undefine("both", "WIREFRAME_TRIANGLE");
  },
  _updateViewControl: function(e, t) {
    var r = e.coordinateSystem, n = e.getModel("viewControl");
    r.viewGL.camera;
    var i = this;
    function a() {
      return {
        type: "globeChangeCamera",
        alpha: o.getAlpha(),
        beta: o.getBeta(),
        distance: o.getDistance() - r.radius,
        center: o.getCenter(),
        from: i.uid,
        globeId: e.id
      };
    }
    var o = this._control;
    o.setViewGL(r.viewGL);
    var s = n.get("targetCoord"), l, u;
    s != null && (u = s[0] + 90, l = s[1]), o.setFromViewControlModel(n, {
      baseDistance: r.radius,
      alpha: l,
      beta: u
    }), o.off("update"), o.on("update", function() {
      t.dispatchAction(a());
    });
  },
  _displaceVertices: function(e, t) {
    var r = e.get("displacementQuality"), n = e.get("debug.wireframe.show"), i = e.coordinateSystem;
    if (!(!e.isDisplacementChanged() && r === this._displacementQuality && n === this._showDebugWireframe)) {
      this._displacementQuality = r, this._showDebugWireframe = n;
      var a = this._sphereGeometry, o = {
        low: 100,
        medium: 200,
        high: 400,
        ultra: 800
      }[r] || 200, s = o / 2;
      (a.widthSegments !== o || n) && (a.widthSegments = o, a.heightSegments = s, a.build()), this._doDisplaceVertices(a, i), n && a.generateBarycentric();
    }
  },
  _doDisplaceVertices: function(e, t) {
    var r = e.attributes.position.value, n = e.attributes.texcoord0.value, i = e.__originalPosition;
    (!i || i.length !== r.length) && (i = new Float32Array(r.length), i.set(r), e.__originalPosition = i);
    for (var a = t.displacementWidth, o = t.displacementHeight, s = t.displacementData, l = 0; l < e.vertexCount; l++) {
      var u = l * 3, f = l * 2, c = i[u + 1], h = i[u + 2], v = i[u + 3], d = n[f++], g = n[f++], y = Math.round(d * (a - 1)), x = Math.round(g * (o - 1)), S = x * a + y, T = s ? s[S] : 0;
      r[u + 1] = c + c * T, r[u + 2] = h + h * T, r[u + 3] = v + v * T;
    }
    e.generateVertexNormals(), e.dirty(), e.updateBoundingBox();
  },
  _updateLight: function(e, t) {
    var r = this._earthMesh;
    this._sceneHelper.updateLight(e);
    var n = this._sceneHelper.mainLight, i = e.get("light.main.time") || /* @__PURE__ */ new Date(), a = mZ.getPosition(Ks(i), 0, 0), o = Math.cos(a.altitude);
    n.position.y = -o * Math.cos(a.azimuth), n.position.x = Math.sin(a.altitude), n.position.z = o * Math.sin(a.azimuth), n.lookAt(r.getWorldPosition());
  },
  dispose: function(e, t) {
    this.groupGL.removeAll(), this._control.dispose();
  }
});
var HSe = bn.vec3;
function oC(e) {
  this.radius = e, this.viewGL = null, this.altitudeAxis, this.displacementData = null, this.displacementWidth, this.displacementHeight;
}
oC.prototype = {
  constructor: oC,
  dimensions: ["lng", "lat", "alt"],
  type: "globe",
  containPoint: function() {
  },
  setDisplacementData: function(e, t, r) {
    this.displacementData = e, this.displacementWidth = t, this.displacementHeight = r;
  },
  _getDisplacementScale: function(e, t) {
    var r = (e + 180) / 360 * (this.displacementWidth - 1), n = (90 - t) / 180 * (this.displacementHeight - 1), i = Math.round(r) + Math.round(n) * this.displacementWidth;
    return this.displacementData[i];
  },
  dataToPoint: function(e, t) {
    var r = e[0], n = e[1], i = e[2] || 0, a = this.radius;
    this.displacementData && (a *= 1 + this._getDisplacementScale(r, n)), this.altitudeAxis && (a += this.altitudeAxis.dataToCoord(i)), r = r * Math.PI / 180, n = n * Math.PI / 180;
    var o = Math.cos(n) * a;
    return t = t || [], t[0] = -o * Math.cos(r + Math.PI), t[1] = Math.sin(n) * a, t[2] = o * Math.sin(r + Math.PI), t;
  },
  pointToData: function(e, t) {
    var r = e[0], n = e[1], i = e[2], a = HSe.len(e);
    r /= a, n /= a, i /= a;
    var o = Math.asin(n), s = Math.atan2(i, -r);
    s < 0 && (s = Math.PI * 2 + s);
    var l = o * 180 / Math.PI, u = s * 180 / Math.PI - 180;
    return t = t || [], t[0] = u, t[1] = l, t[2] = a - this.radius, this.altitudeAxis && (t[2] = this.altitudeAxis.coordToData(t[2])), t;
  }
};
function USe(e, t) {
  var r = document.createElement("canvas"), n = r.getContext("2d"), i = e.width, a = e.height;
  r.width = i, r.height = a, n.drawImage(e, 0, 0, i, a);
  for (var o = n.getImageData(0, 0, i, a).data, s = new Float32Array(o.length / 4), l = 0; l < o.length / 4; l++) {
    var u = o[l * 4];
    s[l] = u / 255 * t;
  }
  return {
    data: s,
    width: i,
    height: a
  };
}
function WSe(e, t) {
  var r = e.getBoxLayoutParams(), n = Tr(r, {
    width: t.getWidth(),
    height: t.getHeight()
  });
  n.y = t.getHeight() - n.y - n.height, this.viewGL.setViewport(n.x, n.y, n.width, n.height, t.getDevicePixelRatio()), this.radius = e.get("globeRadius");
  var i = e.get("globeOuterRadius");
  this.altitudeAxis && this.altitudeAxis.setExtent(0, i - this.radius);
}
function XSe(e, t) {
  var r = [1 / 0, -1 / 0];
  if (e.eachSeries(function(i) {
    if (i.coordinateSystem === this) {
      var a = i.getData(), o = i.coordDimToDataDim("alt"), s = o && o[0];
      if (s) {
        var l = a.getDataExtent(s, !0);
        r[0] = Math.min(r[0], l[0]), r[1] = Math.max(r[1], l[1]);
      }
    }
  }, this), r && isFinite(r[1] - r[0])) {
    var n = GC(r, {
      type: "value",
      // PENDING
      min: "dataMin",
      max: "dataMax"
    });
    this.altitudeAxis = new ra("altitude", n), this.resize(this.model, t);
  }
}
var YSe = {
  dimensions: oC.prototype.dimensions,
  create: function(e, t) {
    var r = [];
    return e.eachComponent("globe", function(n) {
      n.__viewGL = n.__viewGL || new Cr();
      var i = new oC();
      i.viewGL = n.__viewGL, n.coordinateSystem = i, i.model = n, r.push(i), i.resize = WSe, i.resize(n, t), i.update = XSe;
    }), e.eachSeries(function(n) {
      if (n.get("coordinateSystem") === "globe") {
        var i = n.getReferringComponents("globe").models[0];
        if (i || (i = e.getComponent("globe")), !i)
          throw new Error('globe "' + qt.firstNotNull(n.get("globe3DIndex"), n.get("globe3DId"), 0) + '" not found');
        var a = i.coordinateSystem;
        n.coordinateSystem = a;
      }
    }), e.eachComponent("globe", function(n, i) {
      var a = n.coordinateSystem, o = n.getDisplacementTexture(), s = n.getDisplacemenScale();
      if (n.isDisplacementChanged()) {
        if (n.hasDisplacement()) {
          var l = !0;
          J.loadTexture(o, t, function(u) {
            var f = u.image, c = USe(f, s);
            n.setDisplacementData(c.data, c.width, c.height), l || t.dispatchAction({
              type: "globeUpdateDisplacment"
            });
          }), l = !1;
        } else
          a.setDisplacementData(null, 0, 0);
        a.setDisplacementData(n.displacementData, n.displacementWidth, n.displacementHeight);
      }
    }), r;
  }
};
function ZSe(e) {
  e.registerComponentModel(Pd), e.registerComponentView(VSe), e.registerCoordinateSystem("globe", YSe), e.registerAction({
    type: "globeChangeCamera",
    event: "globecamerachanged",
    update: "series:updateCamera"
  }, function(t, r) {
    r.eachComponent({
      mainType: "globe",
      query: t
    }, function(n) {
      n.setView(t);
    });
  }), e.registerAction({
    type: "globeUpdateDisplacment",
    event: "globedisplacementupdated",
    update: "update"
  }, function(t, r) {
  });
}
ft(ZSe);
var SH = ["zoom", "center", "pitch", "bearing"], t3 = At.extend({
  type: "mapbox3D",
  layoutMode: "box",
  coordinateSystem: null,
  defaultOption: {
    zlevel: -10,
    style: "mapbox://styles/mapbox/light-v9",
    center: [0, 0],
    zoom: 0,
    pitch: 0,
    bearing: 0,
    light: {
      main: {
        alpha: 20,
        beta: 30
      }
    },
    altitudeScale: 1,
    // Default depend on altitudeScale
    boxHeight: "auto"
  },
  getMapboxCameraOption: function() {
    var e = this;
    return SH.reduce(function(t, r) {
      return t[r] = e.get(r), t;
    }, {});
  },
  setMapboxCameraOption: function(e) {
    e != null && SH.forEach(function(t) {
      e[t] != null && (this.option[t] = e[t]);
    }, this);
  },
  /**
   * Get mapbox instance
   */
  getMapbox: function() {
    return this._mapbox;
  },
  setMapbox: function(e) {
    this._mapbox = e;
  }
});
je(t3.prototype, vy);
je(t3.prototype, dy);
function uh(e, t) {
  if (this.id = e, this.zr = t, this.dom = document.createElement("div"), this.dom.style.cssText = "position:absolute;left:0;right:0;top:0;bottom:0;", !mapboxgl)
    throw new Error("Mapbox GL library must be included. See https://www.mapbox.com/mapbox-gl-js/api/");
  this._mapbox = new mapboxgl.Map({
    container: this.dom
  }), this._initEvents();
}
uh.prototype.setUnpainted = function() {
};
uh.prototype.resize = function() {
  this._mapbox.resize();
};
uh.prototype.getMapbox = function() {
  return this._mapbox;
};
uh.prototype.clear = function() {
};
uh.prototype.refresh = function() {
  this._mapbox.resize();
};
var yZ = ["mousedown", "mouseup", "click", "dblclick", "mousemove", "mousewheel", "wheel", "touchstart", "touchend", "touchmove", "touchcancel"];
uh.prototype._initEvents = function() {
  var e = this._mapbox.getCanvasContainer();
  this._handlers = this._handlers || {
    contextmenu: function(t) {
      return t.preventDefault(), !1;
    }
  }, yZ.forEach(function(t) {
    this._handlers[t] = function(r) {
      var n = {};
      for (var i in r)
        n[i] = r[i];
      n.bubbles = !1;
      var a = new r.constructor(r.type, n);
      e.dispatchEvent(a);
    }, this.zr.dom.addEventListener(t, this._handlers[t]);
  }, this), this.zr.dom.addEventListener("contextmenu", this._handlers.contextmenu);
};
uh.prototype.dispose = function() {
  yZ.forEach(function(e) {
    this.zr.dom.removeEventListener(e, this._handlers[e]);
  }, this);
};
const _Z = `
@export ecgl.displayShadow.vertex

@import ecgl.common.transformUniforms

@import ecgl.common.uv.header

@import ecgl.common.attributes

varying vec3 v_WorldPosition;

varying vec3 v_Normal;

void main()
{
 @import ecgl.common.uv.main
 v_Normal = normalize((worldInverseTranspose * vec4(normal, 0.0)).xyz);

 v_WorldPosition = (world * vec4(position, 1.0)).xyz;
 gl_Position = worldViewProjection * vec4(position, 1.0);
}

@end


@export ecgl.displayShadow.fragment

@import ecgl.common.uv.fragmentHeader

varying vec3 v_Normal;
varying vec3 v_WorldPosition;

uniform float roughness: 0.2;

#ifdef DIRECTIONAL_LIGHT_COUNT
@import clay.header.directional_light
#endif

@import ecgl.common.ssaoMap.header

@import clay.plugin.compute_shadow_map

void main()
{
 float shadow = 1.0;

 @import ecgl.common.ssaoMap.main

#if defined(DIRECTIONAL_LIGHT_COUNT) && defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)
 float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];
 if(shadowEnabled)
 {
 computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);
 }
 for (int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++) {
 shadow = min(shadow, shadowContribsDir[i] * 0.5 + 0.5);
 }
#endif

 shadow *= 0.5 + ao * 0.5;
 shadow = clamp(shadow, 0.0, 1.0);

 gl_FragColor = vec4(vec3(0.0), 1.0 - shadow);
}

@end`;
J.Shader.import(_Z);
const $Se = fr.extend({
  type: "mapbox3D",
  __ecgl__: !0,
  init: function(e, t) {
    var r = t.getZr();
    this._zrLayer = new uh("mapbox3D", r), r.painter.insertLayer(-1e3, this._zrLayer), this._lightRoot = new J.Node(), this._sceneHelper = new Jc(this._lightRoot), this._sceneHelper.initLight(this._lightRoot);
    var n = this._zrLayer.getMapbox(), i = this._dispatchInteractAction.bind(this, t, n);
    ["zoom", "rotate", "drag", "pitch", "rotate", "move"].forEach(function(a) {
      n.on(a, i);
    }), this._groundMesh = new J.Mesh({
      geometry: new J.PlaneGeometry(),
      material: new J.Material({
        shader: new J.Shader({
          vertex: J.Shader.source("ecgl.displayShadow.vertex"),
          fragment: J.Shader.source("ecgl.displayShadow.fragment")
        }),
        depthMask: !1
      }),
      // Render first
      renderOrder: -100,
      culling: !1,
      castShadow: !1,
      $ignorePicking: !0,
      renderNormal: !0
    });
  },
  render: function(e, t, r) {
    var n = this._zrLayer.getMapbox(), i = e.get("style"), a = JSON.stringify(i);
    a !== this._oldStyleStr && i && n.setStyle(i), this._oldStyleStr = a, n.setCenter(e.get("center")), n.setZoom(e.get("zoom")), n.setPitch(e.get("pitch")), n.setBearing(e.get("bearing")), e.setMapbox(n);
    var o = e.coordinateSystem;
    o.viewGL.scene.add(this._lightRoot), o.viewGL.add(this._groundMesh), this._updateGroundMesh(), this._sceneHelper.setScene(o.viewGL.scene), this._sceneHelper.updateLight(e), o.viewGL.setPostEffect(e.getModel("postEffect"), r), o.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")), this._mapbox3DModel = e;
  },
  afterRender: function(e, t, r, n) {
    var i = n.renderer;
    this._sceneHelper.updateAmbientCubemap(i, e, r), this._sceneHelper.updateSkybox(i, e, r), e.coordinateSystem.viewGL.scene.traverse(function(a) {
      a.material && (a.material.define("fragment", "NORMAL_UP_AXIS", 2), a.material.define("fragment", "NORMAL_FRONT_AXIS", 1));
    });
  },
  updateCamera: function(e, t, r, n) {
    e.coordinateSystem.setCameraOption(n), this._updateGroundMesh(), r.getZr().refresh();
  },
  _dispatchInteractAction: function(e, t, r) {
    e.dispatchAction({
      type: "mapbox3DChangeCamera",
      pitch: t.getPitch(),
      zoom: t.getZoom(),
      center: t.getCenter().toArray(),
      bearing: t.getBearing(),
      mapbox3DId: this._mapbox3DModel && this._mapbox3DModel.id
    });
  },
  _updateGroundMesh: function() {
    if (this._mapbox3DModel) {
      var e = this._mapbox3DModel.coordinateSystem, t = e.dataToPoint(e.center);
      this._groundMesh.position.set(t[0], t[1], -1e-3);
      var r = new J.Plane(new J.Vector3(0, 0, 1), 0), n = e.viewGL.camera.castRay(new J.Vector2(-1, -1)), i = e.viewGL.camera.castRay(new J.Vector2(1, 1)), a = n.intersectPlane(r), o = i.intersectPlane(r), s = a.dist(o) / e.viewGL.rootNode.scale.x;
      this._groundMesh.scale.set(s, s, 1);
    }
  },
  dispose: function(e, t) {
    this._zrLayer && this._zrLayer.dispose(), t.getZr().painter.delLayer(-1e3);
  }
});
var Tc = bn.mat4, O_ = 512, yE = 0.6435011087932844, Wa = Math.PI, jg = 1 / 10;
function Wm() {
  this.width = 0, this.height = 0, this.altitudeScale = 1, this.boxHeight = "auto", this.altitudeExtent, this.bearing = 0, this.pitch = 0, this.center = [0, 0], this._origin, this.zoom = 0, this._initialZoom, this.maxPitch = 60, this.zoomOffset = 0;
}
Wm.prototype = {
  constructor: Wm,
  dimensions: ["lng", "lat", "alt"],
  containPoint: function() {
  },
  setCameraOption: function(e) {
    this.bearing = e.bearing, this.pitch = e.pitch, this.center = e.center, this.zoom = e.zoom, this._origin || (this._origin = this.projectOnTileWithScale(this.center, O_)), this._initialZoom == null && (this._initialZoom = this.zoom), this.updateTransform();
  },
  // https://github.com/mapbox/mapbox-gl-js/blob/master/src/geo/transform.js#L479
  updateTransform: function() {
    if (this.height) {
      var e = 0.5 / Math.tan(yE / 2) * this.height * jg, t = Math.max(Math.min(this.pitch, this.maxPitch), 0) / 180 * Math.PI, r = yE / 2, n = Math.PI / 2 + t, i = Math.sin(r) * e / Math.sin(Math.PI - n - r), a = Math.cos(Math.PI / 2 - t) * i + e, o = a * 1.1;
      this.pitch > 50 && (o = 1e3);
      var s = [];
      Tc.perspective(s, yE, this.width / this.height, 1, o), this.viewGL.camera.projectionMatrix.setArray(s), this.viewGL.camera.decomposeProjectionMatrix();
      var s = Tc.identity([]), l = this.dataToPoint(this.center);
      Tc.scale(s, s, [1, -1, 1]), Tc.translate(s, s, [0, 0, -e]), Tc.rotateX(s, s, t), Tc.rotateZ(s, s, -this.bearing / 180 * Math.PI), Tc.translate(s, s, [-l[0] * this.getScale() * jg, -l[1] * this.getScale() * jg, 0]), this.viewGL.camera.viewMatrix.array = s;
      var u = [];
      Tc.invert(u, s), this.viewGL.camera.worldTransform.array = u, this.viewGL.camera.decomposeWorldTransform();
      var f = O_ * this.getScale(), c;
      if (this.altitudeExtent && !isNaN(this.boxHeight)) {
        var h = this.altitudeExtent[1] - this.altitudeExtent[0];
        c = this.boxHeight / h * this.getScale() / Math.pow(2, this._initialZoom - this.zoomOffset);
      } else
        c = f / (2 * Math.PI * 6378e3 * Math.abs(Math.cos(this.center[1] * (Math.PI / 180)))) * this.altitudeScale * jg;
      this.viewGL.rootNode.scale.set(this.getScale() * jg, this.getScale() * jg, c);
    }
  },
  getScale: function() {
    return Math.pow(2, this.zoom - this.zoomOffset);
  },
  projectOnTile: function(e, t) {
    return this.projectOnTileWithScale(e, this.getScale() * O_, t);
  },
  projectOnTileWithScale: function(e, t, r) {
    var n = e[0], i = e[1], a = n * Wa / 180, o = i * Wa / 180, s = t * (a + Wa) / (2 * Wa), l = t * (Wa - Math.log(Math.tan(Wa / 4 + o * 0.5))) / (2 * Wa);
    return r = r || [], r[0] = s, r[1] = l, r;
  },
  unprojectFromTile: function(e, t) {
    return this.unprojectOnTileWithScale(e, this.getScale() * O_, t);
  },
  unprojectOnTileWithScale: function(e, t, r) {
    var n = e[0], i = e[1], a = n / t * (2 * Wa) - Wa, o = 2 * (Math.atan(Math.exp(Wa - i / t * (2 * Wa))) - Wa / 4);
    return r = r || [], r[0] = a * 180 / Wa, r[1] = o * 180 / Wa, r;
  },
  dataToPoint: function(e, t) {
    return t = this.projectOnTileWithScale(e, O_, t), t[0] -= this._origin[0], t[1] -= this._origin[1], t[2] = isNaN(e[2]) ? 0 : e[2], isNaN(e[2]) || (t[2] = e[2], this.altitudeExtent && (t[2] -= this.altitudeExtent[0])), t;
  }
};
function px() {
  Wm.apply(this, arguments);
}
px.prototype = new Wm();
px.prototype.constructor = px;
px.prototype.type = "mapbox3D";
function xZ(e, t, r) {
  function n(a, o) {
    var s = o.getWidth(), l = o.getHeight(), u = o.getDevicePixelRatio();
    this.viewGL.setViewport(0, 0, s, l, u), this.width = s, this.height = l, this.altitudeScale = a.get("altitudeScale"), this.boxHeight = a.get("boxHeight");
  }
  function i(a, o) {
    if (this.model.get("boxHeight") !== "auto") {
      var s = [1 / 0, -1 / 0];
      a.eachSeries(function(l) {
        if (l.coordinateSystem === this) {
          var u = l.getData(), f = l.coordDimToDataDim("alt")[0];
          if (f) {
            var c = u.getDataExtent(f, !0);
            s[0] = Math.min(s[0], c[0]), s[1] = Math.max(s[1], c[1]);
          }
        }
      }, this), s && isFinite(s[1] - s[0]) && (this.altitudeExtent = s);
    }
  }
  return {
    dimensions: t.prototype.dimensions,
    create: function(a, o) {
      var s = [];
      return a.eachComponent(e, function(l) {
        var u = l.__viewGL;
        u || (u = l.__viewGL = new Cr(), u.setRootNode(new J.Node()));
        var f = new t();
        f.viewGL = l.__viewGL, f.resize = n, f.resize(l, o), s.push(f), l.coordinateSystem = f, f.model = l, f.update = i;
      }), a.eachSeries(function(l) {
        if (l.get("coordinateSystem") === e) {
          var u = l.getReferringComponents(e).models[0];
          if (u || (u = a.getComponent(e)), !u)
            throw new Error(e + ' "' + qt.firstNotNull(l.get(e + "Index"), l.get(e + "Id"), 0) + '" not found');
          l.coordinateSystem = u.coordinateSystem;
        }
      }), r && r(s, a, o), s;
    }
  };
}
var qSe = xZ("mapbox3D", px, function(e) {
  e.forEach(function(t) {
    t.setCameraOption(t.model.getMapboxCameraOption());
  });
});
function jSe(e) {
  e.registerComponentModel(t3), e.registerComponentView($Se), e.registerCoordinateSystem("mapbox3D", qSe), e.registerAction({
    type: "mapbox3DChangeCamera",
    event: "mapbox3dcamerachanged",
    update: "mapbox3D:updateCamera"
  }, function(t, r) {
    r.eachComponent({
      mainType: "mapbox3D",
      query: t
    }, function(n) {
      n.setMapboxCameraOption(t);
    });
  });
}
ft(jSe);
var wH = ["zoom", "center", "pitch", "bearing"], r3 = At.extend({
  type: "maptalks3D",
  layoutMode: "box",
  coordinateSystem: null,
  defaultOption: {
    zlevel: -10,
    urlTemplate: "http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",
    attribution: '&copy; <a href="http://osm.org">OpenStreetMap</a> contributors, &copy; <a href="https://carto.com/">CARTO</a>',
    center: [0, 0],
    zoom: 0,
    pitch: 0,
    bearing: 0,
    light: {
      main: {
        alpha: 20,
        beta: 30
      }
    },
    altitudeScale: 1,
    // Default depend on altitudeScale
    boxHeight: "auto"
  },
  getMaptalksCameraOption: function() {
    var e = this;
    return wH.reduce(function(t, r) {
      return t[r] = e.get(r), t;
    }, {});
  },
  setMaptalksCameraOption: function(e) {
    e != null && wH.forEach(function(t) {
      e[t] != null && (this.option[t] = e[t]);
    }, this);
  },
  /**
   * Get maptalks instance
   */
  getMaptalks: function() {
    return this._maptalks;
  },
  setMaptalks: function(e) {
    this._maptalks = e;
  }
});
je(r3.prototype, vy);
je(r3.prototype, dy);
function fh(e, t, r, n) {
  if (this.id = e, this.zr = t, this.dom = document.createElement("div"), this.dom.style.cssText = "position:absolute;left:0;right:0;top:0;bottom:0;", !maptalks)
    throw new Error("Maptalks library must be included. See https://maptalks.org");
  this._maptalks = new maptalks.Map(this.dom, {
    center: r,
    zoom: n,
    doubleClickZoom: !1,
    fog: !1
    // fogColor: [0, 0, 0]
  }), this._initEvents();
}
fh.prototype.setUnpainted = function() {
};
fh.prototype.resize = function() {
  this._maptalks.checkSize();
};
fh.prototype.getMaptalks = function() {
  return this._maptalks;
};
fh.prototype.clear = function() {
};
fh.prototype.refresh = function() {
  this._maptalks.checkSize();
};
var SZ = ["mousedown", "mouseup", "click", "dblclick", "mousemove", "mousewheel", "DOMMouseScroll", "touchstart", "touchend", "touchmove", "touchcancel"];
fh.prototype._initEvents = function() {
  var e = this.dom;
  this._handlers = this._handlers || {
    contextmenu: function(t) {
      return t.preventDefault(), !1;
    }
  }, SZ.forEach(function(t) {
    this._handlers[t] = function(r) {
      var n = {};
      for (var i in r)
        n[i] = r[i];
      n.bubbles = !1;
      var a = new r.constructor(r.type, n);
      t === "mousewheel" || t === "DOMMouseScroll" ? e.dispatchEvent(a) : e.firstElementChild.dispatchEvent(a);
    }, this.zr.dom.addEventListener(t, this._handlers[t]);
  }, this), this.zr.dom.addEventListener("contextmenu", this._handlers.contextmenu);
};
fh.prototype.dispose = function() {
  SZ.forEach(function(e) {
    this.zr.dom.removeEventListener(e, this._handlers[e]);
  }, this), this._maptalks.remove();
};
J.Shader.import(_Z);
const KSe = fr.extend({
  type: "maptalks3D",
  __ecgl__: !0,
  init: function(e, t) {
    this._groundMesh = new J.Mesh({
      geometry: new J.PlaneGeometry(),
      material: new J.Material({
        shader: new J.Shader({
          vertex: J.Shader.source("ecgl.displayShadow.vertex"),
          fragment: J.Shader.source("ecgl.displayShadow.fragment")
        }),
        depthMask: !1
      }),
      // Render first
      renderOrder: -100,
      culling: !1,
      castShadow: !1,
      $ignorePicking: !0,
      renderNormal: !0
    });
  },
  _initMaptalksLayer: function(e, t) {
    var r = t.getZr();
    this._zrLayer = new fh("maptalks3D", r, e.get("center"), e.get("zoom")), r.painter.insertLayer(-1e3, this._zrLayer), this._lightRoot = new J.Node(), this._sceneHelper = new Jc(this._lightRoot), this._sceneHelper.initLight(this._lightRoot);
    var n = this._zrLayer.getMaptalks(), i = this._dispatchInteractAction.bind(this, t, n);
    ["zoomend", "zooming", "zoomstart", "dragrotating", "pitch", "pitchend", "movestart", "moving", "moveend", "resize", "touchstart", "touchmove", "touchend", "animating"].forEach(function(a) {
      n.on(a, i);
    });
  },
  render: function(e, t, r) {
    this._zrLayer || this._initMaptalksLayer(e, r);
    var n = this._zrLayer.getMaptalks(), i = e.get("urlTemplate"), a = n.getBaseLayer();
    i !== this._oldUrlTemplate && (a ? a.setOptions({
      urlTemplate: i,
      attribution: e.get("attribution")
    }) : (a = new maptalks.TileLayer("maptalks-echarts-gl-baselayer", {
      urlTemplate: i,
      // used sequentially to help with browser parallel requests per domain limitation
      subdomains: ["a", "b", "c"],
      attribution: e.get("attribution")
    }), n.setBaseLayer(a))), this._oldUrlTemplate = i, n.setCenter(e.get("center")), n.setZoom(e.get("zoom"), {
      animation: !1
    }), n.setPitch(e.get("pitch")), n.setBearing(e.get("bearing")), e.setMaptalks(n);
    var o = e.coordinateSystem;
    o.viewGL.scene.add(this._lightRoot), o.viewGL.add(this._groundMesh), this._updateGroundMesh(), this._sceneHelper.setScene(o.viewGL.scene), this._sceneHelper.updateLight(e), o.viewGL.setPostEffect(e.getModel("postEffect"), r), o.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling")), this._maptalks3DModel = e;
  },
  afterRender: function(e, t, r, n) {
    var i = n.renderer;
    this._sceneHelper.updateAmbientCubemap(i, e, r), this._sceneHelper.updateSkybox(i, e, r), e.coordinateSystem.viewGL.scene.traverse(function(a) {
      a.material && (a.material.define("fragment", "NORMAL_UP_AXIS", 2), a.material.define("fragment", "NORMAL_FRONT_AXIS", 1));
    });
  },
  updateCamera: function(e, t, r, n) {
    e.coordinateSystem.setCameraOption(n), this._updateGroundMesh(), r.getZr().refresh();
  },
  _dispatchInteractAction: function(e, t, r) {
    e.dispatchAction({
      type: "maptalks3DChangeCamera",
      pitch: t.getPitch(),
      zoom: JSe(t.getResolution()) + 1,
      center: t.getCenter().toArray(),
      bearing: t.getBearing(),
      maptalks3DId: this._maptalks3DModel && this._maptalks3DModel.id
    });
  },
  _updateGroundMesh: function() {
    if (this._maptalks3DModel) {
      var e = this._maptalks3DModel.coordinateSystem, t = e.dataToPoint(e.center);
      this._groundMesh.position.set(t[0], t[1], -1e-3);
      var r = new J.Plane(new J.Vector3(0, 0, 1), 0), n = e.viewGL.camera.castRay(new J.Vector2(-1, -1)), i = e.viewGL.camera.castRay(new J.Vector2(1, 1)), a = n.intersectPlane(r), o = i.intersectPlane(r), s = a.dist(o) / e.viewGL.rootNode.scale.x;
      this._groundMesh.scale.set(s, s, 1);
    }
  },
  dispose: function(e, t) {
    this._zrLayer && this._zrLayer.dispose(), t.getZr().painter.delLayer(-1e3);
  }
}), QSe = 2 * 6378137 * Math.PI / (256 * Math.pow(2, 20));
function JSe(e) {
  return 19 - Math.log(e / QSe) / Math.LN2;
}
function gx() {
  Wm.apply(this, arguments), this.maxPitch = 85, this.zoomOffset = 1;
}
gx.prototype = new Wm();
gx.prototype.constructor = gx;
gx.prototype.type = "maptalks3D";
var ewe = xZ("maptalks3D", gx, function(e) {
  e.forEach(function(t) {
    t.setCameraOption(t.model.getMaptalksCameraOption());
  });
});
function twe(e) {
  e.registerComponentModel(r3), e.registerComponentView(KSe), e.registerCoordinateSystem("maptalks3D", ewe), e.registerAction({
    type: "maptalks3DChangeCamera",
    event: "maptalks3dcamerachanged",
    update: "maptalks3D:updateCamera"
  }, function(t, r) {
    r.eachComponent({
      mainType: "maptalks3D",
      query: t
    }, function(n) {
      n.setMaptalksCameraOption(t);
    });
  });
}
ft(twe);
var rwe = bn.vec3, nwe = FC.isDimensionStacked;
function iwe(e) {
  var t = e[0], r = e[1];
  return !(t > 0 && r > 0 || t < 0 && r < 0);
}
function awe(e, t) {
  var r = e.getData(), n = e.get("barSize");
  if (n == null) {
    var i = t.size, a, o, s = t.getAxis("x"), l = t.getAxis("y");
    s.type === "category" ? a = s.getBandWidth() * 0.7 : a = Math.round(i[0] / Math.sqrt(r.count())) * 0.6, l.type === "category" ? o = l.getBandWidth() * 0.7 : o = Math.round(i[1] / Math.sqrt(r.count())) * 0.6, n = [a, o];
  } else Se(n) || (n = [n, n]);
  var u = t.getAxis("z").scale.getExtent(), f = iwe(u), c = ["x", "y", "z"].map(function(d) {
    return e.coordDimToDataDim(d)[0];
  }), h = nwe(r, c[2]), v = h ? r.getCalculationInfo("stackResultDimension") : c[2];
  r.each(c, function(d, g, y, x) {
    var S = r.get(v, x), T = h ? S - y : f ? 0 : u[0], C = t.dataToPoint([d, g, T]), A = t.dataToPoint([d, g, S]), M = rwe.dist(C, A), E = [0, A[1] < C[1] ? -1 : 1, 0];
    Math.abs(M) === 0 && (M = 0.1);
    var P = [n[0], M, n[1]];
    r.setItemLayout(x, [C, E, P]);
  }), r.setLayout("orient", [1, 0, 0]);
}
function n3(e, t, r) {
  for (var n = e.getDataExtent(t), i = e.getDataExtent(r), a = n[1] - n[0] || n[0], o = i[1] - i[0] || i[0], s = 50, l = new Uint8Array(s * s), u = 0; u < e.count(); u++) {
    var f = e.get(t, u), c = e.get(r, u), h = Math.floor((f - n[0]) / a * (s - 1)), v = Math.floor((c - i[0]) / o * (s - 1)), d = v * s + h;
    l[d] = l[d] || 1;
  }
  for (var g = 0, u = 0; u < l.length; u++)
    l[u] && g++;
  return g / l.length;
}
var TH = bn.vec3, owe = FC.isDimensionStacked;
function swe(e, t) {
  var r = e.getData(), n = e.get("minHeight") || 0, i = e.get("barSize"), a = ["lng", "lat", "alt"].map(function(u) {
    return e.coordDimToDataDim(u)[0];
  });
  if (i == null) {
    var o = t.radius * Math.PI, s = n3(r, a[0], a[1]);
    i = [o / Math.sqrt(r.count() / s), o / Math.sqrt(r.count() / s)];
  } else Se(i) || (i = [i, i]);
  var l = i3(r, a);
  r.each(a, function(u, f, c, h) {
    var v = r.get(l.dimension, h), d = l.isStacked ? v - c : t.altitudeAxis.scale.getExtent()[0], g = Math.max(t.altitudeAxis.dataToCoord(c), n), y = t.dataToPoint([u, f, d]), x = t.dataToPoint([u, f, v]), S = TH.sub([], x, y);
    TH.normalize(S, S);
    var T = [i[0], g, i[1]];
    r.setItemLayout(h, [y, S, T]);
  }), r.setLayout("orient", Me.UP.array);
}
function lwe(e, t) {
  var r = e.getData(), n = e.get("barSize"), i = e.get("minHeight") || 0, a = ["lng", "lat", "alt"].map(function(f) {
    return e.coordDimToDataDim(f)[0];
  });
  if (n == null) {
    var o = Math.min(t.size[0], t.size[2]), s = n3(r, a[0], a[1]);
    n = [o / Math.sqrt(r.count() / s), o / Math.sqrt(r.count() / s)];
  } else Se(n) || (n = [n, n]);
  var l = [0, 1, 0], u = i3(r, a);
  r.each(a, function(f, c, h, v) {
    var d = r.get(u.dimension, v), g = u.isStacked ? d - h : t.altitudeAxis.scale.getExtent()[0], y = Math.max(t.altitudeAxis.dataToCoord(h), i), x = t.dataToPoint([f, c, g]), S = [n[0], y, n[1]];
    r.setItemLayout(v, [x, l, S]);
  }), r.setLayout("orient", [1, 0, 0]);
}
function uwe(e, t) {
  var r = e.getData(), n = e.coordDimToDataDim("lng")[0], i = e.coordDimToDataDim("lat")[0], a = e.coordDimToDataDim("alt")[0], o = e.get("barSize"), s = e.get("minHeight") || 0;
  if (o == null) {
    var l = r.getDataExtent(n), u = r.getDataExtent(i), f = t.dataToPoint([l[0], u[0]]), c = t.dataToPoint([l[1], u[1]]), h = Math.min(Math.abs(f[0] - c[0]), Math.abs(f[1] - c[1])) || 1, v = n3(r, n, i);
    o = [h / Math.sqrt(r.count() / v), h / Math.sqrt(r.count() / v)];
  } else
    Se(o) || (o = [o, o]), o[0] /= t.getScale() / 16, o[1] /= t.getScale() / 16;
  var d = [0, 0, 1], g = [n, i, a], y = i3(r, g);
  r.each(g, function(x, S, T, C) {
    var A = r.get(y.dimension, C), M = y.isStacked ? A - T : 0, E = t.dataToPoint([x, S, M]), P = t.dataToPoint([x, S, A]), R = Math.max(P[2] - E[2], s), O = [o[0], R, o[1]];
    r.setItemLayout(C, [E, d, O]);
  }), r.setLayout("orient", [1, 0, 0]);
}
function i3(e, t) {
  var r = owe(e, t[2]);
  return {
    dimension: r ? e.getCalculationInfo("stackResultDimension") : t[2],
    isStacked: r
  };
}
function fwe(e) {
  e.registerLayout(function(t, r) {
    t.eachSeriesByType("bar3D", function(n) {
      var i = n.coordinateSystem, a = i && i.type;
      a === "globe" ? swe(n, i) : a === "cartesian3D" ? awe(n, i) : a === "geo3D" ? lwe(n, i) : (a === "mapbox3D" || a === "maptalks3D") && uwe(n, i);
    });
  });
}
var ch = {};
ch.getFormattedLabel = function(e, t, r, n, i) {
  r = r || "normal";
  var a = e.getData(n), o = a.getItemModel(t), s = e.getDataParams(t, n);
  i != null && s.value instanceof Array && (s.value = s.value[i]);
  var l = o.get(r === "normal" ? ["label", "formatter"] : ["emphasis", "label", "formatter"]);
  l == null && (l = o.get(["label", "formatter"]));
  var u;
  return typeof l == "function" ? (s.status = r, u = l(s)) : typeof l == "string" && (u = EC(l, s)), u;
};
ch.normalizeToArray = function(e) {
  return e instanceof Array ? e : e == null ? [] : [e];
};
function cwe(e, t) {
  var r = [];
  return F(e.dimensions, function(n) {
    var i = e.getDimensionInfo(n), a = i.otherDims, o = a[t];
    o != null && o !== !1 && (r[o] = i.name);
  }), r;
}
function Xx(e, t, r) {
  function n(c) {
    var h = [], v = cwe(i, "tooltip");
    v.length ? F(v, function(g) {
      d(i.get(g, t), g);
    }) : F(c, d);
    function d(g, y) {
      var x = i.getDimensionInfo(y);
      if (!(!x || x.otherDims.tooltip === !1)) {
        var S = x.type, T = "- " + (x.tooltipName || x.name) + ": " + (S === "ordinal" ? g + "" : S === "time" ? UW("yyyy/MM/dd hh:mm:ss", g) : G1(g));
        T && h.push(_n(T));
      }
    }
    return "<br/>" + h.join("<br/>");
  }
  var i = e.getData(), a = e.getRawValue(t), o = Se(a) ? n(a) : _n(G1(a)), s = i.getName(t), l = oi(i, t);
  ot(l) && l.colorStops && (l = (l.colorStops[0] || {}).color), l = l || "transparent";
  var u = KR(l), f = e.name;
  return f === "\0-" && (f = ""), f = f ? _n(f) + "<br/>" : "", f + u + (s ? _n(s) + ": " + o : o);
}
function oA(e, t, r) {
  r = r || e.getSource();
  var n = t || gO(e.get("coordinateSystem")) || ["x", "y", "z"], i = ah(r, {
    dimensionsDefine: r.dimensionsDefine || e.get("dimensions"),
    encodeDefine: r.encodeDefine || e.get("encode"),
    coordDimensions: n.map(function(s) {
      var l = e.getReferringComponents(s + "Axis3D").models[0];
      return {
        type: l && l.get("type") === "category" ? "ordinal" : "float",
        name: s
        // Find stackable dimension. Which will represent value.
        // stackable: dim === 'z'
      };
    })
  });
  e.get("coordinateSystem") === "cartesian3D" && i.forEach(function(s) {
    if (n.indexOf(s.coordDim) >= 0) {
      var l = e.getReferringComponents(s.coordDim + "Axis3D").models[0];
      l && l.get("type") === "category" && (s.ordinalMeta = l.getOrdinalMeta());
    }
  });
  var a = FC.enableDataStack(
    // Only support 'z' and `byIndex` now.
    e,
    i,
    {
      byIndex: !0,
      stackedCoordDimension: "z"
    }
  ), o = new zr(i, e);
  return o.setCalculationInfo(a), o.initData(r), o;
}
var wZ = Yt.extend({
  type: "series.bar3D",
  dependencies: ["globe"],
  visualStyleAccessPathvisu: "itemStyle",
  getInitialData: function(e, t) {
    return oA(this);
  },
  getFormattedLabel: function(e, t, r, n) {
    var i = ch.getFormattedLabel(this, e, t, r, n);
    return i == null && (i = this.getData().get("z", e)), i;
  },
  formatTooltip: function(e) {
    return Xx(this, e);
  },
  defaultOption: {
    coordinateSystem: "cartesian3D",
    globeIndex: 0,
    grid3DIndex: 0,
    zlevel: -10,
    // bevelSize, 0 has no bevel
    bevelSize: 0,
    // higher is smoother
    bevelSmoothness: 2,
    // Bar width and depth
    // barSize: [1, 1],
    // On grid plane when coordinateSystem is cartesian3D
    onGridPlane: "xy",
    // Shading of globe
    shading: "color",
    minHeight: 0,
    itemStyle: {
      opacity: 1
    },
    label: {
      show: !1,
      distance: 2,
      textStyle: {
        fontSize: 14,
        color: "#000",
        backgroundColor: "rgba(255,255,255,0.7)",
        padding: 3,
        borderRadius: 3
      }
    },
    emphasis: {
      label: {
        show: !0
      }
    },
    animationDurationUpdate: 500
  }
});
je(wZ.prototype, gy);
var nn = bn.vec3, hwe = bn.mat3, a3 = jt.extend(
  function() {
    return {
      attributes: {
        position: new jt.Attribute("position", "float", 3, "POSITION"),
        normal: new jt.Attribute("normal", "float", 3, "NORMAL"),
        color: new jt.Attribute("color", "float", 4, "COLOR"),
        prevPosition: new jt.Attribute("prevPosition", "float", 3),
        prevNormal: new jt.Attribute("prevNormal", "float", 3)
      },
      dynamic: !0,
      enableNormal: !1,
      bevelSize: 1,
      bevelSegments: 0,
      // Map from vertexIndex to dataIndex.
      _dataIndices: null,
      _vertexOffset: 0,
      _triangleOffset: 0
    };
  },
  /** @lends module:echarts-gl/chart/bars/BarsGeometry.prototype */
  {
    resetOffset: function() {
      this._vertexOffset = 0, this._triangleOffset = 0;
    },
    setBarCount: function(e) {
      var t = this.enableNormal, r = this.getBarVertexCount() * e, n = this.getBarTriangleCount() * e;
      this.vertexCount !== r && (this.attributes.position.init(r), t ? this.attributes.normal.init(r) : this.attributes.normal.value = null, this.attributes.color.init(r)), this.triangleCount !== n && (this.indices = r > 65535 ? new Uint32Array(n * 3) : new Uint16Array(n * 3), this._dataIndices = new Uint32Array(r));
    },
    getBarVertexCount: function() {
      var e = this.bevelSize > 0 ? this.bevelSegments : 0;
      return e > 0 ? this._getBevelBarVertexCount(e) : this.enableNormal ? 24 : 8;
    },
    getBarTriangleCount: function() {
      var e = this.bevelSize > 0 ? this.bevelSegments : 0;
      return e > 0 ? this._getBevelBarTriangleCount(e) : 12;
    },
    _getBevelBarVertexCount: function(e) {
      return (e + 1) * 4 * (e + 1) * 2;
    },
    _getBevelBarTriangleCount: function(e) {
      var t = e * 4 + 3, r = e * 2 + 1;
      return (t + 1) * r * 2 + 4;
    },
    setColor: function(e, t) {
      for (var r = this.getBarVertexCount(), n = r * e, i = r * (e + 1), a = n; a < i; a++)
        this.attributes.color.set(a, t);
      this.dirtyAttribute("color");
    },
    /**
     * Get dataIndex of vertex.
     * @param {number} vertexIndex
     */
    getDataIndexOfVertex: function(e) {
      return this._dataIndices ? this._dataIndices[e] : null;
    },
    /**
     * Add a bar
     * @param {Array.<number>} start
     * @param {Array.<number>} end
     * @param {Array.<number>} orient  right direction
     * @param {Array.<number>} size size on x and z
     * @param {Array.<number>} color
     */
    addBar: (function() {
      for (var e = nn.create, t = nn.scaleAndAdd, r = e(), n = e(), i = e(), a = e(), o = e(), s = e(), l = e(), u = [], f = [], c = 0; c < 8; c++)
        u[c] = e();
      for (var h = [
        // PX
        [0, 1, 5, 4],
        // NX
        [2, 3, 7, 6],
        // PY
        [4, 5, 6, 7],
        // NY
        [3, 2, 1, 0],
        // PZ
        [0, 4, 7, 3],
        // NZ
        [1, 2, 6, 5]
      ], v = [0, 1, 2, 0, 2, 3], d = [], c = 0; c < h.length; c++)
        for (var g = h[c], y = 0; y < 2; y++) {
          for (var x = [], S = 0; S < 3; S++)
            x.push(g[v[y * 3 + S]]);
          d.push(x);
        }
      return function(T, C, A, M, E, P) {
        var R = this._vertexOffset;
        if (this.bevelSize > 0 && this.bevelSegments > 0)
          this._addBevelBar(T, C, A, M, this.bevelSize, this.bevelSegments, E);
        else {
          nn.copy(i, C), nn.normalize(i, i), nn.cross(a, A, i), nn.normalize(a, a), nn.cross(n, i, a), nn.normalize(a, a), nn.negate(o, n), nn.negate(s, i), nn.negate(l, a), t(u[0], T, n, M[0] / 2), t(u[0], u[0], a, M[2] / 2), t(u[1], T, n, M[0] / 2), t(u[1], u[1], l, M[2] / 2), t(u[2], T, o, M[0] / 2), t(u[2], u[2], l, M[2] / 2), t(u[3], T, o, M[0] / 2), t(u[3], u[3], a, M[2] / 2), t(r, T, i, M[1]), t(u[4], r, n, M[0] / 2), t(u[4], u[4], a, M[2] / 2), t(u[5], r, n, M[0] / 2), t(u[5], u[5], l, M[2] / 2), t(u[6], r, o, M[0] / 2), t(u[6], u[6], l, M[2] / 2), t(u[7], r, o, M[0] / 2), t(u[7], u[7], a, M[2] / 2);
          var O = this.attributes;
          if (this.enableNormal) {
            f[0] = n, f[1] = o, f[2] = i, f[3] = s, f[4] = a, f[5] = l;
            for (var N = this._vertexOffset, G = 0; G < h.length; G++) {
              for (var z = this._triangleOffset * 3, H = 0; H < 6; H++)
                this.indices[z++] = N + v[H];
              N += 4, this._triangleOffset += 2;
            }
            for (var G = 0; G < h.length; G++)
              for (var W = f[G], H = 0; H < 4; H++) {
                var Z = h[G][H];
                O.position.set(this._vertexOffset, u[Z]), O.normal.set(this._vertexOffset, W), O.color.set(this._vertexOffset++, E);
              }
          } else {
            for (var G = 0; G < d.length; G++) {
              for (var z = this._triangleOffset * 3, H = 0; H < 3; H++)
                this.indices[z + H] = d[G][H] + this._vertexOffset;
              this._triangleOffset++;
            }
            for (var G = 0; G < u.length; G++)
              O.position.set(this._vertexOffset, u[G]), O.color.set(this._vertexOffset++, E);
          }
        }
        for (var ee = this._vertexOffset, G = R; G < ee; G++)
          this._dataIndices[G] = P;
      };
    })(),
    /**
     * Add a bar with bevel
     * @param {Array.<number>} start
     * @param {Array.<number>} end
     * @param {Array.<number>} orient  right direction
     * @param {Array.<number>} size size on x and z
     * @param {number} bevelSize
     * @param {number} bevelSegments
     * @param {Array.<number>} color
     */
    _addBevelBar: (function() {
      var e = nn.create(), t = nn.create(), r = nn.create(), n = hwe.create(), i = [], a = [1, -1, -1, 1], o = [1, 1, -1, -1], s = [2, 0];
      return function(l, u, f, c, h, v, d) {
        nn.copy(t, u), nn.normalize(t, t), nn.cross(r, f, t), nn.normalize(r, r), nn.cross(e, t, r), nn.normalize(r, r), n[0] = e[0], n[1] = e[1], n[2] = e[2], n[3] = t[0], n[4] = t[1], n[5] = t[2], n[6] = r[0], n[7] = r[1], n[8] = r[2], h = Math.min(c[0], c[2]) / 2 * h;
        for (var g = 0; g < 3; g++)
          i[g] = Math.max(c[g] - h * 2, 0);
        for (var y = (c[0] - i[0]) / 2, x = (c[1] - i[1]) / 2, S = (c[2] - i[2]) / 2, T = [], C = [], A = this._vertexOffset, M = [], g = 0; g < 2; g++) {
          M[g] = M[g] = [];
          for (var E = 0; E <= v; E++)
            for (var P = 0; P < 4; P++) {
              (E === 0 && g === 0 || g === 1 && E === v) && M[g].push(A);
              for (var R = 0; R <= v; R++) {
                var O = R / v * Math.PI / 2 + Math.PI / 2 * P, N = E / v * Math.PI / 2 + Math.PI / 2 * g;
                C[0] = y * Math.cos(O) * Math.sin(N), C[1] = x * Math.cos(N), C[2] = S * Math.sin(O) * Math.sin(N), T[0] = C[0] + a[P] * i[0] / 2, T[1] = C[1] + x + s[g] * i[1] / 2, T[2] = C[2] + o[P] * i[2] / 2, Math.abs(y - x) < 1e-6 && Math.abs(x - S) < 1e-6 || (C[0] /= y * y, C[1] /= x * x, C[2] /= S * S), nn.normalize(C, C), nn.transformMat3(T, T, n), nn.transformMat3(C, C, n), nn.add(T, T, l), this.attributes.position.set(A, T), this.enableNormal && this.attributes.normal.set(A, C), this.attributes.color.set(A, d), A++;
              }
            }
        }
        for (var G = v * 4 + 3, z = v * 2 + 1, H = G + 1, P = 0; P < z; P++)
          for (var g = 0; g <= G; g++) {
            var W = P * H + g + this._vertexOffset, Z = P * H + (g + 1) % H + this._vertexOffset, ee = (P + 1) * H + (g + 1) % H + this._vertexOffset, V = (P + 1) * H + g + this._vertexOffset;
            this.setTriangleIndices(this._triangleOffset++, [ee, W, Z]), this.setTriangleIndices(this._triangleOffset++, [ee, V, W]);
          }
        this.setTriangleIndices(this._triangleOffset++, [M[0][0], M[0][2], M[0][1]]), this.setTriangleIndices(this._triangleOffset++, [M[0][0], M[0][3], M[0][2]]), this.setTriangleIndices(this._triangleOffset++, [M[1][0], M[1][1], M[1][2]]), this.setTriangleIndices(this._triangleOffset++, [M[1][0], M[1][2], M[1][3]]), this._vertexOffset = A;
      };
    })()
  }
);
tt(a3.prototype, Ux);
tt(a3.prototype, JN);
var vwe = bn.vec3;
const dwe = Ut.extend({
  type: "bar3D",
  __ecgl__: !0,
  init: function(e, t) {
    this.groupGL = new J.Node(), this._api = t, this._labelsBuilder = new Lf(256, 256, t);
    var r = this;
    this._labelsBuilder.getLabelPosition = function(n, i, a) {
      if (r._data) {
        var o = r._data.getItemLayout(n), s = o[0], l = o[1], u = o[2][1];
        return vwe.scaleAndAdd([], s, l, a + u);
      } else
        return [0, 0];
    }, this._labelsBuilder.getMesh().renderOrder = 100;
  },
  render: function(e, t, r) {
    var n = this._prevBarMesh;
    this._prevBarMesh = this._barMesh, this._barMesh = n, this._barMesh || (this._barMesh = new J.Mesh({
      geometry: new a3(),
      shadowDepthMaterial: new J.Material({
        shader: new J.Shader(J.Shader.source("ecgl.sm.depth.vertex"), J.Shader.source("ecgl.sm.depth.fragment"))
      }),
      // Only cartesian3D enable culling
      // FIXME Performance
      culling: e.coordinateSystem.type === "cartesian3D",
      // Render after axes
      renderOrder: 10,
      // Render normal in normal pass
      renderNormal: !0
    })), this.groupGL.remove(this._prevBarMesh), this.groupGL.add(this._barMesh), this.groupGL.add(this._labelsBuilder.getMesh());
    var i = e.coordinateSystem;
    if (this._doRender(e, r), i && i.viewGL) {
      i.viewGL.add(this.groupGL);
      var a = i.viewGL.isLinearSpace() ? "define" : "undefine";
      this._barMesh.material[a]("fragment", "SRGB_DECODE");
    }
    this._data = e.getData(), this._labelsBuilder.updateData(this._data), this._labelsBuilder.updateLabels(), this._updateAnimation(e);
  },
  _updateAnimation: function(e) {
    J.updateVertexAnimation([["prevPosition", "position"], ["prevNormal", "normal"]], this._prevBarMesh, this._barMesh, e);
  },
  _doRender: function(e, t) {
    var r = e.getData(), n = e.get("shading"), i = n !== "color", a = this, o = this._barMesh, s = "ecgl." + n;
    (!o.material || o.material.shader.name !== s) && (o.material = J.createMaterial(s, ["VERTEX_COLOR"])), J.setMaterialFromModel(n, o.material, e, t), o.geometry.enableNormal = i, o.geometry.resetOffset();
    var l = e.get("bevelSize"), u = e.get("bevelSmoothness");
    o.geometry.bevelSegments = u, o.geometry.bevelSize = l;
    var f = [], c = new Float32Array(r.count() * 4), h = 0, y = 0, v = !1;
    r.each(function(S) {
      if (r.hasValue(S)) {
        var T = oi(r, S), C = ni(r, S);
        C == null && (C = 1), J.parseColor(T, f), f[3] *= C, c[h++] = f[0], c[h++] = f[1], c[h++] = f[2], c[h++] = f[3], f[3] > 0 && (y++, f[3] < 0.99 && (v = !0));
      }
    }), o.geometry.setBarCount(y);
    var d = r.getLayout("orient"), g = this._barIndexOfData = new Int32Array(r.count()), y = 0;
    r.each(function(S) {
      if (!r.hasValue(S)) {
        g[S] = -1;
        return;
      }
      var T = r.getItemLayout(S), C = T[0], A = T[1], M = T[2], E = S * 4;
      f[0] = c[E++], f[1] = c[E++], f[2] = c[E++], f[3] = c[E++], f[3] > 0 && (a._barMesh.geometry.addBar(C, A, d, M, f, S), g[S] = y++);
    }), o.geometry.dirty(), o.geometry.updateBoundingBox();
    var x = o.material;
    x.transparent = v, x.depthMask = !v, o.geometry.sortTriangles = v, this._initHandler(e, t);
  },
  _initHandler: function(e, t) {
    var r = e.getData(), n = this._barMesh, i = e.coordinateSystem.type === "cartesian3D";
    n.seriesIndex = e.seriesIndex;
    var a = -1;
    n.off("mousemove"), n.off("mouseout"), n.on("mousemove", function(o) {
      var s = n.geometry.getDataIndexOfVertex(o.triangle[0]);
      s !== a && (this._downplay(a), this._highlight(s), this._labelsBuilder.updateLabels([s]), i && t.dispatchAction({
        type: "grid3DShowAxisPointer",
        value: [r.get("x", s), r.get("y", s), r.get("z", s, !0)]
      })), a = s, n.dataIndex = s;
    }, this), n.on("mouseout", function(o) {
      this._downplay(a), this._labelsBuilder.updateLabels(), a = -1, n.dataIndex = -1, i && t.dispatchAction({
        type: "grid3DHideAxisPointer"
      });
    }, this);
  },
  _highlight: function(e) {
    var t = this._data;
    if (t) {
      var r = this._barIndexOfData[e];
      if (!(r < 0)) {
        var n = t.getItemModel(e), i = n.getModel("emphasis.itemStyle"), a = i.get("color"), o = i.get("opacity");
        if (a == null) {
          var s = oi(t, e);
          a = _d(s, -0.4);
        }
        o == null && (o = ni(t, e));
        var l = J.parseColor(a);
        l[3] *= o, this._barMesh.geometry.setColor(r, l), this._api.getZr().refresh();
      }
    }
  },
  _downplay: function(e) {
    var t = this._data;
    if (t) {
      var r = this._barIndexOfData[e];
      if (!(r < 0)) {
        var n = oi(t, e), i = ni(t, e), a = J.parseColor(n);
        a[3] *= i, this._barMesh.geometry.setColor(r, a), this._api.getZr().refresh();
      }
    }
  },
  highlight: function(e, t, r, n) {
    this._toggleStatus("highlight", e, t, r, n);
  },
  downplay: function(e, t, r, n) {
    this._toggleStatus("downplay", e, t, r, n);
  },
  _toggleStatus: function(e, t, r, n, i) {
    var a = t.getData(), o = qt.queryDataIndex(a, i), s = this;
    o != null ? F(ch.normalizeToArray(o), function(l) {
      e === "highlight" ? this._highlight(l) : this._downplay(l);
    }, this) : a.each(function(l) {
      e === "highlight" ? s._highlight(l) : s._downplay(l);
    });
  },
  remove: function() {
    this.groupGL.removeAll();
  },
  dispose: function() {
    this._labelsBuilder.dispose(), this.groupGL.removeAll();
  }
});
function pwe(e) {
  e.registerChartView(dwe), e.registerSeriesModel(wZ), fwe(e), e.registerProcessor(function(t, r) {
    t.eachSeriesByType("bar3d", function(n) {
      var i = n.getData();
      i.filterSelf(function(a) {
        return i.hasValue(a);
      });
    });
  });
}
ft(pwe);
var gwe = Yt.extend({
  type: "series.line3D",
  dependencies: ["grid3D"],
  visualStyleAccessPath: "lineStyle",
  visualDrawType: "stroke",
  getInitialData: function(e, t) {
    return oA(this);
  },
  formatTooltip: function(e) {
    return Xx(this, e);
  },
  defaultOption: {
    coordinateSystem: "cartesian3D",
    zlevel: -10,
    // Cartesian coordinate system
    grid3DIndex: 0,
    lineStyle: {
      width: 2
    },
    animationDurationUpdate: 500
  }
});
function mwe(e, t, r, n, i, a, o) {
  if (i === 0)
    return !1;
  var s = i, l = 0, u = e;
  if (o > t + s && o > n + s || o < t - s && o < n - s || a > e + s && a > r + s || a < e - s && a < r - s)
    return !1;
  if (e !== r)
    l = (t - n) / (e - r), u = (e * n - r * t) / (e - r);
  else
    return Math.abs(a - e) <= s / 2;
  var f = l * a - o + u, c = f * f / (l * l + 1);
  return c <= s / 2 * s / 2;
}
var ywe = bn.vec3;
J.Shader.import(aA);
const _we = Ut.extend({
  type: "line3D",
  __ecgl__: !0,
  init: function(e, t) {
    this.groupGL = new J.Node(), this._api = t;
  },
  render: function(e, t, r) {
    var n = this._prevLine3DMesh;
    this._prevLine3DMesh = this._line3DMesh, this._line3DMesh = n, this._line3DMesh || (this._line3DMesh = new J.Mesh({
      geometry: new lh({
        useNativeLine: !1,
        sortTriangles: !0
      }),
      material: new J.Material({
        shader: J.createShader("ecgl.meshLines3D")
      }),
      // Render after axes
      renderOrder: 10
    }), this._line3DMesh.geometry.pick = this._pick.bind(this)), this.groupGL.remove(this._prevLine3DMesh), this.groupGL.add(this._line3DMesh);
    var i = e.coordinateSystem;
    if (i && i.viewGL) {
      i.viewGL.add(this.groupGL);
      var a = i.viewGL.isLinearSpace() ? "define" : "undefine";
      this._line3DMesh.material[a]("fragment", "SRGB_DECODE");
    }
    this._doRender(e, r), this._data = e.getData(), this._camera = i.viewGL.camera, this.updateCamera(), this._updateAnimation(e);
  },
  updateCamera: function() {
    this._updateNDCPosition();
  },
  _doRender: function(e, t) {
    var r = e.getData(), n = this._line3DMesh;
    n.geometry.resetOffset();
    var i = r.getLayout("points"), a = [], o = new Float32Array(i.length / 3 * 4), s = 0, l = !1;
    r.each(function(c) {
      var h = oi(r, c), v = ni(r, c);
      v == null && (v = 1), J.parseColor(h, a), a[3] *= v, o[s++] = a[0], o[s++] = a[1], o[s++] = a[2], o[s++] = a[3], a[3] < 0.99 && (l = !0);
    }), n.geometry.setVertexCount(n.geometry.getPolylineVertexCount(i)), n.geometry.setTriangleCount(n.geometry.getPolylineTriangleCount(i)), n.geometry.addPolyline(i, o, qt.firstNotNull(e.get("lineStyle.width"), 1)), n.geometry.dirty(), n.geometry.updateBoundingBox();
    var u = n.material;
    u.transparent = l, u.depthMask = !l;
    var f = e.getModel("debug.wireframe");
    f.get("show") ? (n.geometry.createAttribute("barycentric", "float", 3), n.geometry.generateBarycentric(), n.material.set("both", "WIREFRAME_TRIANGLE"), n.material.set("wireframeLineColor", J.parseColor(f.get("lineStyle.color") || "rgba(0,0,0,0.5)")), n.material.set("wireframeLineWidth", qt.firstNotNull(f.get("lineStyle.width"), 1))) : n.material.set("both", "WIREFRAME_TRIANGLE"), this._points = i, this._initHandler(e, t);
  },
  _updateAnimation: function(e) {
    J.updateVertexAnimation([["prevPosition", "position"], ["prevPositionPrev", "positionPrev"], ["prevPositionNext", "positionNext"]], this._prevLine3DMesh, this._line3DMesh, e);
  },
  _initHandler: function(e, t) {
    var r = e.getData(), n = e.coordinateSystem, i = this._line3DMesh, a = -1;
    i.seriesIndex = e.seriesIndex, i.off("mousemove"), i.off("mouseout"), i.on("mousemove", function(o) {
      var s = n.pointToData(o.point.array), l = r.indicesOfNearest("x", s[0])[0];
      l !== a && (t.dispatchAction({
        type: "grid3DShowAxisPointer",
        value: [r.get("x", l), r.get("y", l), r.get("z", l)]
      }), i.dataIndex = l), a = l;
    }, this), i.on("mouseout", function(o) {
      a = -1, i.dataIndex = -1, t.dispatchAction({
        type: "grid3DHideAxisPointer"
      });
    }, this);
  },
  // _highlight: function (dataIndex) {
  //     var data = this._data;
  //     if (!data) {
  //         return;
  //     }
  // },
  // _downplay: function (dataIndex) {
  //     var data = this._data;
  //     if (!data) {
  //         return;
  //     }
  // },
  _updateNDCPosition: function() {
    var e = new Ke(), t = this._camera;
    Ke.multiply(e, t.projectionMatrix, t.viewMatrix);
    var r = this._positionNDC, n = this._points, i = n.length / 3;
    (!r || r.length / 2 !== i) && (r = this._positionNDC = new Float32Array(i * 2));
    for (var a = [], o = 0; o < i; o++) {
      var s = o * 3, l = o * 2;
      a[0] = n[s], a[1] = n[s + 1], a[2] = n[s + 2], a[3] = 1, ywe.transformMat4(a, a, e.array), r[l] = a[0] / a[3], r[l + 1] = a[1] / a[3];
    }
  },
  _pick: function(e, t, r, n, i, a) {
    var o = this._positionNDC, s = this._data.hostModel, l = s.get("lineStyle.width"), u = -1, f = r.viewport.width, c = r.viewport.height, h = f * 0.5, v = c * 0.5;
    e = (e + 1) * h, t = (t + 1) * v;
    for (var d = 1; d < o.length / 2; d++) {
      var g = (o[(d - 1) * 2] + 1) * h, y = (o[(d - 1) * 2 + 1] + 1) * v, x = (o[d * 2] + 1) * h, S = (o[d * 2 + 1] + 1) * v;
      if (mwe(g, y, x, S, l, e, t)) {
        var T = (g - e) * (g - e) + (y - t) * (y - t), C = (x - e) * (x - e) + (S - t) * (S - t);
        u = T < C ? d - 1 : d;
      }
    }
    if (u >= 0) {
      var A = u * 3, M = new Me(this._points[A], this._points[A + 1], this._points[A + 2]);
      a.push({
        dataIndex: u,
        point: M,
        pointWorld: M.clone(),
        target: this._line3DMesh,
        distance: this._camera.getWorldPosition().dist(M)
      });
    }
  },
  remove: function() {
    this.groupGL.removeAll();
  },
  dispose: function() {
    this.groupGL.removeAll();
  }
});
function xwe(e) {
  e.registerChartView(_we), e.registerSeriesModel(gwe), e.registerLayout(function(t, r) {
    t.eachSeriesByType("line3D", function(n) {
      var i = n.getData(), a = n.coordinateSystem;
      if (a) {
        if (a.type !== "cartesian3D")
          return;
        var o = new Float32Array(i.count() * 3), s = [], l = [], u = a.dimensions, f = u.map(function(c) {
          return n.coordDimToDataDim(c)[0];
        });
        a && i.each(f, function(c, h, v, d) {
          s[0] = c, s[1] = h, s[2] = v, a.dataToPoint(s, l), o[d * 3] = l[0], o[d * 3 + 1] = l[1], o[d * 3 + 2] = l[2];
        }), i.setLayout("points", o);
      }
    });
  });
}
ft(xwe);
const Swe = Yt.extend({
  type: "series.scatter3D",
  dependencies: ["globe", "grid3D", "geo3D"],
  visualStyleAccessPath: "itemStyle",
  hasSymbolVisual: !0,
  getInitialData: function(e, t) {
    return oA(this);
  },
  getFormattedLabel: function(e, t, r, n) {
    var i = ch.getFormattedLabel(this, e, t, r, n);
    if (i == null) {
      var a = this.getData(), o = a.dimensions[a.dimensions.length - 1];
      i = a.get(o, e);
    }
    return i;
  },
  formatTooltip: function(e) {
    return Xx(this, e);
  },
  defaultOption: {
    coordinateSystem: "cartesian3D",
    zlevel: -10,
    progressive: 1e5,
    progressiveThreshold: 1e5,
    // Cartesian coordinate system
    grid3DIndex: 0,
    globeIndex: 0,
    symbol: "circle",
    symbolSize: 10,
    // Support source-over, lighter
    blendMode: "source-over",
    label: {
      show: !1,
      position: "right",
      // Screen space distance
      distance: 5,
      textStyle: {
        fontSize: 14,
        color: "#000",
        backgroundColor: "rgba(255,255,255,0.7)",
        padding: 3,
        borderRadius: 3
      }
    },
    itemStyle: {
      opacity: 0.8
    },
    emphasis: {
      label: {
        show: !0
      }
    },
    animationDurationUpdate: 500
  }
});
function _E(e, n, r) {
  var n = n || document.createElement("canvas");
  n.width = e, n.height = e;
  var i = n.getContext("2d");
  return r && r(i), n;
}
function wwe(e, t, r, n) {
  Se(t) || (t = [t, t]);
  var i = sC.getMarginByStyle(r, n), a = t[0] + i.left + i.right, o = t[1] + i.top + i.bottom, s = en(e, 0, 0, t[0], t[1]), l = Math.max(a, o);
  s.x = i.left, s.y = i.top, a > o ? s.y += (l - o) / 2 : s.x += (l - a) / 2;
  var u = s.getBoundingRect();
  return s.x -= u.x, s.y -= u.y, s.setStyle(r), s.update(), s.__size = l, s;
}
function Twe(e, t, r) {
  var n = t.width, i = t.height, a = e.canvas.width, o = e.canvas.height, s = n / a, l = i / o;
  function u(x) {
    return x < 128 ? 1 : -1;
  }
  function f(x, S) {
    var T = 1 / 0;
    x = Math.floor(x * s), S = Math.floor(S * l);
    for (var C = S * n + x, A = t.data[C * 4], M = u(A), E = Math.max(S - r, 0); E < Math.min(S + r, i); E++)
      for (var P = Math.max(x - r, 0); P < Math.min(x + r, n); P++) {
        var C = E * n + P, R = t.data[C * 4], O = u(R), N = P - x, G = E - S;
        if (M !== O) {
          var z = N * N + G * G;
          z < T && (T = z);
        }
      }
    return M * Math.sqrt(T);
  }
  for (var c = e.createImageData(a, o), h = 0; h < o; h++)
    for (var v = 0; v < a; v++) {
      var d = f(v, h), g = d / r * 0.5 + 0.5, y = (h * a + v) * 4;
      c.data[y++] = (1 - g) * 255, c.data[y++] = (1 - g) * 255, c.data[y++] = (1 - g) * 255, c.data[y++] = 255;
    }
  return c;
}
var sC = {
  getMarginByStyle: function(e) {
    var t = e.minMargin || 0, r = 0;
    e.stroke && e.stroke !== "none" && (r = e.lineWidth == null ? 1 : e.lineWidth);
    var n = e.shadowBlur || 0, i = e.shadowOffsetX || 0, a = e.shadowOffsetY || 0, o = {};
    return o.left = Math.max(r / 2, -i + n, t), o.right = Math.max(r / 2, i + n, t), o.top = Math.max(r / 2, -a + n, t), o.bottom = Math.max(r / 2, a + n, t), o;
  },
  // TODO Not consider shadowOffsetX, shadowOffsetY.
  /**
   * @param {string} symbol
   * @param {number | Array.<number>} symbolSize
   * @param {Object} style
   */
  createSymbolSprite: function(e, t, r, n) {
    var i = wwe(e, t, r), a = sC.getMarginByStyle(r);
    return {
      image: _E(i.__size, n, function(o) {
        Ix(o, i);
      }),
      margin: a
    };
  },
  createSDFFromCanvas: function(e, t, r, n) {
    return _E(t, n, function(i) {
      var a = e.getContext("2d"), o = a.getImageData(0, 0, e.width, e.height);
      i.putImageData(Twe(i, o, r), 0, 0);
    });
  },
  createSimpleSprite: function(e, t) {
    return _E(e, t, function(r) {
      var n = e / 2;
      r.beginPath(), r.arc(n, n, 60, 0, Math.PI * 2, !1), r.closePath();
      var i = r.createRadialGradient(n, n, 0, n, n, n);
      i.addColorStop(0, "rgba(255, 255, 255, 1)"), i.addColorStop(0.5, "rgba(255, 255, 255, 0.5)"), i.addColorStop(1, "rgba(255, 255, 255, 0)"), r.fillStyle = i, r.fill();
    });
  }
}, bH = bn.vec3;
const bwe = {
  needsSortVertices: function() {
    return this.sortVertices;
  },
  needsSortVerticesProgressively: function() {
    return this.needsSortVertices() && this.vertexCount >= 2e4;
  },
  doSortVertices: function(e, t) {
    var r = this.indices, n = bH.create();
    if (!r) {
      r = this.indices = this.vertexCount > 65535 ? new Uint32Array(this.vertexCount) : new Uint16Array(this.vertexCount);
      for (var i = 0; i < r.length; i++)
        r[i] = i;
    }
    if (t === 0) {
      var a = this.attributes.position, e = e.array, o = 0;
      (!this._zList || this._zList.length !== this.vertexCount) && (this._zList = new Float32Array(this.vertexCount));
      for (var s, i = 0; i < this.vertexCount; i++) {
        a.get(i, n);
        var l = bH.sqrDist(n, e);
        isNaN(l) && (l = 1e7, o++), i === 0 ? (s = l, l = 0) : l = l - s, this._zList[i] = l;
      }
      this._noneCount = o;
    }
    if (this.vertexCount < 2e4)
      t === 0 && this._simpleSort(this._noneCount / this.vertexCount > 0.05);
    else
      for (var i = 0; i < 3; i++)
        this._progressiveQuickSort(t * 3 + i);
    this.dirtyIndices();
  },
  _simpleSort: function(e) {
    var t = this._zList, r = this.indices;
    function n(i, a) {
      return t[a] - t[i];
    }
    e ? Array.prototype.sort.call(r, n) : Hm.sort(r, n, 0, r.length - 1);
  },
  _progressiveQuickSort: function(e) {
    var t = this._zList, r = this.indices;
    this._quickSort = this._quickSort || new Hm(), this._quickSort.step(r, function(n, i) {
      return t[i] - t[n];
    }, e);
  }
}, Cwe = `@export ecgl.sdfSprite.vertex

uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
uniform float elapsedTime : 0;

attribute vec3 position : POSITION;

#ifdef VERTEX_SIZE
attribute float size;
#else
uniform float u_Size;
#endif

#ifdef VERTEX_COLOR
attribute vec4 a_FillColor: COLOR;
varying vec4 v_Color;
#endif

#ifdef VERTEX_ANIMATION
attribute vec3 prevPosition;
attribute float prevSize;
uniform float percent : 1.0;
#endif


#ifdef POSITIONTEXTURE_ENABLED
uniform sampler2D positionTexture;
#endif

varying float v_Size;

void main()
{

#ifdef POSITIONTEXTURE_ENABLED
 gl_Position = worldViewProjection * vec4(texture2D(positionTexture, position.xy).xy, -10.0, 1.0);
#else

 #ifdef VERTEX_ANIMATION
 vec3 pos = mix(prevPosition, position, percent);
 #else
 vec3 pos = position;
 #endif
 gl_Position = worldViewProjection * vec4(pos, 1.0);
#endif

#ifdef VERTEX_SIZE
#ifdef VERTEX_ANIMATION
 v_Size = mix(prevSize, size, percent);
#else
 v_Size = size;
#endif
#else
 v_Size = u_Size;
#endif

#ifdef VERTEX_COLOR
 v_Color = a_FillColor;
 #endif

 gl_PointSize = v_Size;
}

@end

@export ecgl.sdfSprite.fragment

uniform vec4 color: [1, 1, 1, 1];
uniform vec4 strokeColor: [1, 1, 1, 1];
uniform float smoothing: 0.07;

uniform float lineWidth: 0.0;

#ifdef VERTEX_COLOR
varying vec4 v_Color;
#endif

varying float v_Size;

uniform sampler2D sprite;

@import clay.util.srgb

void main()
{
 gl_FragColor = color;

 vec4 _strokeColor = strokeColor;

#ifdef VERTEX_COLOR
 gl_FragColor *= v_Color;
 #endif

#ifdef SPRITE_ENABLED
 float d = texture2D(sprite, gl_PointCoord).r;
 gl_FragColor.a *= smoothstep(0.5 - smoothing, 0.5 + smoothing, d);

 if (lineWidth > 0.0) {
 float sLineWidth = lineWidth / 2.0;

 float outlineMaxValue0 = 0.5 + sLineWidth;
 float outlineMaxValue1 = 0.5 + sLineWidth + smoothing;
 float outlineMinValue0 = 0.5 - sLineWidth - smoothing;
 float outlineMinValue1 = 0.5 - sLineWidth;

 if (d <= outlineMaxValue1 && d >= outlineMinValue0) {
 float a = _strokeColor.a;
 if (d <= outlineMinValue1) {
 a = a * smoothstep(outlineMinValue0, outlineMinValue1, d);
 }
 else {
 a = a * smoothstep(outlineMaxValue1, outlineMaxValue0, d);
 }
 gl_FragColor.rgb = mix(gl_FragColor.rgb * gl_FragColor.a, _strokeColor.rgb, a);
 gl_FragColor.a = gl_FragColor.a * (1.0 - a) + a;
 }
 }
#endif

#ifdef SRGB_DECODE
 gl_FragColor = sRGBToLinear(gl_FragColor);
#endif
}
@end`;
var xE = bn.vec4;
J.Shader.import(Cwe);
var Awe = J.Mesh.extend(function() {
  var e = new J.Geometry({
    dynamic: !0,
    attributes: {
      color: new J.Geometry.Attribute("color", "float", 4, "COLOR"),
      position: new J.Geometry.Attribute("position", "float", 3, "POSITION"),
      size: new J.Geometry.Attribute("size", "float", 1),
      prevPosition: new J.Geometry.Attribute("prevPosition", "float", 3),
      prevSize: new J.Geometry.Attribute("prevSize", "float", 1)
    }
  });
  Object.assign(e, bwe);
  var t = new J.Material({
    shader: J.createShader("ecgl.sdfSprite"),
    transparent: !0,
    depthMask: !1
  });
  t.enableTexture("sprite"), t.define("both", "VERTEX_COLOR"), t.define("both", "VERTEX_SIZE");
  var r = new J.Texture2D({
    image: document.createElement("canvas"),
    flipY: !1
  });
  return t.set("sprite", r), e.pick = this._pick.bind(this), {
    geometry: e,
    material: t,
    mode: J.Mesh.POINTS,
    sizeScale: 1
  };
}, {
  _pick: function(e, t, r, n, i, a) {
    var o = this._positionNDC;
    if (o)
      for (var s = r.viewport, l = 2 / s.width, u = 2 / s.height, f = this.geometry.vertexCount - 1; f >= 0; f--) {
        var c;
        this.geometry.indices ? c = this.geometry.indices[f] : c = f;
        var h = o[c * 2], v = o[c * 2 + 1], d = this.geometry.attributes.size.get(c) / this.sizeScale, g = d / 2;
        if (e > h - g * l && e < h + g * l && t > v - g * u && t < v + g * u) {
          var y = new J.Vector3(), x = new J.Vector3();
          this.geometry.attributes.position.get(c, y.array), J.Vector3.transformMat4(x, y, this.worldTransform), a.push({
            vertexIndex: c,
            point: y,
            pointWorld: x,
            target: this,
            distance: x.distance(n.getWorldPosition())
          });
        }
      }
  },
  updateNDCPosition: function(e, t, r) {
    var n = this._positionNDC, i = this.geometry;
    (!n || n.length / 2 !== i.vertexCount) && (n = this._positionNDC = new Float32Array(i.vertexCount * 2));
    for (var a = xE.create(), o = 0; o < i.vertexCount; o++)
      i.attributes.position.get(o, a), a[3] = 1, xE.transformMat4(a, a, e.array), xE.scale(a, a, 1 / a[3]), n[o * 2] = a[0], n[o * 2 + 1] = a[1];
  }
}), CH = 20, AH = -10;
function Mwe(e, t) {
  return e && t && e[0] === t[0] && e[1] === t[1];
}
function Rd(e, t) {
  this.rootNode = new J.Node(), this.is2D = e, this._labelsBuilder = new Lf(256, 256, t), this._labelsBuilder.getMesh().renderOrder = 100, this.rootNode.add(this._labelsBuilder.getMesh()), this._api = t, this._spriteImageCanvas = document.createElement("canvas"), this._startDataIndex = 0, this._endDataIndex = 0, this._sizeScale = 1;
}
Rd.prototype = {
  constructor: Rd,
  /**
   * If highlight on over
   */
  highlightOnMouseover: !0,
  update: function(e, t, r, n, i) {
    var a = this._prevMesh;
    this._prevMesh = this._mesh, this._mesh = a;
    var o = e.getData();
    if (n == null && (n = 0), i == null && (i = o.count()), this._startDataIndex = n, this._endDataIndex = i - 1, !this._mesh) {
      var s = this._prevMesh && this._prevMesh.material;
      this._mesh = new Awe({
        // Render after axes
        renderOrder: 10,
        // FIXME
        frustumCulling: !1
      }), s && (this._mesh.material = s);
    }
    var s = this._mesh.material, l = this._mesh.geometry, u = l.attributes;
    this.rootNode.remove(this._prevMesh), this.rootNode.add(this._mesh), this._setPositionTextureToMesh(this._mesh, this._positionTexture);
    var f = this._getSymbolInfo(e, n, i), c = r.getDevicePixelRatio(), h = e.getModel("itemStyle").getItemStyle(), v = e.get("large"), d = 1;
    f.maxSize > 2 ? (d = this._updateSymbolSprite(e, h, f, c), s.enableTexture("sprite")) : s.disableTexture("sprite"), u.position.init(i - n);
    var g = [];
    if (v) {
      s.undefine("VERTEX_SIZE"), s.undefine("VERTEX_COLOR");
      var y = ySe(o), x = _Se(o);
      J.parseColor(y, g), g[3] *= x, s.set({
        color: g,
        u_Size: f.maxSize * this._sizeScale
      });
    } else
      s.set({
        color: [1, 1, 1, 1]
      }), s.define("VERTEX_SIZE"), s.define("VERTEX_COLOR"), u.size.init(i - n), u.color.init(i - n), this._originalOpacity = new Float32Array(i - n);
    for (var S = o.getLayout("points"), T = u.position.value, C = 0; C < i - n; C++) {
      var A = C * 3, M = C * 2;
      if (this.is2D ? (T[A] = S[M], T[A + 1] = S[M + 1], T[A + 2] = AH) : (T[A] = S[A], T[A + 1] = S[A + 1], T[A + 2] = S[A + 2]), !v) {
        var y = oi(o, C), x = ni(o, C);
        J.parseColor(y, g), g[3] *= x, u.color.set(C, g), g[3] < 0.99;
        var E = o.getItemVisual(C, "symbolSize");
        E = E instanceof Array ? Math.max(E[0], E[1]) : E, isNaN(E) && (E = 0), u.size.value[C] = E * d * this._sizeScale, this._originalOpacity[C] = g[3];
      }
    }
    this._mesh.sizeScale = d, l.updateBoundingBox(), l.dirty(), this._updateMaterial(e, h);
    var P = e.coordinateSystem;
    if (P && P.viewGL) {
      var R = P.viewGL.isLinearSpace() ? "define" : "undefine";
      s[R]("fragment", "SRGB_DECODE");
    }
    v || this._updateLabelBuilder(e, n, i), this._updateHandler(e, t, r), this._updateAnimation(e), this._api = r;
  },
  getPointsMesh: function() {
    return this._mesh;
  },
  updateLabels: function(e) {
    this._labelsBuilder.updateLabels(e);
  },
  hideLabels: function() {
    this.rootNode.remove(this._labelsBuilder.getMesh());
  },
  showLabels: function() {
    this.rootNode.add(this._labelsBuilder.getMesh());
  },
  dispose: function() {
    this._labelsBuilder.dispose();
  },
  _updateSymbolSprite: function(e, t, r, n) {
    r.maxSize = Math.min(r.maxSize * 2, 200);
    var i = [];
    return r.aspect > 1 ? (i[0] = r.maxSize, i[1] = r.maxSize / r.aspect) : (i[1] = r.maxSize, i[0] = r.maxSize * r.aspect), i[0] = i[0] || 1, i[1] = i[1] || 1, (this._symbolType !== r.type || !Mwe(this._symbolSize, i) || this._lineWidth !== t.lineWidth) && (sC.createSymbolSprite(r.type, i, {
      fill: "#fff",
      lineWidth: t.lineWidth,
      stroke: "transparent",
      shadowColor: "transparent",
      minMargin: Math.min(i[0] / 2, 10)
    }, this._spriteImageCanvas), sC.createSDFFromCanvas(this._spriteImageCanvas, Math.min(this._spriteImageCanvas.width, 32), CH, this._mesh.material.get("sprite").image), this._symbolType = r.type, this._symbolSize = i, this._lineWidth = t.lineWidth), this._spriteImageCanvas.width / r.maxSize * n;
  },
  _updateMaterial: function(e, t) {
    var r = e.get("blendMode") === "lighter" ? J.additiveBlend : null, n = this._mesh.material;
    n.blend = r, n.set("lineWidth", t.lineWidth / CH);
    var i = J.parseColor(t.stroke);
    n.set("strokeColor", i), n.transparent = !0, n.depthMask = !1, n.depthTest = !this.is2D, n.sortVertices = !this.is2D;
  },
  _updateLabelBuilder: function(e, o, r) {
    var n = e.getData(), i = this._mesh.geometry, a = i.attributes.position.value, o = this._startDataIndex, s = this._mesh.sizeScale;
    this._labelsBuilder.updateData(n, o, r), this._labelsBuilder.getLabelPosition = function(l, u, f) {
      var c = (l - o) * 3;
      return [a[c], a[c + 1], a[c + 2]];
    }, this._labelsBuilder.getLabelDistance = function(l, u, f) {
      var c = i.attributes.size.get(l - o) / s;
      return c / 2 + f;
    }, this._labelsBuilder.updateLabels();
  },
  _updateAnimation: function(e) {
    J.updateVertexAnimation([["prevPosition", "position"], ["prevSize", "size"]], this._prevMesh, this._mesh, e);
  },
  _updateHandler: function(e, t, r) {
    var n = e.getData(), i = this._mesh, a = this, o = -1, s = e.coordinateSystem && e.coordinateSystem.type === "cartesian3D", l;
    s && (l = e.coordinateSystem.model), i.seriesIndex = e.seriesIndex, i.off("mousemove"), i.off("mouseout"), i.on("mousemove", function(u) {
      var f = u.vertexIndex + a._startDataIndex;
      f !== o && (this.highlightOnMouseover && (this.downplay(n, o), this.highlight(n, f), this._labelsBuilder.updateLabels([f])), s && r.dispatchAction({
        type: "grid3DShowAxisPointer",
        value: [n.get(e.coordDimToDataDim("x")[0], f), n.get(e.coordDimToDataDim("y")[0], f), n.get(e.coordDimToDataDim("z")[0], f)],
        grid3DIndex: l.componentIndex
      })), i.dataIndex = f, o = f;
    }, this), i.on("mouseout", function(u) {
      var f = u.vertexIndex + a._startDataIndex;
      this.highlightOnMouseover && (this.downplay(n, f), this._labelsBuilder.updateLabels()), o = -1, i.dataIndex = -1, s && r.dispatchAction({
        type: "grid3DHideAxisPointer",
        grid3DIndex: l.componentIndex
      });
    }, this);
  },
  updateLayout: function(e, t, r) {
    var n = e.getData();
    if (this._mesh) {
      var i = this._mesh.geometry.attributes.position.value, a = n.getLayout("points");
      if (this.is2D)
        for (var o = 0; o < a.length / 2; o++) {
          var s = o * 3, l = o * 2;
          i[s] = a[l], i[s + 1] = a[l + 1], i[s + 2] = AH;
        }
      else
        for (var o = 0; o < a.length; o++)
          i[o] = a[o];
      this._mesh.geometry.dirty(), r.getZr().refresh();
    }
  },
  updateView: function(e) {
    if (this._mesh) {
      var t = new Ke();
      Ke.mul(t, e.viewMatrix, this._mesh.worldTransform), Ke.mul(t, e.projectionMatrix, t), this._mesh.updateNDCPosition(t, this.is2D, this._api);
    }
  },
  highlight: function(e, t) {
    if (!(t > this._endDataIndex || t < this._startDataIndex)) {
      var r = e.getItemModel(t), n = r.getModel("emphasis.itemStyle"), i = n.get("color"), a = n.get("opacity");
      if (i == null) {
        var o = oi(e, t);
        i = _d(o, -0.4);
      }
      a == null && (a = ni(e, t));
      var s = J.parseColor(i);
      s[3] *= a, this._mesh.geometry.attributes.color.set(t - this._startDataIndex, s), this._mesh.geometry.dirtyAttribute("color"), this._api.getZr().refresh();
    }
  },
  downplay: function(e, t) {
    if (!(t > this._endDataIndex || t < this._startDataIndex)) {
      var r = oi(e, t), n = ni(e, t), i = J.parseColor(r);
      i[3] *= n, this._mesh.geometry.attributes.color.set(t - this._startDataIndex, i), this._mesh.geometry.dirtyAttribute("color"), this._api.getZr().refresh();
    }
  },
  fadeOutAll: function(e) {
    if (this._originalOpacity) {
      for (var t = this._mesh.geometry, r = 0; r < t.vertexCount; r++) {
        var n = this._originalOpacity[r] * e;
        t.attributes.color.value[r * 4 + 3] = n;
      }
      t.dirtyAttribute("color"), this._api.getZr().refresh();
    }
  },
  fadeInAll: function() {
    this.fadeOutAll(1);
  },
  setPositionTexture: function(e) {
    this._mesh && this._setPositionTextureToMesh(this._mesh, e), this._positionTexture = e;
  },
  removePositionTexture: function() {
    this._positionTexture = null, this._mesh && this._setPositionTextureToMesh(this._mesh, null);
  },
  setSizeScale: function(e) {
    if (e !== this._sizeScale) {
      if (this._mesh) {
        var t = this._mesh.material.get("u_Size");
        this._mesh.material.set("u_Size", t / this._sizeScale * e);
        var r = this._mesh.geometry.attributes;
        if (r.size.value)
          for (var n = 0; n < r.size.value.length; n++)
            r.size.value[n] = r.size.value[n] / this._sizeScale * e;
      }
      this._sizeScale = e;
    }
  },
  _setPositionTextureToMesh: function(e, t) {
    t && e.material.set("positionTexture", t), e.material[t ? "enableTexture" : "disableTexture"]("positionTexture");
  },
  _getSymbolInfo: function(e, t, r) {
    if (e.get("large")) {
      var n = qt.firstNotNull(e.get("symbolSize"), 1), s, a;
      return n instanceof Array ? (s = Math.max(n[0], n[1]), a = n[0] / n[1]) : (s = n, a = 1), {
        maxSize: n,
        type: e.get("symbol"),
        aspect: a
      };
    }
    for (var i = e.getData(), a, o = i.getItemVisual(0, "symbol") || "circle", s = 0, l = t; l < r; l++) {
      var n = i.getItemVisual(l, "symbolSize"), u = i.getItemVisual(l, "symbol"), f;
      if (n instanceof Array)
        f = n[0] / n[1], s = Math.max(Math.max(n[0], n[1]), s);
      else {
        if (isNaN(n))
          continue;
        f = 1, s = Math.max(n, s);
      }
      o = u, a = f;
    }
    return {
      maxSize: s,
      type: o,
      aspect: a
    };
  }
};
const Lwe = Ut.extend({
  type: "scatter3D",
  hasSymbolVisual: !0,
  __ecgl__: !0,
  init: function(e, t) {
    this.groupGL = new J.Node(), this._pointsBuilderList = [], this._currentStep = 0;
  },
  render: function(e, t, r) {
    if (this.groupGL.removeAll(), !!e.getData().count()) {
      var n = e.coordinateSystem;
      if (n && n.viewGL) {
        n.viewGL.add(this.groupGL), this._camera = n.viewGL.camera;
        var i = this._pointsBuilderList[0];
        i || (i = this._pointsBuilderList[0] = new Rd(!1, r)), this._pointsBuilderList.length = 1, this.groupGL.add(i.rootNode), i.update(e, t, r), i.updateView(n.viewGL.camera);
      }
    }
  },
  incrementalPrepareRender: function(e, t, r) {
    var n = e.coordinateSystem;
    n && n.viewGL && (n.viewGL.add(this.groupGL), this._camera = n.viewGL.camera), this.groupGL.removeAll(), this._currentStep = 0;
  },
  incrementalRender: function(e, t, r, n) {
    if (!(e.end <= e.start)) {
      var i = this._pointsBuilderList[this._currentStep];
      i || (i = new Rd(!1, n), this._pointsBuilderList[this._currentStep] = i), this.groupGL.add(i.rootNode), i.update(t, r, n, e.start, e.end), i.updateView(t.coordinateSystem.viewGL.camera), this._currentStep++;
    }
  },
  updateCamera: function() {
    this._pointsBuilderList.forEach(function(e) {
      e.updateView(this._camera);
    }, this);
  },
  highlight: function(e, t, r, n) {
    this._toggleStatus("highlight", e, t, r, n);
  },
  downplay: function(e, t, r, n) {
    this._toggleStatus("downplay", e, t, r, n);
  },
  _toggleStatus: function(e, t, r, n, i) {
    var a = t.getData(), o = qt.queryDataIndex(a, i), s = e === "highlight";
    o != null ? F(ch.normalizeToArray(o), function(l) {
      for (var u = 0; u < this._pointsBuilderList.length; u++) {
        var f = this._pointsBuilderList[u];
        s ? f.highlight(a, l) : f.downplay(a, l);
      }
    }, this) : a.each(function(l) {
      for (var u = 0; u < this._pointsBuilderList.length; u++) {
        var f = this._pointsBuilderList[u];
        s ? f.highlight(a, l) : f.downplay(a, l);
      }
    });
  },
  dispose: function() {
    this._pointsBuilderList.forEach(function(e) {
      e.dispose();
    }), this.groupGL.removeAll();
  },
  remove: function() {
    this.groupGL.removeAll();
  }
});
function Dwe(e) {
  e.registerChartView(Lwe), e.registerSeriesModel(Swe), e.registerLayout({
    seriesType: "scatter3D",
    reset: function(t) {
      var r = t.coordinateSystem;
      if (r) {
        var n = r.dimensions;
        if (n.length < 3)
          return;
        var i = n.map(function(s) {
          return t.coordDimToDataDim(s)[0];
        }), a = [], o = [];
        return {
          progress: function(s, l) {
            for (var u = new Float32Array((s.end - s.start) * 3), f = s.start; f < s.end; f++) {
              var c = (f - s.start) * 3;
              a[0] = l.get(i[0], f), a[1] = l.get(i[1], f), a[2] = l.get(i[2], f), r.dataToPoint(a, o), u[c] = o[0], u[c + 1] = o[1], u[c + 2] = o[2];
            }
            l.setLayout("points", u);
          }
        };
      }
    }
  });
}
ft(Dwe);
var Fn = bn.vec3, MH = bn.vec2, Xu = Fn.normalize, s2 = Fn.cross, LH = Fn.sub, SE = Fn.add, zc = Fn.create, bc = zc(), $o = zc(), Cc = zc(), N_ = zc(), DH = [], EH = [];
function Ewe(e, t) {
  MH.copy(DH, e[0]), MH.copy(EH, e[1]);
  var r = [], n = r[0] = zc(), i = r[1] = zc(), a = r[2] = zc(), o = r[3] = zc();
  t.dataToPoint(DH, n), t.dataToPoint(EH, o), Xu(bc, n), LH($o, o, n), Xu($o, $o), s2(Cc, $o, bc), Xu(Cc, Cc), s2($o, bc, Cc), SE(i, bc, $o), Xu(i, i), Xu(bc, o), LH($o, n, o), Xu($o, $o), s2(Cc, $o, bc), Xu(Cc, Cc), s2($o, bc, Cc), SE(a, bc, $o), Xu(a, a), SE(N_, n, o), Xu(N_, N_);
  var s = Fn.dot(n, N_), l = Fn.dot(N_, i), u = (Math.max(Fn.len(n), Fn.len(o)) - s) / l * 2;
  return Fn.scaleAndAdd(i, n, i, u), Fn.scaleAndAdd(a, o, a, u), r;
}
function Pwe(e, t, r) {
  var n = [], i = n[0] = Fn.create(), a = n[1] = Fn.create(), o = n[2] = Fn.create(), s = n[3] = Fn.create();
  t.dataToPoint(e[0], i), t.dataToPoint(e[1], s);
  var l = Fn.dist(i, s);
  return Fn.lerp(a, i, s, 0.3), Fn.lerp(o, i, s, 0.3), Fn.scaleAndAdd(a, a, r, Math.min(l * 0.1, 10)), Fn.scaleAndAdd(o, o, r, Math.min(l * 0.1, 10)), n;
}
function TZ(e, t) {
  for (var r = new Float32Array(e.length * 3), n = 0, i = [], a = 0; a < e.length; a++)
    t.dataToPoint(e[a], i), r[n++] = i[0], r[n++] = i[1], r[n++] = i[2];
  return r;
}
function bZ(e) {
  var t = [];
  return e.each(function(r) {
    var n = e.getItemModel(r), i = n.option instanceof Array ? n.option : n.getShallow("coords", !0);
    t.push(i);
  }), {
    coordsList: t
  };
}
function Iwe(e, t) {
  var r = e.getData(), n = e.get("polyline");
  r.setLayout("lineType", n ? "polyline" : "cubicBezier");
  var i = bZ(r);
  r.each(function(a) {
    var o = i.coordsList[a], s = n ? TZ : Ewe;
    r.setItemLayout(a, s(o, t));
  });
}
function PH(e, t, r) {
  var n = e.getData(), i = e.get("polyline"), a = bZ(n);
  n.setLayout("lineType", i ? "polyline" : "cubicBezier"), n.each(function(o) {
    var s = a.coordsList[o], l = i ? TZ(s, t) : Pwe(s, t, r);
    n.setItemLayout(o, l);
  });
}
function Rwe(e, t) {
  e.eachSeriesByType("lines3D", function(r) {
    var n = r.coordinateSystem;
    n.type === "globe" ? Iwe(r, n) : n.type === "geo3D" ? PH(r, n, [0, 1, 0]) : (n.type === "mapbox3D" || n.type === "maptalks3D") && PH(r, n, [0, 0, 1]);
  });
}
const Owe = Yt.extend({
  type: "series.lines3D",
  dependencies: ["globe"],
  visualStyleAccessPath: "lineStyle",
  visualDrawType: "stroke",
  getInitialData: function(e, t) {
    var r = new zr(["value"], this);
    return r.hasItemOption = !1, r.initData(e.data, [], function(n, i, a, o) {
      if (n instanceof Array)
        return NaN;
      r.hasItemOption = !0;
      var s = n.value;
      if (s != null)
        return s instanceof Array ? s[o] : s;
    }), r;
  },
  defaultOption: {
    coordinateSystem: "globe",
    globeIndex: 0,
    geo3DIndex: 0,
    zlevel: -10,
    polyline: !1,
    effect: {
      show: !1,
      period: 4,
      // Trail width
      trailWidth: 4,
      trailLength: 0.2,
      spotIntensity: 6
    },
    silent: !0,
    // Support source-over, lighter
    blendMode: "source-over",
    lineStyle: {
      width: 1,
      opacity: 0.5
      // color
    }
  }
}), Nwe = `@export ecgl.trail2.vertex
attribute vec3 position: POSITION;
attribute vec3 positionPrev;
attribute vec3 positionNext;
attribute float offset;
attribute float dist;
attribute float distAll;
attribute float start;

attribute vec4 a_Color : COLOR;

uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
uniform vec4 viewport : VIEWPORT;
uniform float near : NEAR;

uniform float speed : 0;
uniform float trailLength: 0.3;
uniform float time;
uniform float period: 1000;

uniform float spotSize: 1;

varying vec4 v_Color;
varying float v_Percent;
varying float v_SpotPercent;

@import ecgl.common.wireframe.vertexHeader

@import ecgl.lines3D.clipNear

void main()
{
 @import ecgl.lines3D.expandLine

 gl_Position = currProj;

 v_Color = a_Color;

 @import ecgl.common.wireframe.vertexMain

#ifdef CONSTANT_SPEED
 float t = mod((speed * time + start) / distAll, 1. + trailLength) - trailLength;
#else
 float t = mod((time + start) / period, 1. + trailLength) - trailLength;
#endif

 float trailLen = distAll * trailLength;

 v_Percent = (dist - t * distAll) / trailLen;

 v_SpotPercent = spotSize / distAll;

 }
@end


@export ecgl.trail2.fragment

uniform vec4 color : [1.0, 1.0, 1.0, 1.0];
uniform float spotIntensity: 5;

varying vec4 v_Color;
varying float v_Percent;
varying float v_SpotPercent;

@import ecgl.common.wireframe.fragmentHeader

@import clay.util.srgb

void main()
{
 if (v_Percent > 1.0 || v_Percent < 0.0) {
 discard;
 }

 float fade = v_Percent;

#ifdef SRGB_DECODE
 gl_FragColor = sRGBToLinear(color * v_Color);
#else
 gl_FragColor = color * v_Color;
#endif

 @import ecgl.common.wireframe.fragmentMain

 if (v_Percent > (1.0 - v_SpotPercent)) {
 gl_FragColor.rgb *= spotIntensity;
 }

 gl_FragColor.a *= fade;
}

@end`;
var IH = bn.vec3;
function kwe(e) {
  return e > 0 ? 1 : -1;
}
J.Shader.import(Nwe);
const Bwe = J.Mesh.extend(function() {
  var e = new J.Material({
    shader: new J.Shader(J.Shader.source("ecgl.trail2.vertex"), J.Shader.source("ecgl.trail2.fragment")),
    transparent: !0,
    depthMask: !1
  }), t = new lh({
    dynamic: !0
  });
  return t.createAttribute("dist", "float", 1), t.createAttribute("distAll", "float", 1), t.createAttribute("start", "float", 1), {
    geometry: t,
    material: e,
    culling: !1,
    $ignorePicking: !0
  };
}, {
  updateData: function(e, t, r) {
    var n = e.hostModel, i = this.geometry, a = n.getModel("effect"), o = a.get("trailWidth") * t.getDevicePixelRatio(), s = a.get("trailLength"), l = n.get("effect.constantSpeed"), u = n.get("effect.period") * 1e3, f = l != null;
    f ? this.material.set("speed", l / 1e3) : this.material.set("period", u), this.material[f ? "define" : "undefine"]("vertex", "CONSTANT_SPEED");
    var c = n.get("polyline");
    i.trailLength = s, this.material.set("trailLength", s), i.resetOffset(), ["position", "positionPrev", "positionNext"].forEach(function(E) {
      i.attributes[E].value = r.attributes[E].value;
    });
    var h = ["dist", "distAll", "start", "offset", "color"];
    h.forEach(function(E) {
      i.attributes[E].init(i.vertexCount);
    }), i.indices = r.indices;
    var v = [], d = a.get("trailColor"), g = a.get("trailOpacity"), y = d != null, x = g != null;
    this.updateWorldTransform();
    var S = this.worldTransform.x.len(), T = this.worldTransform.y.len(), C = this.worldTransform.z.len(), A = 0, M = 0;
    e.each(function(E) {
      var P = e.getItemLayout(E), R = x ? g : ni(e, E), O = oi(e, E);
      R == null && (R = 1), v = J.parseColor(y ? d : O, v), v[3] *= R;
      for (var N = c ? r.getPolylineVertexCount(P) : r.getCubicCurveVertexCount(P[0], P[1], P[2], P[3]), G = 0, z = [], H = [], W = A; W < A + N; W++)
        i.attributes.position.get(W, z), z[0] *= S, z[1] *= T, z[2] *= C, W > A && (G += IH.dist(z, H)), i.attributes.dist.set(W, G), IH.copy(H, z);
      M = Math.max(M, G);
      for (var Z = Math.random() * (f ? G : u), W = A; W < A + N; W++)
        i.attributes.distAll.set(W, G), i.attributes.start.set(W, Z), i.attributes.offset.set(W, kwe(r.attributes.offset.get(W)) * o / 2), i.attributes.color.set(W, v);
      A += N;
    }), this.material.set("spotSize", M * 0.1 * s), this.material.set("spotIntensity", a.get("spotIntensity")), i.dirty();
  },
  setAnimationTime: function(e) {
    this.material.set("time", e);
  }
});
J.Shader.import(aA);
function zwe(e) {
  return e.radius != null ? e.radius : e.size != null ? Math.max(e.size[0], e.size[1], e.size[2]) : 100;
}
const Fwe = Ut.extend({
  type: "lines3D",
  __ecgl__: !0,
  init: function(e, t) {
    this.groupGL = new J.Node(), this._meshLinesMaterial = new J.Material({
      shader: J.createShader("ecgl.meshLines3D"),
      transparent: !0,
      depthMask: !1
    }), this._linesMesh = new J.Mesh({
      geometry: new lh(),
      material: this._meshLinesMaterial,
      $ignorePicking: !0
    }), this._trailMesh = new Bwe();
  },
  render: function(e, t, r) {
    this.groupGL.add(this._linesMesh);
    var n = e.coordinateSystem, i = e.getData();
    if (n && n.viewGL) {
      var a = n.viewGL;
      a.add(this.groupGL), this._updateLines(e, t, r);
      var o = n.viewGL.isLinearSpace() ? "define" : "undefine";
      this._linesMesh.material[o]("fragment", "SRGB_DECODE"), this._trailMesh.material[o]("fragment", "SRGB_DECODE");
    }
    var s = this._trailMesh;
    if (s.stopAnimation(), e.get("effect.show")) {
      this.groupGL.add(s), s.updateData(i, r, this._linesMesh.geometry), s.__time = s.__time || 0;
      var l = 3600 * 1e3;
      this._curveEffectsAnimator = s.animate("", {
        loop: !0
      }).when(l, {
        __time: l
      }).during(function() {
        s.setAnimationTime(s.__time);
      }).start();
    } else
      this.groupGL.remove(s), this._curveEffectsAnimator = null;
    this._linesMesh.material.blend = this._trailMesh.material.blend = e.get("blendMode") === "lighter" ? J.additiveBlend : null;
  },
  pauseEffect: function() {
    this._curveEffectsAnimator && this._curveEffectsAnimator.pause();
  },
  resumeEffect: function() {
    this._curveEffectsAnimator && this._curveEffectsAnimator.resume();
  },
  toggleEffect: function() {
    var e = this._curveEffectsAnimator;
    e && (e.isPaused() ? e.resume() : e.pause());
  },
  _updateLines: function(e, t, r) {
    var n = e.getData(), i = e.coordinateSystem, a = this._linesMesh.geometry, o = e.get("polyline");
    a.expandLine = !0;
    var s = zwe(i);
    a.segmentScale = s / 20;
    var l = "lineStyle.width".split("."), u = r.getDevicePixelRatio();
    n.each(function(v) {
      var d = n.getItemModel(v), g = d.get(l);
      g == null && (g = 1), n.setItemVisual(v, "lineWidth", g);
    }), a.useNativeLine = !1;
    var f = 0, c = 0;
    n.each(function(v) {
      var d = n.getItemLayout(v);
      o ? (f += a.getPolylineVertexCount(d), c += a.getPolylineTriangleCount(d)) : (f += a.getCubicCurveVertexCount(d[0], d[1], d[2], d[3]), c += a.getCubicCurveTriangleCount(d[0], d[1], d[2], d[3]));
    }), a.setVertexCount(f), a.setTriangleCount(c), a.resetOffset();
    var h = [];
    n.each(function(v) {
      var d = n.getItemLayout(v), g = oi(n, v), y = ni(n, v), x = n.getItemVisual(v, "lineWidth") * u;
      y == null && (y = 1), h = J.parseColor(g, h), h[3] *= y, o ? a.addPolyline(d, h, x) : a.addCubicCurve(d[0], d[1], d[2], d[3], h, x);
    }), a.dirty();
  },
  remove: function() {
    this.groupGL.removeAll();
  },
  dispose: function() {
    this.groupGL.removeAll();
  }
});
function Gwe(e) {
  e.registerChartView(Fwe), e.registerSeriesModel(Owe), e.registerLayout(Rwe), e.registerAction({
    type: "lines3DPauseEffect",
    event: "lines3deffectpaused",
    update: "series.lines3D:pauseEffect"
  }, function() {
  }), e.registerAction({
    type: "lines3DResumeEffect",
    event: "lines3deffectresumed",
    update: "series.lines3D:resumeEffect"
  }, function() {
  }), e.registerAction({
    type: "lines3DToggleEffect",
    event: "lines3deffectchanged",
    update: "series.lines3D:toggleEffect"
  }, function() {
  });
}
ft(Gwe);
function RH(e, t) {
  for (var r = [], n = 0; n < t.length; n++)
    r.push(e.dataToPoint(t[n]));
  return r;
}
var CZ = Yt.extend({
  type: "series.polygons3D",
  getRegionModel: function(e) {
    return this.getData().getItemModel(e);
  },
  getRegionPolygonCoords: function(e) {
    var t = this.coordinateSystem, r = this.getData().getItemModel(e), n = r.option instanceof Array ? r.option : r.getShallow("coords");
    r.get("multiPolygon") || (n = [n]);
    for (var i = [], a = 0; a < n.length; a++) {
      for (var o = [], s = 1; s < n[a].length; s++)
        o.push(RH(t, n[a][s]));
      i.push({
        exterior: RH(t, n[a][0]),
        interiors: o
      });
    }
    return i;
  },
  getInitialData: function(e) {
    var t = new zr(["value"], this);
    return t.hasItemOption = !1, t.initData(e.data, [], function(r, n, i, a) {
      if (r instanceof Array)
        return NaN;
      t.hasItemOption = !0;
      var o = r.value;
      if (o != null)
        return o instanceof Array ? o[a] : o;
    }), t;
  },
  defaultOption: {
    show: !0,
    data: null,
    multiPolygon: !1,
    progressiveThreshold: 1e3,
    progressive: 1e3,
    zlevel: -10,
    label: {
      show: !1,
      // Distance in 3d space.
      distance: 2,
      textStyle: {
        fontSize: 20,
        color: "#000",
        backgroundColor: "rgba(255,255,255,0.7)",
        padding: 3,
        borderRadius: 4
      }
    },
    itemStyle: {
      color: "#fff",
      borderWidth: 0,
      borderColor: "#333"
    },
    emphasis: {
      itemStyle: {
        color: "#639fc0"
      },
      label: {
        show: !0
      }
    }
  }
});
je(CZ.prototype, gy);
const Vwe = Ut.extend({
  type: "polygons3D",
  __ecgl__: !0,
  init: function(e, t) {
    this.groupGL = new J.Node(), this._geo3DBuilderList = [], this._currentStep = 0;
  },
  render: function(e, t, r) {
    this.groupGL.removeAll();
    var n = e.coordinateSystem;
    n && n.viewGL && n.viewGL.add(this.groupGL);
    var i = this._geo3DBuilderList[0];
    i || (i = new Um(r), i.extrudeY = n.type !== "mapbox3D" && n.type !== "maptalks3D", this._geo3DBuilderList[0] = i), this._updateShaderDefines(n, i), i.update(e, t, r), this._geo3DBuilderList.length = 1, this.groupGL.add(i.rootNode);
  },
  incrementalPrepareRender: function(e, t, r) {
    this.groupGL.removeAll();
    var n = e.coordinateSystem;
    n && n.viewGL && n.viewGL.add(this.groupGL), this._currentStep = 0;
  },
  incrementalRender: function(e, t, r, n) {
    var i = this._geo3DBuilderList[this._currentStep], a = t.coordinateSystem;
    i || (i = new Um(n), i.extrudeY = a.type !== "mapbox3D" && a.type !== "maptalks3D", this._geo3DBuilderList[this._currentStep] = i), i.update(t, r, n, e.start, e.end), this.groupGL.add(i.rootNode), this._updateShaderDefines(a, i), this._currentStep++;
  },
  _updateShaderDefines: function(e, t) {
    var r = e.viewGL.isLinearSpace() ? "define" : "undefine";
    t.rootNode.traverse(function(n) {
      n.material && (n.material[r]("fragment", "SRGB_DECODE"), (e.type === "mapbox3D" || e.type === "maptalks3D") && (n.material.define("fragment", "NORMAL_UP_AXIS", 2), n.material.define("fragment", "NORMAL_FRONT_AXIS", 1)));
    });
  },
  remove: function() {
    this.groupGL.removeAll();
  },
  dispose: function() {
    this.groupGL.removeAll(), this._geo3DBuilderList.forEach(function(e) {
      e.dispose();
    });
  }
});
function Hwe(e) {
  e.registerChartView(Vwe), e.registerSeriesModel(CZ);
}
ft(Hwe);
var AZ = Yt.extend({
  type: "series.surface",
  dependencies: ["globe", "grid3D", "geo3D"],
  visualStyleAccessPath: "itemStyle",
  formatTooltip: function(e) {
    return Xx(this, e);
  },
  getInitialData: function(e, t) {
    var r = e.data;
    function n(ee) {
      return !(isNaN(ee.min) || isNaN(ee.max) || isNaN(ee.step));
    }
    function i(ee) {
      var V = mC;
      return Math.max(V(ee.min), V(ee.max), V(ee.step)) + 1;
    }
    if (!r)
      if (e.parametric) {
        var C = e.parametricEquation || {}, A = C.u || {}, M = C.v || {};
        ["u", "v"].forEach(function(V) {
          n(C[V]);
        }), ["x", "y", "z"].forEach(function(V) {
          C[V];
        });
        var E = Math.floor((A.max + A.step - A.min) / A.step), P = Math.floor((M.max + M.step - M.min) / M.step);
        r = new Float32Array(E * P * 5);
        for (var R = i(A), O = i(M), h = 0, v = 0; v < P; v++)
          for (var d = 0; d < E; d++) {
            var N = d * A.step + A.min, G = v * M.step + M.min, z = jr(Math.min(N, A.max), R), H = jr(Math.min(G, M.max), O), g = C.x(z, H), y = C.y(z, H), T = C.z(z, H);
            r[h++] = g, r[h++] = y, r[h++] = T, r[h++] = z, r[h++] = H;
          }
      } else {
        var a = e.equation || {}, o = a.x || {}, s = a.y || {};
        if (["x", "y"].forEach(function(ee) {
          n(a[ee]);
        }), typeof a.z != "function")
          return;
        var l = Math.floor((o.max + o.step - o.min) / o.step), u = Math.floor((s.max + s.step - s.min) / s.step);
        r = new Float32Array(l * u * 3);
        for (var f = i(o), c = i(s), h = 0, v = 0; v < u; v++)
          for (var d = 0; d < l; d++) {
            var g = d * o.step + o.min, y = v * s.step + s.min, x = jr(Math.min(g, o.max), f), S = jr(Math.min(y, s.max), c), T = a.z(x, S);
            r[h++] = x, r[h++] = S, r[h++] = T;
          }
      }
    var W = ["x", "y", "z"];
    e.parametric && W.push("u", "v");
    var Z = oA(this, W, r);
    return Z;
  },
  defaultOption: {
    coordinateSystem: "cartesian3D",
    zlevel: -10,
    // Cartesian coordinate system
    grid3DIndex: 0,
    // Surface needs lambert shading to show the difference
    shading: "lambert",
    // If parametric surface
    parametric: !1,
    wireframe: {
      show: !0,
      lineStyle: {
        color: "rgba(0,0,0,0.5)",
        width: 1
      }
    },
    /**
     * Generate surface data from z = f(x, y) equation
     */
    equation: {
      // [min, max, step]
      x: {
        min: -1,
        max: 1,
        step: 0.1
      },
      y: {
        min: -1,
        max: 1,
        step: 0.1
      },
      z: null
    },
    parametricEquation: {
      // [min, max, step]
      u: {
        min: -1,
        max: 1,
        step: 0.1
      },
      v: {
        min: -1,
        max: 1,
        step: 0.1
      },
      // [x, y, z] = f(x, y)
      x: null,
      y: null,
      z: null
    },
    // Shape of give data
    // It is an array to specify rows and columns.
    // For example [30, 30]
    dataShape: null,
    itemStyle: {
      // Color
    },
    animationDurationUpdate: 500
  }
});
je(AZ.prototype, gy);
var Uv = bn.vec3;
function Uwe(e) {
  return isNaN(e[0]) || isNaN(e[1]) || isNaN(e[2]);
}
const Wwe = Ut.extend({
  type: "surface",
  __ecgl__: !0,
  init: function(e, t) {
    this.groupGL = new J.Node();
  },
  render: function(e, t, r) {
    var n = this._prevSurfaceMesh;
    this._prevSurfaceMesh = this._surfaceMesh, this._surfaceMesh = n, this._surfaceMesh || (this._surfaceMesh = this._createSurfaceMesh()), this.groupGL.remove(this._prevSurfaceMesh), this.groupGL.add(this._surfaceMesh);
    var i = e.coordinateSystem, a = e.get("shading"), o = e.getData(), s = "ecgl." + a;
    if ((!this._surfaceMesh.material || this._surfaceMesh.material.shader.name !== s) && (this._surfaceMesh.material = J.createMaterial(s, ["VERTEX_COLOR", "DOUBLE_SIDED"])), J.setMaterialFromModel(a, this._surfaceMesh.material, e, r), i && i.viewGL) {
      i.viewGL.add(this.groupGL);
      var l = i.viewGL.isLinearSpace() ? "define" : "undefine";
      this._surfaceMesh.material[l]("fragment", "SRGB_DECODE");
    }
    var u = e.get("parametric"), f = e.get("dataShape");
    f || (f = this._getDataShape(o, u));
    var c = e.getModel("wireframe"), h = c.get("lineStyle.width"), v = c.get("show") && h > 0;
    this._updateSurfaceMesh(this._surfaceMesh, e, f, v);
    var d = this._surfaceMesh.material;
    v ? (d.define("WIREFRAME_QUAD"), d.set("wireframeLineWidth", h), d.set("wireframeLineColor", J.parseColor(c.get("lineStyle.color")))) : d.undefine("WIREFRAME_QUAD"), this._initHandler(e, r), this._updateAnimation(e);
  },
  _updateAnimation: function(e) {
    J.updateVertexAnimation([["prevPosition", "position"], ["prevNormal", "normal"]], this._prevSurfaceMesh, this._surfaceMesh, e);
  },
  _createSurfaceMesh: function() {
    var e = new J.Mesh({
      geometry: new J.Geometry({
        dynamic: !0,
        sortTriangles: !0
      }),
      shadowDepthMaterial: new J.Material({
        shader: new J.Shader(J.Shader.source("ecgl.sm.depth.vertex"), J.Shader.source("ecgl.sm.depth.fragment"))
      }),
      culling: !1,
      // Render after axes
      renderOrder: 10,
      // Render normal in normal pass
      renderNormal: !0
    });
    return e.geometry.createAttribute("barycentric", "float", 4), e.geometry.createAttribute("prevPosition", "float", 3), e.geometry.createAttribute("prevNormal", "float", 3), Object.assign(e.geometry, JN), e;
  },
  _initHandler: function(e, t) {
    var r = e.getData(), n = this._surfaceMesh, i = e.coordinateSystem;
    function a(s, l) {
      for (var u = 1 / 0, f = -1, c = [], h = 0; h < s.length; h++) {
        n.geometry.attributes.position.get(s[h], c);
        var v = Uv.dist(l.array, c);
        v < u && (u = v, f = s[h]);
      }
      return f;
    }
    n.seriesIndex = e.seriesIndex;
    var o = -1;
    n.off("mousemove"), n.off("mouseout"), n.on("mousemove", function(s) {
      var l = a(s.triangle, s.point);
      if (l >= 0) {
        var u = [];
        n.geometry.attributes.position.get(l, u);
        for (var f = i.pointToData(u), c = 1 / 0, h = -1, v = [], d = 0; d < r.count(); d++) {
          v[0] = r.get("x", d), v[1] = r.get("y", d), v[2] = r.get("z", d);
          var g = Uv.squaredDistance(v, f);
          g < c && (h = d, c = g);
        }
        h !== o && t.dispatchAction({
          type: "grid3DShowAxisPointer",
          value: f
        }), o = h, n.dataIndex = h;
      } else
        n.dataIndex = -1;
    }, this), n.on("mouseout", function(s) {
      o = -1, n.dataIndex = -1, t.dispatchAction({
        type: "grid3DHideAxisPointer"
      });
    }, this);
  },
  _updateSurfaceMesh: function(e, t, r, n) {
    var i = e.geometry, a = t.getData(), o = a.getLayout("points"), s = 0;
    a.each(function(Ue) {
      a.hasValue(Ue) || s++;
    });
    var l = s || n, u = i.attributes.position, f = i.attributes.normal, c = i.attributes.texcoord0, h = i.attributes.barycentric, v = i.attributes.color, d = r[0], g = r[1], y = t.get("shading"), x = y !== "color";
    if (l) {
      var S = (d - 1) * (g - 1) * 4;
      u.init(S), n && h.init(S);
    } else
      u.value = new Float32Array(o);
    v.init(i.vertexCount), c.init(i.vertexCount);
    var T = [0, 3, 1, 1, 3, 2], C = [[1, 1, 0, 0], [0, 1, 0, 1], [1, 0, 0, 1], [1, 0, 1, 0]], A = i.indices = new (i.vertexCount > 65535 ? Uint32Array : Uint16Array)((d - 1) * (g - 1) * 6), M = function(Ue, Xe, $e) {
      $e[1] = Ue * g + Xe, $e[0] = Ue * g + Xe + 1, $e[3] = (Ue + 1) * g + Xe + 1, $e[2] = (Ue + 1) * g + Xe;
    }, E = !1;
    if (l) {
      var P = [], R = [], O = 0;
      x ? f.init(i.vertexCount) : f.value = null;
      for (var N = [[], [], []], G = [], z = [], H = Uv.create(), W = function(Ue, Xe, $e) {
        var vt = Xe * 3;
        return $e[0] = Ue[vt], $e[1] = Ue[vt + 1], $e[2] = Ue[vt + 2], $e;
      }, Z = new Float32Array(o.length), ee = new Float32Array(o.length / 3 * 4), V = 0; V < a.count(); V++)
        if (a.hasValue(V)) {
          var Ae = J.parseColor(oi(a, V)), Q = ni(a, V);
          Q != null && (Ae[3] *= Q), Ae[3] < 0.99 && (E = !0);
          for (var q = 0; q < 4; q++)
            ee[V * 4 + q] = Ae[q];
        }
      for (var X = [1e7, 1e7, 1e7], V = 0; V < d - 1; V++)
        for (var K = 0; K < g - 1; K++) {
          var ue = V * (g - 1) + K, oe = ue * 4;
          M(V, K, P);
          for (var te = !1, q = 0; q < 4; q++)
            W(o, P[q], R), Uwe(R) && (te = !0);
          for (var q = 0; q < 4; q++)
            te ? u.set(oe + q, X) : (W(o, P[q], R), u.set(oe + q, R)), n && h.set(oe + q, C[q]);
          for (var q = 0; q < 6; q++)
            A[O++] = T[q] + oe;
          if (x && !te)
            for (var q = 0; q < 2; q++) {
              for (var pe = q * 3, me = 0; me < 3; me++) {
                var de = P[T[pe] + me];
                W(o, de, N[me]);
              }
              Uv.sub(G, N[0], N[1]), Uv.sub(z, N[1], N[2]), Uv.cross(H, G, z);
              for (var me = 0; me < 3; me++) {
                var ve = P[T[pe] + me] * 3;
                Z[ve] = Z[ve] + H[0], Z[ve + 1] = Z[ve + 1] + H[1], Z[ve + 2] = Z[ve + 2] + H[2];
              }
            }
        }
      if (x)
        for (var V = 0; V < Z.length / 3; V++)
          W(Z, V, H), Uv.normalize(H, H), Z[V * 3] = H[0], Z[V * 3 + 1] = H[1], Z[V * 3 + 2] = H[2];
      for (var Ae = [], be = [], V = 0; V < d - 1; V++)
        for (var K = 0; K < g - 1; K++) {
          var ue = V * (g - 1) + K, oe = ue * 4;
          M(V, K, P);
          for (var q = 0; q < 4; q++) {
            for (var me = 0; me < 4; me++)
              Ae[me] = ee[P[q] * 4 + me];
            v.set(oe + q, Ae), x && (W(Z, P[q], H), f.set(oe + q, H));
            var de = P[q];
            be[0] = de % g / (g - 1), be[1] = Math.floor(de / g) / (d - 1), c.set(oe + q, be);
          }
          ue++;
        }
    } else {
      for (var be = [], V = 0; V < a.count(); V++) {
        be[0] = V % g / (g - 1), be[1] = Math.floor(V / g) / (d - 1);
        var Ae = J.parseColor(oi(a, V)), Q = ni(a, V);
        Q != null && (Ae[3] *= Q), Ae[3] < 0.99 && (E = !0), v.set(V, Ae), c.set(V, be);
      }
      for (var P = [], De = 0, V = 0; V < d - 1; V++)
        for (var K = 0; K < g - 1; K++) {
          M(V, K, P);
          for (var q = 0; q < 6; q++)
            A[De++] = P[T[q]];
        }
      x ? i.generateVertexNormals() : f.value = null;
    }
    e.material.get("normalMap") && i.generateTangents(), i.updateBoundingBox(), i.dirty(), e.material.transparent = E, e.material.depthMask = !E;
  },
  _getDataShape: function(e, t) {
    for (var r = -1 / 0, n = 0, i = 0, a = !1, o = t ? "u" : "x", s = e.count(), l = 0; l < s; l++) {
      var u = e.get(o, l);
      u < r && (i = 0, n++), r = u, i++;
    }
    if ((!n || i === 1) && (a = !0), !a)
      return [n + 1, i];
    for (var f = Math.floor(Math.sqrt(s)); f > 0; ) {
      if (Math.floor(s / f) === s / f)
        return [f, s / f];
      f--;
    }
    return f = Math.floor(Math.sqrt(s)), [f, f];
  },
  dispose: function() {
    this.groupGL.removeAll();
  },
  remove: function() {
    this.groupGL.removeAll();
  }
});
function Xwe(e) {
  e.registerChartView(Wwe), e.registerSeriesModel(AZ), e.registerLayout(function(t, r) {
    t.eachSeriesByType("surface", function(n) {
      var i = n.coordinateSystem;
      !i || i.type;
      var a = n.getData(), o = new Float32Array(3 * a.count()), s = [NaN, NaN, NaN];
      if (i && i.type === "cartesian3D") {
        var l = i.dimensions, u = l.map(function(f) {
          return n.coordDimToDataDim(f)[0];
        });
        a.each(u, function(f, c, h, v) {
          var d;
          a.hasValue(v) ? d = i.dataToPoint([f, c, h]) : d = s, o[v * 3] = d[0], o[v * 3 + 1] = d[1], o[v * 3 + 2] = d[2];
        });
      }
      a.setLayout("points", o);
    });
  });
}
ft(Xwe);
function OH(e, t) {
  for (var r = [], n = 0; n < t.length; n++)
    r.push(e.dataToPoint(t[n]));
  return r;
}
var yy = Yt.extend({
  type: "series.map3D",
  layoutMode: "box",
  coordinateSystem: null,
  visualStyleAccessPath: "itemStyle",
  optionUpdated: function(e) {
    var t = this.get("coordinateSystem");
    t == null || t === "geo3D" || (this.get("groundPlane.show") && (this.option.groundPlane.show = !1), this._geo = null);
  },
  getInitialData: function(e) {
    e.data = this.getFilledRegions(e.data, e.map);
    var t = ah(e.data, {
      coordDimensions: ["value"]
    }), r = new zr(t, this);
    r.initData(e.data);
    var n = {};
    return r.each(function(i) {
      var a = r.getName(i), o = r.getItemModel(i);
      n[a] = o;
    }), this._regionModelMap = n, r;
  },
  formatTooltip: function(e) {
    return Xx(this, e);
  },
  getRegionModel: function(e) {
    var t = this.getData().getName(e);
    return this._regionModelMap[t] || new It(null, this);
  },
  getRegionPolygonCoords: function(e) {
    var t = this.coordinateSystem, r = this.getData().getName(e);
    if (t.transform) {
      var n = t.getRegion(r);
      return n ? n.geometries : [];
    } else {
      this._geo || (this._geo = e3.createGeo3D(this));
      for (var n = this._geo.getRegion(r), i = [], a = 0; a < n.geometries.length; a++) {
        var o = n.geometries[a], s = [], l = OH(t, o.exterior);
        if (s && s.length)
          for (var u = 0; u < o.interiors.length; u++)
            s.push(OH(t, s[u]));
        i.push({
          interiors: s,
          exterior: l
        });
      }
      return i;
    }
  },
  /**
   * Format label
   * @param {string} name Region name
   * @param {string} [status='normal'] 'normal' or 'emphasis'
   * @return {string}
   */
  getFormattedLabel: function(e, t) {
    var r = ch.getFormattedLabel(this, e, t);
    return r == null && (r = this.getData().getName(e)), r;
  },
  defaultOption: {
    // Support geo3D, mapbox, maptalks3D
    coordinateSystem: "geo3D",
    // itemStyle: {},
    // height,
    // label: {}
    data: null
  }
});
je(yy.prototype, iZ);
je(yy.prototype, rA);
je(yy.prototype, vy);
je(yy.prototype, dy);
je(yy.prototype, gy);
const Ywe = Ut.extend({
  type: "map3D",
  __ecgl__: !0,
  init: function(e, t) {
    this._geo3DBuilder = new Um(t), this.groupGL = new J.Node();
  },
  render: function(e, t, r) {
    var n = e.coordinateSystem;
    if (!(!n || !n.viewGL)) {
      if (this.groupGL.add(this._geo3DBuilder.rootNode), n.viewGL.add(this.groupGL), n.type === "geo3D") {
        this._sceneHelper || (this._sceneHelper = new Jc(), this._sceneHelper.initLight(this.groupGL)), this._sceneHelper.setScene(n.viewGL.scene), this._sceneHelper.updateLight(e), n.viewGL.setPostEffect(e.getModel("postEffect"), r), n.viewGL.setTemporalSuperSampling(e.getModel("temporalSuperSampling"));
        var i = this._control;
        i || (i = this._control = new Hx({
          zr: r.getZr()
        }), this._control.init());
        var a = e.getModel("viewControl");
        i.setViewGL(n.viewGL), i.setFromViewControlModel(a, 0), i.off("update"), i.on("update", function() {
          r.dispatchAction({
            type: "map3DChangeCamera",
            alpha: i.getAlpha(),
            beta: i.getBeta(),
            distance: i.getDistance(),
            from: this.uid,
            map3DId: e.id
          });
        }), this._geo3DBuilder.extrudeY = !0;
      } else
        this._control && (this._control.dispose(), this._control = null), this._sceneHelper && (this._sceneHelper.dispose(), this._sceneHelper = null), e.getData().getLayout("geo3D"), this._geo3DBuilder.extrudeY = !1;
      this._geo3DBuilder.update(e, t, r, 0, e.getData().count());
      var o = n.viewGL.isLinearSpace() ? "define" : "undefine";
      this._geo3DBuilder.rootNode.traverse(function(s) {
        s.material && s.material[o]("fragment", "SRGB_DECODE");
      });
    }
  },
  afterRender: function(e, t, r, n) {
    var i = n.renderer, a = e.coordinateSystem;
    a && a.type === "geo3D" && (this._sceneHelper.updateAmbientCubemap(i, e, r), this._sceneHelper.updateSkybox(i, e, r));
  },
  dispose: function() {
    this.groupGL.removeAll(), this._control.dispose(), this._geo3DBuilder.dispose();
  }
});
function Zwe(e) {
  hZ(e), e.registerChartView(Ywe), e.registerSeriesModel(yy), e.registerAction({
    type: "map3DChangeCamera",
    event: "map3dcamerachanged",
    update: "series:updateCamera"
  }, function(t, r) {
    r.eachComponent({
      mainType: "series",
      subType: "map3D",
      query: t
    }, function(n) {
      n.setView(t);
    });
  });
}
ft(Zwe);
const $we = Yt.extend({
  type: "series.scatterGL",
  dependencies: ["grid", "polar", "geo", "singleAxis"],
  visualStyleAccessPath: "itemStyle",
  hasSymbolVisual: !0,
  getInitialData: function() {
    return I6(this);
  },
  defaultOption: {
    coordinateSystem: "cartesian2d",
    zlevel: 10,
    progressive: 1e5,
    progressiveThreshold: 1e5,
    // Cartesian coordinate system
    // xAxisIndex: 0,
    // yAxisIndex: 0,
    // Polar coordinate system
    // polarIndex: 0,
    // Geo coordinate system
    // geoIndex: 0,
    large: !1,
    symbol: "circle",
    symbolSize: 10,
    // symbolSize scale when zooming.
    zoomScale: 0,
    // Support source-over, lighter
    blendMode: "source-over",
    itemStyle: {
      opacity: 0.8
    },
    postEffect: {
      enable: !1,
      colorCorrection: {
        exposure: 0,
        brightness: 0,
        contrast: 1,
        saturation: 1,
        enable: !0
      }
    }
  }
});
function qwe() {
  return [1, 0, 0, 1, 0, 0];
}
function jwe(e, t) {
  var r = t[0], n = t[2], i = t[4], a = t[1], o = t[3], s = t[5], l = r * o - a * n;
  return l ? (l = 1 / l, e[0] = o * l, e[1] = -a * l, e[2] = -n * l, e[3] = r * l, e[4] = (n * s - o * i) * l, e[5] = (a * i - r * s) * l, e) : null;
}
function Df(e) {
  this.viewGL = e;
}
Df.prototype.reset = function(e, t) {
  this._updateCamera(t.getWidth(), t.getHeight(), t.getDevicePixelRatio()), this._viewTransform = qwe(), this.updateTransform(e, t);
};
Df.prototype.updateTransform = function(e, t) {
  var r = e.coordinateSystem;
  r.getRoamTransform && (jwe(this._viewTransform, r.getRoamTransform()), this._setCameraTransform(this._viewTransform), t.getZr().refresh());
};
Df.prototype.dataToPoint = function(e, t, r) {
  r = e.dataToPoint(t, null, r);
  var n = this._viewTransform;
  n && IY(r, r, n);
};
Df.prototype.removeTransformInPoint = function(e) {
  return this._viewTransform && IY(e, e, this._viewTransform), e;
};
Df.prototype.getZoom = function() {
  if (this._viewTransform) {
    var e = this._viewTransform;
    return 1 / Math.max(Math.sqrt(e[0] * e[0] + e[1] * e[1]), Math.sqrt(e[2] * e[2] + e[3] * e[3]));
  }
  return 1;
};
Df.prototype._setCameraTransform = function(e) {
  var t = this.viewGL.camera;
  t.position.set(e[4], e[5], 0), t.scale.set(Math.sqrt(e[0] * e[0] + e[1] * e[1]), Math.sqrt(e[2] * e[2] + e[3] * e[3]), 1);
};
Df.prototype._updateCamera = function(e, t, r) {
  this.viewGL.setViewport(0, 0, e, t, r);
  var n = this.viewGL.camera;
  n.left = n.top = 0, n.bottom = t, n.right = e, n.near = 0, n.far = 100;
};
const Kwe = Ut.extend({
  type: "scatterGL",
  __ecgl__: !0,
  init: function(e, t) {
    this.groupGL = new J.Node(), this.viewGL = new Cr("orthographic"), this.viewGL.add(this.groupGL), this._pointsBuilderList = [], this._currentStep = 0, this._sizeScale = 1, this._glViewHelper = new Df(this.viewGL);
  },
  render: function(e, t, r) {
    if (this.groupGL.removeAll(), this._glViewHelper.reset(e, r), !!e.getData().count()) {
      var n = this._pointsBuilderList[0];
      n || (n = this._pointsBuilderList[0] = new Rd(!0, r)), this._pointsBuilderList.length = 1, this.groupGL.add(n.rootNode), this._removeTransformInPoints(e.getData().getLayout("points")), n.update(e, t, r), this.viewGL.setPostEffect(e.getModel("postEffect"), r);
    }
  },
  incrementalPrepareRender: function(e, t, r) {
    this.groupGL.removeAll(), this._glViewHelper.reset(e, r), this._currentStep = 0, this.viewGL.setPostEffect(e.getModel("postEffect"), r);
  },
  incrementalRender: function(e, t, r, n) {
    if (!(e.end <= e.start)) {
      var i = this._pointsBuilderList[this._currentStep];
      i || (i = new Rd(!0, n), this._pointsBuilderList[this._currentStep] = i), this.groupGL.add(i.rootNode), this._removeTransformInPoints(t.getData().getLayout("points")), i.setSizeScale(this._sizeScale), i.update(t, r, n, e.start, e.end), n.getZr().refresh(), this._currentStep++;
    }
  },
  updateTransform: function(e, t, r) {
    if (e.coordinateSystem.getRoamTransform) {
      this._glViewHelper.updateTransform(e, r);
      var n = this._glViewHelper.getZoom(), i = Math.max((e.get("zoomScale") || 0) * (n - 1) + 1, 0);
      this._sizeScale = i, this._pointsBuilderList.forEach(function(a) {
        a.setSizeScale(i);
      });
    }
  },
  _removeTransformInPoints: function(e) {
    if (e)
      for (var t = [], r = 0; r < e.length; r += 2)
        t[0] = e[r], t[1] = e[r + 1], this._glViewHelper.removeTransformInPoint(t), e[r] = t[0], e[r + 1] = t[1];
  },
  dispose: function() {
    this.groupGL.removeAll(), this._pointsBuilderList.forEach(function(e) {
      e.dispose();
    });
  },
  remove: function() {
    this.groupGL.removeAll();
  }
});
function Qwe(e) {
  e.registerChartView(Kwe), e.registerSeriesModel($we), e.registerLayout({
    seriesType: "scatterGL",
    reset: function(t) {
      var r = t.coordinateSystem, n = t.getData(), i;
      if (r) {
        var a = r.dimensions.map(function(s) {
          return n.mapDimension(s);
        }).slice(0, 2), o = [];
        a.length === 1 ? i = function(s) {
          for (var l = new Float32Array((s.end - s.start) * 2), u = s.start; u < s.end; u++) {
            var f = (u - s.start) * 2, c = n.get(a[0], u), h = r.dataToPoint(c);
            l[f] = h[0], l[f + 1] = h[1];
          }
          n.setLayout("points", l);
        } : a.length === 2 && (i = function(s) {
          for (var l = new Float32Array((s.end - s.start) * 2), u = s.start; u < s.end; u++) {
            var f = (u - s.start) * 2, c = n.get(a[0], u), h = n.get(a[1], u);
            o[0] = c, o[1] = h, o = r.dataToPoint(o), l[f] = o[0], l[f + 1] = o[1];
          }
          n.setLayout("points", l);
        });
      }
      return {
        progress: i
      };
    }
  });
}
ft(Qwe);
function Jwe(e, t, r, n, i) {
  for (var a = new M7(n), o = 0; o < e.length; o++)
    a.addNode(qt.firstNotNull(
      // Id, name, dataIndex
      e[o].id,
      e[o].name,
      o
    ), o);
  for (var s = [], l = [], u = 0, o = 0; o < t.length; o++) {
    var f = t[o], c = f.source, h = f.target;
    a.addEdge(c, h, u) && (l.push(f), s.push(qt.firstNotNull(f.id, c + " > " + h)), u++);
  }
  var v, d = ah(e, {
    coordDimensions: ["value"]
  });
  v = new zr(d, r), v.initData(e);
  var g = new zr(["value"], r);
  return g.initData(l, s), i && i(v, g), $O({
    mainData: v,
    struct: a,
    structAttr: "graph",
    datas: {
      node: v,
      edge: g
    },
    datasAttr: {
      node: "data",
      edge: "edgeData"
    }
  }), a.update(), a;
}
var r1 = Yt.extend({
  type: "series.graphGL",
  visualStyleAccessPath: "itemStyle",
  hasSymbolVisual: !0,
  init: function(e) {
    r1.superApply(this, "init", arguments), this.legendDataProvider = function() {
      return this._categoriesData;
    }, this._updateCategoriesData();
  },
  mergeOption: function(e) {
    r1.superApply(this, "mergeOption", arguments), this._updateCategoriesData();
  },
  getFormattedLabel: function(e, t, r, n) {
    var i = ch.getFormattedLabel(this, e, t, r, n);
    if (i == null) {
      var a = this.getData(), o = a.dimensions[a.dimensions.length - 1];
      i = a.get(o, e);
    }
    return i;
  },
  getInitialData: function(e, t) {
    var r = e.edges || e.links || [], n = e.data || e.nodes || [], i = this;
    if (n && r)
      return Jwe(n, r, this, !0, a).data;
    function a(o, s) {
      o.wrapMethod("getItemModel", function(c) {
        const h = i._categoriesModels, v = c.getShallow("category"), d = h[v];
        return d && (d.parentModel = c.parentModel, c.parentModel = d), c;
      });
      const l = t.getModel([]).getModel;
      function u(c, h) {
        const v = l.call(this, c, h);
        return v.resolveParentPath = f, v;
      }
      s.wrapMethod("getItemModel", function(c) {
        return c.resolveParentPath = f, c.getModel = u, c;
      });
      function f(c) {
        if (c && (c[0] === "label" || c[1] === "label")) {
          const h = c.slice();
          return c[0] === "label" ? h[0] = "edgeLabel" : c[1] === "label" && (h[1] = "edgeLabel"), h;
        }
        return c;
      }
    }
  },
  /**
   * @return {module:echarts/data/Graph}
   */
  getGraph: function() {
    return this.getData().graph;
  },
  /**
   * @return {module:echarts/data/List}
   */
  getEdgeData: function() {
    return this.getGraph().edgeData;
  },
  /**
   * @return {module:echarts/data/List}
   */
  getCategoriesData: function() {
    return this._categoriesData;
  },
  /**
   * @override
   */
  formatTooltip: function(e, t, r) {
    if (r === "edge") {
      var n = this.getData(), i = this.getDataParams(e, r), a = n.graph.getEdgeByIndex(e), o = n.getName(a.node1.dataIndex), s = n.getName(a.node2.dataIndex), l = [];
      return o != null && l.push(o), s != null && l.push(s), l = _n(l.join(" > ")), i.value && (l += " : " + _n(i.value)), l;
    } else
      return r1.superApply(this, "formatTooltip", arguments);
  },
  _updateCategoriesData: function() {
    var e = (this.option.categories || []).map(function(r) {
      return r.value != null ? r : Object.assign({
        value: 0
      }, r);
    }), t = new zr(["value"], this);
    t.initData(e), this._categoriesData = t, this._categoriesModels = t.mapArray(function(r) {
      return t.getItemModel(r, !0);
    });
  },
  setView: function(e) {
    e.zoom != null && (this.option.zoom = e.zoom), e.offset != null && (this.option.offset = e.offset);
  },
  setNodePosition: function(e) {
    for (var t = 0; t < e.length / 2; t++) {
      var r = e[t * 2], n = e[t * 2 + 1], i = this.getData().getRawDataItem(t);
      i.x = r, i.y = n;
    }
  },
  isAnimationEnabled: function() {
    return r1.superCall(this, "isAnimationEnabled") && !(this.get("layout") === "force" && this.get("force.layoutAnimation"));
  },
  defaultOption: {
    zlevel: 10,
    z: 2,
    legendHoverLink: !0,
    // Only support forceAtlas2
    layout: "forceAtlas2",
    // Configuration of force directed layout
    forceAtlas2: {
      initLayout: null,
      GPU: !0,
      steps: 1,
      // barnesHutOptimize
      // Maxp layout steps.
      maxSteps: 1e3,
      repulsionByDegree: !0,
      linLogMode: !1,
      strongGravityMode: !1,
      gravity: 1,
      // scaling: 1.0,
      edgeWeightInfluence: 1,
      // Edge weight range.
      edgeWeight: [1, 4],
      // Node weight range.
      nodeWeight: [1, 4],
      // jitterTolerence: 0.1,
      preventOverlap: !1,
      gravityCenter: null
    },
    focusNodeAdjacency: !0,
    focusNodeAdjacencyOn: "mouseover",
    left: "center",
    top: "center",
    // right: null,
    // bottom: null,
    // width: '80%',
    // height: '80%',
    symbol: "circle",
    symbolSize: 5,
    roam: !1,
    // Default on center of graph
    center: null,
    zoom: 1,
    // categories: [],
    // data: []
    // Or
    // nodes: []
    //
    // links: []
    // Or
    // edges: []
    label: {
      show: !1,
      formatter: "{b}",
      position: "right",
      distance: 5,
      textStyle: {
        fontSize: 14
      }
    },
    itemStyle: {},
    lineStyle: {
      color: "#aaa",
      width: 1,
      opacity: 0.5
    },
    emphasis: {
      label: {
        show: !0
      }
    },
    animation: !1
  }
}), zn = bn.vec2, NH = [[0, 0], [1, 1]], o3 = jt.extend(
  function() {
    return {
      segmentScale: 4,
      dynamic: !0,
      /**
       * Need to use mesh to expand lines if lineWidth > MAX_LINE_WIDTH
       */
      useNativeLine: !0,
      attributes: {
        position: new jt.Attribute("position", "float", 2, "POSITION"),
        normal: new jt.Attribute("normal", "float", 2),
        offset: new jt.Attribute("offset", "float", 1),
        color: new jt.Attribute("color", "float", 4, "COLOR")
      }
    };
  },
  /** @lends module: echarts-gl/util/geometry/LinesGeometry.prototype */
  {
    /**
     * Reset offset
     */
    resetOffset: function() {
      this._vertexOffset = 0, this._faceOffset = 0, this._itemVertexOffsets = [];
    },
    /**
     * @param {number} nVertex
     */
    setVertexCount: function(e) {
      var t = this.attributes;
      this.vertexCount !== e && (t.position.init(e), t.color.init(e), this.useNativeLine || (t.offset.init(e), t.normal.init(e)), e > 65535 ? this.indices instanceof Uint16Array && (this.indices = new Uint32Array(this.indices)) : this.indices instanceof Uint32Array && (this.indices = new Uint16Array(this.indices)));
    },
    /**
     * @param {number} nTriangle
     */
    setTriangleCount: function(e) {
      this.triangleCount !== e && (e === 0 ? this.indices = null : this.indices = this.vertexCount > 65535 ? new Uint32Array(e * 3) : new Uint16Array(e * 3));
    },
    _getCubicCurveApproxStep: function(e, t, r, n) {
      var i = zn.dist(e, t) + zn.dist(r, t) + zn.dist(n, r), a = 1 / (i + 1) * this.segmentScale;
      return a;
    },
    /**
     * Get vertex count of cubic curve
     * @param {Array.<number>} p0
     * @param {Array.<number>} p1
     * @param {Array.<number>} p2
     * @param {Array.<number>} p3
     * @return number
     */
    getCubicCurveVertexCount: function(e, t, r, n) {
      var i = this._getCubicCurveApproxStep(e, t, r, n), a = Math.ceil(1 / i);
      return this.useNativeLine ? a * 2 : a * 2 + 2;
    },
    /**
     * Get face count of cubic curve
     * @param {Array.<number>} p0
     * @param {Array.<number>} p1
     * @param {Array.<number>} p2
     * @param {Array.<number>} p3
     * @return number
     */
    getCubicCurveTriangleCount: function(e, t, r, n) {
      var i = this._getCubicCurveApproxStep(e, t, r, n), a = Math.ceil(1 / i);
      return this.useNativeLine ? 0 : a * 2;
    },
    /**
     * Get vertex count of line
     * @return {number}
     */
    getLineVertexCount: function() {
      return this.getPolylineVertexCount(NH);
    },
    /**
     * Get face count of line
     * @return {number}
     */
    getLineTriangleCount: function() {
      return this.getPolylineTriangleCount(NH);
    },
    /**
     * Get how many vertices will polyline take.
     * @type {number|Array} points Can be a 1d/2d list of points, or a number of points amount.
     * @return {number}
     */
    getPolylineVertexCount: function(e) {
      var t;
      if (typeof e == "number")
        t = e;
      else {
        var r = typeof e[0] != "number";
        t = r ? e.length : e.length / 2;
      }
      return this.useNativeLine ? (t - 1) * 2 : (t - 1) * 2 + 2;
    },
    /**
     * Get how many triangles will polyline take.
     * @type {number|Array} points Can be a 1d/2d list of points, or a number of points amount.
     * @return {number}
     */
    getPolylineTriangleCount: function(e) {
      var t;
      if (typeof e == "number")
        t = e;
      else {
        var r = typeof e[0] != "number";
        t = r ? e.length : e.length / 2;
      }
      return this.useNativeLine ? 0 : (t - 1) * 2;
    },
    /**
     * Add a cubic curve
     * @param {Array.<number>} p0
     * @param {Array.<number>} p1
     * @param {Array.<number>} p2
     * @param {Array.<number>} p3
     * @param {Array.<number>} color
     * @param {number} [lineWidth=1]
     */
    addCubicCurve: function(e, t, r, n, i, a) {
      a == null && (a = 1);
      for (var o = e[0], s = e[1], l = t[0], u = t[1], f = r[0], c = r[1], h = n[0], v = n[1], d = this._getCubicCurveApproxStep(e, t, r, n), g = d * d, y = g * d, x = 3 * d, S = 3 * g, T = 6 * g, C = 6 * y, A = o - l * 2 + f, M = s - u * 2 + c, E = (l - f) * 3 - o + h, P = (u - c) * 3 - s + v, R = o, O = s, N = (l - o) * x + A * S + E * y, G = (u - s) * x + M * S + P * y, z = A * T + E * C, H = M * T + P * C, W = E * C, Z = P * C, ee = 0, V = 0, Q = Math.ceil(1 / d), q = new Float32Array((Q + 1) * 3), q = [], X = 0, V = 0; V < Q + 1; V++)
        q[X++] = R, q[X++] = O, R += N, O += G, N += z, G += H, z += W, H += Z, ee += d, ee > 1 && (R = N > 0 ? Math.min(R, h) : Math.max(R, h), O = G > 0 ? Math.min(O, v) : Math.max(O, v));
      this.addPolyline(q, i, a);
    },
    /**
     * Add a straight line
     * @param {Array.<number>} p0
     * @param {Array.<number>} p1
     * @param {Array.<number>} color
     * @param {number} [lineWidth=1]
     */
    addLine: function(e, t, r, n) {
      this.addPolyline([e, t], r, n);
    },
    /**
     * Add a straight line
     * @param {Array.<Array> | Array.<number>} points
     * @param {Array.<number> | Array.<Array>} color
     * @param {number} [lineWidth=1]
     * @param {number} [arrayOffset=0]
     * @param {number} [pointsCount] Default to be amount of points in the first argument
     */
    addPolyline: (function() {
      var e = zn.create(), t = zn.create(), r = zn.create(), n = zn.create(), i = [], a = [], o = [];
      return function(s, l, u, f, c) {
        if (s.length) {
          var h = typeof s[0] != "number";
          if (c == null && (c = h ? s.length : s.length / 2), !(c < 2)) {
            f == null && (f = 0), u == null && (u = 1), this._itemVertexOffsets.push(this._vertexOffset);
            for (var v = h ? typeof l[0] != "number" : l.length / 4 === c, d = this.attributes.position, g = this.attributes.color, y = this.attributes.offset, x = this.attributes.normal, S = this.indices, T = this._vertexOffset, C, A = 0; A < c; A++) {
              if (h)
                i = s[A + f], v ? C = l[A + f] : C = l;
              else {
                var M = A * 2 + f;
                if (i = i || [], i[0] = s[M], i[1] = s[M + 1], v) {
                  var E = A * 4 + f;
                  C = C || [], C[0] = l[E], C[1] = l[E + 1], C[2] = l[E + 2], C[3] = l[E + 3];
                } else
                  C = l;
              }
              if (this.useNativeLine)
                A > 1 && (d.copy(T, T - 1), g.copy(T, T - 1), T++);
              else {
                var P;
                if (A < c - 1) {
                  if (h)
                    zn.copy(a, s[A + 1]);
                  else {
                    var M = (A + 1) * 2 + f;
                    a = a || [], a[0] = s[M], a[1] = s[M + 1];
                  }
                  if (A > 0) {
                    zn.sub(e, i, o), zn.sub(t, a, i), zn.normalize(e, e), zn.normalize(t, t), zn.add(n, e, t), zn.normalize(n, n);
                    var R = u / 2 * Math.min(1 / zn.dot(e, n), 2);
                    r[0] = -n[1], r[1] = n[0], P = R;
                  } else
                    zn.sub(e, a, i), zn.normalize(e, e), r[0] = -e[1], r[1] = e[0], P = u / 2;
                } else
                  zn.sub(e, i, o), zn.normalize(e, e), r[0] = -e[1], r[1] = e[0], P = u / 2;
                x.set(T, r), x.set(T + 1, r), y.set(T, P), y.set(T + 1, -P), zn.copy(o, i), d.set(T, i), d.set(T + 1, i), g.set(T, C), g.set(T + 1, C), T += 2;
              }
              if (this.useNativeLine)
                g.set(T, C), d.set(T, i), T++;
              else if (A > 0) {
                var O = this._faceOffset * 3, S = this.indices;
                S[O] = T - 4, S[O + 1] = T - 3, S[O + 2] = T - 2, S[O + 3] = T - 3, S[O + 4] = T - 1, S[O + 5] = T - 2, this._faceOffset += 2;
              }
            }
            this._vertexOffset = T;
          }
        }
      };
    })(),
    /**
     * Set color of single line.
     */
    setItemColor: function(e, t) {
      for (var r = this._itemVertexOffsets[e], n = e < this._itemVertexOffsets.length - 1 ? this._itemVertexOffsets[e + 1] : this._vertexOffset, i = r; i < n; i++)
        this.attributes.color.set(i, t);
      this.dirty("color");
    }
  }
);
tt(o3.prototype, Ux);
const eTe = `@export ecgl.forceAtlas2.updateNodeRepulsion

#define NODE_COUNT 0

uniform sampler2D positionTex;

uniform vec2 textureSize;
uniform float gravity;
uniform float scaling;
uniform vec2 gravityCenter;

uniform bool strongGravityMode;
uniform bool preventOverlap;

varying vec2 v_Texcoord;

void main() {

 vec4 n0 = texture2D(positionTex, v_Texcoord);

 vec2 force = vec2(0.0);
 for (int i = 0; i < NODE_COUNT; i++) {
 vec2 uv = vec2(
 mod(float(i), textureSize.x) / (textureSize.x - 1.0),
 floor(float(i) / textureSize.x) / (textureSize.y - 1.0)
 );
 vec4 n1 = texture2D(positionTex, uv);

 vec2 dir = n0.xy - n1.xy;
 float d2 = dot(dir, dir);

 if (d2 > 0.0) {
 float factor = 0.0;
 if (preventOverlap) {
 float d = sqrt(d2);
 d = d - n0.w - n1.w;
 if (d > 0.0) {
 factor = scaling * n0.z * n1.z / (d * d);
 }
 else if (d < 0.0) {
 factor = scaling * 100.0 * n0.z * n1.z;
 }
 }
 else {
 factor = scaling * n0.z * n1.z / d2;
 }
 force += dir * factor;
 }
 }

 vec2 dir = gravityCenter - n0.xy;
 float d = 1.0;
 if (!strongGravityMode) {
 d = length(dir);
 }

 force += dir * n0.z * gravity / (d + 1.0);

 gl_FragColor = vec4(force, 0.0, 1.0);
}
@end

@export ecgl.forceAtlas2.updateEdgeAttraction.vertex

attribute vec2 node1;
attribute vec2 node2;
attribute float weight;

uniform sampler2D positionTex;
uniform float edgeWeightInfluence;
uniform bool preventOverlap;
uniform bool linLogMode;

uniform vec2 windowSize: WINDOW_SIZE;

varying vec2 v_Force;

void main() {

 vec4 n0 = texture2D(positionTex, node1);
 vec4 n1 = texture2D(positionTex, node2);

 vec2 dir = n1.xy - n0.xy;
 float d = length(dir);
 float w;
 if (edgeWeightInfluence == 0.0) {
 w = 1.0;
 }
 else if (edgeWeightInfluence == 1.0) {
 w = weight;
 }
 else {
 w = pow(weight, edgeWeightInfluence);
 }
 vec2 offset = vec2(1.0 / windowSize.x, 1.0 / windowSize.y);
 vec2 scale = vec2((windowSize.x - 1.0) / windowSize.x, (windowSize.y - 1.0) / windowSize.y);
 vec2 pos = node1 * scale * 2.0 - 1.0;
 gl_Position = vec4(pos + offset, 0.0, 1.0);
 gl_PointSize = 1.0;

 float factor;
 if (preventOverlap) {
 d = d - n1.w - n0.w;
 }
 if (d <= 0.0) {
 v_Force = vec2(0.0);
 return;
 }

 if (linLogMode) {
 factor = w * log(d) / d;
 }
 else {
 factor = w;
 }
 v_Force = dir * factor;
}
@end

@export ecgl.forceAtlas2.updateEdgeAttraction.fragment

varying vec2 v_Force;

void main() {
 gl_FragColor = vec4(v_Force, 0.0, 0.0);
}
@end

@export ecgl.forceAtlas2.calcWeightedSum.vertex

attribute vec2 node;

varying vec2 v_NodeUv;

void main() {

 v_NodeUv = node;
 gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
 gl_PointSize = 1.0;
}
@end

@export ecgl.forceAtlas2.calcWeightedSum.fragment

varying vec2 v_NodeUv;

uniform sampler2D positionTex;
uniform sampler2D forceTex;
uniform sampler2D forcePrevTex;

void main() {
 vec2 force = texture2D(forceTex, v_NodeUv).rg;
 vec2 forcePrev = texture2D(forcePrevTex, v_NodeUv).rg;

 float mass = texture2D(positionTex, v_NodeUv).z;
 float swing = length(force - forcePrev) * mass;
 float traction = length(force + forcePrev) * 0.5 * mass;

 gl_FragColor = vec4(swing, traction, 0.0, 0.0);
}
@end

@export ecgl.forceAtlas2.calcGlobalSpeed

uniform sampler2D globalSpeedPrevTex;
uniform sampler2D weightedSumTex;
uniform float jitterTolerence;

void main() {
 vec2 weightedSum = texture2D(weightedSumTex, vec2(0.5)).xy;
 float prevGlobalSpeed = texture2D(globalSpeedPrevTex, vec2(0.5)).x;
 float globalSpeed = jitterTolerence * jitterTolerence
 * weightedSum.y / weightedSum.x;
 if (prevGlobalSpeed > 0.0) {
 globalSpeed = min(globalSpeed / prevGlobalSpeed, 1.5) * prevGlobalSpeed;
 }
 gl_FragColor = vec4(globalSpeed, 0.0, 0.0, 1.0);
}
@end

@export ecgl.forceAtlas2.updatePosition

uniform sampler2D forceTex;
uniform sampler2D forcePrevTex;
uniform sampler2D positionTex;
uniform sampler2D globalSpeedTex;

varying vec2 v_Texcoord;

void main() {
 vec2 force = texture2D(forceTex, v_Texcoord).xy;
 vec2 forcePrev = texture2D(forcePrevTex, v_Texcoord).xy;
 vec4 node = texture2D(positionTex, v_Texcoord);

 float globalSpeed = texture2D(globalSpeedTex, vec2(0.5)).r;
 float swing = length(force - forcePrev);
 float speed = 0.1 * globalSpeed / (0.1 + globalSpeed * sqrt(swing));

 float df = length(force);
 if (df > 0.0) {
 speed = min(df * speed, 10.0) / df;

 gl_FragColor = vec4(node.xy + speed * force, node.zw);
 }
 else {
 gl_FragColor = node;
 }
}
@end

@export ecgl.forceAtlas2.edges.vertex
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;

attribute vec2 node;
attribute vec4 a_Color : COLOR;
varying vec4 v_Color;

uniform sampler2D positionTex;

void main()
{
 gl_Position = worldViewProjection * vec4(
 texture2D(positionTex, node).xy, -10.0, 1.0
 );
 v_Color = a_Color;
}
@end

@export ecgl.forceAtlas2.edges.fragment
uniform vec4 color : [1.0, 1.0, 1.0, 1.0];
varying vec4 v_Color;
void main() {
 gl_FragColor = color * v_Color;
}
@end`;
J.Shader.import(eTe);
var wE = {
  repulsionByDegree: !0,
  linLogMode: !1,
  strongGravityMode: !1,
  gravity: 1,
  scaling: 1,
  edgeWeightInfluence: 1,
  jitterTolerence: 0.1,
  preventOverlap: !1,
  dissuadeHubs: !1,
  gravityCenter: null
};
function Hn(e) {
  var t = {
    type: J.Texture.FLOAT,
    minFilter: J.Texture.NEAREST,
    magFilter: J.Texture.NEAREST
  };
  this._positionSourceTex = new J.Texture2D(t), this._positionSourceTex.flipY = !1, this._positionTex = new J.Texture2D(t), this._positionPrevTex = new J.Texture2D(t), this._forceTex = new J.Texture2D(t), this._forcePrevTex = new J.Texture2D(t), this._weightedSumTex = new J.Texture2D(t), this._weightedSumTex.width = this._weightedSumTex.height = 1, this._globalSpeedTex = new J.Texture2D(t), this._globalSpeedPrevTex = new J.Texture2D(t), this._globalSpeedTex.width = this._globalSpeedTex.height = 1, this._globalSpeedPrevTex.width = this._globalSpeedPrevTex.height = 1, this._nodeRepulsionPass = new Pn({
    fragment: J.Shader.source("ecgl.forceAtlas2.updateNodeRepulsion")
  }), this._positionPass = new Pn({
    fragment: J.Shader.source("ecgl.forceAtlas2.updatePosition")
  }), this._globalSpeedPass = new Pn({
    fragment: J.Shader.source("ecgl.forceAtlas2.calcGlobalSpeed")
  }), this._copyPass = new Pn({
    fragment: J.Shader.source("clay.compositor.output")
  });
  var r = function(n) {
    n.blendEquation(n.FUNC_ADD), n.blendFunc(n.ONE, n.ONE);
  };
  this._edgeForceMesh = new J.Mesh({
    geometry: new J.Geometry({
      attributes: {
        node1: new J.Geometry.Attribute("node1", "float", 2),
        node2: new J.Geometry.Attribute("node2", "float", 2),
        weight: new J.Geometry.Attribute("weight", "float", 1)
      },
      dynamic: !0,
      mainAttribute: "node1"
    }),
    material: new J.Material({
      transparent: !0,
      shader: J.createShader("ecgl.forceAtlas2.updateEdgeAttraction"),
      blend: r,
      depthMask: !1,
      depthText: !1
    }),
    mode: J.Mesh.POINTS
  }), this._weightedSumMesh = new J.Mesh({
    geometry: new J.Geometry({
      attributes: {
        node: new J.Geometry.Attribute("node", "float", 2)
      },
      dynamic: !0,
      mainAttribute: "node"
    }),
    material: new J.Material({
      transparent: !0,
      shader: J.createShader("ecgl.forceAtlas2.calcWeightedSum"),
      blend: r,
      depthMask: !1,
      depthText: !1
    }),
    mode: J.Mesh.POINTS
  }), this._framebuffer = new Tn({
    depthBuffer: !1
  }), this._dummyCamera = new J.OrthographicCamera({
    left: -1,
    right: 1,
    top: 1,
    bottom: -1,
    near: 0,
    far: 100
  }), this._globalSpeed = 0;
}
Hn.prototype.updateOption = function(e) {
  for (var t in wE)
    this[t] = wE[t];
  var r = this._nodes.length;
  if (r > 5e4 ? this.jitterTolerence = 10 : r > 5e3 ? this.jitterTolerence = 1 : this.jitterTolerence = 0.1, r > 100 ? this.scaling = 2 : this.scaling = 10, e)
    for (var t in wE)
      e[t] != null && (this[t] = e[t]);
  if (this.repulsionByDegree)
    for (var n = this._positionSourceTex.pixels, i = 0; i < this._nodes.length; i++)
      n[i * 4 + 2] = (this._nodes[i].degree || 0) + 1;
};
Hn.prototype._updateGravityCenter = function(e) {
  var t = this._nodes, r = this._edges;
  if (this.gravityCenter)
    this._gravityCenter = this.gravityCenter;
  else {
    for (var n = [1 / 0, 1 / 0], i = [-1 / 0, -1 / 0], a = 0; a < t.length; a++)
      n[0] = Math.min(t[a].x, n[0]), n[1] = Math.min(t[a].y, n[1]), i[0] = Math.max(t[a].x, i[0]), i[1] = Math.max(t[a].y, i[1]);
    this._gravityCenter = [(n[0] + i[0]) * 0.5, (n[1] + i[1]) * 0.5];
  }
  for (var a = 0; a < r.length; a++) {
    var o = r[a].node1, s = r[a].node2;
    t[o].degree = (t[o].degree || 0) + 1, t[s].degree = (t[s].degree || 0) + 1;
  }
};
Hn.prototype.initData = function(e, t) {
  this._nodes = e, this._edges = t, this._updateGravityCenter();
  var r = Math.ceil(Math.sqrt(e.length)), n = r, i = new Float32Array(r * n * 4);
  this._resize(r, n);
  for (var a = 0, o = 0; o < e.length; o++) {
    var s = e[o];
    i[a++] = s.x || 0, i[a++] = s.y || 0, i[a++] = s.mass || 1, i[a++] = s.size || 1;
  }
  this._positionSourceTex.pixels = i;
  var l = this._edgeForceMesh.geometry, u = t.length;
  l.attributes.node1.init(u * 2), l.attributes.node2.init(u * 2), l.attributes.weight.init(u * 2);
  for (var f = [], o = 0; o < t.length; o++) {
    var c = l.attributes, h = t[o].weight;
    h == null && (h = 1), c.node1.set(o, this.getNodeUV(t[o].node1, f)), c.node2.set(o, this.getNodeUV(t[o].node2, f)), c.weight.set(o, h), c.node1.set(o + u, this.getNodeUV(t[o].node2, f)), c.node2.set(o + u, this.getNodeUV(t[o].node1, f)), c.weight.set(o + u, h);
  }
  var v = this._weightedSumMesh.geometry;
  v.attributes.node.init(e.length);
  for (var o = 0; o < e.length; o++)
    v.attributes.node.set(o, this.getNodeUV(o, f));
  l.dirty(), v.dirty(), this._nodeRepulsionPass.material.define("fragment", "NODE_COUNT", e.length), this._nodeRepulsionPass.material.setUniform("textureSize", [r, n]), this._inited = !1, this._frame = 0;
};
Hn.prototype.getNodes = function() {
  return this._nodes;
};
Hn.prototype.getEdges = function() {
  return this._edges;
};
Hn.prototype.step = function(e) {
  this._inited || (this._initFromSource(e), this._inited = !0), this._frame++, this._framebuffer.attach(this._forceTex), this._framebuffer.bind(e);
  var t = this._nodeRepulsionPass;
  t.setUniform("strongGravityMode", this.strongGravityMode), t.setUniform("gravity", this.gravity), t.setUniform("gravityCenter", this._gravityCenter), t.setUniform("scaling", this.scaling), t.setUniform("preventOverlap", this.preventOverlap), t.setUniform("positionTex", this._positionPrevTex), t.render(e);
  var r = this._edgeForceMesh;
  r.material.set("linLogMode", this.linLogMode), r.material.set("edgeWeightInfluence", this.edgeWeightInfluence), r.material.set("preventOverlap", this.preventOverlap), r.material.set("positionTex", this._positionPrevTex), e.gl.enable(e.gl.BLEND), e.renderPass([r], this._dummyCamera), this._framebuffer.attach(this._weightedSumTex), e.gl.clearColor(0, 0, 0, 0), e.gl.clear(e.gl.COLOR_BUFFER_BIT), e.gl.enable(e.gl.BLEND);
  var n = this._weightedSumMesh;
  n.material.set("positionTex", this._positionPrevTex), n.material.set("forceTex", this._forceTex), n.material.set("forcePrevTex", this._forcePrevTex), e.renderPass([n], this._dummyCamera), this._framebuffer.attach(this._globalSpeedTex);
  var i = this._globalSpeedPass;
  i.setUniform("globalSpeedPrevTex", this._globalSpeedPrevTex), i.setUniform("weightedSumTex", this._weightedSumTex), i.setUniform("jitterTolerence", this.jitterTolerence), e.gl.disable(e.gl.BLEND), i.render(e);
  var a = this._positionPass;
  this._framebuffer.attach(this._positionTex), a.setUniform("globalSpeedTex", this._globalSpeedTex), a.setUniform("positionTex", this._positionPrevTex), a.setUniform("forceTex", this._forceTex), a.setUniform("forcePrevTex", this._forcePrevTex), a.render(e), this._framebuffer.unbind(e), this._swapTexture();
};
Hn.prototype.update = function(e, t, r) {
  t == null && (t = 1), t = Math.max(t, 1);
  for (var n = 0; n < t; n++)
    this.step(e);
  r && r();
};
Hn.prototype.getNodePositionTexture = function() {
  return this._inited ? this._positionPrevTex : this._positionSourceTex;
};
Hn.prototype.getNodeUV = function(e, t) {
  t = t || [];
  var r = this._positionTex.width, n = this._positionTex.height;
  return t[0] = e % r / (r - 1), t[1] = Math.floor(e / r) / (n - 1) || 0, t;
};
Hn.prototype.getNodePosition = function(e, t) {
  var r = this._positionArr, n = this._positionTex.width, i = this._positionTex.height, a = n * i;
  (!r || r.length !== a * 4) && (r = this._positionArr = new Float32Array(a * 4)), this._framebuffer.bind(e), this._framebuffer.attach(this._positionPrevTex), e.gl.readPixels(0, 0, n, i, e.gl.RGBA, e.gl.FLOAT, r), this._framebuffer.unbind(e), t || (t = new Float32Array(this._nodes.length * 2));
  for (var o = 0; o < this._nodes.length; o++)
    t[o * 2] = r[o * 4], t[o * 2 + 1] = r[o * 4 + 1];
  return t;
};
Hn.prototype.getTextureData = function(e, t) {
  var r = this["_" + t + "Tex"], n = r.width, i = r.height;
  this._framebuffer.bind(e), this._framebuffer.attach(r);
  var a = new Float32Array(n * i * 4);
  return e.gl.readPixels(0, 0, n, i, e.gl.RGBA, e.gl.FLOAT, a), this._framebuffer.unbind(e), a;
};
Hn.prototype.getTextureSize = function() {
  return {
    width: this._positionTex.width,
    height: this._positionTex.height
  };
};
Hn.prototype.isFinished = function(e) {
  return this._frame > e;
};
Hn.prototype._swapTexture = function() {
  var e = this._positionPrevTex;
  this._positionPrevTex = this._positionTex, this._positionTex = e;
  var e = this._forcePrevTex;
  this._forcePrevTex = this._forceTex, this._forceTex = e;
  var e = this._globalSpeedPrevTex;
  this._globalSpeedPrevTex = this._globalSpeedTex, this._globalSpeedTex = e;
};
Hn.prototype._initFromSource = function(e) {
  this._framebuffer.attach(this._positionPrevTex), this._framebuffer.bind(e), this._copyPass.setUniform("texture", this._positionSourceTex), this._copyPass.render(e), e.gl.clearColor(0, 0, 0, 0), this._framebuffer.attach(this._forcePrevTex), e.gl.clear(e.gl.COLOR_BUFFER_BIT), this._framebuffer.attach(this._globalSpeedPrevTex), e.gl.clear(e.gl.COLOR_BUFFER_BIT), this._framebuffer.unbind(e);
};
Hn.prototype._resize = function(e, t) {
  ["_positionSourceTex", "_positionTex", "_positionPrevTex", "_forceTex", "_forcePrevTex"].forEach(function(r) {
    this[r].width = e, this[r].height = t, this[r].dirty();
  }, this);
};
Hn.prototype.dispose = function(e) {
  this._framebuffer.dispose(e), this._copyPass.dispose(e), this._nodeRepulsionPass.dispose(e), this._positionPass.dispose(e), this._globalSpeedPass.dispose(e), this._edgeForceMesh.geometry.dispose(e), this._weightedSumMesh.geometry.dispose(e), this._positionSourceTex.dispose(e), this._positionTex.dispose(e), this._positionPrevTex.dispose(e), this._forceTex.dispose(e), this._forcePrevTex.dispose(e), this._weightedSumTex.dispose(e), this._globalSpeedTex.dispose(e), this._globalSpeedPrevTex.dispose(e);
};
function tTe() {
  var e = {
    create: function() {
      return new Float32Array(2);
    },
    dist: function(l, u) {
      var f = u[0] - l[0], c = u[1] - l[1];
      return Math.sqrt(f * f + c * c);
    },
    len: function(l) {
      var u = l[0], f = l[1];
      return Math.sqrt(u * u + f * f);
    },
    scaleAndAdd: function(l, u, f, c) {
      return l[0] = u[0] + f[0] * c, l[1] = u[1] + f[1] * c, l;
    },
    scale: function(l, u, f) {
      return l[0] = u[0] * f, l[1] = u[1] * f, l;
    },
    add: function(l, u, f) {
      return l[0] = u[0] + f[0], l[1] = u[1] + f[1], l;
    },
    sub: function(l, u, f) {
      return l[0] = u[0] - f[0], l[1] = u[1] - f[1], l;
    },
    normalize: function(l, u) {
      var f = u[0], c = u[1], h = f * f + c * c;
      return h > 0 && (h = 1 / Math.sqrt(h), l[0] = u[0] * h, l[1] = u[1] * h), l;
    },
    negate: function(l, u) {
      return l[0] = -u[0], l[1] = -u[1], l;
    },
    copy: function(l, u) {
      return l[0] = u[0], l[1] = u[1], l;
    },
    set: function(l, u, f) {
      return l[0] = u, l[1] = f, l;
    }
  };
  function t() {
    this.subRegions = [], this.nSubRegions = 0, this.node = null, this.mass = 0, this.centerOfMass = null, this.bbox = new Float32Array(4), this.size = 0;
  }
  var r = t.prototype;
  r.beforeUpdate = function() {
    for (var l = 0; l < this.nSubRegions; l++)
      this.subRegions[l].beforeUpdate();
    this.mass = 0, this.centerOfMass && (this.centerOfMass[0] = 0, this.centerOfMass[1] = 0), this.nSubRegions = 0, this.node = null;
  }, r.afterUpdate = function() {
    this.subRegions.length = this.nSubRegions;
    for (var l = 0; l < this.nSubRegions; l++)
      this.subRegions[l].afterUpdate();
  }, r.addNode = function(l) {
    if (this.nSubRegions === 0)
      if (this.node == null) {
        this.node = l;
        return;
      } else
        this._addNodeToSubRegion(this.node), this.node = null;
    this._addNodeToSubRegion(l), this._updateCenterOfMass(l);
  }, r.findSubRegion = function(l, u) {
    for (var f = 0; f < this.nSubRegions; f++) {
      var c = this.subRegions[f];
      if (c.contain(l, u))
        return c;
    }
  }, r.contain = function(l, u) {
    return this.bbox[0] <= l && this.bbox[2] >= l && this.bbox[1] <= u && this.bbox[3] >= u;
  }, r.setBBox = function(l, u, f, c) {
    this.bbox[0] = l, this.bbox[1] = u, this.bbox[2] = f, this.bbox[3] = c, this.size = (f - l + c - u) / 2;
  }, r._newSubRegion = function() {
    var l = this.subRegions[this.nSubRegions];
    return l || (l = new t(), this.subRegions[this.nSubRegions] = l), this.nSubRegions++, l;
  }, r._addNodeToSubRegion = function(l) {
    var u = this.findSubRegion(l.position[0], l.position[1]), f = this.bbox;
    if (!u) {
      var c = (f[0] + f[2]) / 2, h = (f[1] + f[3]) / 2, v = (f[2] - f[0]) / 2, d = (f[3] - f[1]) / 2, g = l.position[0] >= c ? 1 : 0, y = l.position[1] >= h ? 1 : 0, u = this._newSubRegion();
      u.setBBox(
        // Min
        g * v + f[0],
        y * d + f[1],
        // Max
        (g + 1) * v + f[0],
        (y + 1) * d + f[1]
      );
    }
    u.addNode(l);
  }, r._updateCenterOfMass = function(l) {
    this.centerOfMass == null && (this.centerOfMass = new Float32Array(2));
    var u = this.centerOfMass[0] * this.mass, f = this.centerOfMass[1] * this.mass;
    u += l.position[0] * l.mass, f += l.position[1] * l.mass, this.mass += l.mass, this.centerOfMass[0] = u / this.mass, this.centerOfMass[1] = f / this.mass;
  };
  function n() {
    this.position = new Float32Array(2), this.force = e.create(), this.forcePrev = e.create(), this.mass = 1, this.inDegree = 0, this.outDegree = 0;
  }
  function i(l, u) {
    this.source = l, this.target = u, this.weight = 1;
  }
  function a() {
    this.autoSettings = !0, this.barnesHutOptimize = !0, this.barnesHutTheta = 1.5, this.repulsionByDegree = !0, this.linLogMode = !1, this.strongGravityMode = !1, this.gravity = 1, this.scaling = 1, this.edgeWeightInfluence = 1, this.jitterTolerence = 0.1, this.preventOverlap = !1, this.dissuadeHubs = !1, this.rootRegion = new t(), this.rootRegion.centerOfMass = e.create(), this.nodes = [], this.edges = [], this.bbox = new Float32Array(4), this.gravityCenter = null, this._massArr = null, this._swingingArr = null, this._sizeArr = null, this._globalSpeed = 0;
  }
  var o = a.prototype;
  o.initNodes = function(l, u, f) {
    var c = u.length;
    this.nodes.length = 0;
    for (var h = typeof f < "u", v = 0; v < c; v++) {
      var d = new n();
      d.position[0] = l[v * 2], d.position[1] = l[v * 2 + 1], d.mass = u[v], h && (d.size = f[v]), this.nodes.push(d);
    }
    this._massArr = u, this._swingingArr = new Float32Array(c), h && (this._sizeArr = f);
  }, o.initEdges = function(l, u) {
    var f = l.length / 2;
    this.edges.length = 0;
    for (var c = 0; c < f; c++) {
      var h = l[c * 2], v = l[c * 2 + 1], d = this.nodes[h], g = this.nodes[v];
      if (!d || !g) {
        console.error("Node not exists, try initNodes before initEdges");
        return;
      }
      d.outDegree++, g.inDegree++;
      var y = new i(d, g);
      u && (y.weight = u[c]), this.edges.push(y);
    }
  }, o.updateSettings = function() {
    if (this.repulsionByDegree)
      for (var l = 0; l < this.nodes.length; l++) {
        var u = this.nodes[l];
        u.mass = u.inDegree + u.outDegree + 1;
      }
    else
      for (var l = 0; l < this.nodes.length; l++) {
        var u = this.nodes[l];
        u.mass = this._massArr[l];
      }
  }, o.update = function() {
    var l = this.nodes.length;
    if (this.updateSettings(), this.updateBBox(), this.barnesHutOptimize) {
      this.rootRegion.setBBox(this.bbox[0], this.bbox[1], this.bbox[2], this.bbox[3]), this.rootRegion.beforeUpdate();
      for (var u = 0; u < l; u++)
        this.rootRegion.addNode(this.nodes[u]);
      this.rootRegion.afterUpdate();
    }
    for (var u = 0; u < l; u++) {
      var f = this.nodes[u];
      e.copy(f.forcePrev, f.force), e.set(f.force, 0, 0);
    }
    for (var u = 0; u < l; u++) {
      var c = this.nodes[u];
      if (this.barnesHutOptimize)
        this.applyRegionToNodeRepulsion(this.rootRegion, c);
      else
        for (var h = u + 1; h < l; h++) {
          var v = this.nodes[h];
          this.applyNodeToNodeRepulsion(c, v, !1);
        }
      this.gravity > 0 && (this.strongGravityMode ? this.applyNodeStrongGravity(c) : this.applyNodeGravity(c));
    }
    for (var u = 0; u < this.edges.length; u++)
      this.applyEdgeAttraction(this.edges[u]);
    for (var d = 0, g = 0, y = e.create(), u = 0; u < l; u++) {
      var f = this.nodes[u], x = e.dist(f.force, f.forcePrev);
      d += x * f.mass, e.add(y, f.force, f.forcePrev);
      var S = e.len(y) * 0.5;
      g += S * f.mass, this._swingingArr[u] = x;
    }
    var T = this.jitterTolerence * this.jitterTolerence * g / d;
    this._globalSpeed > 0 && (T = Math.min(T / this._globalSpeed, 1.5) * this._globalSpeed), this._globalSpeed = T;
    for (var u = 0; u < l; u++) {
      var f = this.nodes[u], x = this._swingingArr[u], C = 0.1 * T / (1 + T * Math.sqrt(x)), A = e.len(f.force);
      A > 0 && (C = Math.min(A * C, 10) / A, e.scaleAndAdd(f.position, f.position, f.force, C));
    }
  }, o.applyRegionToNodeRepulsion = (function() {
    var l = e.create();
    return function(f, c) {
      if (f.node)
        this.applyNodeToNodeRepulsion(f.node, c, !0);
      else {
        e.sub(l, c.position, f.centerOfMass);
        var h = l[0] * l[0] + l[1] * l[1];
        if (h > this.barnesHutTheta * f.size * f.size) {
          var v = this.scaling * c.mass * f.mass / h;
          e.scaleAndAdd(c.force, c.force, l, v);
        } else
          for (var d = 0; d < f.nSubRegions; d++)
            this.applyRegionToNodeRepulsion(f.subRegions[d], c);
      }
    };
  })(), o.applyNodeToNodeRepulsion = (function() {
    var l = e.create();
    return function(f, c, h) {
      if (f != c) {
        e.sub(l, f.position, c.position);
        var v = l[0] * l[0] + l[1] * l[1];
        if (v !== 0) {
          var d;
          if (this.preventOverlap) {
            var g = Math.sqrt(v);
            if (g = g - f.size - c.size, g > 0)
              d = this.scaling * f.mass * c.mass / (g * g);
            else if (g < 0)
              d = this.scaling * 100 * f.mass * c.mass;
            else
              return;
          } else
            d = this.scaling * f.mass * c.mass / v;
          e.scaleAndAdd(f.force, f.force, l, d), e.scaleAndAdd(c.force, c.force, l, -d);
        }
      }
    };
  })(), o.applyEdgeAttraction = (function() {
    var l = e.create();
    return function(f) {
      var c = f.source, h = f.target;
      e.sub(l, c.position, h.position);
      var v = e.len(l), d;
      this.edgeWeightInfluence === 0 ? d = 1 : this.edgeWeightInfluence === 1 ? d = f.weight : d = Math.pow(f.weight, this.edgeWeightInfluence);
      var g;
      this.preventOverlap && (v = v - c.size - h.size, v <= 0) || (this.linLogMode ? g = -d * Math.log(v + 1) / (v + 1) : g = -d, e.scaleAndAdd(c.force, c.force, l, g), e.scaleAndAdd(h.force, h.force, l, -g));
    };
  })(), o.applyNodeGravity = (function() {
    var l = e.create();
    return function(u) {
      e.sub(l, this.gravityCenter, u.position);
      var f = e.len(l);
      e.scaleAndAdd(u.force, u.force, l, this.gravity * u.mass / (f + 1));
    };
  })(), o.applyNodeStrongGravity = (function() {
    var l = e.create();
    return function(u) {
      e.sub(l, this.gravityCenter, u.position), e.scaleAndAdd(u.force, u.force, l, this.gravity * u.mass);
    };
  })(), o.updateBBox = function() {
    for (var l = 1 / 0, u = 1 / 0, f = -1 / 0, c = -1 / 0, h = 0; h < this.nodes.length; h++) {
      var v = this.nodes[h].position;
      l = Math.min(l, v[0]), u = Math.min(u, v[1]), f = Math.max(f, v[0]), c = Math.max(c, v[1]);
    }
    this.bbox[0] = l, this.bbox[1] = u, this.bbox[2] = f, this.bbox[3] = c;
  }, o.getGlobalSpeed = function() {
    return this._globalSpeed;
  };
  var s = null;
  self.onmessage = function(l) {
    switch (l.data.cmd) {
      case "init":
        s = new a(), s.initNodes(l.data.nodesPosition, l.data.nodesMass, l.data.nodesSize), s.initEdges(l.data.edges, l.data.edgesWeight);
        break;
      case "updateConfig":
        if (s)
          for (var u in l.data.config)
            s[u] = l.data.config[u];
        break;
      case "update":
        var f = l.data.steps;
        if (s) {
          for (var c = 0; c < f; c++)
            s.update();
          for (var h = s.nodes.length, v = new Float32Array(h * 2), c = 0; c < h; c++) {
            var d = s.nodes[c];
            v[c * 2] = d.position[0], v[c * 2 + 1] = d.position[1];
          }
          self.postMessage({
            buffer: v.buffer,
            globalSpeed: s.getGlobalSpeed()
          }, [v.buffer]);
        } else {
          var g = new Float32Array();
          self.postMessage({
            buffer: g.buffer,
            globalSpeed: s.getGlobalSpeed()
          }, [g.buffer]);
        }
        break;
    }
  };
}
var n1 = tTe.toString();
n1 = n1.slice(n1.indexOf("{") + 1, n1.lastIndexOf("}"));
var A1 = {
  barnesHutOptimize: !0,
  barnesHutTheta: 1.5,
  repulsionByDegree: !0,
  linLogMode: !1,
  strongGravityMode: !1,
  gravity: 1,
  scaling: 1,
  edgeWeightInfluence: 1,
  jitterTolerence: 0.1,
  preventOverlap: !1,
  dissuadeHubs: !1,
  gravityCenter: null
}, Ka = function(e) {
  for (var t in A1)
    this[t] = A1[t];
  if (e)
    for (var t in e)
      this[t] = e[t];
  this._nodes = [], this._edges = [], this._disposed = !1, this._positionTex = new Vt({
    type: We.FLOAT,
    flipY: !1,
    minFilter: We.NEAREST,
    magFilter: We.NEAREST
  });
};
Ka.prototype.initData = function(e, t) {
  var r = new Blob([n1]), n = window.URL.createObjectURL(r);
  this._worker = new Worker(n), this._worker.onmessage = this._$onupdate.bind(this), this._nodes = e, this._edges = t, this._frame = 0;
  for (var i = e.length, a = t.length, o = new Float32Array(i * 2), s = new Float32Array(i), l = new Float32Array(i), u = new Float32Array(a * 2), f = new Float32Array(a), c = 0; c < e.length; c++) {
    var h = e[c];
    o[c * 2] = h.x, o[c * 2 + 1] = h.y, s[c] = h.mass == null ? 1 : h.mass, l[c] = h.size == null ? 1 : h.size;
  }
  for (var c = 0; c < t.length; c++) {
    var v = t[c], d = v.node1, g = v.node2;
    u[c * 2] = d, u[c * 2 + 1] = g, f[c] = v.weight == null ? 1 : v.weight;
  }
  var y = Math.ceil(Math.sqrt(e.length)), x = y, S = new Float32Array(y * x * 4), T = this._positionTex;
  T.width = y, T.height = x, T.pixels = S, this._worker.postMessage({
    cmd: "init",
    nodesPosition: o,
    nodesMass: s,
    nodesSize: l,
    edges: u,
    edgesWeight: f
  }), this._globalSpeed = 1 / 0;
};
Ka.prototype.updateOption = function(e) {
  var t = {};
  for (var r in A1)
    t[r] = A1[r];
  var n = this._nodes, i = this._edges, a = n.length;
  if (a > 5e4 ? t.jitterTolerence = 10 : a > 5e3 ? t.jitterTolerence = 1 : t.jitterTolerence = 0.1, a > 100 ? t.scaling = 2 : t.scaling = 10, a > 1e3 ? t.barnesHutOptimize = !0 : t.barnesHutOptimize = !1, e)
    for (var r in A1)
      e[r] != null && (t[r] = e[r]);
  if (!t.gravityCenter) {
    for (var o = [1 / 0, 1 / 0], s = [-1 / 0, -1 / 0], l = 0; l < n.length; l++)
      o[0] = Math.min(n[l].x, o[0]), o[1] = Math.min(n[l].y, o[1]), s[0] = Math.max(n[l].x, s[0]), s[1] = Math.max(n[l].y, s[1]);
    t.gravityCenter = [(o[0] + s[0]) * 0.5, (o[1] + s[1]) * 0.5];
  }
  for (var l = 0; l < i.length; l++) {
    var u = i[l].node1, f = i[l].node2;
    n[u].degree = (n[u].degree || 0) + 1, n[f].degree = (n[f].degree || 0) + 1;
  }
  this._worker && this._worker.postMessage({
    cmd: "updateConfig",
    config: t
  });
};
Ka.prototype.update = function(e, t, r) {
  t == null && (t = 1), t = Math.max(t, 1), this._frame += t, this._onupdate = r, this._worker && this._worker.postMessage({
    cmd: "update",
    steps: Math.round(t)
  });
};
Ka.prototype._$onupdate = function(e) {
  if (!this._disposed) {
    var t = new Float32Array(e.data.buffer);
    this._globalSpeed = e.data.globalSpeed, this._positionArr = t, this._updateTexture(t), this._onupdate && this._onupdate();
  }
};
Ka.prototype.getNodePositionTexture = function() {
  return this._positionTex;
};
Ka.prototype.getNodeUV = function(e, t) {
  t = t || [];
  var r = this._positionTex.width, n = this._positionTex.height;
  return t[0] = e % r / (r - 1), t[1] = Math.floor(e / r) / (n - 1), t;
};
Ka.prototype.getNodes = function() {
  return this._nodes;
};
Ka.prototype.getEdges = function() {
  return this._edges;
};
Ka.prototype.isFinished = function(e) {
  return this._frame > e;
};
Ka.prototype.getNodePosition = function(e, t) {
  if (t || (t = new Float32Array(this._nodes.length * 2)), this._positionArr)
    for (var r = 0; r < this._positionArr.length; r++)
      t[r] = this._positionArr[r];
  return t;
};
Ka.prototype._updateTexture = function(e) {
  for (var t = this._positionTex.pixels, r = 0, n = 0; n < e.length; )
    t[r++] = e[n++], t[r++] = e[n++], t[r++] = 1, t[r++] = 1;
  this._positionTex.dirty();
};
Ka.prototype.dispose = function(e) {
  this._disposed = !0, this._worker = null;
};
var rTe = Mi.extend(function() {
  return {
    /**
     * @type {module:zrender~ZRender}
     */
    zr: null,
    /**
     * @type {module:echarts-gl/core/ViewGL}
     */
    viewGL: null,
    minZoom: 0.2,
    maxZoom: 5,
    _needsUpdate: !1,
    _dx: 0,
    _dy: 0,
    _zoom: 1
  };
}, function() {
  this._mouseDownHandler = this._mouseDownHandler.bind(this), this._mouseWheelHandler = this._mouseWheelHandler.bind(this), this._mouseMoveHandler = this._mouseMoveHandler.bind(this), this._mouseUpHandler = this._mouseUpHandler.bind(this), this._update = this._update.bind(this);
}, {
  init: function() {
    var e = this.zr;
    e.on("mousedown", this._mouseDownHandler), e.on("mousewheel", this._mouseWheelHandler), e.on("globalout", this._mouseUpHandler), e.animation.on("frame", this._update);
  },
  setTarget: function(e) {
    this._target = e;
  },
  setZoom: function(e) {
    this._zoom = Math.max(Math.min(e, this.maxZoom), this.minZoom), this._needsUpdate = !0;
  },
  setOffset: function(e) {
    this._dx = e[0], this._dy = e[1], this._needsUpdate = !0;
  },
  getZoom: function() {
    return this._zoom;
  },
  getOffset: function() {
    return [this._dx, this._dy];
  },
  _update: function() {
    if (this._target && this._needsUpdate) {
      var e = this._target, t = this._zoom;
      e.position.x = this._dx, e.position.y = this._dy, e.scale.set(t, t, t), this.zr.refresh(), this._needsUpdate = !1, this.trigger("update");
    }
  },
  _mouseDownHandler: function(e) {
    if (!e.target) {
      var t = e.offsetX, r = e.offsetY;
      if (!(this.viewGL && !this.viewGL.containPoint(t, r))) {
        this.zr.on("mousemove", this._mouseMoveHandler), this.zr.on("mouseup", this._mouseUpHandler);
        var n = this._convertPos(t, r);
        this._x = n.x, this._y = n.y;
      }
    }
  },
  // Convert pos from screen space to viewspace.
  _convertPos: function(e, t) {
    var r = this.viewGL.camera, n = this.viewGL.viewport;
    return {
      x: (e - n.x) / n.width * (r.right - r.left) + r.left,
      y: (t - n.y) / n.height * (r.bottom - r.top) + r.top
    };
  },
  _mouseMoveHandler: function(e) {
    var t = this._convertPos(e.offsetX, e.offsetY);
    this._dx += t.x - this._x, this._dy += t.y - this._y, this._x = t.x, this._y = t.y, this._needsUpdate = !0;
  },
  _mouseUpHandler: function(e) {
    this.zr.off("mousemove", this._mouseMoveHandler), this.zr.off("mouseup", this._mouseUpHandler);
  },
  _mouseWheelHandler: function(e) {
    e = e.event;
    var t = e.wheelDelta || -e.detail;
    if (t !== 0) {
      var r = e.offsetX, n = e.offsetY;
      if (!(this.viewGL && !this.viewGL.containPoint(r, n))) {
        var i = t > 0 ? 1.1 : 0.9, a = Math.max(Math.min(this._zoom * i, this.maxZoom), this.minZoom);
        i = a / this._zoom;
        var o = this._convertPos(r, n), s = (o.x - this._dx) * (i - 1), l = (o.y - this._dy) * (i - 1);
        this._dx -= s, this._dy -= l, this._zoom = a, this._needsUpdate = !0;
      }
    }
  },
  dispose: function() {
    var e = this.zr;
    e.off("mousedown", this._mouseDownHandler), e.off("mousemove", this._mouseMoveHandler), e.off("mouseup", this._mouseUpHandler), e.off("mousewheel", this._mouseWheelHandler), e.off("globalout", this._mouseUpHandler), e.animation.off("frame", this._update);
  }
});
const nTe = `@export ecgl.lines2D.vertex

uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;

attribute vec2 position: POSITION;
attribute vec4 a_Color : COLOR;
varying vec4 v_Color;

#ifdef POSITIONTEXTURE_ENABLED
uniform sampler2D positionTexture;
#endif

void main()
{
 gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);

 v_Color = a_Color;
}

@end

@export ecgl.lines2D.fragment

uniform vec4 color : [1.0, 1.0, 1.0, 1.0];

varying vec4 v_Color;

void main()
{
 gl_FragColor = color * v_Color;
}
@end


@export ecgl.meshLines2D.vertex

attribute vec2 position: POSITION;
attribute vec2 normal;
attribute float offset;
attribute vec4 a_Color : COLOR;

uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;
uniform vec4 viewport : VIEWPORT;

varying vec4 v_Color;
varying float v_Miter;

void main()
{
 vec4 p2 = worldViewProjection * vec4(position + normal, -10.0, 1.0);
 gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);

 p2.xy /= p2.w;
 gl_Position.xy /= gl_Position.w;

 vec2 N = normalize(p2.xy - gl_Position.xy);
 gl_Position.xy += N * offset / viewport.zw * 2.0;

 gl_Position.xy *= gl_Position.w;

 v_Color = a_Color;
}
@end


@export ecgl.meshLines2D.fragment

uniform vec4 color : [1.0, 1.0, 1.0, 1.0];

varying vec4 v_Color;
varying float v_Miter;

void main()
{
 gl_FragColor = color * v_Color;
}

@end`;
var l2 = bn.vec2;
J.Shader.import(nTe);
var iTe = 1;
const aTe = Ut.extend({
  type: "graphGL",
  __ecgl__: !0,
  init: function(e, t) {
    this.groupGL = new J.Node(), this.viewGL = new Cr("orthographic"), this.viewGL.camera.left = this.viewGL.camera.right = 0, this.viewGL.add(this.groupGL), this._pointsBuilder = new Rd(!0, t), this._forceEdgesMesh = new J.Mesh({
      material: new J.Material({
        shader: J.createShader("ecgl.forceAtlas2.edges"),
        transparent: !0,
        depthMask: !1,
        depthTest: !1
      }),
      $ignorePicking: !0,
      geometry: new J.Geometry({
        attributes: {
          node: new J.Geometry.Attribute("node", "float", 2),
          color: new J.Geometry.Attribute("color", "float", 4, "COLOR")
        },
        dynamic: !0,
        mainAttribute: "node"
      }),
      renderOrder: -1,
      mode: J.Mesh.LINES
    }), this._edgesMesh = new J.Mesh({
      material: new J.Material({
        shader: J.createShader("ecgl.meshLines2D"),
        transparent: !0,
        depthMask: !1,
        depthTest: !1
      }),
      $ignorePicking: !0,
      geometry: new o3({
        useNativeLine: !1,
        dynamic: !0
      }),
      renderOrder: -1,
      culling: !1
    }), this._layoutId = 0, this._control = new rTe({
      zr: t.getZr(),
      viewGL: this.viewGL
    }), this._control.setTarget(this.groupGL), this._control.init(), this._clickHandler = this._clickHandler.bind(this);
  },
  render: function(e, t, r) {
    this.groupGL.add(this._pointsBuilder.rootNode), this._model = e, this._api = r, this._initLayout(e, t, r), this._pointsBuilder.update(e, t, r), this._forceLayoutInstance instanceof Hn || this.groupGL.remove(this._forceEdgesMesh), this._updateCamera(e, r), this._control.off("update"), this._control.on("update", function() {
      r.dispatchAction({
        type: "graphGLRoam",
        seriesId: e.id,
        zoom: this._control.getZoom(),
        offset: this._control.getOffset()
      }), this._pointsBuilder.updateView(this.viewGL.camera);
    }, this), this._control.setZoom(qt.firstNotNull(e.get("zoom"), 1)), this._control.setOffset(e.get("offset") || [0, 0]);
    var n = this._pointsBuilder.getPointsMesh();
    if (n.off("mousemove", this._mousemoveHandler), n.off("mouseout", this._mouseOutHandler, this), r.getZr().off("click", this._clickHandler), this._pointsBuilder.highlightOnMouseover = !0, e.get("focusNodeAdjacency")) {
      var i = e.get("focusNodeAdjacencyOn");
      i === "click" ? r.getZr().on("click", this._clickHandler) : i === "mouseover" && (n.on("mousemove", this._mousemoveHandler, this), n.on("mouseout", this._mouseOutHandler, this), this._pointsBuilder.highlightOnMouseover = !1);
    }
    this._lastMouseOverDataIndex = -1;
  },
  _clickHandler: function(e) {
    if (!this._layouting) {
      var t = this._pointsBuilder.getPointsMesh().dataIndex;
      t >= 0 ? this._api.dispatchAction({
        type: "graphGLFocusNodeAdjacency",
        seriesId: this._model.id,
        dataIndex: t
      }) : this._api.dispatchAction({
        type: "graphGLUnfocusNodeAdjacency",
        seriesId: this._model.id
      });
    }
  },
  _mousemoveHandler: function(e) {
    if (!this._layouting) {
      var t = this._pointsBuilder.getPointsMesh().dataIndex;
      t >= 0 ? t !== this._lastMouseOverDataIndex && this._api.dispatchAction({
        type: "graphGLFocusNodeAdjacency",
        seriesId: this._model.id,
        dataIndex: t
      }) : this._mouseOutHandler(e), this._lastMouseOverDataIndex = t;
    }
  },
  _mouseOutHandler: function(e) {
    this._layouting || (this._api.dispatchAction({
      type: "graphGLUnfocusNodeAdjacency",
      seriesId: this._model.id
    }), this._lastMouseOverDataIndex = -1);
  },
  _updateForceEdgesGeometry: function(e, t) {
    var r = this._forceEdgesMesh.geometry, n = t.getEdgeData(), i = 0, a = this._forceLayoutInstance, o = n.count() * 2;
    r.attributes.node.init(o), r.attributes.color.init(o), n.each(function(s) {
      var l = e[s];
      r.attributes.node.set(i, a.getNodeUV(l.node1)), r.attributes.node.set(i + 1, a.getNodeUV(l.node2));
      var u = oi(n, l.dataIndex), f = J.parseColor(u);
      f[3] *= qt.firstNotNull(ni(n, l.dataIndex), 1), r.attributes.color.set(i, f), r.attributes.color.set(i + 1, f), i += 2;
    }), r.dirty();
  },
  _updateMeshLinesGeometry: function() {
    var t = this._model.getEdgeData(), e = this._edgesMesh.geometry, t = this._model.getEdgeData(), r = this._model.getData().getLayout("points");
    e.resetOffset(), e.setVertexCount(t.count() * e.getLineVertexCount()), e.setTriangleCount(t.count() * e.getLineTriangleCount());
    var n = [], i = [], a = ["lineStyle", "width"];
    this._originalEdgeColors = new Float32Array(t.count() * 4), this._edgeIndicesMap = new Float32Array(t.count()), t.each(function(o) {
      var s = t.graph.getEdgeByIndex(o), l = s.node1.dataIndex * 2, u = s.node2.dataIndex * 2;
      n[0] = r[l], n[1] = r[l + 1], i[0] = r[u], i[1] = r[u + 1];
      var f = oi(t, s.dataIndex), c = J.parseColor(f);
      c[3] *= qt.firstNotNull(ni(t, s.dataIndex), 1);
      var h = t.getItemModel(s.dataIndex), v = qt.firstNotNull(h.get(a), 1) * this._api.getDevicePixelRatio();
      e.addLine(n, i, c, v);
      for (var d = 0; d < 4; d++)
        this._originalEdgeColors[s.dataIndex * 4 + d] = c[d];
      this._edgeIndicesMap[s.dataIndex] = o;
    }, this), e.dirty();
  },
  _updateForceNodesGeometry: function(e) {
    for (var t = this._pointsBuilder.getPointsMesh(), r = [], n = 0; n < e.count(); n++)
      this._forceLayoutInstance.getNodeUV(n, r), t.geometry.attributes.position.set(n, r);
    t.geometry.dirty("position");
  },
  _initLayout: function(e, t, r) {
    var n = e.get("layout"), i = e.getGraph(), a = e.getBoxLayoutParams(), o = Tr(a, {
      width: r.getWidth(),
      height: r.getHeight()
    });
    n === "force" && (n = "forceAtlas2"), this.stopLayout(e, t, r, {
      beforeLayout: !0
    });
    var s = e.getData(), l = e.getData();
    if (n === "forceAtlas2") {
      var u = e.getModel("forceAtlas2"), f = this._forceLayoutInstance, c = [], h = [], v = s.getDataExtent("value"), d = l.getDataExtent("value"), g = qt.firstNotNull(u.get("edgeWeight"), 1), y = qt.firstNotNull(u.get("nodeWeight"), 1);
      typeof g == "number" && (g = [g, g]), typeof y == "number" && (y = [y, y]);
      var x = 0, S = {}, T = new Float32Array(s.count() * 2);
      if (i.eachNode(function(A) {
        var M = A.dataIndex, E = s.get("value", M), P, R;
        if (s.hasItemOption) {
          var O = s.getItemModel(M);
          P = O.get("x"), R = O.get("y");
        }
        P == null && (P = o.x + Math.random() * o.width, R = o.y + Math.random() * o.height), T[x * 2] = P, T[x * 2 + 1] = R, S[A.id] = x++;
        var N = er(E, v, y);
        isNaN(N) && (isNaN(y[0]) ? N = 1 : N = y[0]), c.push({
          x: P,
          y: R,
          mass: N,
          size: s.getItemVisual(M, "symbolSize")
        });
      }), s.setLayout("points", T), i.eachEdge(function(A) {
        var M = A.dataIndex, E = s.get("value", M), P = er(E, d, g);
        isNaN(P) && (isNaN(g[0]) ? P = 1 : P = g[0]), h.push({
          node1: S[A.node1.id],
          node2: S[A.node2.id],
          weight: P,
          dataIndex: M
        });
      }), !f) {
        var C = u.get("GPU");
        this._forceLayoutInstance && (C && !(this._forceLayoutInstance instanceof Hn) || !C && !(this._forceLayoutInstance instanceof Ka)) && (this._forceLayoutInstanceToDispose = this._forceLayoutInstance), f = this._forceLayoutInstance = C ? new Hn() : new Ka();
      }
      f.initData(c, h), f.updateOption(u.option), this._updateForceEdgesGeometry(f.getEdges(), e), this._updatePositionTexture(), r.dispatchAction({
        type: "graphGLStartLayout",
        from: this.uid
      });
    } else {
      var T = new Float32Array(s.count() * 2), x = 0;
      i.eachNode(function(E) {
        var P = E.dataIndex, R, O;
        if (s.hasItemOption) {
          var N = s.getItemModel(P);
          R = N.get("x"), O = N.get("y");
        }
        T[x++] = R, T[x++] = O;
      }), s.setLayout("points", T), this._updateAfterLayout(e, t, r);
    }
  },
  _updatePositionTexture: function() {
    var e = this._forceLayoutInstance.getNodePositionTexture();
    this._pointsBuilder.setPositionTexture(e), this._forceEdgesMesh.material.set("positionTex", e);
  },
  startLayout: function(e, t, a, n) {
    if (!(n && n.from != null && n.from !== this.uid)) {
      var i = this.viewGL, a = this._api, o = this._forceLayoutInstance, s = this._model.getData(), l = this._model.getModel("forceAtlas2");
      if (o && (this.groupGL.remove(this._edgesMesh), this.groupGL.add(this._forceEdgesMesh), !!this._forceLayoutInstance)) {
        this._updateForceNodesGeometry(e.getData()), this._pointsBuilder.hideLabels();
        var u = this, f = this._layoutId = iTe++, c = l.getShallow("maxSteps"), h = l.getShallow("steps"), v = 0, d = Math.max(h * 2, 20), g = function(y) {
          if (y === u._layoutId) {
            if (o.isFinished(c)) {
              a.dispatchAction({
                type: "graphGLStopLayout",
                from: u.uid
              }), a.dispatchAction({
                type: "graphGLFinishLayout",
                points: s.getLayout("points"),
                from: u.uid
              });
              return;
            }
            o.update(i.layer.renderer, h, function() {
              u._updatePositionTexture(), v += h, v >= d && (u._syncNodePosition(e), v = 0), a.getZr().refresh(), qb(function() {
                g(y);
              });
            });
          }
        };
        qb(function() {
          u._forceLayoutInstanceToDispose && (u._forceLayoutInstanceToDispose.dispose(i.layer.renderer), u._forceLayoutInstanceToDispose = null), g(f);
        }), this._layouting = !0;
      }
    }
  },
  stopLayout: function(e, t, r, n) {
    n && n.from != null && n.from !== this.uid || (this._layoutId = 0, this.groupGL.remove(this._forceEdgesMesh), this.groupGL.add(this._edgesMesh), this._forceLayoutInstance && this.viewGL.layer && (n && n.beforeLayout || (this._syncNodePosition(e), this._updateAfterLayout(e, t, r)), this._api.getZr().refresh(), this._layouting = !1));
  },
  _syncNodePosition: function(e) {
    var t = this._forceLayoutInstance.getNodePosition(this.viewGL.layer.renderer);
    e.getData().setLayout("points", t), e.setNodePosition(t);
  },
  _updateAfterLayout: function(e, t, r) {
    this._updateMeshLinesGeometry(), this._pointsBuilder.removePositionTexture(), this._pointsBuilder.updateLayout(e, t, r), this._pointsBuilder.updateView(this.viewGL.camera), this._pointsBuilder.updateLabels(), this._pointsBuilder.showLabels();
  },
  focusNodeAdjacency: function(e, t, r, n) {
    var i = this._model.getData();
    this._downplayAll();
    var a = n.dataIndex, o = i.graph, s = [], l = o.getNodeByIndex(a);
    s.push(l), l.edges.forEach(function(f) {
      f.dataIndex < 0 || (f.node1 !== l && s.push(f.node1), f.node2 !== l && s.push(f.node2));
    }, this), this._pointsBuilder.fadeOutAll(0.05), this._fadeOutEdgesAll(0.05), s.forEach(function(f) {
      this._pointsBuilder.highlight(i, f.dataIndex);
    }, this), this._pointsBuilder.updateLabels(s.map(function(f) {
      return f.dataIndex;
    }));
    var u = [];
    l.edges.forEach(function(f) {
      f.dataIndex >= 0 && (this._highlightEdge(f.dataIndex), u.push(f));
    }, this), this._focusNodes = s, this._focusEdges = u;
  },
  unfocusNodeAdjacency: function(e, t, r, n) {
    this._downplayAll(), this._pointsBuilder.fadeInAll(), this._fadeInEdgesAll(), this._pointsBuilder.updateLabels();
  },
  _highlightEdge: function(e) {
    var t = this._model.getEdgeData().getItemModel(e), r = J.parseColor(t.get("emphasis.lineStyle.color") || t.get("lineStyle.color")), n = qt.firstNotNull(t.get("emphasis.lineStyle.opacity"), t.get("lineStyle.opacity"), 1);
    r[3] *= n, this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[e], r);
  },
  _downplayAll: function() {
    this._focusNodes && this._focusNodes.forEach(function(e) {
      this._pointsBuilder.downplay(this._model.getData(), e.dataIndex);
    }, this), this._focusEdges && this._focusEdges.forEach(function(e) {
      this._downplayEdge(e.dataIndex);
    }, this);
  },
  _downplayEdge: function(e) {
    var t = this._getColor(e, []);
    this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[e], t);
  },
  _setEdgeFade: /* @__PURE__ */ (function() {
    var e = [];
    return function(t, r) {
      this._getColor(t, e), e[3] *= r, this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[t], e);
    };
  })(),
  _getColor: function(e, t) {
    for (var r = 0; r < 4; r++)
      t[r] = this._originalEdgeColors[e * 4 + r];
    return t;
  },
  _fadeOutEdgesAll: function(e) {
    var t = this._model.getData().graph;
    t.eachEdge(function(r) {
      this._setEdgeFade(r.dataIndex, e);
    }, this);
  },
  _fadeInEdgesAll: function() {
    this._fadeOutEdgesAll(1);
  },
  _updateCamera: function(e, t) {
    this.viewGL.setViewport(0, 0, t.getWidth(), t.getHeight(), t.getDevicePixelRatio());
    for (var r = this.viewGL.camera, n = e.getData(), i = n.getLayout("points"), a = l2.create(1 / 0, 1 / 0), o = l2.create(-1 / 0, -1 / 0), s = [], l = 0; l < i.length; )
      s[0] = i[l++], s[1] = i[l++], l2.min(a, a, s), l2.max(o, o, s);
    var u = (o[1] + a[1]) / 2, f = (o[0] + a[0]) / 2;
    if (!(f > r.left && f < r.right && u < r.bottom && u > r.top)) {
      var c = Math.max(o[0] - a[0], 10), h = c / t.getWidth() * t.getHeight();
      c *= 1.4, h *= 1.4, a[0] -= c * 0.2, r.left = a[0], r.top = u - h / 2, r.bottom = u + h / 2, r.right = c + a[0], r.near = 0, r.far = 100;
    }
  },
  dispose: function() {
    var e = this.viewGL.layer.renderer;
    this._forceLayoutInstance && this._forceLayoutInstance.dispose(e), this.groupGL.removeAll(), this._layoutId = -1, this._pointsBuilder.dispose();
  },
  remove: function() {
    this.groupGL.removeAll(), this._control.dispose();
  }
});
function u2(e) {
  return e instanceof Array || (e = [e, e]), e;
}
function oTe(e) {
  e.registerChartView(aTe), e.registerSeriesModel(r1), e.registerVisual(function(r) {
    const n = {};
    r.eachSeriesByType("graphGL", function(i) {
      var a = i.getCategoriesData(), o = i.getData(), s = {};
      a.each(function(l) {
        var u = a.getName(l);
        s["ec-" + u] = l;
        var f = a.getItemModel(l), c = f.getModel("itemStyle").getItemStyle();
        c.fill || (c.fill = i.getColorFromPalette(u, n)), a.setItemVisual(l, "style", c);
        var h = ["symbol", "symbolSize", "symbolKeepAspect"];
        for (let d = 0; d < h.length; d++) {
          var v = f.getShallow(h[d], !0);
          v != null && a.setItemVisual(l, h[d], v);
        }
      }), a.count() && o.each(function(l) {
        var u = o.getItemModel(l);
        let f = u.getShallow("category");
        if (f != null) {
          typeof f == "string" && (f = s["ec-" + f]);
          var c = a.getItemVisual(f, "style"), h = o.ensureUniqueItemVisual(l, "style");
          xe(h, c);
          var v = ["symbol", "symbolSize", "symbolKeepAspect"];
          for (let d = 0; d < v.length; d++)
            o.setItemVisual(l, v[d], a.getItemVisual(f, v[d]));
        }
      });
    });
  }), e.registerVisual(function(r) {
    r.eachSeriesByType("graphGL", function(n) {
      var i = n.getGraph(), a = n.getEdgeData(), o = u2(n.get("edgeSymbol")), s = u2(n.get("edgeSymbolSize"));
      a.setVisual("drawType", "stroke"), a.setVisual("fromSymbol", o && o[0]), a.setVisual("toSymbol", o && o[1]), a.setVisual("fromSymbolSize", s && s[0]), a.setVisual("toSymbolSize", s && s[1]), a.setVisual("style", n.getModel("lineStyle").getLineStyle()), a.each(function(l) {
        var u = a.getItemModel(l), f = i.getEdgeByIndex(l), c = u2(u.getShallow("symbol", !0)), h = u2(u.getShallow("symbolSize", !0)), v = u.getModel("lineStyle").getLineStyle(), d = a.ensureUniqueItemVisual(l, "style");
        switch (xe(d, v), d.stroke) {
          case "source": {
            var g = f.node1.getVisual("style");
            d.stroke = g && g.fill;
            break;
          }
          case "target": {
            var g = f.node2.getVisual("style");
            d.stroke = g && g.fill;
            break;
          }
        }
        c[0] && f.setVisual("fromSymbol", c[0]), c[1] && f.setVisual("toSymbol", c[1]), h[0] && f.setVisual("fromSymbolSize", h[0]), h[1] && f.setVisual("toSymbolSize", h[1]);
      });
    });
  }), e.registerAction({
    type: "graphGLRoam",
    event: "graphglroam",
    update: "series.graphGL:roam"
  }, function(r, n) {
    n.eachComponent({
      mainType: "series",
      query: r
    }, function(i) {
      i.setView(r);
    });
  });
  function t() {
  }
  e.registerAction({
    type: "graphGLStartLayout",
    event: "graphgllayoutstarted",
    update: "series.graphGL:startLayout"
  }, t), e.registerAction({
    type: "graphGLStopLayout",
    event: "graphgllayoutstopped",
    update: "series.graphGL:stopLayout"
  }, t), e.registerAction({
    type: "graphGLFocusNodeAdjacency",
    event: "graphGLFocusNodeAdjacency",
    update: "series.graphGL:focusNodeAdjacency"
  }, t), e.registerAction({
    type: "graphGLUnfocusNodeAdjacency",
    event: "graphGLUnfocusNodeAdjacency",
    update: "series.graphGL:unfocusNodeAdjacency"
  }, t);
}
ft(oTe);
const sTe = Yt.extend({
  type: "series.flowGL",
  dependencies: ["geo", "grid", "bmap"],
  visualStyleAccessPath: "itemStyle",
  getInitialData: function(e, t) {
    var r = this.get("coordinateSystem"), n = r === "geo" ? ["lng", "lat"] : gO(r) || ["x", "y"];
    n.push("vx", "vy");
    var i = ah(this.getSource(), {
      coordDimensions: n,
      encodeDefine: this.get("encode"),
      dimensionsDefine: this.get("dimensions")
    }), a = new zr(i, this);
    return a.initData(this.getSource()), a;
  },
  defaultOption: {
    coordinateSystem: "cartesian2d",
    zlevel: 10,
    supersampling: 1,
    // 128x128 particles
    particleType: "point",
    particleDensity: 128,
    particleSize: 1,
    particleSpeed: 1,
    particleTrail: 2,
    colorTexture: null,
    gridWidth: "auto",
    gridHeight: "auto",
    itemStyle: {
      color: "#fff",
      opacity: 0.8
    }
  }
});
var lTe = jt.extend(
  function() {
    return {
      dynamic: !0,
      attributes: {
        position: new jt.Attribute("position", "float", 3, "POSITION")
      }
    };
  },
  /** @lends module: echarts-gl/util/geometry/LinesGeometry.prototype */
  {
    /**
     * Reset offset
     */
    resetOffset: function() {
      this._vertexOffset = 0, this._faceOffset = 0;
    },
    /**
     * @param {number} nVertex
     */
    setLineCount: function(e) {
      var t = this.attributes, r = 4 * e, n = 2 * e;
      this.vertexCount !== r && t.position.init(r), this.triangleCount !== n && (n === 0 ? this.indices = null : this.indices = this.vertexCount > 65535 ? new Uint32Array(n * 3) : new Uint16Array(n * 3));
    },
    addLine: function(e) {
      var t = this._vertexOffset;
      this.attributes.position.set(t, [e[0], e[1], 1]), this.attributes.position.set(t + 1, [e[0], e[1], -1]), this.attributes.position.set(t + 2, [e[0], e[1], 2]), this.attributes.position.set(t + 3, [e[0], e[1], -2]), this.setTriangleIndices(this._faceOffset++, [t, t + 1, t + 2]), this.setTriangleIndices(this._faceOffset++, [t + 1, t + 2, t + 3]), this._vertexOffset += 4;
    }
  }
);
const uTe = `@export ecgl.vfParticle.particle.fragment

uniform sampler2D particleTexture;
uniform sampler2D spawnTexture;
uniform sampler2D velocityTexture;

uniform float deltaTime;
uniform float elapsedTime;

uniform float speedScaling : 1.0;

uniform vec2 textureSize;
uniform vec4 region : [0, 0, 1, 1];
uniform float firstFrameTime;

varying vec2 v_Texcoord;


void main()
{
 vec4 p = texture2D(particleTexture, v_Texcoord);
 bool spawn = false;
 if (p.w <= 0.0) {
 p = texture2D(spawnTexture, fract(v_Texcoord + elapsedTime / 10.0));
 p.w -= firstFrameTime;
 spawn = true;
 }
 vec2 v = texture2D(velocityTexture, fract(p.xy * region.zw + region.xy)).xy;
 v = (v - 0.5) * 2.0;
 p.z = length(v);
 p.xy += v * deltaTime / 10.0 * speedScaling;
 p.w -= deltaTime;

 if (spawn || p.xy != fract(p.xy)) {
 p.z = 0.0;
 }
 p.xy = fract(p.xy);

 gl_FragColor = p;
}
@end

@export ecgl.vfParticle.renderPoints.vertex

#define PI 3.1415926

attribute vec2 texcoord : TEXCOORD_0;

uniform sampler2D particleTexture;
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;

uniform float size : 1.0;

varying float v_Mag;
varying vec2 v_Uv;

void main()
{
 vec4 p = texture2D(particleTexture, texcoord);

 if (p.w > 0.0 && p.z > 1e-5) {
 gl_Position = worldViewProjection * vec4(p.xy * 2.0 - 1.0, 0.0, 1.0);
 }
 else {
 gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);
 }

 v_Mag = p.z;
 v_Uv = p.xy;

 gl_PointSize = size;
}

@end

@export ecgl.vfParticle.renderPoints.fragment

uniform vec4 color : [1.0, 1.0, 1.0, 1.0];
uniform sampler2D gradientTexture;
uniform sampler2D colorTexture;
uniform sampler2D spriteTexture;

varying float v_Mag;
varying vec2 v_Uv;

void main()
{
 gl_FragColor = color;
#ifdef SPRITETEXTURE_ENABLED
 gl_FragColor *= texture2D(spriteTexture, gl_PointCoord);
 if (color.a == 0.0) {
 discard;
 }
#endif
#ifdef GRADIENTTEXTURE_ENABLED
 gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));
#endif
#ifdef COLORTEXTURE_ENABLED
 gl_FragColor *= texture2D(colorTexture, v_Uv);
#endif
}

@end

@export ecgl.vfParticle.renderLines.vertex

#define PI 3.1415926

attribute vec3 position : POSITION;

uniform sampler2D particleTexture;
uniform sampler2D prevParticleTexture;

uniform float size : 1.0;
uniform vec4 vp: VIEWPORT;
uniform mat4 worldViewProjection : WORLDVIEWPROJECTION;

varying float v_Mag;
varying vec2 v_Uv;

@import clay.util.rand

void main()
{
 vec4 p = texture2D(particleTexture, position.xy);
 vec4 p2 = texture2D(prevParticleTexture, position.xy);

 p.xy = p.xy * 2.0 - 1.0;
 p2.xy = p2.xy * 2.0 - 1.0;

 if (p.w > 0.0 && p.z > 1e-5) {
 vec2 dir = normalize(p.xy - p2.xy);
 vec2 norm = vec2(dir.y / vp.z, -dir.x / vp.w) * sign(position.z) * size;
 if (abs(position.z) == 2.0) {
 gl_Position = vec4(p.xy + norm, 0.0, 1.0);
 v_Uv = p.xy;
 v_Mag = p.z;
 }
 else {
 gl_Position = vec4(p2.xy + norm, 0.0, 1.0);
 v_Mag = p2.z;
 v_Uv = p2.xy;
 }
 gl_Position = worldViewProjection * gl_Position;
 }
 else {
 gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);
 }
}

@end

@export ecgl.vfParticle.renderLines.fragment

uniform vec4 color : [1.0, 1.0, 1.0, 1.0];
uniform sampler2D gradientTexture;
uniform sampler2D colorTexture;

varying float v_Mag;
varying vec2 v_Uv;

void main()
{
 gl_FragColor = color;
 #ifdef GRADIENTTEXTURE_ENABLED
 gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));
#endif
#ifdef COLORTEXTURE_ENABLED
 gl_FragColor *= texture2D(colorTexture, v_Uv);
#endif
}

@end
`;
Ze.import(uTe);
function fTe(e) {
  var t = document.createElement("canvas");
  t.width = t.height = e;
  var r = t.getContext("2d");
  return r.fillStyle = "#fff", r.arc(e / 2, e / 2, e / 2, 0, Math.PI * 2), r.fill(), t;
}
var JI = function() {
  this.motionBlurFactor = 0.99, this.vectorFieldTexture = new Vt({
    type: We.FLOAT,
    // minFilter: Texture.NEAREST,
    // magFilter: Texture.NEAREST,
    flipY: !1
  }), this.particleLife = [5, 20], this._particleType = "point", this._particleSize = 1, this.particleColor = [1, 1, 1, 1], this.particleSpeedScaling = 1, this._thisFrameTexture = null, this._particlePass = null, this._spawnTexture = null, this._particleTexture0 = null, this._particleTexture1 = null, this._particlePointsMesh = null, this._surfaceFrameBuffer = null, this._elapsedTime = 0, this._scene = null, this._camera = null, this._lastFrameTexture = null, this._supersampling = 1, this._downsampleTextures = [], this._width = 512, this._height = 512, this.init();
};
JI.prototype = {
  constructor: JI,
  init: function() {
    var e = {
      type: We.FLOAT,
      minFilter: We.NEAREST,
      magFilter: We.NEAREST,
      useMipmap: !1
    };
    this._spawnTexture = new Vt(e), this._particleTexture0 = new Vt(e), this._particleTexture1 = new Vt(e), this._frameBuffer = new Tn({
      depthBuffer: !1
    }), this._particlePass = new Pn({
      fragment: Ze.source("ecgl.vfParticle.particle.fragment")
    }), this._particlePass.setUniform("velocityTexture", this.vectorFieldTexture), this._particlePass.setUniform("spawnTexture", this._spawnTexture), this._downsamplePass = new Pn({
      fragment: Ze.source("clay.compositor.downsample")
    });
    var t = new ri({
      // Render after last frame full quad
      renderOrder: 10,
      material: new ls({
        shader: new Ze(Ze.source("ecgl.vfParticle.renderPoints.vertex"), Ze.source("ecgl.vfParticle.renderPoints.fragment"))
      }),
      mode: ri.POINTS,
      geometry: new jt({
        dynamic: !0,
        mainAttribute: "texcoord0"
      })
    }), r = new ri({
      // Render after last frame full quad
      renderOrder: 10,
      material: new ls({
        shader: new Ze(Ze.source("ecgl.vfParticle.renderLines.vertex"), Ze.source("ecgl.vfParticle.renderLines.fragment"))
      }),
      geometry: new lTe(),
      culling: !1
    }), n = new ri({
      material: new ls({
        shader: new Ze(Ze.source("ecgl.color.vertex"), Ze.source("ecgl.color.fragment"))
        // DO NOT BLEND Blend will multiply alpha
        // transparent: true
      }),
      geometry: new eA()
    });
    n.material.enableTexture("diffuseMap"), this._particlePointsMesh = t, this._particleLinesMesh = r, this._lastFrameFullQuadMesh = n, this._camera = new Gm(), this._thisFrameTexture = new Vt(), this._lastFrameTexture = new Vt();
  },
  setParticleDensity: function(e, t) {
    for (var r = e * t, n = new Float32Array(r * 4), i = 0, a = this.particleLife, o = 0; o < e; o++)
      for (var s = 0; s < t; s++, i++) {
        n[i * 4] = Math.random(), n[i * 4 + 1] = Math.random(), n[i * 4 + 2] = Math.random();
        var l = (a[1] - a[0]) * Math.random() + a[0];
        n[i * 4 + 3] = l;
      }
    this._particleType === "line" ? this._setLineGeometry(e, t) : this._setPointsGeometry(e, t), this._spawnTexture.width = e, this._spawnTexture.height = t, this._spawnTexture.pixels = n, this._particleTexture0.width = this._particleTexture1.width = e, this._particleTexture0.height = this._particleTexture1.height = t, this._particlePass.setUniform("textureSize", [e, t]);
  },
  _setPointsGeometry: function(e, t) {
    var r = e * t, n = this._particlePointsMesh.geometry, i = n.attributes;
    i.texcoord0.init(r);
    for (var a = 0, o = 0; o < e; o++)
      for (var s = 0; s < t; s++, a++)
        i.texcoord0.value[a * 2] = o / e, i.texcoord0.value[a * 2 + 1] = s / t;
    n.dirty();
  },
  _setLineGeometry: function(e, t) {
    var r = e * t, n = this._getParticleMesh().geometry;
    n.setLineCount(r), n.resetOffset();
    for (var i = 0; i < e; i++)
      for (var a = 0; a < t; a++)
        n.addLine([i / e, a / t]);
    n.dirty();
  },
  _getParticleMesh: function() {
    return this._particleType === "line" ? this._particleLinesMesh : this._particlePointsMesh;
  },
  update: function(e, t, r, n) {
    var i = this._getParticleMesh(), a = this._frameBuffer, o = this._particlePass;
    n && this._updateDownsampleTextures(e, t), i.material.set("size", this._particleSize * this._supersampling), i.material.set("color", this.particleColor), o.setUniform("speedScaling", this.particleSpeedScaling), a.attach(this._particleTexture1), o.setUniform("firstFrameTime", n ? (this.particleLife[1] + this.particleLife[0]) / 2 : 0), o.setUniform("particleTexture", this._particleTexture0), o.setUniform("deltaTime", r), o.setUniform("elapsedTime", this._elapsedTime), o.render(e, a), i.material.set("particleTexture", this._particleTexture1), i.material.set("prevParticleTexture", this._particleTexture0), a.attach(this._thisFrameTexture), a.bind(e), e.gl.clear(e.gl.DEPTH_BUFFER_BIT | e.gl.COLOR_BUFFER_BIT);
    var s = this._lastFrameFullQuadMesh;
    s.material.set("diffuseMap", this._lastFrameTexture), s.material.set("color", [1, 1, 1, this.motionBlurFactor]), this._camera.update(!0), e.renderPass([s, i], this._camera), a.unbind(e), this._downsample(e), this._swapTexture(), this._elapsedTime += r;
  },
  _downsample: function(e) {
    var t = this._downsampleTextures;
    if (t.length !== 0)
      for (var r = 0, n = this._thisFrameTexture, i = t[r]; i; )
        this._frameBuffer.attach(i), this._downsamplePass.setUniform("texture", n), this._downsamplePass.setUniform("textureSize", [n.width, n.height]), this._downsamplePass.render(e, this._frameBuffer), n = i, i = t[++r];
  },
  getSurfaceTexture: function() {
    var e = this._downsampleTextures;
    return e.length > 0 ? e[e.length - 1] : this._lastFrameTexture;
  },
  setRegion: function(e) {
    this._particlePass.setUniform("region", e);
  },
  resize: function(e, t) {
    this._lastFrameTexture.width = e * this._supersampling, this._lastFrameTexture.height = t * this._supersampling, this._thisFrameTexture.width = e * this._supersampling, this._thisFrameTexture.height = t * this._supersampling, this._width = e, this._height = t;
  },
  setParticleSize: function(e) {
    var t = this._getParticleMesh();
    if (e <= 2) {
      t.material.disableTexture("spriteTexture"), t.material.transparent = !1;
      return;
    }
    this._spriteTexture || (this._spriteTexture = new Vt()), (!this._spriteTexture.image || this._spriteTexture.image.width !== e) && (this._spriteTexture.image = fTe(e), this._spriteTexture.dirty()), t.material.transparent = !0, t.material.enableTexture("spriteTexture"), t.material.set("spriteTexture", this._spriteTexture), this._particleSize = e;
  },
  setGradientTexture: function(e) {
    var t = this._getParticleMesh().material;
    t[e ? "enableTexture" : "disableTexture"]("gradientTexture"), t.setUniform("gradientTexture", e);
  },
  setColorTextureImage: function(e, t) {
    var r = this._getParticleMesh().material;
    r.setTextureImage("colorTexture", e, t, {
      flipY: !0
    });
  },
  setParticleType: function(e) {
    this._particleType = e;
  },
  clearFrame: function(e) {
    var t = this._frameBuffer;
    t.attach(this._lastFrameTexture), t.bind(e), e.gl.clear(e.gl.DEPTH_BUFFER_BIT | e.gl.COLOR_BUFFER_BIT), t.unbind(e);
  },
  setSupersampling: function(e) {
    this._supersampling = e, this.resize(this._width, this._height);
  },
  _updateDownsampleTextures: function(e, t) {
    for (var r = this._downsampleTextures, n = Math.max(Math.floor(Math.log(this._supersampling / t.getDevicePixelRatio()) / Math.log(2)), 0), i = 2, a = this._width * this._supersampling, o = this._height * this._supersampling, s = 0; s < n; s++)
      r[s] = r[s] || new Vt(), r[s].width = a / i, r[s].height = o / i, i *= 2;
    for (; s < r.length; s++)
      r[s].dispose(e);
    r.length = n;
  },
  _swapTexture: function() {
    var e = this._particleTexture0;
    this._particleTexture0 = this._particleTexture1, this._particleTexture1 = e;
    var e = this._thisFrameTexture;
    this._thisFrameTexture = this._lastFrameTexture, this._lastFrameTexture = e;
  },
  dispose: function(e) {
    e.disposeFrameBuffer(this._frameBuffer), e.disposeTexture(this.vectorFieldTexture), e.disposeTexture(this._spawnTexture), e.disposeTexture(this._particleTexture0), e.disposeTexture(this._particleTexture1), e.disposeTexture(this._thisFrameTexture), e.disposeTexture(this._lastFrameTexture), e.disposeGeometry(this._particleLinesMesh.geometry), e.disposeGeometry(this._particlePointsMesh.geometry), e.disposeGeometry(this._lastFrameFullQuadMesh.geometry), this._spriteTexture && e.disposeTexture(this._spriteTexture), this._particlePass.dispose(e), this._downsamplePass.dispose(e), this._downsampleTextures.forEach(function(t) {
      t.dispose(e);
    });
  }
};
const cTe = Ut.extend({
  type: "flowGL",
  __ecgl__: !0,
  init: function(e, t) {
    this.viewGL = new Cr("orthographic"), this.groupGL = new J.Node(), this.viewGL.add(this.groupGL), this._particleSurface = new JI();
    var r = new J.Mesh({
      geometry: new J.PlaneGeometry(),
      material: new J.Material({
        shader: new J.Shader({
          vertex: J.Shader.source("ecgl.color.vertex"),
          fragment: J.Shader.source("ecgl.color.fragment")
        }),
        // Must enable blending and multiply alpha.
        // Or premultipliedAlpha will let the alpha useless.
        transparent: !0
      })
    });
    r.material.enableTexture("diffuseMap"), this.groupGL.add(r), this._planeMesh = r;
  },
  render: function(e, t, r) {
    var n = this._particleSurface;
    n.setParticleType(e.get("particleType")), n.setSupersampling(e.get("supersampling")), this._updateData(e, r), this._updateCamera(r.getWidth(), r.getHeight(), r.getDevicePixelRatio());
    var i = qt.firstNotNull(e.get("particleDensity"), 128);
    n.setParticleDensity(i, i);
    var a = this._planeMesh, o = +/* @__PURE__ */ new Date(), s = this, l = !0;
    a.__percent = 0, a.stopAnimation(), a.animate("", {
      loop: !0
    }).when(1e5, {
      __percent: 1
    }).during(function() {
      var c = +/* @__PURE__ */ new Date(), h = Math.min(c - o, 20);
      o = o + h, s._renderer && (n.update(s._renderer, r, h / 1e3, l), a.material.set("diffuseMap", n.getSurfaceTexture())), l = !1;
    }).start();
    var u = e.getModel("itemStyle"), f = J.parseColor(u.get("color"));
    f[3] *= qt.firstNotNull(u.get("opacity"), 1), a.material.set("color", f), n.setColorTextureImage(e.get("colorTexture"), r), n.setParticleSize(e.get("particleSize")), n.particleSpeedScaling = e.get("particleSpeed"), n.motionBlurFactor = 1 - Math.pow(0.1, e.get("particleTrail"));
  },
  updateTransform: function(e, t, r) {
    this._updateData(e, r);
  },
  afterRender: function(e, t, r, n) {
    var i = n.renderer;
    this._renderer = i;
  },
  _updateData: function(e, t) {
    var r = e.coordinateSystem, n = r.dimensions.map(function(S) {
      return e.coordDimToDataDim(S)[0];
    }), i = e.getData(), a = i.getDataExtent(n[0]), o = i.getDataExtent(n[1]), s = e.get("gridWidth"), l = e.get("gridHeight");
    if (s == null || s === "auto") {
      var u = (a[1] - a[0]) / (o[1] - o[0]);
      s = Math.round(Math.sqrt(u * i.count()));
    }
    (l == null || l === "auto") && (l = Math.ceil(i.count() / s));
    var f = this._particleSurface.vectorFieldTexture, c = f.pixels;
    if (!c || c.length !== l * s * 4)
      c = f.pixels = new Float32Array(s * l * 4);
    else
      for (var h = 0; h < c.length; h++)
        c[h] = 0;
    var v = 0, d = 1 / 0, g = new Float32Array(i.count() * 2), y = 0, x = [[1 / 0, 1 / 0], [-1 / 0, -1 / 0]];
    i.each([n[0], n[1], "vx", "vy"], function(S, T, C, A) {
      var M = r.dataToPoint([S, T]);
      g[y++] = M[0], g[y++] = M[1], x[0][0] = Math.min(M[0], x[0][0]), x[0][1] = Math.min(M[1], x[0][1]), x[1][0] = Math.max(M[0], x[1][0]), x[1][1] = Math.max(M[1], x[1][1]);
      var E = Math.sqrt(C * C + A * A);
      v = Math.max(v, E), d = Math.min(d, E);
    }), i.each(["vx", "vy"], function(S, T, C) {
      var A = Math.round((g[C * 2] - x[0][0]) / (x[1][0] - x[0][0]) * (s - 1)), M = l - 1 - Math.round((g[C * 2 + 1] - x[0][1]) / (x[1][1] - x[0][1]) * (l - 1)), E = (M * s + A) * 4;
      c[E] = S / v * 0.5 + 0.5, c[E + 1] = T / v * 0.5 + 0.5, c[E + 3] = 1;
    }), f.width = s, f.height = l, e.get("coordinateSystem") === "bmap" && this._fillEmptyPixels(f), f.dirty(), this._updatePlanePosition(x[0], x[1], e, t), this._updateGradientTexture(i.getVisual("visualMeta"), [d, v]);
  },
  // PENDING Use grid mesh ? or delaunay triangulation?
  _fillEmptyPixels: function(e) {
    var t = e.pixels, r = e.width, n = e.height;
    function i(g, y, x) {
      g = Math.max(Math.min(g, r - 1), 0), y = Math.max(Math.min(y, n - 1), 0);
      var S = (y * (r - 1) + g) * 4;
      return t[S + 3] === 0 ? !1 : (x[0] = t[S], x[1] = t[S + 1], !0);
    }
    function a(g, y, x) {
      x[0] = g[0] + y[0], x[1] = g[1] + y[1];
    }
    for (var o = [], s = [], l = [], u = [], f = [], c = 0, h = 0; h < n; h++)
      for (var v = 0; v < r; v++) {
        var d = (h * (r - 1) + v) * 4;
        t[d + 3] === 0 && (c = o[0] = o[1] = 0, i(v - 1, h, s) && (c++, a(s, o, o)), i(v + 1, h, l) && (c++, a(l, o, o)), i(v, h - 1, u) && (c++, a(u, o, o)), i(v, h + 1, f) && (c++, a(f, o, o)), o[0] /= c, o[1] /= c, t[d] = o[0], t[d + 1] = o[1]), t[d + 3] = 1;
      }
  },
  _updateGradientTexture: function(e, t) {
    if (!e || !e.length) {
      this._particleSurface.setGradientTexture(null);
      return;
    }
    this._gradientTexture = this._gradientTexture || new J.Texture2D({
      image: document.createElement("canvas")
    });
    var r = this._gradientTexture, n = r.image;
    n.width = 200, n.height = 1;
    var i = n.getContext("2d"), a = i.createLinearGradient(0, 0.5, n.width, 0.5);
    e[0].stops.forEach(function(o) {
      var s;
      t[1] === t[0] ? s = 0 : (s = o.value / t[1], s = Math.min(Math.max(s, 0), 1)), a.addColorStop(s, o.color);
    }), i.fillStyle = a, i.fillRect(0, 0, n.width, n.height), r.dirty(), this._particleSurface.setGradientTexture(this._gradientTexture);
  },
  _updatePlanePosition: function(e, t, r, n) {
    var i = this._limitInViewportAndFullFill(e, t, r, n);
    e = i.leftTop, t = i.rightBottom, this._particleSurface.setRegion(i.region), this._planeMesh.position.set((e[0] + t[0]) / 2, n.getHeight() - (e[1] + t[1]) / 2, 0);
    var a = t[0] - e[0], o = t[1] - e[1];
    this._planeMesh.scale.set(a / 2, o / 2, 1), this._particleSurface.resize(Math.max(Math.min(a, 2048), 1), Math.max(Math.min(o, 2048), 1)), this._renderer && this._particleSurface.clearFrame(this._renderer);
  },
  _limitInViewportAndFullFill: function(e, t, r, n) {
    var i = [Math.max(e[0], 0), Math.max(e[1], 0)], a = [Math.min(t[0], n.getWidth()), Math.min(t[1], n.getHeight())];
    if (r.get("coordinateSystem") === "bmap") {
      var o = r.getData().getDataExtent(r.coordDimToDataDim("lng")[0]), s = Math.floor(o[1] - o[0]) >= 359;
      s && (i[0] > 0 && (i[0] = 0), a[0] < n.getWidth() && (a[0] = n.getWidth()));
    }
    var l = t[0] - e[0], u = t[1] - e[1], f = a[0] - i[0], c = a[1] - i[1], h = [(i[0] - e[0]) / l, 1 - c / u - (i[1] - e[1]) / u, f / l, c / u];
    return {
      leftTop: i,
      rightBottom: a,
      region: h
    };
  },
  _updateCamera: function(e, t, r) {
    this.viewGL.setViewport(0, 0, e, t, r);
    var n = this.viewGL.camera;
    n.left = n.bottom = 0, n.top = t, n.right = e, n.near = 0, n.far = 100, n.position.z = 10;
  },
  remove: function() {
    this._planeMesh.stopAnimation(), this.groupGL.removeAll();
  },
  dispose: function() {
    this._renderer && this._particleSurface.dispose(this._renderer), this.groupGL.removeAll();
  }
});
function hTe(e) {
  e.registerChartView(cTe), e.registerSeriesModel(sTe);
}
ft(hTe);
var eR = Yt.extend({
  type: "series.linesGL",
  dependencies: ["grid", "geo"],
  visualStyleAccessPath: "lineStyle",
  visualDrawType: "stroke",
  streamEnabled: !0,
  init: function(e) {
    var t = this._processFlatCoordsArray(e.data);
    this._flatCoords = t.flatCoords, this._flatCoordsOffset = t.flatCoordsOffset, t.flatCoords && (e.data = new Float32Array(t.count)), eR.superApply(this, "init", arguments);
  },
  mergeOption: function(e) {
    var t = this._processFlatCoordsArray(e.data);
    this._flatCoords = t.flatCoords, this._flatCoordsOffset = t.flatCoordsOffset, t.flatCoords && (e.data = new Float32Array(t.count)), eR.superApply(this, "mergeOption", arguments);
  },
  appendData: function(e) {
    var t = this._processFlatCoordsArray(e.data);
    t.flatCoords && (this._flatCoords ? (this._flatCoords = ZV(this._flatCoords, t.flatCoords), this._flatCoordsOffset = ZV(this._flatCoordsOffset, t.flatCoordsOffset)) : (this._flatCoords = t.flatCoords, this._flatCoordsOffset = t.flatCoordsOffset), e.data = new Float32Array(t.count)), this.getRawData().appendData(e.data);
  },
  _getCoordsFromItemModel: function(e) {
    var t = this.getData().getItemModel(e), r = t.option instanceof Array ? t.option : t.getShallow("coords");
    return r;
  },
  getLineCoordsCount: function(e) {
    return this._flatCoordsOffset ? this._flatCoordsOffset[e * 2 + 1] : this._getCoordsFromItemModel(e).length;
  },
  getLineCoords: function(e, t) {
    if (this._flatCoordsOffset) {
      for (var r = this._flatCoordsOffset[e * 2], n = this._flatCoordsOffset[e * 2 + 1], i = 0; i < n; i++)
        t[i] = t[i] || [], t[i][0] = this._flatCoords[r + i * 2], t[i][1] = this._flatCoords[r + i * 2 + 1];
      return n;
    } else {
      for (var a = this._getCoordsFromItemModel(e), i = 0; i < a.length; i++)
        t[i] = t[i] || [], t[i][0] = a[i][0], t[i][1] = a[i][1];
      return a.length;
    }
  },
  _processFlatCoordsArray: function(e) {
    var t = 0;
    if (this._flatCoords && (t = this._flatCoords.length), typeof e[0] == "number") {
      for (var r = e.length, n = new Uint32Array(r), i = new Float64Array(r), a = 0, o = 0, s = 0, l = 0; l < r; ) {
        s++;
        var u = e[l++];
        n[o++] = a + t, n[o++] = u;
        for (var f = 0; f < u; f++) {
          var c = e[l++], h = e[l++];
          i[a++] = c, i[a++] = h;
        }
      }
      return {
        flatCoordsOffset: new Uint32Array(n.buffer, 0, o),
        flatCoords: i,
        count: s
      };
    }
    return {
      flatCoordsOffset: null,
      flatCoords: null,
      count: e.length
    };
  },
  getInitialData: function(e, t) {
    var r = new zr(["value"], this);
    return r.hasItemOption = !1, r.initData(e.data, [], function(n, i, a, o) {
      if (n instanceof Array)
        return NaN;
      r.hasItemOption = !0;
      var s = n.value;
      if (s != null)
        return s instanceof Array ? s[o] : s;
    }), r;
  },
  defaultOption: {
    coordinateSystem: "geo",
    zlevel: 10,
    progressive: 1e4,
    progressiveThreshold: 5e4,
    // Cartesian coordinate system
    // xAxisIndex: 0,
    // yAxisIndex: 0,
    // Geo coordinate system
    // geoIndex: 0,
    // Support source-over, lighter
    blendMode: "source-over",
    lineStyle: {
      opacity: 0.8
    },
    postEffect: {
      enable: !1,
      colorCorrection: {
        exposure: 0,
        brightness: 0,
        contrast: 1,
        saturation: 1,
        enable: !0
      }
    }
  }
});
const vTe = Ut.extend({
  type: "linesGL",
  __ecgl__: !0,
  init: function(e, t) {
    this.groupGL = new J.Node(), this.viewGL = new Cr("orthographic"), this.viewGL.add(this.groupGL), this._glViewHelper = new Df(this.viewGL), this._nativeLinesShader = J.createShader("ecgl.lines3D"), this._meshLinesShader = J.createShader("ecgl.meshLines3D"), this._linesMeshes = [], this._currentStep = 0;
  },
  render: function(e, t, r) {
    this.groupGL.removeAll(), this._glViewHelper.reset(e, r);
    var n = this._linesMeshes[0];
    n || (n = this._linesMeshes[0] = this._createLinesMesh(e)), this._linesMeshes.length = 1, this.groupGL.add(n), this._updateLinesMesh(e, n, 0, e.getData().count()), this.viewGL.setPostEffect(e.getModel("postEffect"), r);
  },
  incrementalPrepareRender: function(e, t, r) {
    this.groupGL.removeAll(), this._glViewHelper.reset(e, r), this._currentStep = 0, this.viewGL.setPostEffect(e.getModel("postEffect"), r);
  },
  incrementalRender: function(e, t, r, n) {
    var i = this._linesMeshes[this._currentStep];
    i || (i = this._createLinesMesh(t), this._linesMeshes[this._currentStep] = i), this._updateLinesMesh(t, i, e.start, e.end), this.groupGL.add(i), n.getZr().refresh(), this._currentStep++;
  },
  updateTransform: function(e, t, r) {
    e.coordinateSystem.getRoamTransform && this._glViewHelper.updateTransform(e, r);
  },
  _createLinesMesh: function(e) {
    var t = new J.Mesh({
      $ignorePicking: !0,
      material: new J.Material({
        shader: J.createShader("ecgl.lines3D"),
        transparent: !0,
        depthMask: !1,
        depthTest: !1
      }),
      geometry: new o3({
        segmentScale: 10,
        useNativeLine: !0,
        dynamic: !1
      }),
      mode: J.Mesh.LINES,
      culling: !1
    });
    return t;
  },
  _updateLinesMesh: function(e, t, r, n) {
    var i = e.getData();
    t.material.blend = e.get("blendMode") === "lighter" ? J.additiveBlend : null;
    var a = e.get("lineStyle.curveness") || 0, o = e.get("polyline"), s = t.geometry, l = e.coordinateSystem, u = qt.firstNotNull(e.get("lineStyle.width"), 1);
    u > 1 ? (t.material.shader !== this._meshLinesShader && t.material.attachShader(this._meshLinesShader), t.mode = J.Mesh.TRIANGLES) : (t.material.shader !== this._nativeLinesShader && t.material.attachShader(this._nativeLinesShader), t.mode = J.Mesh.LINES), r = r || 0, n = n || i.count(), s.resetOffset();
    var f = 0, c = 0, h = [], v = [], d = [], g = [], y = [], x = 0.3, S = 0.7;
    function T() {
      v[0] = h[0] * S + g[0] * x - (h[1] - g[1]) * a, v[1] = h[1] * S + g[1] * x - (g[0] - h[0]) * a, d[0] = h[0] * x + g[0] * S - (h[1] - g[1]) * a, d[1] = h[1] * x + g[1] * S - (g[0] - h[0]) * a;
    }
    if (o || a !== 0)
      for (var C = r; C < n; C++)
        if (o) {
          var A = e.getLineCoordsCount(C);
          f += s.getPolylineVertexCount(A), c += s.getPolylineTriangleCount(A);
        } else
          e.getLineCoords(C, y), this._glViewHelper.dataToPoint(l, y[0], h), this._glViewHelper.dataToPoint(l, y[1], g), T(), f += s.getCubicCurveVertexCount(h, v, d, g), c += s.getCubicCurveTriangleCount(h, v, d, g);
    else {
      var M = n - r;
      f += M * s.getLineVertexCount(), c += M * s.getLineVertexCount();
    }
    s.setVertexCount(f), s.setTriangleCount(c);
    for (var E = r, P = [], C = r; C < n; C++) {
      J.parseColor(oi(i, E), P);
      var R = qt.firstNotNull(ni(i, E), 1);
      P[3] *= R;
      for (var A = e.getLineCoords(C, y), O = 0; O < A; O++)
        this._glViewHelper.dataToPoint(l, y[O], y[O]);
      o ? s.addPolyline(y, P, u, 0, A) : a !== 0 ? (h = y[0], g = y[1], T(), s.addCubicCurve(h, v, d, g, P, u)) : s.addPolyline(y, P, u, 0, 2), E++;
    }
  },
  dispose: function() {
    this.groupGL.removeAll();
  },
  remove: function() {
    this.groupGL.removeAll();
  }
});
function dTe(e) {
  e.registerChartView(vTe), e.registerSeriesModel(eR);
}
ft(dTe);
MO({
  type: "series.liquidFill",
  optionUpdated: function() {
    var e = this.option;
    e.gridSize = Math.max(Math.floor(e.gridSize), 4);
  },
  getInitialData: function(e, t) {
    var r = ah(e.data, {
      coordDimensions: ["value"]
    }), n = new zr(r, this);
    return n.initData(e.data), n;
  },
  defaultOption: {
    color: ["#294D99", "#156ACF", "#1598ED", "#45BDFF"],
    center: ["50%", "50%"],
    radius: "50%",
    amplitude: "8%",
    waveLength: "80%",
    phase: "auto",
    period: "auto",
    direction: "right",
    shape: "circle",
    waveAnimation: !0,
    animationEasing: "linear",
    animationEasingUpdate: "linear",
    animationDuration: 2e3,
    animationDurationUpdate: 1e3,
    outline: {
      show: !0,
      borderDistance: 8,
      itemStyle: {
        color: "none",
        borderColor: "#294D99",
        borderWidth: 8,
        shadowBlur: 20,
        shadowColor: "rgba(0, 0, 0, 0.25)"
      }
    },
    backgroundStyle: {
      color: "#E3F7FF"
    },
    itemStyle: {
      opacity: 0.95,
      shadowBlur: 50,
      shadowColor: "rgba(0, 0, 0, 0.4)"
    },
    label: {
      show: !0,
      color: "#294D99",
      insideColor: "#fff",
      fontSize: 50,
      fontWeight: "bold",
      align: "center",
      baseline: "middle",
      position: "inside"
    },
    emphasis: {
      itemStyle: {
        opacity: 0.8
      }
    }
  }
});
const pTe = IR({
  type: "ec-liquid-fill",
  shape: {
    waveLength: 0,
    radius: 0,
    radiusY: 0,
    cx: 0,
    cy: 0,
    waterLevel: 0,
    amplitude: 0,
    phase: 0,
    inverse: !1
  },
  buildPath: function(e, t) {
    t.radiusY == null && (t.radiusY = t.radius);
    for (var r = Math.max(
      Math.ceil(2 * t.radius / t.waveLength * 4) * 2,
      8
    ); t.phase < -Math.PI * 2; )
      t.phase += Math.PI * 2;
    for (; t.phase > 0; )
      t.phase -= Math.PI * 2;
    var n = t.phase / Math.PI / 2 * t.waveLength, i = t.cx - t.radius + n - t.radius * 2;
    e.moveTo(i, t.waterLevel);
    for (var a = 0, o = 0; o < r; ++o) {
      var s = o % 4, l = gTe(
        o * t.waveLength / 4,
        s,
        t.waveLength,
        t.amplitude
      );
      e.bezierCurveTo(
        l[0][0] + i,
        -l[0][1] + t.waterLevel,
        l[1][0] + i,
        -l[1][1] + t.waterLevel,
        l[2][0] + i,
        -l[2][1] + t.waterLevel
      ), o === r - 1 && (a = l[2][0]);
    }
    t.inverse ? (e.lineTo(a + i, t.cy - t.radiusY), e.lineTo(i, t.cy - t.radiusY), e.lineTo(i, t.waterLevel)) : (e.lineTo(a + i, t.cy + t.radiusY), e.lineTo(i, t.cy + t.radiusY), e.lineTo(i, t.waterLevel)), e.closePath();
  }
});
function gTe(e, t, r, n) {
  return t === 0 ? [
    [e + 1 / 2 * r / Math.PI / 2, n / 2],
    [e + 1 / 2 * r / Math.PI, n],
    [e + r / 4, n]
  ] : t === 1 ? [
    [
      e + 1 / 2 * r / Math.PI / 2 * (Math.PI - 2),
      n
    ],
    [
      e + 1 / 2 * r / Math.PI / 2 * (Math.PI - 1),
      n / 2
    ],
    [e + r / 4, 0]
  ] : t === 2 ? [
    [e + 1 / 2 * r / Math.PI / 2, -n / 2],
    [e + 1 / 2 * r / Math.PI, -n],
    [e + r / 4, -n]
  ] : [
    [
      e + 1 / 2 * r / Math.PI / 2 * (Math.PI - 2),
      -n
    ],
    [
      e + 1 / 2 * r / Math.PI / 2 * (Math.PI - 1),
      -n / 2
    ],
    [e + r / 4, 0]
  ];
}
var Yu = Be;
function kH(e) {
  return e && e.indexOf("path://") === 0;
}
LO({
  type: "liquidFill",
  render: function(e, t, r) {
    var n = this, i = this.group;
    i.removeAll();
    var a = e.getData(), o = a.getItemModel(0), s = o.get("center"), l = o.get("radius"), u = r.getWidth(), f = r.getHeight(), c = Math.min(u, f), h = 0, v = 0, d = e.get("outline.show");
    d && (h = e.get("outline.borderDistance"), v = Yu(
      e.get("outline.itemStyle.borderWidth"),
      c
    ));
    var g = Yu(s[0], u), y = Yu(s[1], f), x, S, T, C = !1, A = e.get("shape");
    if (A === "container" ? (C = !0, x = [
      u / 2,
      f / 2
    ], S = [
      x[0] - v / 2,
      x[1] - v / 2
    ], T = [
      Yu(h, u),
      Yu(h, f)
    ], l = [
      Math.max(S[0] - T[0], 0),
      Math.max(S[1] - T[1], 0)
    ]) : (x = Yu(l, c) / 2, S = x - v / 2, T = Yu(h, c), l = Math.max(S - T, 0)), d) {
      var M = z();
      M.style.lineWidth = v, i.add(z());
    }
    var E = C ? 0 : g - l, P = C ? 0 : y - l, R = null;
    i.add(H());
    var O = this._data, N = [];
    a.diff(O).add(function(V) {
      var Q = W(V, !1), q = Q.shape.waterLevel;
      Q.shape.waterLevel = C ? f / 2 : l, Ir(Q, {
        shape: {
          waterLevel: q
        }
      }, e), Q.z2 = 2, Z(V, Q, null), i.add(Q), a.setItemGraphicEl(V, Q), N.push(Q);
    }).update(function(V, Q) {
      for (var q = O.getItemGraphicEl(Q), X = W(V, !1, q), K = {}, ue = ["amplitude", "cx", "cy", "phase", "radius", "radiusY", "waterLevel", "waveLength"], oe = 0; oe < ue.length; ++oe) {
        var te = ue[oe];
        X.shape.hasOwnProperty(te) && (K[te] = X.shape[te]);
      }
      for (var pe = {}, me = ["fill", "opacity", "shadowBlur", "shadowColor"], oe = 0; oe < me.length; ++oe) {
        var te = me[oe];
        X.style.hasOwnProperty(te) && (pe[te] = X.style[te]);
      }
      C && (K.radiusY = f / 2), Wt(q, {
        shape: K,
        x: X.x,
        y: X.y
      }, e), e.isUniversalTransitionEnabled && e.isUniversalTransitionEnabled() ? Wt(q, {
        style: pe
      }, e) : q.useStyle(pe);
      var de = q.getClipPath(), ve = X.getClipPath();
      q.setClipPath(X.getClipPath()), q.shape.inverse = X.inverse, de && ve && n._shape === A && !kH(A) && Wt(ve, {
        shape: de.shape
      }, e, { isFrom: !0 }), Z(V, q, q), i.add(q), a.setItemGraphicEl(V, q), N.push(q);
    }).remove(function(V) {
      var Q = O.getItemGraphicEl(V);
      i.remove(Q);
    }).execute(), o.get("label.show") && i.add(ee(N)), this._shape = A, this._data = a;
    function G(V, Q) {
      if (A)
        if (kH(A)) {
          var q = $c(A.slice(7), {}), X = q.getBoundingRect(), K = X.width, ue = X.height;
          K > ue ? (ue = V * 2 / K * ue, K = V * 2) : (K = V * 2 / ue * K, ue = V * 2);
          var oe = Q ? 0 : g - K / 2, te = Q ? 0 : y - ue / 2;
          return q = $c(
            A.slice(7),
            {},
            new st(oe, te, K, ue)
          ), Q && (q.x = -K / 2, q.y = -ue / 2), q;
        } else if (C) {
          var pe = Q ? -V[0] : g - V[0], me = Q ? -V[1] : y - V[1];
          return en(
            "rect",
            pe,
            me,
            V[0] * 2,
            V[1] * 2
          );
        } else {
          var pe = Q ? -V : g - V, me = Q ? -V : y - V;
          return A === "pin" ? me += V : A === "arrow" && (me -= V), en(A, pe, me, V * 2, V * 2);
        }
      return new Qs({
        shape: {
          cx: Q ? 0 : g,
          cy: Q ? 0 : y,
          r: V
        }
      });
    }
    function z() {
      var V = G(x);
      return V.style.fill = null, V.setStyle(e.getModel("outline.itemStyle").getItemStyle()), V;
    }
    function H() {
      var V = G(l);
      V.setStyle(e.getModel("backgroundStyle").getItemStyle()), V.style.fill = null, V.z2 = 5;
      var Q = G(l);
      Q.setStyle(e.getModel("backgroundStyle").getItemStyle()), Q.style.stroke = null;
      var q = new rt();
      return q.add(V), q.add(Q), q;
    }
    function W(V, Q, q) {
      var X = C ? l[0] : l, K = C ? f / 2 : l, ue = a.getItemModel(V), oe = ue.getModel("itemStyle"), te = ue.get("phase"), pe = Yu(
        ue.get("amplitude"),
        K * 2
      ), me = Yu(
        ue.get("waveLength"),
        X * 2
      ), de = a.get("value", V), ve = K - de * K * 2;
      te = q ? q.shape.phase : te === "auto" ? V * Math.PI / 4 : te;
      var Ae = oe.getItemStyle();
      if (!Ae.fill) {
        var be = e.get("color"), De = V % be.length;
        Ae.fill = be[De];
      }
      var Ue = X * 2, Xe = new pTe({
        shape: {
          waveLength: me,
          radius: X,
          radiusY: K,
          cx: Ue,
          cy: 0,
          waterLevel: ve,
          amplitude: pe,
          phase: te,
          inverse: Q
        },
        style: Ae,
        x: g,
        y
      });
      Xe.shape._waterLevel = ve;
      var $e = ue.getModel("emphasis.itemStyle").getItemStyle();
      $e.lineWidth = 0, Xe.ensureState("emphasis").style = $e, jl(Xe);
      var vt = G(l, !0);
      return vt.setStyle({
        fill: "white"
      }), Xe.setClipPath(vt), Xe;
    }
    function Z(V, Q, q) {
      var X = a.getItemModel(V), K = X.get("period"), ue = X.get("direction"), oe = a.get("value", V), te = X.get("phase");
      te = q ? q.shape.phase : te === "auto" ? V * Math.PI / 4 : te;
      var pe = function(ve) {
        var Ae = a.count();
        return Ae === 0 ? ve : ve * (0.2 + (Ae - V) / Ae * 0.8);
      }, me = 0;
      K === "auto" ? me = pe(5e3) : me = typeof K == "function" ? K(oe, V) : K;
      var de = 0;
      ue === "right" || ue == null ? de = Math.PI : ue === "left" ? de = -Math.PI : ue === "none" ? de = 0 : console.error("Illegal direction value for liquid fill."), ue !== "none" && X.get("waveAnimation") && Q.animate("shape", !0).when(0, {
        phase: te
      }).when(me / 2, {
        phase: de + te
      }).when(me, {
        phase: de * 2 + te
      }).during(function() {
        R && R.dirty(!0);
      }).start();
    }
    function ee(V) {
      var Q = o.getModel("label");
      function q() {
        var Ae = e.getFormattedLabel(0, "normal"), be = a.get("value", 0) * 100, De = a.getName(0) || e.name;
        return isNaN(be) || (De = be.toFixed(0) + "%"), Ae ?? De;
      }
      var X = {
        z2: 10,
        shape: {
          x: E,
          y: P,
          width: (C ? l[0] : l) * 2,
          height: (C ? l[1] : l) * 2
        },
        style: {
          fill: "transparent"
        },
        textConfig: {
          position: Q.get("position") || "inside"
        },
        silent: !0
      }, K = {
        style: {
          text: q(),
          textAlign: Q.get("align"),
          textVerticalAlign: Q.get("baseline")
        }
      };
      Object.assign(K.style, y1(Q));
      var ue = new Mt(X), oe = new Mt(X);
      oe.disableLabelAnimation = !0, ue.disableLabelAnimation = !0;
      var te = new Rt(K), pe = new Rt(K);
      ue.setTextContent(te), oe.setTextContent(pe);
      var me = Q.get("insideColor");
      pe.style.fill = me;
      var de = new rt();
      de.add(ue), de.add(oe);
      var ve = G(l, !0);
      return R = new Km({
        shape: {
          paths: V
        },
        x: g,
        y
      }), R.setClipPath(ve), oe.setClipPath(R), de;
    }
  },
  dispose: function() {
  }
});
MO({
  type: "series.wordCloud",
  visualStyleAccessPath: "textStyle",
  visualStyleMapper: function(e) {
    return {
      fill: e.get("color")
    };
  },
  visualDrawType: "fill",
  optionUpdated: function() {
    var e = this.option;
    e.gridSize = Math.max(Math.floor(e.gridSize), 4);
  },
  getInitialData: function(e, t) {
    var r = ah(e.data, {
      coordDimensions: ["value"]
    }), n = new zr(r, this);
    return n.initData(e.data), n;
  },
  // Most of options are from https://github.com/timdream/wordcloud2.js/blob/gh-pages/API.md
  defaultOption: {
    maskImage: null,
    // Shape can be 'circle', 'cardioid', 'diamond', 'triangle-forward', 'triangle', 'pentagon', 'star'
    shape: "circle",
    keepAspect: !1,
    left: "center",
    top: "center",
    width: "70%",
    height: "80%",
    sizeRange: [12, 60],
    rotationRange: [-90, 90],
    rotationStep: 45,
    gridSize: 8,
    drawOutOfBound: !1,
    shrinkToFit: !1,
    textStyle: {
      fontWeight: "normal"
    }
  }
});
LO({
  type: "wordCloud",
  render: function(e, t, r) {
    var n = this.group;
    n.removeAll();
    var i = e.getData(), a = e.get("gridSize");
    e.layoutInstance.ondraw = function(o, s, l, u) {
      var f = i.getItemModel(l), c = f.getModel("textStyle"), h = new Rt({
        style: y1(c),
        scaleX: 1 / u.info.mu,
        scaleY: 1 / u.info.mu,
        x: (u.gx + u.info.gw / 2) * a,
        y: (u.gy + u.info.gh / 2) * a,
        rotation: u.rot
      });
      h.setStyle({
        x: u.info.fillTextOffsetX,
        y: u.info.fillTextOffsetY + s * 0.5,
        text: o,
        verticalAlign: "middle",
        fill: i.getItemVisual(l, "style").fill,
        fontSize: s
      }), n.add(h), i.setItemGraphicEl(l, h), h.ensureState("emphasis").style = y1(
        f.getModel(["emphasis", "textStyle"]),
        {
          state: "emphasis"
        }
      ), h.ensureState("blur").style = y1(
        f.getModel(["blur", "textStyle"]),
        {
          state: "blur"
        }
      ), jl(
        h,
        f.get(["emphasis", "focus"]),
        f.get(["emphasis", "blurScope"])
      ), h.stateTransition = {
        duration: e.get("animation") ? e.get(["stateAnimation", "duration"]) : 0,
        easing: e.get(["stateAnimation", "easing"])
      }, h.__highDownDispatcher = !0;
    }, this._model = e;
  },
  remove: function() {
    this.group.removeAll(), this._model.layoutInstance.dispose();
  },
  dispose: function() {
    this._model.layoutInstance.dispose();
  }
});
window.setImmediate || (window.setImmediate = (function() {
  return window.msSetImmediate || window.webkitSetImmediate || window.mozSetImmediate || window.oSetImmediate || (function() {
    if (!window.postMessage || !window.addEventListener)
      return null;
    var r = [void 0], n = "zero-timeout-message", i = function(o) {
      var s = r.length;
      return r.push(o), window.postMessage(n + s.toString(36), "*"), s;
    };
    return window.addEventListener(
      "message",
      function(o) {
        if (!(typeof o.data != "string" || o.data.substr(0, n.length) !== n)) {
          o.stopImmediatePropagation();
          var s = parseInt(o.data.substr(n.length), 36);
          r[s] && (r[s](), r[s] = void 0);
        }
      },
      !0
    ), window.clearImmediate = function(o) {
      r[o] && (r[o] = void 0);
    }, i;
  })() || // fallback
  function(r) {
    window.setTimeout(r, 0);
  };
})());
window.clearImmediate || (window.clearImmediate = (function() {
  return window.msClearImmediate || window.webkitClearImmediate || window.mozClearImmediate || window.oClearImmediate || // "clearZeroTimeout" is implement on the previous block ||
  // fallback
  function(r) {
    window.clearTimeout(r);
  };
})());
var s3 = (function() {
  var t = document.createElement("canvas");
  if (!t || !t.getContext)
    return !1;
  var r = t.getContext("2d");
  return !(!r || !r.getImageData || !r.fillText || !Array.prototype.some || !Array.prototype.push);
})(), tR = (function() {
  if (s3) {
    for (var t = document.createElement("canvas").getContext("2d"), r = 20, n, i; r; ) {
      if (t.font = r.toString(10) + "px sans-serif", t.measureText("Ｗ").width === n && t.measureText("m").width === i)
        return r + 1;
      n = t.measureText("Ｗ").width, i = t.measureText("m").width, r--;
    }
    return 0;
  }
})(), mTe = function(e) {
  if (Array.isArray(e)) {
    var t = e.slice();
    return t.splice(0, 2), t;
  } else
    return [];
}, yTe = function(t) {
  for (var r, n, i = t.length; i; )
    r = Math.floor(Math.random() * i), n = t[--i], t[i] = t[r], t[r] = n;
  return t;
}, Kg = {}, sA = function(t, r) {
  if (!s3)
    return;
  var n = Math.floor(Math.random() * Date.now());
  Array.isArray(t) || (t = [t]), t.forEach(function(oe, te) {
    if (typeof oe == "string") {
      if (t[te] = document.getElementById(oe), !t[te])
        throw new Error("The element id specified is not found.");
    } else if (!oe.tagName && !oe.appendChild)
      throw new Error(
        "You must pass valid HTML elements, or ID of the element."
      );
  });
  var i = {
    list: [],
    fontFamily: '"Trebuchet MS", "Heiti TC", "微軟正黑體", "Arial Unicode MS", "Droid Fallback Sans", sans-serif',
    fontWeight: "normal",
    color: "random-dark",
    minSize: 0,
    // 0 to disable
    weightFactor: 1,
    clearCanvas: !0,
    backgroundColor: "#fff",
    // opaque white = rgba(255, 255, 255, 1)
    gridSize: 8,
    drawOutOfBound: !1,
    shrinkToFit: !1,
    origin: null,
    drawMask: !1,
    maskColor: "rgba(255,0,0,0.3)",
    maskGapWidth: 0.3,
    layoutAnimation: !0,
    wait: 0,
    abortThreshold: 0,
    // disabled
    abort: function() {
    },
    minRotation: -Math.PI / 2,
    maxRotation: Math.PI / 2,
    rotationStep: 0.1,
    shuffle: !0,
    rotateRatio: 0.1,
    shape: "circle",
    ellipticity: 0.65,
    classes: null,
    hover: null,
    click: null
  };
  if (r)
    for (var a in r)
      a in i && (i[a] = r[a]);
  if (typeof i.weightFactor != "function") {
    var o = i.weightFactor;
    i.weightFactor = function(te) {
      return te * o;
    };
  }
  if (typeof i.shape != "function")
    switch (i.shape) {
      case "circle":
      /* falls through */
      default:
        i.shape = "circle";
        break;
      case "cardioid":
        i.shape = function(te) {
          return 1 - Math.sin(te);
        };
        break;
      /*
        To work out an X-gon, one has to calculate "m",
        where 1/(cos(2*PI/X)+m*sin(2*PI/X)) = 1/(cos(0)+m*sin(0))
        http://www.wolframalpha.com/input/?i=1%2F%28cos%282*PI%2FX%29%2Bm*sin%28
        2*PI%2FX%29%29+%3D+1%2F%28cos%280%29%2Bm*sin%280%29%29
        Copy the solution into polar equation r = 1/(cos(t') + m*sin(t'))
        where t' equals to mod(t, 2PI/X);
        */
      case "diamond":
        i.shape = function(te) {
          var pe = te % (2 * Math.PI / 4);
          return 1 / (Math.cos(pe) + Math.sin(pe));
        };
        break;
      case "square":
        i.shape = function(te) {
          return Math.min(
            1 / Math.abs(Math.cos(te)),
            1 / Math.abs(Math.sin(te))
          );
        };
        break;
      case "triangle-forward":
        i.shape = function(te) {
          var pe = te % (2 * Math.PI / 3);
          return 1 / (Math.cos(pe) + Math.sqrt(3) * Math.sin(pe));
        };
        break;
      case "triangle":
      case "triangle-upright":
        i.shape = function(te) {
          var pe = (te + Math.PI * 3 / 2) % (2 * Math.PI / 3);
          return 1 / (Math.cos(pe) + Math.sqrt(3) * Math.sin(pe));
        };
        break;
      case "pentagon":
        i.shape = function(te) {
          var pe = (te + 0.955) % (2 * Math.PI / 5);
          return 1 / (Math.cos(pe) + 0.726543 * Math.sin(pe));
        };
        break;
      case "star":
        i.shape = function(te) {
          var pe = (te + 0.955) % (2 * Math.PI / 10);
          return (te + 0.955) % (2 * Math.PI / 5) - 2 * Math.PI / 10 >= 0 ? 1 / (Math.cos(2 * Math.PI / 10 - pe) + 3.07768 * Math.sin(2 * Math.PI / 10 - pe)) : 1 / (Math.cos(pe) + 3.07768 * Math.sin(pe));
        };
        break;
    }
  i.gridSize = Math.max(Math.floor(i.gridSize), 4);
  var s = i.gridSize, l = s - i.maskGapWidth, u = Math.abs(i.maxRotation - i.minRotation), f = Math.min(i.maxRotation, i.minRotation), c = i.rotationStep, h, v, d, g, y, x, S;
  function T(oe, te) {
    return "hsl(" + (Math.random() * 360).toFixed() + "," + (Math.random() * 30 + 70).toFixed() + "%," + (Math.random() * (te - oe) + oe).toFixed() + "%)";
  }
  switch (i.color) {
    case "random-dark":
      S = function() {
        return T(10, 50);
      };
      break;
    case "random-light":
      S = function() {
        return T(50, 90);
      };
      break;
    default:
      typeof i.color == "function" && (S = i.color);
      break;
  }
  var C;
  typeof i.fontWeight == "function" && (C = i.fontWeight);
  var A = null;
  typeof i.classes == "function" && (A = i.classes);
  var M = !1, E = [], P, R = function(te) {
    var pe = te.currentTarget, me = pe.getBoundingClientRect(), de, ve;
    te.touches ? (de = te.touches[0].clientX, ve = te.touches[0].clientY) : (de = te.clientX, ve = te.clientY);
    var Ae = de - me.left, be = ve - me.top, De = Math.floor(Ae * (pe.width / me.width || 1) / s), Ue = Math.floor(be * (pe.height / me.height || 1) / s);
    return E[De] ? E[De][Ue] : null;
  }, O = function(te) {
    var pe = R(te);
    if (P !== pe) {
      if (P = pe, !pe) {
        i.hover(void 0, void 0, te);
        return;
      }
      i.hover(pe.item, pe.dimension, te);
    }
  }, N = function(te) {
    var pe = R(te);
    pe && (i.click(pe.item, pe.dimension, te), te.preventDefault());
  }, G = [], z = function(te) {
    if (G[te])
      return G[te];
    var pe = te * 8, me = pe, de = [];
    for (te === 0 && de.push([g[0], g[1], 0]); me--; ) {
      var ve = 1;
      i.shape !== "circle" && (ve = i.shape(me / pe * 2 * Math.PI)), de.push([
        g[0] + te * ve * Math.cos(-me / pe * 2 * Math.PI),
        g[1] + te * ve * Math.sin(-me / pe * 2 * Math.PI) * i.ellipticity,
        me / pe * 2 * Math.PI
      ]);
    }
    return G[te] = de, de;
  }, H = function() {
    return i.abortThreshold > 0 && (/* @__PURE__ */ new Date()).getTime() - x > i.abortThreshold;
  }, W = function() {
    return i.rotateRatio === 0 || Math.random() > i.rotateRatio ? 0 : u === 0 ? f : f + Math.round(Math.random() * u / c) * c;
  }, Z = function(te, pe, me, de) {
    var ve = i.weightFactor(pe);
    if (ve <= i.minSize)
      return !1;
    var Ae = 1;
    ve < tR && (Ae = (function() {
      for (var tl = 2; tl * ve < tR; )
        tl += 2;
      return tl;
    })());
    var be;
    C ? be = C(te, pe, ve, de) : be = i.fontWeight;
    var De = document.createElement("canvas"), Ue = De.getContext("2d", { willReadFrequently: !0 });
    Ue.font = be + " " + (ve * Ae).toString(10) + "px " + i.fontFamily;
    var Xe = Ue.measureText(te).width / Ae, $e = Math.max(
      ve * Ae,
      Ue.measureText("m").width,
      Ue.measureText("Ｗ").width
    ) / Ae, vt = Xe + $e * 2, Lt = $e * 3, cr = Math.ceil(vt / s), mr = Math.ceil(Lt / s);
    vt = cr * s, Lt = mr * s;
    var Kt = -Xe / 2, wt = -$e * 0.4, ir = Math.ceil(
      (vt * Math.abs(Math.sin(me)) + Lt * Math.abs(Math.cos(me))) / s
    ), Nr = Math.ceil(
      (vt * Math.abs(Math.cos(me)) + Lt * Math.abs(Math.sin(me))) / s
    ), Di = Nr * s, na = ir * s;
    De.setAttribute("width", Di), De.setAttribute("height", na), Ue.scale(1 / Ae, 1 / Ae), Ue.translate(Di * Ae / 2, na * Ae / 2), Ue.rotate(-me), Ue.font = be + " " + (ve * Ae).toString(10) + "px " + i.fontFamily, Ue.fillStyle = "#000", Ue.textBaseline = "middle", Ue.fillText(
      te,
      Kt * Ae,
      (wt + ve * 0.5) * Ae
    );
    var su = Ue.getImageData(0, 0, Di, na).data;
    if (H())
      return !1;
    for (var Mo = [], Zn = Nr, ia, Qa, Ja, aa = [ir / 2, Nr / 2, ir / 2, Nr / 2]; Zn--; )
      for (ia = ir; ia--; ) {
        Ja = s;
        e: for (; Ja--; )
          for (Qa = s; Qa--; )
            if (su[((ia * s + Ja) * Di + (Zn * s + Qa)) * 4 + 3]) {
              Mo.push([Zn, ia]), Zn < aa[3] && (aa[3] = Zn), Zn > aa[1] && (aa[1] = Zn), ia < aa[0] && (aa[0] = ia), ia > aa[2] && (aa[2] = ia);
              break e;
            }
      }
    return {
      mu: Ae,
      occupied: Mo,
      bounds: aa,
      gw: Nr,
      gh: ir,
      fillTextOffsetX: Kt,
      fillTextOffsetY: wt,
      fillTextWidth: Xe,
      fillTextHeight: $e,
      fontSize: ve
    };
  }, ee = function(te, pe, me, de, ve) {
    for (var Ae = ve.length; Ae--; ) {
      var be = te + ve[Ae][0], De = pe + ve[Ae][1];
      if (be >= v || De >= d || be < 0 || De < 0) {
        if (!i.drawOutOfBound)
          return !1;
        continue;
      }
      if (!h[be][De])
        return !1;
    }
    return !0;
  }, V = function(te, pe, me, de, ve, Ae, be, De, Ue, Xe) {
    var $e = me.fontSize, vt;
    S ? vt = S(
      de,
      ve,
      $e,
      Ae,
      be,
      Xe
    ) : vt = i.color;
    var Lt;
    C ? Lt = C(de, ve, $e, Xe) : Lt = i.fontWeight;
    var cr;
    A ? cr = A(de, ve, $e, Xe) : cr = i.classes, t.forEach(function(mr) {
      if (mr.getContext) {
        var Kt = mr.getContext("2d"), wt = me.mu;
        Kt.save(), Kt.scale(1 / wt, 1 / wt), Kt.font = Lt + " " + ($e * wt).toString(10) + "px " + i.fontFamily, Kt.fillStyle = vt, Kt.translate((te + me.gw / 2) * s * wt, (pe + me.gh / 2) * s * wt), De !== 0 && Kt.rotate(-De), Kt.textBaseline = "middle", Kt.fillText(
          de,
          me.fillTextOffsetX * wt,
          (me.fillTextOffsetY + $e * 0.5) * wt
        ), Kt.restore();
      } else {
        var ir = document.createElement("span"), Nr = "";
        Nr = "rotate(" + -De / Math.PI * 180 + "deg) ", me.mu !== 1 && (Nr += "translateX(-" + me.fillTextWidth / 4 + "px) scale(" + 1 / me.mu + ")");
        var Di = {
          position: "absolute",
          display: "block",
          font: Lt + " " + $e * me.mu + "px " + i.fontFamily,
          left: (te + me.gw / 2) * s + me.fillTextOffsetX + "px",
          top: (pe + me.gh / 2) * s + me.fillTextOffsetY + "px",
          width: me.fillTextWidth + "px",
          height: me.fillTextHeight + "px",
          lineHeight: $e + "px",
          whiteSpace: "nowrap",
          transform: Nr,
          webkitTransform: Nr,
          msTransform: Nr,
          transformOrigin: "50% 40%",
          webkitTransformOrigin: "50% 40%",
          msTransformOrigin: "50% 40%"
        };
        vt && (Di.color = vt), ir.textContent = de;
        for (var na in Di)
          ir.style[na] = Di[na];
        if (Ue)
          for (var su in Ue)
            ir.setAttribute(su, Ue[su]);
        cr && (ir.className += cr), mr.appendChild(ir);
      }
    });
  }, Q = function(te, pe, me, de, ve) {
    if (!(te >= v || pe >= d || te < 0 || pe < 0)) {
      if (h[te][pe] = !1, me) {
        var Ae = t[0].getContext("2d");
        Ae.fillRect(te * s, pe * s, l, l);
      }
      M && (E[te][pe] = { item: ve, dimension: de });
    }
  }, q = function(te, pe, me, de, ve, Ae) {
    var be = ve.occupied, De = i.drawMask, Ue;
    De && (Ue = t[0].getContext("2d"), Ue.save(), Ue.fillStyle = i.maskColor);
    var Xe;
    if (M) {
      var $e = ve.bounds;
      Xe = {
        x: (te + $e[3]) * s,
        y: (pe + $e[0]) * s,
        w: ($e[1] - $e[3] + 1) * s,
        h: ($e[2] - $e[0] + 1) * s
      };
    }
    for (var vt = be.length; vt--; ) {
      var Lt = te + be[vt][0], cr = pe + be[vt][1];
      Lt >= v || cr >= d || Lt < 0 || cr < 0 || Q(Lt, cr, De, Xe, Ae);
    }
    De && Ue.restore();
  }, X = function oe(te, pe) {
    if (pe > 20)
      return null;
    var me, de, ve;
    Array.isArray(te) ? (me = te[0], de = te[1]) : (me = te.word, de = te.weight, ve = te.attributes);
    var Ae = W(), be = mTe(te), De = Z(me, de, Ae, be);
    if (!De || H())
      return !1;
    if (!i.drawOutOfBound && !i.shrinkToFit) {
      var Ue = De.bounds;
      if (Ue[1] - Ue[3] + 1 > v || Ue[2] - Ue[0] + 1 > d)
        return !1;
    }
    for (var Xe = y + 1, $e = function(mr) {
      var Kt = Math.floor(mr[0] - De.gw / 2), wt = Math.floor(mr[1] - De.gh / 2), ir = De.gw, Nr = De.gh;
      return ee(Kt, wt, ir, Nr, De.occupied) ? (V(
        Kt,
        wt,
        De,
        me,
        de,
        y - Xe,
        mr[2],
        Ae,
        ve,
        be
      ), q(Kt, wt, ir, Nr, De, te), {
        gx: Kt,
        gy: wt,
        rot: Ae,
        info: De
      }) : !1;
    }; Xe--; ) {
      var vt = z(y - Xe);
      i.shuffle && (vt = [].concat(vt), yTe(vt));
      for (var Lt = 0; Lt < vt.length; Lt++) {
        var cr = $e(vt[Lt]);
        if (cr)
          return cr;
      }
    }
    return i.shrinkToFit ? (Array.isArray(te) ? te[1] = te[1] * 3 / 4 : te.weight = te.weight * 3 / 4, oe(te, pe + 1)) : null;
  }, K = function(te, pe, me) {
    if (pe)
      return !t.some(function(de) {
        var ve = new CustomEvent(te, {
          detail: me || {}
        });
        return !de.dispatchEvent(ve);
      }, this);
    t.forEach(function(de) {
      var ve = new CustomEvent(te, {
        detail: me || {}
      });
      de.dispatchEvent(ve);
    }, this);
  }, ue = function() {
    var te = t[0];
    if (te.getContext)
      v = Math.ceil(te.width / s), d = Math.ceil(te.height / s);
    else {
      var pe = te.getBoundingClientRect();
      v = Math.ceil(pe.width / s), d = Math.ceil(pe.height / s);
    }
    if (K("wordcloudstart", !0)) {
      g = i.origin ? [i.origin[0] / s, i.origin[1] / s] : [v / 2, d / 2], y = Math.floor(Math.sqrt(v * v + d * d)), h = [];
      var me, de, ve;
      if (!te.getContext || i.clearCanvas)
        for (t.forEach(function(wt) {
          if (wt.getContext) {
            var ir = wt.getContext("2d");
            ir.fillStyle = i.backgroundColor, ir.clearRect(0, 0, v * (s + 1), d * (s + 1)), ir.fillRect(0, 0, v * (s + 1), d * (s + 1));
          } else
            wt.textContent = "", wt.style.backgroundColor = i.backgroundColor, wt.style.position = "relative";
        }), me = v; me--; )
          for (h[me] = [], de = d; de--; )
            h[me][de] = !0;
      else {
        var Ae = document.createElement("canvas").getContext("2d");
        Ae.fillStyle = i.backgroundColor, Ae.fillRect(0, 0, 1, 1);
        var be = Ae.getImageData(0, 0, 1, 1).data, De = te.getContext("2d").getImageData(0, 0, v * s, d * s).data;
        me = v;
        for (var Ue, Xe; me--; )
          for (h[me] = [], de = d; de--; ) {
            Xe = s;
            e: for (; Xe--; )
              for (Ue = s; Ue--; )
                for (ve = 4; ve--; )
                  if (De[((de * s + Xe) * v * s + (me * s + Ue)) * 4 + ve] !== be[ve]) {
                    h[me][de] = !1;
                    break e;
                  }
            h[me][de] !== !1 && (h[me][de] = !0);
          }
        De = Ae = be = void 0;
      }
      if (i.hover || i.click) {
        for (M = !0, me = v + 1; me--; )
          E[me] = [];
        i.hover && te.addEventListener("mousemove", O), i.click && (te.addEventListener("click", N), te.addEventListener("touchstart", N), te.addEventListener("touchend", function(wt) {
          wt.preventDefault();
        }), te.style.webkitTapHighlightColor = "rgba(0, 0, 0, 0)"), te.addEventListener("wordcloudstart", function wt() {
          te.removeEventListener("wordcloudstart", wt), te.removeEventListener("mousemove", O), te.removeEventListener("click", N), P = void 0;
        });
      }
      ve = 0;
      var $e, vt, Lt = !0;
      i.layoutAnimation ? i.wait !== 0 ? ($e = window.setTimeout, vt = window.clearTimeout) : ($e = window.setImmediate, vt = window.clearImmediate) : ($e = function(wt) {
        wt();
      }, vt = function() {
        Lt = !1;
      });
      var cr = function(ir, Nr) {
        t.forEach(function(Di) {
          Di.addEventListener(ir, Nr);
        }, this);
      }, mr = function(ir, Nr) {
        t.forEach(function(Di) {
          Di.removeEventListener(ir, Nr);
        }, this);
      }, Kt = function wt() {
        mr("wordcloudstart", wt), vt(Kg[n]);
      };
      cr("wordcloudstart", Kt), Kg[n] = (i.layoutAnimation ? $e : setTimeout)(
        function wt() {
          if (Lt) {
            if (ve >= i.list.length) {
              vt(Kg[n]), K("wordcloudstop", !1), mr("wordcloudstart", Kt), delete Kg[n];
              return;
            }
            x = (/* @__PURE__ */ new Date()).getTime();
            var ir = X(i.list[ve], 0), Nr = !K("wordclouddrawn", !0, {
              item: i.list[ve],
              drawn: ir
            });
            if (H() || Nr) {
              vt(Kg[n]), i.abort(), K("wordcloudabort", !1), K("wordcloudstop", !1), mr("wordcloudstart", Kt);
              return;
            }
            ve++, Kg[n] = $e(wt, i.wait);
          }
        },
        i.wait
      );
    }
  };
  ue();
};
sA.isSupported = s3;
sA.minFontSize = tR;
if (!sA.isSupported)
  throw new Error("Sorry your browser not support wordCloud");
function _Te(e) {
  for (var t = e.getContext("2d"), r = t.getImageData(0, 0, e.width, e.height), n = t.createImageData(r), i = 0, a = 0, o = 0; o < r.data.length; o += 4) {
    var s = r.data[o + 3];
    if (s > 128) {
      var l = r.data[o] + r.data[o + 1] + r.data[o + 2];
      i += l, ++a;
    }
  }
  for (var u = i / a, o = 0; o < r.data.length; o += 4) {
    var l = r.data[o] + r.data[o + 1] + r.data[o + 2], s = r.data[o + 3];
    s < 128 || l > u ? (n.data[o] = 0, n.data[o + 1] = 0, n.data[o + 2] = 0, n.data[o + 3] = 0) : (n.data[o] = 255, n.data[o + 1] = 255, n.data[o + 2] = 255, n.data[o + 3] = 255);
  }
  t.putImageData(n, 0, 0);
}
mO(function(e, t) {
  e.eachSeriesByType("wordCloud", function(r) {
    var n = Tr(
      r.getBoxLayoutParams(),
      {
        width: t.getWidth(),
        height: t.getHeight()
      }
    ), i = r.get("keepAspect"), a = r.get("maskImage"), o = a ? a.width / a.height : 1;
    i && xTe(n, o);
    var s = r.getData(), l = document.createElement("canvas");
    l.width = n.width, l.height = n.height;
    var u = l.getContext("2d");
    if (a)
      try {
        u.drawImage(a, 0, 0, l.width, l.height), _Te(l);
      } catch (y) {
        console.error("Invalid mask image"), console.error(y.toString());
      }
    var f = r.get("sizeRange"), c = r.get("rotationRange"), h = s.getDataExtent("value"), v = Math.PI / 180, d = r.get("gridSize");
    sA(l, {
      list: s.mapArray("value", function(y, x) {
        var S = s.getItemModel(x);
        return [
          s.getName(x),
          S.get("textStyle.fontSize", !0) || er(y, h, f),
          x
        ];
      }).sort(function(y, x) {
        return x[1] - y[1];
      }),
      fontFamily: r.get("textStyle.fontFamily") || r.get("emphasis.textStyle.fontFamily") || e.get("textStyle.fontFamily"),
      fontWeight: r.get("textStyle.fontWeight") || r.get("emphasis.textStyle.fontWeight") || e.get("textStyle.fontWeight"),
      gridSize: d,
      ellipticity: n.height / n.width,
      minRotation: c[0] * v,
      maxRotation: c[1] * v,
      clearCanvas: !a,
      rotateRatio: 1,
      rotationStep: r.get("rotationStep") * v,
      drawOutOfBound: r.get("drawOutOfBound"),
      shrinkToFit: r.get("shrinkToFit"),
      layoutAnimation: r.get("layoutAnimation"),
      shuffle: !1,
      shape: r.get("shape")
    });
    function g(y) {
      var x = y.detail.item;
      y.detail.drawn && r.layoutInstance.ondraw && (y.detail.drawn.gx += n.x / d, y.detail.drawn.gy += n.y / d, r.layoutInstance.ondraw(
        x[0],
        x[1],
        x[2],
        y.detail.drawn
      ));
    }
    l.addEventListener("wordclouddrawn", g), r.layoutInstance && r.layoutInstance.dispose(), r.layoutInstance = {
      ondraw: null,
      dispose: function() {
        l.removeEventListener("wordclouddrawn", g), l.addEventListener("wordclouddrawn", function(y) {
          y.preventDefault();
        });
      }
    };
  });
});
Rx(function(e) {
  var t = (e || {}).series;
  !Se(t) && (t = t ? [t] : []);
  var r = ["shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY"];
  F(t, function(i) {
    if (i && i.type === "wordCloud") {
      var a = i.textStyle || {};
      n(a.normal), n(a.emphasis);
    }
  });
  function n(i) {
    i && F(r, function(a) {
      i.hasOwnProperty(a) && (i["text" + WW(a)] = i[a]);
    });
  }
});
function xTe(e, t) {
  var r = e.width, n = e.height;
  r > n * t ? (e.x += (r - n * t) / 2, e.width = n * t) : (e.y += (n - r / t) / 2, e.height = r / t);
}
var Zu = {}, $u = {}, TE = {}, BH;
function STe() {
  return BH || (BH = 1, (function(e) {
    Object.defineProperty(e, "__esModule", {
      value: !0
    }), e.default = void 0;
    var t = 1;
    e.default = function() {
      return "".concat(t++);
    };
  })(TE)), TE;
}
var k_ = {}, B_ = {}, bE = {}, zH;
function MZ() {
  return zH || (zH = 1, (function(e) {
    Object.defineProperty(e, "__esModule", {
      value: !0
    }), e.default = void 0, e.default = function(r) {
      var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 60, i = null;
      return function() {
        for (var a = this, o = arguments.length, s = new Array(o), l = 0; l < o; l++)
          s[l] = arguments[l];
        clearTimeout(i), i = setTimeout(function() {
          r.apply(a, s);
        }, n);
      };
    };
  })(bE)), bE;
}
var qu = {}, FH;
function l3() {
  return FH || (FH = 1, Object.defineProperty(qu, "__esModule", {
    value: !0
  }), qu.SizeSensorId = qu.SensorTabIndex = qu.SensorClassName = void 0, qu.SizeSensorId = "size-sensor-id", qu.SensorClassName = "size-sensor-object", qu.SensorTabIndex = "-1"), qu;
}
var GH;
function wTe() {
  if (GH) return B_;
  GH = 1, Object.defineProperty(B_, "__esModule", {
    value: !0
  }), B_.createSensor = void 0;
  var e = r(MZ()), t = l3();
  function r(n) {
    return n && n.__esModule ? n : { default: n };
  }
  return B_.createSensor = function(i, a) {
    var o = void 0, s = [], l = function() {
      getComputedStyle(i).position === "static" && (i.style.position = "relative");
      var d = document.createElement("object");
      return d.onload = function() {
        d.contentDocument.defaultView.addEventListener("resize", u), u();
      }, d.style.display = "block", d.style.position = "absolute", d.style.top = "0", d.style.left = "0", d.style.height = "100%", d.style.width = "100%", d.style.overflow = "hidden", d.style.pointerEvents = "none", d.style.zIndex = "-1", d.style.opacity = "0", d.setAttribute("class", t.SensorClassName), d.setAttribute("tabindex", t.SensorTabIndex), d.type = "text/html", i.appendChild(d), d.data = "about:blank", d;
    }, u = (0, e.default)(function() {
      s.forEach(function(v) {
        v(i);
      });
    }), f = function(d) {
      o || (o = l()), s.indexOf(d) === -1 && s.push(d);
    }, c = function() {
      o && o.parentNode && (o.contentDocument && o.contentDocument.defaultView.removeEventListener("resize", u), o.parentNode.removeChild(o), i.removeAttribute(t.SizeSensorId), o = void 0, s = [], a && a());
    }, h = function(d) {
      var g = s.indexOf(d);
      g !== -1 && s.splice(g, 1), s.length === 0 && o && c();
    };
    return {
      element: i,
      bind: f,
      destroy: c,
      unbind: h
    };
  }, B_;
}
var z_ = {}, VH;
function TTe() {
  if (VH) return z_;
  VH = 1, Object.defineProperty(z_, "__esModule", {
    value: !0
  }), z_.createSensor = void 0;
  var e = l3(), t = r(MZ());
  function r(n) {
    return n && n.__esModule ? n : { default: n };
  }
  return z_.createSensor = function(i, a) {
    var o = void 0, s = [], l = (0, t.default)(function() {
      s.forEach(function(v) {
        v(i);
      });
    }), u = function() {
      var d = new ResizeObserver(l);
      return d.observe(i), l(), d;
    }, f = function(d) {
      o || (o = u()), s.indexOf(d) === -1 && s.push(d);
    }, c = function() {
      o && o.disconnect(), s = [], o = void 0, i.removeAttribute(e.SizeSensorId), a && a();
    }, h = function(d) {
      var g = s.indexOf(d);
      g !== -1 && s.splice(g, 1), s.length === 0 && o && c();
    };
    return {
      element: i,
      bind: f,
      destroy: c,
      unbind: h
    };
  }, z_;
}
var HH;
function bTe() {
  if (HH) return k_;
  HH = 1, Object.defineProperty(k_, "__esModule", {
    value: !0
  }), k_.createSensor = void 0;
  var e = wTe(), t = TTe();
  return k_.createSensor = typeof ResizeObserver < "u" ? t.createSensor : e.createSensor, k_;
}
var UH;
function CTe() {
  if (UH) return $u;
  UH = 1, Object.defineProperty($u, "__esModule", {
    value: !0
  }), $u.removeSensor = $u.getSensor = $u.Sensors = void 0;
  var e = n(STe()), t = bTe(), r = l3();
  function n(o) {
    return o && o.__esModule ? o : { default: o };
  }
  var i = $u.Sensors = {};
  function a(o) {
    o && i[o] && delete i[o];
  }
  return $u.getSensor = function(s) {
    var l = s.getAttribute(r.SizeSensorId);
    if (l && i[l])
      return i[l];
    var u = (0, e.default)();
    s.setAttribute(r.SizeSensorId, u);
    var f = (0, t.createSensor)(s, function() {
      return a(u);
    });
    return i[u] = f, f;
  }, $u.removeSensor = function(s) {
    var l = s.element.getAttribute(r.SizeSensorId);
    s.destroy(), a(l);
  }, $u;
}
var WH;
function ATe() {
  if (WH) return Zu;
  WH = 1, Object.defineProperty(Zu, "__esModule", {
    value: !0
  }), Zu.ver = Zu.clear = Zu.bind = void 0;
  var e = CTe();
  return Zu.bind = function(r, n) {
    var i = (0, e.getSensor)(r);
    return i.bind(n), function() {
      i.unbind(n);
    };
  }, Zu.clear = function(r) {
    var n = (0, e.getSensor)(r);
    (0, e.removeSensor)(n);
  }, Zu.ver = "1.0.3", Zu;
}
var XH = ATe();
function YH(e, t) {
  var r = {};
  return t.forEach(function(n) {
    r[n] = e[n];
  }), r;
}
function CE(e) {
  return typeof e == "function";
}
function MTe(e) {
  return typeof e == "string";
}
var AE, ZH;
function LTe() {
  return ZH || (ZH = 1, AE = function e(t, r) {
    if (t === r) return !0;
    if (t && r && typeof t == "object" && typeof r == "object") {
      if (t.constructor !== r.constructor) return !1;
      var n, i, a;
      if (Array.isArray(t)) {
        if (n = t.length, n != r.length) return !1;
        for (i = n; i-- !== 0; )
          if (!e(t[i], r[i])) return !1;
        return !0;
      }
      if (t.constructor === RegExp) return t.source === r.source && t.flags === r.flags;
      if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === r.valueOf();
      if (t.toString !== Object.prototype.toString) return t.toString() === r.toString();
      if (a = Object.keys(t), n = a.length, n !== Object.keys(r).length) return !1;
      for (i = n; i-- !== 0; )
        if (!Object.prototype.hasOwnProperty.call(r, a[i])) return !1;
      for (i = n; i-- !== 0; ) {
        var o = a[i];
        if (!e(t[o], r[o])) return !1;
      }
      return !0;
    }
    return t !== t && r !== r;
  }), AE;
}
var DTe = LTe();
const Qg = /* @__PURE__ */ $H(DTe);
var ETe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r) {
      var n = e.call(this, r) || this;
      return n.echarts = r.echarts, n.ele = null, n.isInitialResize = !0, n.eventHandlerRefs = {}, n;
    }
    return t.prototype.componentDidMount = function() {
      this.renderNewEcharts();
    }, t.prototype.componentDidUpdate = function(r) {
      var n = this.props.shouldSetOption;
      if (!(CE(n) && !n(r, this.props))) {
        if (!Qg(r.theme, this.props.theme) || !Qg(r.opts, this.props.opts)) {
          this.dispose(), this.renderNewEcharts();
          return;
        }
        var i = this.getEchartsInstance();
        Qg(r.onEvents, this.props.onEvents) || (this.unbindEvents(i), this.bindEvents(i, this.props.onEvents));
        var a = ["option", "notMerge", "replaceMerge", "lazyUpdate", "showLoading", "loadingOption"];
        Qg(YH(this.props, a), YH(r, a)) || this.updateEChartsOption(), (!Qg(r.style, this.props.style) || !Qg(r.className, this.props.className)) && this.resize();
      }
    }, t.prototype.componentWillUnmount = function() {
      this.dispose();
    }, t.prototype.initEchartsInstance = function() {
      return B3(this, void 0, void 0, function() {
        var r = this;
        return z3(this, function(n) {
          return [2, new Promise(function(i) {
            r.echarts.init(r.ele, r.props.theme, r.props.opts);
            var a = r.getEchartsInstance();
            a.on("finished", function() {
              var o = r.ele.clientWidth, s = r.ele.clientHeight;
              r.echarts.dispose(r.ele);
              var l = a1({ width: o, height: s }, r.props.opts);
              i(r.echarts.init(r.ele, r.props.theme, l));
            });
          })];
        });
      });
    }, t.prototype.getEchartsInstance = function() {
      return this.echarts.getInstanceByDom(this.ele);
    }, t.prototype.dispose = function() {
      if (this.ele) {
        try {
          XH.clear(this.ele);
        } catch (r) {
          console.warn(r);
        }
        this.echarts.dispose(this.ele);
      }
    }, t.prototype.renderNewEcharts = function() {
      return B3(this, void 0, void 0, function() {
        var r, n, i, a, o, s, l = this;
        return z3(this, function(u) {
          switch (u.label) {
            case 0:
              return r = this.props, n = r.onEvents, i = r.onChartReady, a = r.autoResize, o = a === void 0 ? !0 : a, [4, this.initEchartsInstance()];
            case 1:
              return u.sent(), s = this.updateEChartsOption(), this.bindEvents(s, n || {}), CE(i) && i(s), this.ele && o && XH.bind(this.ele, function() {
                l.resize();
              }), [
                2
                /*return*/
              ];
          }
        });
      });
    }, t.prototype.bindEvents = function(r, n) {
      var i = this, a = function(s, l) {
        if (MTe(s) && CE(l)) {
          var u = function(f) {
            l(f, r);
          };
          r.on(s, u), i.eventHandlerRefs[s] = u;
        }
      };
      for (var o in n)
        Object.prototype.hasOwnProperty.call(n, o) && a(o, n[o]);
    }, t.prototype.unbindEvents = function(r) {
      for (var n = 0, i = Object.entries(this.eventHandlerRefs); n < i.length; n++) {
        var a = i[n], o = a[0], s = a[1];
        r.off(o, s);
      }
      this.eventHandlerRefs = {};
    }, t.prototype.updateEChartsOption = function() {
      var r = this.props, n = r.option, i = r.notMerge, a = i === void 0 ? !1 : i, o = r.replaceMerge, s = o === void 0 ? null : o, l = r.lazyUpdate, u = l === void 0 ? !1 : l, f = r.showLoading, c = r.loadingOption, h = c === void 0 ? null : c, v = this.getEchartsInstance();
      return v.setOption(n, { notMerge: a, replaceMerge: s, lazyUpdate: u }), f ? v.showLoading(h) : v.hideLoading(), v;
    }, t.prototype.resize = function() {
      var r = this.getEchartsInstance();
      if (!this.isInitialResize)
        try {
          r.resize({
            width: "auto",
            height: "auto"
          });
        } catch (n) {
          console.warn(n);
        }
      this.isInitialResize = !1;
    }, t.prototype.render = function() {
      var r = this, n = this.props, i = n.style, a = n.className, o = a === void 0 ? "" : a;
      n.echarts, n.option, n.theme, n.notMerge, n.replaceMerge, n.lazyUpdate, n.showLoading, n.loadingOption, n.opts, n.onChartReady, n.onEvents, n.shouldSetOption, n.autoResize;
      var s = fj(n, ["style", "className", "echarts", "option", "theme", "notMerge", "replaceMerge", "lazyUpdate", "showLoading", "loadingOption", "opts", "onChartReady", "onEvents", "shouldSetOption", "autoResize"]), l = a1({ height: 300 }, i);
      return tj.createElement("div", a1({ ref: function(u) {
        r.ele = u;
      }, style: l, className: "echarts-for-react ".concat(o) }, s));
    }, t;
  })(M1.PureComponent)
), PTe = (
  /** @class */
  (function(e) {
    ae(t, e);
    function t(r) {
      var n = e.call(this, r) || this;
      return n.echarts = r_e, n;
    }
    return t;
  })(ETe)
);
function LZ(e, t, r) {
  return i1.transform(e, function(n, i, a) {
    n[a] = i1.isObject(i) ? LZ(i, t, r) : t.call(r, i, a, e);
  });
}
const ITe = ({
  options: e,
  theme: t,
  onEvents: r,
  height: n,
  width: i,
  renderer: a,
  map: o,
  setStateValue: s,
  setTriggerValue: l
}) => {
  const u = M1.useRef(null), f = "--x_x--0_0--", c = (x) => {
    const S = "custom_theme";
    return i1.isObject(x) && BC(S, x), i1.isObject(x) ? S : x;
  }, h = (x) => {
    let T = new RegExp(
      `${f}\\s*(function\\s*.*)\\s*${f}`
    ).exec(x);
    if (T) {
      const C = T[1];
      return new Function("return " + C)();
    } else
      return x;
  }, v = (x) => LZ(x, h, {}), d = c(t);
  i1.isObject(o) && xO(o.mapName, o.geoJson, o.specialAreas);
  const g = v(e), y = {};
  return Object.keys(r).forEach((x) => {
    const S = r[x];
    y[x] = M1.useCallback(
      (T) => {
        const C = h(S)(T);
        l("chart_event", C);
      },
      [S, l]
    );
  }), /* @__PURE__ */ ME.jsx(
    PTe,
    {
      ref: u,
      option: g,
      notMerge: !0,
      lazyUpdate: !0,
      style: { height: n, width: i },
      theme: d,
      onEvents: y,
      opts: { renderer: a }
    }
  );
}, f2 = /* @__PURE__ */ new WeakMap(), RTe = (e) => {
  const { data: t, parentElement: r, setStateValue: n, setTriggerValue: i } = e, a = r.querySelector(".react-root");
  if (!a)
    throw new Error("Unexpected: React root element not found");
  let o = f2.get(r);
  return o || (o = sj.createRoot(a), f2.set(r, o)), o.render(
    /* @__PURE__ */ ME.jsx(M1.StrictMode, { children: /* @__PURE__ */ ME.jsx(
      ITe,
      {
        ...t,
        setStateValue: n,
        setTriggerValue: i
      }
    ) })
  ), () => {
    const s = f2.get(r);
    s && (s.unmount(), f2.delete(r));
  };
};
export {
  RTe as default
};
