var kT = Object.defineProperty;
var _T = (t, e, r) => e in t ? kT(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
var Tr = (t, e, r) => _T(t, typeof e != "symbol" ? e + "" : e, r);
import { Loading as Kp, CircleCheck as TT, CircleClose as Gp, View as IT, Hide as OT, Close as Xs, ArrowDown as Vo, CaretRight as AT, CopyDocument as PT, ArrowUp as Up, Edit as DT, Delete as RT, Finished as LT, Aim as FT, Lock as MT, Unlock as NT, ZoomIn as BT, ZoomOut as $T, Warning as bl, Search as xE } from "@element-plus/icons-vue";
import { getCurrentScope as qT, onScopeDispose as zT, unref as P, getCurrentInstance as mt, onMounted as St, nextTick as ot, watch as Re, ref as de, warn as VT, computed as j, inject as Ue, isRef as yi, shallowRef as xn, onBeforeUnmount as Zr, onBeforeMount as HT, provide as Et, defineComponent as Se, openBlock as q, createElementBlock as ie, mergeProps as Ur, renderSlot as Fe, toRef as Gr, onUnmounted as KT, useAttrs as GT, useSlots as Ho, createCommentVNode as pe, Fragment as je, normalizeClass as le, createElementVNode as ae, createBlock as me, withCtx as U, resolveDynamicComponent as rr, withModifiers as pt, createVNode as J, toDisplayString as ke, normalizeStyle as st, Transition as Ai, withDirectives as Ye, vShow as dt, reactive as on, onActivated as UT, onUpdated as EE, cloneVNode as WT, Text as SE, Comment as jT, Teleport as YT, readonly as ZT, onDeactivated as XT, createTextVNode as Be, toRaw as Js, vModelCheckbox as Qs, toRefs as Ko, toHandlers as JT, watchEffect as kE, renderList as Lt, withKeys as ma, resolveComponent as tr, resolveDirective as QT, toHandlerKey as eI, vModelText as tI, h as ba, createApp as rI, pushScopeId as Ba, popScopeId as $a, createStaticVNode as nI } from "vue";
const mn = (t, e, { checkForDefaultPrevented: r = !0 } = {}) => (a) => {
  const i = t == null ? void 0 : t(a);
  if (r === !1 || !i)
    return e == null ? void 0 : e(a);
};
var wy;
const It = typeof window < "u", aI = (t) => typeof t == "string", _E = () => {
}, cp = It && ((wy = window == null ? void 0 : window.navigator) == null ? void 0 : wy.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
function TE(t) {
  return typeof t == "function" ? t() : P(t);
}
function iI(t) {
  return t;
}
function wl(t) {
  return qT() ? (zT(t), !0) : !1;
}
function oI(t, e = !0) {
  mt() ? St(t) : e ? t() : ot(t);
}
function Cn(t) {
  var e;
  const r = TE(t);
  return (e = r == null ? void 0 : r.$el) != null ? e : r;
}
const Cl = It ? window : void 0;
function Ar(...t) {
  let e, r, n, a;
  if (aI(t[0]) || Array.isArray(t[0]) ? ([r, n, a] = t, e = Cl) : [e, r, n, a] = t, !e)
    return _E;
  Array.isArray(r) || (r = [r]), Array.isArray(n) || (n = [n]);
  const i = [], o = () => {
    i.forEach((c) => c()), i.length = 0;
  }, s = (c, d, f, h) => (c.addEventListener(d, f, h), () => c.removeEventListener(d, f, h)), u = Re(() => [Cn(e), TE(a)], ([c, d]) => {
    o(), c && i.push(...r.flatMap((f) => n.map((h) => s(c, f, h, d))));
  }, { immediate: !0, flush: "post" }), l = () => {
    u(), o();
  };
  return wl(l), l;
}
let Cy = !1;
function sI(t, e, r = {}) {
  const { window: n = Cl, ignore: a = [], capture: i = !0, detectIframe: o = !1 } = r;
  if (!n)
    return;
  cp && !Cy && (Cy = !0, Array.from(n.document.body.children).forEach((f) => f.addEventListener("click", _E)));
  let s = !0;
  const u = (f) => a.some((h) => {
    if (typeof h == "string")
      return Array.from(n.document.querySelectorAll(h)).some((v) => v === f.target || f.composedPath().includes(v));
    {
      const v = Cn(h);
      return v && (f.target === v || f.composedPath().includes(v));
    }
  }), c = [
    Ar(n, "click", (f) => {
      const h = Cn(t);
      if (!(!h || h === f.target || f.composedPath().includes(h))) {
        if (f.detail === 0 && (s = !u(f)), !s) {
          s = !0;
          return;
        }
        e(f);
      }
    }, { passive: !0, capture: i }),
    Ar(n, "pointerdown", (f) => {
      const h = Cn(t);
      h && (s = !f.composedPath().includes(h) && !u(f));
    }, { passive: !0 }),
    o && Ar(n, "blur", (f) => {
      var h;
      const v = Cn(t);
      ((h = n.document.activeElement) == null ? void 0 : h.tagName) === "IFRAME" && !(v != null && v.contains(n.document.activeElement)) && e(f);
    })
  ].filter(Boolean);
  return () => c.forEach((f) => f());
}
function IE(t, e = !1) {
  const r = de(), n = () => r.value = !!t();
  return n(), oI(n, e), r;
}
const xy = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Ey = "__vueuse_ssr_handlers__";
xy[Ey] = xy[Ey] || {};
var Sy = Object.getOwnPropertySymbols, lI = Object.prototype.hasOwnProperty, uI = Object.prototype.propertyIsEnumerable, cI = (t, e) => {
  var r = {};
  for (var n in t)
    lI.call(t, n) && e.indexOf(n) < 0 && (r[n] = t[n]);
  if (t != null && Sy)
    for (var n of Sy(t))
      e.indexOf(n) < 0 && uI.call(t, n) && (r[n] = t[n]);
  return r;
};
function bn(t, e, r = {}) {
  const n = r, { window: a = Cl } = n, i = cI(n, ["window"]);
  let o;
  const s = IE(() => a && "ResizeObserver" in a), u = () => {
    o && (o.disconnect(), o = void 0);
  }, l = Re(() => Cn(t), (d) => {
    u(), s.value && a && d && (o = new ResizeObserver(e), o.observe(d, i));
  }, { immediate: !0, flush: "post" }), c = () => {
    u(), l();
  };
  return wl(c), {
    isSupported: s,
    stop: c
  };
}
var ky = Object.getOwnPropertySymbols, dI = Object.prototype.hasOwnProperty, fI = Object.prototype.propertyIsEnumerable, vI = (t, e) => {
  var r = {};
  for (var n in t)
    dI.call(t, n) && e.indexOf(n) < 0 && (r[n] = t[n]);
  if (t != null && ky)
    for (var n of ky(t))
      e.indexOf(n) < 0 && fI.call(t, n) && (r[n] = t[n]);
  return r;
};
function hI(t, e, r = {}) {
  const n = r, { window: a = Cl } = n, i = vI(n, ["window"]);
  let o;
  const s = IE(() => a && "MutationObserver" in a), u = () => {
    o && (o.disconnect(), o = void 0);
  }, l = Re(() => Cn(t), (d) => {
    u(), s.value && a && d && (o = new MutationObserver(e), o.observe(d, i));
  }, { immediate: !0 }), c = () => {
    u(), l();
  };
  return wl(c), {
    isSupported: s,
    stop: c
  };
}
var _y;
(function(t) {
  t.UP = "UP", t.RIGHT = "RIGHT", t.DOWN = "DOWN", t.LEFT = "LEFT", t.NONE = "NONE";
})(_y || (_y = {}));
var pI = Object.defineProperty, Ty = Object.getOwnPropertySymbols, gI = Object.prototype.hasOwnProperty, yI = Object.prototype.propertyIsEnumerable, Iy = (t, e, r) => e in t ? pI(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, mI = (t, e) => {
  for (var r in e || (e = {}))
    gI.call(e, r) && Iy(t, r, e[r]);
  if (Ty)
    for (var r of Ty(e))
      yI.call(e, r) && Iy(t, r, e[r]);
  return t;
};
const bI = {
  easeInSine: [0.12, 0, 0.39, 0],
  easeOutSine: [0.61, 1, 0.88, 1],
  easeInOutSine: [0.37, 0, 0.63, 1],
  easeInQuad: [0.11, 0, 0.5, 0],
  easeOutQuad: [0.5, 1, 0.89, 1],
  easeInOutQuad: [0.45, 0, 0.55, 1],
  easeInCubic: [0.32, 0, 0.67, 0],
  easeOutCubic: [0.33, 1, 0.68, 1],
  easeInOutCubic: [0.65, 0, 0.35, 1],
  easeInQuart: [0.5, 0, 0.75, 0],
  easeOutQuart: [0.25, 1, 0.5, 1],
  easeInOutQuart: [0.76, 0, 0.24, 1],
  easeInQuint: [0.64, 0, 0.78, 0],
  easeOutQuint: [0.22, 1, 0.36, 1],
  easeInOutQuint: [0.83, 0, 0.17, 1],
  easeInExpo: [0.7, 0, 0.84, 0],
  easeOutExpo: [0.16, 1, 0.3, 1],
  easeInOutExpo: [0.87, 0, 0.13, 1],
  easeInCirc: [0.55, 0, 1, 0.45],
  easeOutCirc: [0, 0.55, 0.45, 1],
  easeInOutCirc: [0.85, 0, 0.15, 1],
  easeInBack: [0.36, 0, 0.66, -0.56],
  easeOutBack: [0.34, 1.56, 0.64, 1],
  easeInOutBack: [0.68, -0.6, 0.32, 1.6]
};
mI({
  linear: iI
}, bI);
const wI = () => It && /firefox/i.test(window.navigator.userAgent), Wp = (t) => {
  let e, r;
  return t.type === "touchend" ? (r = t.changedTouches[0].clientY, e = t.changedTouches[0].clientX) : t.type.startsWith("touch") ? (r = t.touches[0].clientY, e = t.touches[0].clientX) : (r = t.clientY, e = t.clientX), {
    clientX: e,
    clientY: r
  };
};
/**
* @vue/shared v3.4.27
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
process.env.NODE_ENV !== "production" && Object.freeze({});
process.env.NODE_ENV !== "production" && Object.freeze([]);
const Eo = () => {
}, CI = Object.prototype.hasOwnProperty, Ta = (t, e) => CI.call(t, e), hr = Array.isArray, cr = (t) => typeof t == "function", nr = (t) => typeof t == "string", Gt = (t) => t !== null && typeof t == "object", xI = Object.prototype.toString, EI = (t) => xI.call(t), gu = (t) => EI(t).slice(8, -1), OE = (t) => {
  const e = /* @__PURE__ */ Object.create(null);
  return (r) => e[r] || (e[r] = t(r));
}, SI = /-(\w)/g, kI = OE((t) => t.replace(SI, (e, r) => r ? r.toUpperCase() : "")), _I = /\B([A-Z])/g, TI = OE(
  (t) => t.replace(_I, "-$1").toLowerCase()
);
var AE = typeof global == "object" && global && global.Object === Object && global, II = typeof self == "object" && self && self.Object === Object && self, dn = AE || II || Function("return this")(), sn = dn.Symbol, PE = Object.prototype, OI = PE.hasOwnProperty, AI = PE.toString, Xi = sn ? sn.toStringTag : void 0;
function PI(t) {
  var e = OI.call(t, Xi), r = t[Xi];
  try {
    t[Xi] = void 0;
    var n = !0;
  } catch {
  }
  var a = AI.call(t);
  return n && (e ? t[Xi] = r : delete t[Xi]), a;
}
var DI = Object.prototype, RI = DI.toString;
function LI(t) {
  return RI.call(t);
}
var FI = "[object Null]", MI = "[object Undefined]", Oy = sn ? sn.toStringTag : void 0;
function Pi(t) {
  return t == null ? t === void 0 ? MI : FI : Oy && Oy in Object(t) ? PI(t) : LI(t);
}
function mi(t) {
  return t != null && typeof t == "object";
}
var NI = "[object Symbol]";
function xl(t) {
  return typeof t == "symbol" || mi(t) && Pi(t) == NI;
}
function BI(t, e) {
  for (var r = -1, n = t == null ? 0 : t.length, a = Array(n); ++r < n; )
    a[r] = e(t[r], r, t);
  return a;
}
var jr = Array.isArray, $I = 1 / 0, Ay = sn ? sn.prototype : void 0, Py = Ay ? Ay.toString : void 0;
function DE(t) {
  if (typeof t == "string")
    return t;
  if (jr(t))
    return BI(t, DE) + "";
  if (xl(t))
    return Py ? Py.call(t) : "";
  var e = t + "";
  return e == "0" && 1 / t == -$I ? "-0" : e;
}
var qI = /\s/;
function zI(t) {
  for (var e = t.length; e-- && qI.test(t.charAt(e)); )
    ;
  return e;
}
var VI = /^\s+/;
function HI(t) {
  return t && t.slice(0, zI(t) + 1).replace(VI, "");
}
function Jn(t) {
  var e = typeof t;
  return t != null && (e == "object" || e == "function");
}
var Dy = NaN, KI = /^[-+]0x[0-9a-f]+$/i, GI = /^0b[01]+$/i, UI = /^0o[0-7]+$/i, WI = parseInt;
function Ry(t) {
  if (typeof t == "number")
    return t;
  if (xl(t))
    return Dy;
  if (Jn(t)) {
    var e = typeof t.valueOf == "function" ? t.valueOf() : t;
    t = Jn(e) ? e + "" : e;
  }
  if (typeof t != "string")
    return t === 0 ? t : +t;
  t = HI(t);
  var r = GI.test(t);
  return r || UI.test(t) ? WI(t.slice(2), r ? 2 : 8) : KI.test(t) ? Dy : +t;
}
function RE(t) {
  return t;
}
var jI = "[object AsyncFunction]", YI = "[object Function]", ZI = "[object GeneratorFunction]", XI = "[object Proxy]";
function LE(t) {
  if (!Jn(t))
    return !1;
  var e = Pi(t);
  return e == YI || e == ZI || e == jI || e == XI;
}
var yu = dn["__core-js_shared__"], Ly = function() {
  var t = /[^.]+$/.exec(yu && yu.keys && yu.keys.IE_PROTO || "");
  return t ? "Symbol(src)_1." + t : "";
}();
function JI(t) {
  return !!Ly && Ly in t;
}
var QI = Function.prototype, eO = QI.toString;
function qa(t) {
  if (t != null) {
    try {
      return eO.call(t);
    } catch {
    }
    try {
      return t + "";
    } catch {
    }
  }
  return "";
}
var tO = /[\\^$.*+?()[\]{}|]/g, rO = /^\[object .+?Constructor\]$/, nO = Function.prototype, aO = Object.prototype, iO = nO.toString, oO = aO.hasOwnProperty, sO = RegExp(
  "^" + iO.call(oO).replace(tO, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function lO(t) {
  if (!Jn(t) || JI(t))
    return !1;
  var e = LE(t) ? sO : rO;
  return e.test(qa(t));
}
function uO(t, e) {
  return t == null ? void 0 : t[e];
}
function za(t, e) {
  var r = uO(t, e);
  return lO(r) ? r : void 0;
}
var dp = za(dn, "WeakMap");
function cO(t, e, r) {
  switch (r.length) {
    case 0:
      return t.call(e);
    case 1:
      return t.call(e, r[0]);
    case 2:
      return t.call(e, r[0], r[1]);
    case 3:
      return t.call(e, r[0], r[1], r[2]);
  }
  return t.apply(e, r);
}
var dO = 800, fO = 16, vO = Date.now;
function hO(t) {
  var e = 0, r = 0;
  return function() {
    var n = vO(), a = fO - (n - r);
    if (r = n, a > 0) {
      if (++e >= dO)
        return arguments[0];
    } else
      e = 0;
    return t.apply(void 0, arguments);
  };
}
function pO(t) {
  return function() {
    return t;
  };
}
var el = function() {
  try {
    var t = za(Object, "defineProperty");
    return t({}, "", {}), t;
  } catch {
  }
}(), gO = el ? function(t, e) {
  return el(t, "toString", {
    configurable: !0,
    enumerable: !1,
    value: pO(e),
    writable: !0
  });
} : RE, yO = hO(gO);
function mO(t, e, r, n) {
  t.length;
  for (var a = r + 1; a--; )
    if (e(t[a], a, t))
      return a;
  return -1;
}
var bO = 9007199254740991, wO = /^(?:0|[1-9]\d*)$/;
function jp(t, e) {
  var r = typeof t;
  return e = e ?? bO, !!e && (r == "number" || r != "symbol" && wO.test(t)) && t > -1 && t % 1 == 0 && t < e;
}
function CO(t, e, r) {
  e == "__proto__" && el ? el(t, e, {
    configurable: !0,
    enumerable: !0,
    value: r,
    writable: !0
  }) : t[e] = r;
}
function Yp(t, e) {
  return t === e || t !== t && e !== e;
}
var xO = Object.prototype, EO = xO.hasOwnProperty;
function SO(t, e, r) {
  var n = t[e];
  (!(EO.call(t, e) && Yp(n, r)) || r === void 0 && !(e in t)) && CO(t, e, r);
}
var Fy = Math.max;
function kO(t, e, r) {
  return e = Fy(e === void 0 ? t.length - 1 : e, 0), function() {
    for (var n = arguments, a = -1, i = Fy(n.length - e, 0), o = Array(i); ++a < i; )
      o[a] = n[e + a];
    a = -1;
    for (var s = Array(e + 1); ++a < e; )
      s[a] = n[a];
    return s[e] = r(o), cO(t, this, s);
  };
}
var _O = 9007199254740991;
function Zp(t) {
  return typeof t == "number" && t > -1 && t % 1 == 0 && t <= _O;
}
function TO(t) {
  return t != null && Zp(t.length) && !LE(t);
}
var IO = Object.prototype;
function OO(t) {
  var e = t && t.constructor, r = typeof e == "function" && e.prototype || IO;
  return t === r;
}
function AO(t, e) {
  for (var r = -1, n = Array(t); ++r < t; )
    n[r] = e(r);
  return n;
}
var PO = "[object Arguments]";
function My(t) {
  return mi(t) && Pi(t) == PO;
}
var FE = Object.prototype, DO = FE.hasOwnProperty, RO = FE.propertyIsEnumerable, Xp = My(/* @__PURE__ */ function() {
  return arguments;
}()) ? My : function(t) {
  return mi(t) && DO.call(t, "callee") && !RO.call(t, "callee");
};
function LO() {
  return !1;
}
var ME = typeof exports == "object" && exports && !exports.nodeType && exports, Ny = ME && typeof module == "object" && module && !module.nodeType && module, FO = Ny && Ny.exports === ME, By = FO ? dn.Buffer : void 0, MO = By ? By.isBuffer : void 0, fp = MO || LO, NO = "[object Arguments]", BO = "[object Array]", $O = "[object Boolean]", qO = "[object Date]", zO = "[object Error]", VO = "[object Function]", HO = "[object Map]", KO = "[object Number]", GO = "[object Object]", UO = "[object RegExp]", WO = "[object Set]", jO = "[object String]", YO = "[object WeakMap]", ZO = "[object ArrayBuffer]", XO = "[object DataView]", JO = "[object Float32Array]", QO = "[object Float64Array]", eA = "[object Int8Array]", tA = "[object Int16Array]", rA = "[object Int32Array]", nA = "[object Uint8Array]", aA = "[object Uint8ClampedArray]", iA = "[object Uint16Array]", oA = "[object Uint32Array]", vt = {};
vt[JO] = vt[QO] = vt[eA] = vt[tA] = vt[rA] = vt[nA] = vt[aA] = vt[iA] = vt[oA] = !0;
vt[NO] = vt[BO] = vt[ZO] = vt[$O] = vt[XO] = vt[qO] = vt[zO] = vt[VO] = vt[HO] = vt[KO] = vt[GO] = vt[UO] = vt[WO] = vt[jO] = vt[YO] = !1;
function sA(t) {
  return mi(t) && Zp(t.length) && !!vt[Pi(t)];
}
function lA(t) {
  return function(e) {
    return t(e);
  };
}
var NE = typeof exports == "object" && exports && !exports.nodeType && exports, yo = NE && typeof module == "object" && module && !module.nodeType && module, uA = yo && yo.exports === NE, mu = uA && AE.process, $y = function() {
  try {
    var t = yo && yo.require && yo.require("util").types;
    return t || mu && mu.binding && mu.binding("util");
  } catch {
  }
}(), qy = $y && $y.isTypedArray, BE = qy ? lA(qy) : sA, cA = Object.prototype, dA = cA.hasOwnProperty;
function fA(t, e) {
  var r = jr(t), n = !r && Xp(t), a = !r && !n && fp(t), i = !r && !n && !a && BE(t), o = r || n || a || i, s = o ? AO(t.length, String) : [], u = s.length;
  for (var l in t)
    dA.call(t, l) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode.
    (l == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
    a && (l == "offset" || l == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
    i && (l == "buffer" || l == "byteLength" || l == "byteOffset") || // Skip index properties.
    jp(l, u))) && s.push(l);
  return s;
}
function vA(t, e) {
  return function(r) {
    return t(e(r));
  };
}
var hA = vA(Object.keys, Object), pA = Object.prototype, gA = pA.hasOwnProperty;
function yA(t) {
  if (!OO(t))
    return hA(t);
  var e = [];
  for (var r in Object(t))
    gA.call(t, r) && r != "constructor" && e.push(r);
  return e;
}
function $E(t) {
  return TO(t) ? fA(t) : yA(t);
}
var mA = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, bA = /^\w*$/;
function Jp(t, e) {
  if (jr(t))
    return !1;
  var r = typeof t;
  return r == "number" || r == "symbol" || r == "boolean" || t == null || xl(t) ? !0 : bA.test(t) || !mA.test(t) || e != null && t in Object(e);
}
var So = za(Object, "create");
function wA() {
  this.__data__ = So ? So(null) : {}, this.size = 0;
}
function CA(t) {
  var e = this.has(t) && delete this.__data__[t];
  return this.size -= e ? 1 : 0, e;
}
var xA = "__lodash_hash_undefined__", EA = Object.prototype, SA = EA.hasOwnProperty;
function kA(t) {
  var e = this.__data__;
  if (So) {
    var r = e[t];
    return r === xA ? void 0 : r;
  }
  return SA.call(e, t) ? e[t] : void 0;
}
var _A = Object.prototype, TA = _A.hasOwnProperty;
function IA(t) {
  var e = this.__data__;
  return So ? e[t] !== void 0 : TA.call(e, t);
}
var OA = "__lodash_hash_undefined__";
function AA(t, e) {
  var r = this.__data__;
  return this.size += this.has(t) ? 0 : 1, r[t] = So && e === void 0 ? OA : e, this;
}
function Ia(t) {
  var e = -1, r = t == null ? 0 : t.length;
  for (this.clear(); ++e < r; ) {
    var n = t[e];
    this.set(n[0], n[1]);
  }
}
Ia.prototype.clear = wA;
Ia.prototype.delete = CA;
Ia.prototype.get = kA;
Ia.prototype.has = IA;
Ia.prototype.set = AA;
function PA() {
  this.__data__ = [], this.size = 0;
}
function El(t, e) {
  for (var r = t.length; r--; )
    if (Yp(t[r][0], e))
      return r;
  return -1;
}
var DA = Array.prototype, RA = DA.splice;
function LA(t) {
  var e = this.__data__, r = El(e, t);
  if (r < 0)
    return !1;
  var n = e.length - 1;
  return r == n ? e.pop() : RA.call(e, r, 1), --this.size, !0;
}
function FA(t) {
  var e = this.__data__, r = El(e, t);
  return r < 0 ? void 0 : e[r][1];
}
function MA(t) {
  return El(this.__data__, t) > -1;
}
function NA(t, e) {
  var r = this.__data__, n = El(r, t);
  return n < 0 ? (++this.size, r.push([t, e])) : r[n][1] = e, this;
}
function In(t) {
  var e = -1, r = t == null ? 0 : t.length;
  for (this.clear(); ++e < r; ) {
    var n = t[e];
    this.set(n[0], n[1]);
  }
}
In.prototype.clear = PA;
In.prototype.delete = LA;
In.prototype.get = FA;
In.prototype.has = MA;
In.prototype.set = NA;
var ko = za(dn, "Map");
function BA() {
  this.size = 0, this.__data__ = {
    hash: new Ia(),
    map: new (ko || In)(),
    string: new Ia()
  };
}
function $A(t) {
  var e = typeof t;
  return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
}
function Sl(t, e) {
  var r = t.__data__;
  return $A(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
}
function qA(t) {
  var e = Sl(this, t).delete(t);
  return this.size -= e ? 1 : 0, e;
}
function zA(t) {
  return Sl(this, t).get(t);
}
function VA(t) {
  return Sl(this, t).has(t);
}
function HA(t, e) {
  var r = Sl(this, t), n = r.size;
  return r.set(t, e), this.size += r.size == n ? 0 : 1, this;
}
function On(t) {
  var e = -1, r = t == null ? 0 : t.length;
  for (this.clear(); ++e < r; ) {
    var n = t[e];
    this.set(n[0], n[1]);
  }
}
On.prototype.clear = BA;
On.prototype.delete = qA;
On.prototype.get = zA;
On.prototype.has = VA;
On.prototype.set = HA;
var KA = "Expected a function";
function Qp(t, e) {
  if (typeof t != "function" || e != null && typeof e != "function")
    throw new TypeError(KA);
  var r = function() {
    var n = arguments, a = e ? e.apply(this, n) : n[0], i = r.cache;
    if (i.has(a))
      return i.get(a);
    var o = t.apply(this, n);
    return r.cache = i.set(a, o) || i, o;
  };
  return r.cache = new (Qp.Cache || On)(), r;
}
Qp.Cache = On;
var GA = 500;
function UA(t) {
  var e = Qp(t, function(n) {
    return r.size === GA && r.clear(), n;
  }), r = e.cache;
  return e;
}
var WA = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, jA = /\\(\\)?/g, YA = UA(function(t) {
  var e = [];
  return t.charCodeAt(0) === 46 && e.push(""), t.replace(WA, function(r, n, a, i) {
    e.push(a ? i.replace(jA, "$1") : n || r);
  }), e;
});
function ZA(t) {
  return t == null ? "" : DE(t);
}
function kl(t, e) {
  return jr(t) ? t : Jp(t, e) ? [t] : YA(ZA(t));
}
var XA = 1 / 0;
function Go(t) {
  if (typeof t == "string" || xl(t))
    return t;
  var e = t + "";
  return e == "0" && 1 / t == -XA ? "-0" : e;
}
function eg(t, e) {
  e = kl(e, t);
  for (var r = 0, n = e.length; t != null && r < n; )
    t = t[Go(e[r++])];
  return r && r == n ? t : void 0;
}
function wn(t, e, r) {
  var n = t == null ? void 0 : eg(t, e);
  return n === void 0 ? r : n;
}
function qE(t, e) {
  for (var r = -1, n = e.length, a = t.length; ++r < n; )
    t[a + r] = e[r];
  return t;
}
var zy = sn ? sn.isConcatSpreadable : void 0;
function JA(t) {
  return jr(t) || Xp(t) || !!(zy && t && t[zy]);
}
function QA(t, e, r, n, a) {
  var i = -1, o = t.length;
  for (r || (r = JA), a || (a = []); ++i < o; ) {
    var s = t[i];
    r(s) ? qE(a, s) : a[a.length] = s;
  }
  return a;
}
function eP(t) {
  var e = t == null ? 0 : t.length;
  return e ? QA(t) : [];
}
function tP(t) {
  return yO(kO(t, void 0, eP), t + "");
}
function Kn() {
  if (!arguments.length)
    return [];
  var t = arguments[0];
  return jr(t) ? t : [t];
}
function rP() {
  this.__data__ = new In(), this.size = 0;
}
function nP(t) {
  var e = this.__data__, r = e.delete(t);
  return this.size = e.size, r;
}
function aP(t) {
  return this.__data__.get(t);
}
function iP(t) {
  return this.__data__.has(t);
}
var oP = 200;
function sP(t, e) {
  var r = this.__data__;
  if (r instanceof In) {
    var n = r.__data__;
    if (!ko || n.length < oP - 1)
      return n.push([t, e]), this.size = ++r.size, this;
    r = this.__data__ = new On(n);
  }
  return r.set(t, e), this.size = r.size, this;
}
function En(t) {
  var e = this.__data__ = new In(t);
  this.size = e.size;
}
En.prototype.clear = rP;
En.prototype.delete = nP;
En.prototype.get = aP;
En.prototype.has = iP;
En.prototype.set = sP;
function lP(t, e) {
  for (var r = -1, n = t == null ? 0 : t.length, a = 0, i = []; ++r < n; ) {
    var o = t[r];
    e(o, r, t) && (i[a++] = o);
  }
  return i;
}
function uP() {
  return [];
}
var cP = Object.prototype, dP = cP.propertyIsEnumerable, Vy = Object.getOwnPropertySymbols, fP = Vy ? function(t) {
  return t == null ? [] : (t = Object(t), lP(Vy(t), function(e) {
    return dP.call(t, e);
  }));
} : uP;
function vP(t, e, r) {
  var n = e(t);
  return jr(t) ? n : qE(n, r(t));
}
function Hy(t) {
  return vP(t, $E, fP);
}
var vp = za(dn, "DataView"), hp = za(dn, "Promise"), pp = za(dn, "Set"), Ky = "[object Map]", hP = "[object Object]", Gy = "[object Promise]", Uy = "[object Set]", Wy = "[object WeakMap]", jy = "[object DataView]", pP = qa(vp), gP = qa(ko), yP = qa(hp), mP = qa(pp), bP = qa(dp), Hn = Pi;
(vp && Hn(new vp(new ArrayBuffer(1))) != jy || ko && Hn(new ko()) != Ky || hp && Hn(hp.resolve()) != Gy || pp && Hn(new pp()) != Uy || dp && Hn(new dp()) != Wy) && (Hn = function(t) {
  var e = Pi(t), r = e == hP ? t.constructor : void 0, n = r ? qa(r) : "";
  if (n)
    switch (n) {
      case pP:
        return jy;
      case gP:
        return Ky;
      case yP:
        return Gy;
      case mP:
        return Uy;
      case bP:
        return Wy;
    }
  return e;
});
var Yy = dn.Uint8Array, wP = "__lodash_hash_undefined__";
function CP(t) {
  return this.__data__.set(t, wP), this;
}
function xP(t) {
  return this.__data__.has(t);
}
function tl(t) {
  var e = -1, r = t == null ? 0 : t.length;
  for (this.__data__ = new On(); ++e < r; )
    this.add(t[e]);
}
tl.prototype.add = tl.prototype.push = CP;
tl.prototype.has = xP;
function EP(t, e) {
  for (var r = -1, n = t == null ? 0 : t.length; ++r < n; )
    if (e(t[r], r, t))
      return !0;
  return !1;
}
function SP(t, e) {
  return t.has(e);
}
var kP = 1, _P = 2;
function zE(t, e, r, n, a, i) {
  var o = r & kP, s = t.length, u = e.length;
  if (s != u && !(o && u > s))
    return !1;
  var l = i.get(t), c = i.get(e);
  if (l && c)
    return l == e && c == t;
  var d = -1, f = !0, h = r & _P ? new tl() : void 0;
  for (i.set(t, e), i.set(e, t); ++d < s; ) {
    var v = t[d], p = e[d];
    if (n)
      var g = o ? n(p, v, d, e, t, i) : n(v, p, d, t, e, i);
    if (g !== void 0) {
      if (g)
        continue;
      f = !1;
      break;
    }
    if (h) {
      if (!EP(e, function(y, m) {
        if (!SP(h, m) && (v === y || a(v, y, r, n, i)))
          return h.push(m);
      })) {
        f = !1;
        break;
      }
    } else if (!(v === p || a(v, p, r, n, i))) {
      f = !1;
      break;
    }
  }
  return i.delete(t), i.delete(e), f;
}
function TP(t) {
  var e = -1, r = Array(t.size);
  return t.forEach(function(n, a) {
    r[++e] = [a, n];
  }), r;
}
function IP(t) {
  var e = -1, r = Array(t.size);
  return t.forEach(function(n) {
    r[++e] = n;
  }), r;
}
var OP = 1, AP = 2, PP = "[object Boolean]", DP = "[object Date]", RP = "[object Error]", LP = "[object Map]", FP = "[object Number]", MP = "[object RegExp]", NP = "[object Set]", BP = "[object String]", $P = "[object Symbol]", qP = "[object ArrayBuffer]", zP = "[object DataView]", Zy = sn ? sn.prototype : void 0, bu = Zy ? Zy.valueOf : void 0;
function VP(t, e, r, n, a, i, o) {
  switch (r) {
    case zP:
      if (t.byteLength != e.byteLength || t.byteOffset != e.byteOffset)
        return !1;
      t = t.buffer, e = e.buffer;
    case qP:
      return !(t.byteLength != e.byteLength || !i(new Yy(t), new Yy(e)));
    case PP:
    case DP:
    case FP:
      return Yp(+t, +e);
    case RP:
      return t.name == e.name && t.message == e.message;
    case MP:
    case BP:
      return t == e + "";
    case LP:
      var s = TP;
    case NP:
      var u = n & OP;
      if (s || (s = IP), t.size != e.size && !u)
        return !1;
      var l = o.get(t);
      if (l)
        return l == e;
      n |= AP, o.set(t, e);
      var c = zE(s(t), s(e), n, a, i, o);
      return o.delete(t), c;
    case $P:
      if (bu)
        return bu.call(t) == bu.call(e);
  }
  return !1;
}
var HP = 1, KP = Object.prototype, GP = KP.hasOwnProperty;
function UP(t, e, r, n, a, i) {
  var o = r & HP, s = Hy(t), u = s.length, l = Hy(e), c = l.length;
  if (u != c && !o)
    return !1;
  for (var d = u; d--; ) {
    var f = s[d];
    if (!(o ? f in e : GP.call(e, f)))
      return !1;
  }
  var h = i.get(t), v = i.get(e);
  if (h && v)
    return h == e && v == t;
  var p = !0;
  i.set(t, e), i.set(e, t);
  for (var g = o; ++d < u; ) {
    f = s[d];
    var y = t[f], m = e[f];
    if (n)
      var b = o ? n(m, y, f, e, t, i) : n(y, m, f, t, e, i);
    if (!(b === void 0 ? y === m || a(y, m, r, n, i) : b)) {
      p = !1;
      break;
    }
    g || (g = f == "constructor");
  }
  if (p && !g) {
    var w = t.constructor, x = e.constructor;
    w != x && "constructor" in t && "constructor" in e && !(typeof w == "function" && w instanceof w && typeof x == "function" && x instanceof x) && (p = !1);
  }
  return i.delete(t), i.delete(e), p;
}
var WP = 1, Xy = "[object Arguments]", Jy = "[object Array]", gs = "[object Object]", jP = Object.prototype, Qy = jP.hasOwnProperty;
function YP(t, e, r, n, a, i) {
  var o = jr(t), s = jr(e), u = o ? Jy : Hn(t), l = s ? Jy : Hn(e);
  u = u == Xy ? gs : u, l = l == Xy ? gs : l;
  var c = u == gs, d = l == gs, f = u == l;
  if (f && fp(t)) {
    if (!fp(e))
      return !1;
    o = !0, c = !1;
  }
  if (f && !c)
    return i || (i = new En()), o || BE(t) ? zE(t, e, r, n, a, i) : VP(t, e, u, r, n, a, i);
  if (!(r & WP)) {
    var h = c && Qy.call(t, "__wrapped__"), v = d && Qy.call(e, "__wrapped__");
    if (h || v) {
      var p = h ? t.value() : t, g = v ? e.value() : e;
      return i || (i = new En()), a(p, g, r, n, i);
    }
  }
  return f ? (i || (i = new En()), UP(t, e, r, n, a, i)) : !1;
}
function _l(t, e, r, n, a) {
  return t === e ? !0 : t == null || e == null || !mi(t) && !mi(e) ? t !== t && e !== e : YP(t, e, r, n, _l, a);
}
var ZP = 1, XP = 2;
function JP(t, e, r, n) {
  var a = r.length, i = a;
  if (t == null)
    return !i;
  for (t = Object(t); a--; ) {
    var o = r[a];
    if (o[2] ? o[1] !== t[o[0]] : !(o[0] in t))
      return !1;
  }
  for (; ++a < i; ) {
    o = r[a];
    var s = o[0], u = t[s], l = o[1];
    if (o[2]) {
      if (u === void 0 && !(s in t))
        return !1;
    } else {
      var c = new En(), d;
      if (!(d === void 0 ? _l(l, u, ZP | XP, n, c) : d))
        return !1;
    }
  }
  return !0;
}
function VE(t) {
  return t === t && !Jn(t);
}
function QP(t) {
  for (var e = $E(t), r = e.length; r--; ) {
    var n = e[r], a = t[n];
    e[r] = [n, a, VE(a)];
  }
  return e;
}
function HE(t, e) {
  return function(r) {
    return r == null ? !1 : r[t] === e && (e !== void 0 || t in Object(r));
  };
}
function eD(t) {
  var e = QP(t);
  return e.length == 1 && e[0][2] ? HE(e[0][0], e[0][1]) : function(r) {
    return r === t || JP(r, t, e);
  };
}
function tD(t, e) {
  return t != null && e in Object(t);
}
function rD(t, e, r) {
  e = kl(e, t);
  for (var n = -1, a = e.length, i = !1; ++n < a; ) {
    var o = Go(e[n]);
    if (!(i = t != null && r(t, o)))
      break;
    t = t[o];
  }
  return i || ++n != a ? i : (a = t == null ? 0 : t.length, !!a && Zp(a) && jp(o, a) && (jr(t) || Xp(t)));
}
function KE(t, e) {
  return t != null && rD(t, e, tD);
}
var nD = 1, aD = 2;
function iD(t, e) {
  return Jp(t) && VE(e) ? HE(Go(t), e) : function(r) {
    var n = wn(r, t);
    return n === void 0 && n === e ? KE(r, t) : _l(e, n, nD | aD);
  };
}
function oD(t) {
  return function(e) {
    return e == null ? void 0 : e[t];
  };
}
function sD(t) {
  return function(e) {
    return eg(e, t);
  };
}
function lD(t) {
  return Jp(t) ? oD(Go(t)) : sD(t);
}
function uD(t) {
  return typeof t == "function" ? t : t == null ? RE : typeof t == "object" ? jr(t) ? iD(t[0], t[1]) : eD(t) : lD(t);
}
var wu = function() {
  return dn.Date.now();
}, cD = "Expected a function", dD = Math.max, fD = Math.min;
function GE(t, e, r) {
  var n, a, i, o, s, u, l = 0, c = !1, d = !1, f = !0;
  if (typeof t != "function")
    throw new TypeError(cD);
  e = Ry(e) || 0, Jn(r) && (c = !!r.leading, d = "maxWait" in r, i = d ? dD(Ry(r.maxWait) || 0, e) : i, f = "trailing" in r ? !!r.trailing : f);
  function h(E) {
    var C = n, k = a;
    return n = a = void 0, l = E, o = t.apply(k, C), o;
  }
  function v(E) {
    return l = E, s = setTimeout(y, e), c ? h(E) : o;
  }
  function p(E) {
    var C = E - u, k = E - l, S = e - C;
    return d ? fD(S, i - k) : S;
  }
  function g(E) {
    var C = E - u, k = E - l;
    return u === void 0 || C >= e || C < 0 || d && k >= i;
  }
  function y() {
    var E = wu();
    if (g(E))
      return m(E);
    s = setTimeout(y, p(E));
  }
  function m(E) {
    return s = void 0, f && n ? h(E) : (n = a = void 0, o);
  }
  function b() {
    s !== void 0 && clearTimeout(s), l = 0, n = u = a = s = void 0;
  }
  function w() {
    return s === void 0 ? o : m(wu());
  }
  function x() {
    var E = wu(), C = g(E);
    if (n = arguments, a = this, u = E, C) {
      if (s === void 0)
        return v(u);
      if (d)
        return clearTimeout(s), s = setTimeout(y, e), h(u);
    }
    return s === void 0 && (s = setTimeout(y, e)), o;
  }
  return x.cancel = b, x.flush = w, x;
}
function vD(t, e, r) {
  var n = t == null ? 0 : t.length;
  if (!n)
    return -1;
  var a = n - 1;
  return mO(t, uD(e), a);
}
function rl(t) {
  for (var e = -1, r = t == null ? 0 : t.length, n = {}; ++e < r; ) {
    var a = t[e];
    n[a[0]] = a[1];
  }
  return n;
}
function nl(t, e) {
  return _l(t, e);
}
function Yn(t) {
  return t == null;
}
function hD(t) {
  return t === void 0;
}
function pD(t, e, r, n) {
  if (!Jn(t))
    return t;
  e = kl(e, t);
  for (var a = -1, i = e.length, o = i - 1, s = t; s != null && ++a < i; ) {
    var u = Go(e[a]), l = r;
    if (u === "__proto__" || u === "constructor" || u === "prototype")
      return t;
    if (a != o) {
      var c = s[u];
      l = void 0, l === void 0 && (l = Jn(c) ? c : jp(e[a + 1]) ? [] : {});
    }
    SO(s, u, l), s = s[u];
  }
  return t;
}
function gD(t, e, r) {
  for (var n = -1, a = e.length, i = {}; ++n < a; ) {
    var o = e[n], s = eg(t, o);
    r(s, o) && pD(i, kl(o, t), s);
  }
  return i;
}
function yD(t, e) {
  return gD(t, e, function(r, n) {
    return KE(t, n);
  });
}
var UE = tP(function(t, e) {
  return t == null ? {} : yD(t, e);
});
const Un = (t) => t === void 0, bi = (t) => typeof t == "boolean", Ut = (t) => typeof t == "number", Ea = (t) => typeof Element > "u" ? !1 : t instanceof Element, al = (t) => Yn(t), mD = (t) => nr(t) ? !Number.isNaN(Number(t)) : !1, bD = (t = "") => t.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"), em = (t) => Object.keys(t);
class WE extends Error {
  constructor(e) {
    super(e), this.name = "ElementPlusError";
  }
}
function wD(t, e) {
  throw new WE(`[${t}] ${e}`);
}
function Ot(t, e) {
  if (process.env.NODE_ENV !== "production") {
    const r = nr(t) ? new WE(`[${t}] ${e}`) : t;
    console.warn(r);
  }
}
const CD = "utils/dom/style", jE = (t = "") => t.split(" ").filter((e) => !!e.trim()), gp = (t, e) => {
  !t || !e.trim() || t.classList.add(...jE(e));
}, Sa = (t, e) => {
  !t || !e.trim() || t.classList.remove(...jE(e));
}, Ji = (t, e) => {
  var r;
  if (!It || !t || !e)
    return "";
  let n = kI(e);
  n === "float" && (n = "cssFloat");
  try {
    const a = t.style[n];
    if (a)
      return a;
    const i = (r = document.defaultView) == null ? void 0 : r.getComputedStyle(t, "");
    return i ? i[n] : "";
  } catch {
    return t.style[n];
  }
};
function wi(t, e = "px") {
  if (!t)
    return "";
  if (Ut(t) || mD(t))
    return `${t}${e}`;
  if (nr(t))
    return t;
  Ot(CD, "binding value must be a string or number");
}
function xD(t, e) {
  if (!It)
    return;
  if (!e) {
    t.scrollTop = 0;
    return;
  }
  const r = [];
  let n = e.offsetParent;
  for (; n !== null && t !== n && t.contains(n); )
    r.push(n), n = n.offsetParent;
  const a = e.offsetTop + r.reduce((u, l) => u + l.offsetTop, 0), i = a + e.offsetHeight, o = t.scrollTop, s = o + t.clientHeight;
  a < o ? t.scrollTop = a : i > s && (t.scrollTop = i - t.clientHeight);
}
const YE = "__epPropKey", qe = (t) => t, ED = (t) => Gt(t) && !!t[YE], Tl = (t, e) => {
  if (!Gt(t) || ED(t))
    return t;
  const { values: r, required: n, default: a, type: i, validator: o } = t, u = {
    type: i,
    required: !!n,
    validator: r || o ? (l) => {
      let c = !1, d = [];
      if (r && (d = Array.from(r), Ta(t, "default") && d.push(a), c || (c = d.includes(l))), o && (c || (c = o(l))), !c && d.length > 0) {
        const f = [...new Set(d)].map((h) => JSON.stringify(h)).join(", ");
        VT(`Invalid prop: validation failed${e ? ` for prop "${e}"` : ""}. Expected one of [${f}], got value ${JSON.stringify(l)}.`);
      }
      return c;
    } : void 0,
    [YE]: !0
  };
  return Ta(t, "default") && (u.default = a), u;
}, rt = (t) => rl(Object.entries(t).map(([e, r]) => [
  e,
  Tl(r, e)
])), Qn = qe([
  String,
  Object,
  Function
]), ZE = {
  validating: Kp,
  success: TT,
  error: Gp
}, Vt = (t, e) => {
  if (t.install = (r) => {
    for (const n of [t, ...Object.values(e ?? {})])
      r.component(n.name, n);
  }, e)
    for (const [r, n] of Object.entries(e))
      t[r] = n;
  return t;
}, SD = (t, e) => (t.install = (r) => {
  r.directive(e, t);
}, t), An = (t) => (t.install = Eo, t), Rt = {
  tab: "Tab",
  enter: "Enter",
  space: "Space",
  left: "ArrowLeft",
  up: "ArrowUp",
  right: "ArrowRight",
  down: "ArrowDown",
  esc: "Escape",
  delete: "Delete",
  backspace: "Backspace",
  numpadEnter: "NumpadEnter",
  pageUp: "PageUp",
  pageDown: "PageDown",
  home: "Home",
  end: "End"
}, Kt = "update:modelValue", tg = "change", XE = ["", "default", "small", "large"], kD = (t) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(t), oi = (t) => t, _D = ["class", "style"], TD = /^on[A-Z]/, ID = (t = {}) => {
  const { excludeListeners: e = !1, excludeKeys: r } = t, n = j(() => ((r == null ? void 0 : r.value) || []).concat(_D)), a = mt();
  return a ? j(() => {
    var i;
    return rl(Object.entries((i = a.proxy) == null ? void 0 : i.$attrs).filter(([o]) => !n.value.includes(o) && !(e && TD.test(o))));
  }) : (Ot("use-attrs", "getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"), j(() => ({})));
}, Ns = ({ from: t, replacement: e, scope: r, version: n, ref: a, type: i = "API" }, o) => {
  Re(() => P(o), (s) => {
    s && Ot(r, `[${i}] ${t} is about to be deprecated in version ${n}, please use ${e} instead.
For more detail, please visit: ${a}
`);
  }, {
    immediate: !0
  });
};
var OD = {
  name: "en",
  el: {
    breadcrumb: {
      label: "Breadcrumb"
    },
    colorpicker: {
      confirm: "OK",
      clear: "Clear",
      defaultLabel: "color picker",
      description: "current color is {color}. press enter to select a new color.",
      alphaLabel: "pick alpha value"
    },
    datepicker: {
      now: "Now",
      today: "Today",
      cancel: "Cancel",
      clear: "Clear",
      confirm: "OK",
      dateTablePrompt: "Use the arrow keys and enter to select the day of the month",
      monthTablePrompt: "Use the arrow keys and enter to select the month",
      yearTablePrompt: "Use the arrow keys and enter to select the year",
      selectedDate: "Selected date",
      selectDate: "Select date",
      selectTime: "Select time",
      startDate: "Start Date",
      startTime: "Start Time",
      endDate: "End Date",
      endTime: "End Time",
      prevYear: "Previous Year",
      nextYear: "Next Year",
      prevMonth: "Previous Month",
      nextMonth: "Next Month",
      year: "",
      month1: "January",
      month2: "February",
      month3: "March",
      month4: "April",
      month5: "May",
      month6: "June",
      month7: "July",
      month8: "August",
      month9: "September",
      month10: "October",
      month11: "November",
      month12: "December",
      week: "week",
      weeks: {
        sun: "Sun",
        mon: "Mon",
        tue: "Tue",
        wed: "Wed",
        thu: "Thu",
        fri: "Fri",
        sat: "Sat"
      },
      weeksFull: {
        sun: "Sunday",
        mon: "Monday",
        tue: "Tuesday",
        wed: "Wednesday",
        thu: "Thursday",
        fri: "Friday",
        sat: "Saturday"
      },
      months: {
        jan: "Jan",
        feb: "Feb",
        mar: "Mar",
        apr: "Apr",
        may: "May",
        jun: "Jun",
        jul: "Jul",
        aug: "Aug",
        sep: "Sep",
        oct: "Oct",
        nov: "Nov",
        dec: "Dec"
      }
    },
    inputNumber: {
      decrease: "decrease number",
      increase: "increase number"
    },
    select: {
      loading: "Loading",
      noMatch: "No matching data",
      noData: "No data",
      placeholder: "Select"
    },
    mention: {
      loading: "Loading"
    },
    dropdown: {
      toggleDropdown: "Toggle Dropdown"
    },
    cascader: {
      noMatch: "No matching data",
      loading: "Loading",
      placeholder: "Select",
      noData: "No data"
    },
    pagination: {
      goto: "Go to",
      pagesize: "/page",
      total: "Total {total}",
      pageClassifier: "",
      page: "Page",
      prev: "Go to previous page",
      next: "Go to next page",
      currentPage: "page {pager}",
      prevPages: "Previous {pager} pages",
      nextPages: "Next {pager} pages",
      deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details"
    },
    dialog: {
      close: "Close this dialog"
    },
    drawer: {
      close: "Close this dialog"
    },
    messagebox: {
      title: "Message",
      confirm: "OK",
      cancel: "Cancel",
      error: "Illegal input",
      close: "Close this dialog"
    },
    upload: {
      deleteTip: "press delete to remove",
      delete: "Delete",
      preview: "Preview",
      continue: "Continue"
    },
    slider: {
      defaultLabel: "slider between {min} and {max}",
      defaultRangeStartLabel: "pick start value",
      defaultRangeEndLabel: "pick end value"
    },
    table: {
      emptyText: "No Data",
      confirmFilter: "Confirm",
      resetFilter: "Reset",
      clearFilter: "All",
      sumText: "Sum"
    },
    tour: {
      next: "Next",
      previous: "Previous",
      finish: "Finish"
    },
    tree: {
      emptyText: "No Data"
    },
    transfer: {
      noMatch: "No matching data",
      noData: "No data",
      titles: ["List 1", "List 2"],
      filterPlaceholder: "Enter keyword",
      noCheckedFormat: "{total} items",
      hasCheckedFormat: "{checked}/{total} checked"
    },
    image: {
      error: "FAILED"
    },
    pageHeader: {
      title: "Back"
    },
    popconfirm: {
      confirmButtonText: "Yes",
      cancelButtonText: "No"
    },
    carousel: {
      leftArrow: "Carousel arrow left",
      rightArrow: "Carousel arrow right",
      indicator: "Carousel switch to index {index}"
    }
  }
};
const AD = (t) => (e, r) => PD(e, r, P(t)), PD = (t, e, r) => wn(r, t, t).replace(/\{(\w+)\}/g, (n, a) => {
  var i;
  return `${(i = e == null ? void 0 : e[a]) != null ? i : `{${a}}`}`;
}), DD = (t) => {
  const e = j(() => P(t).name), r = yi(t) ? t : de(t);
  return {
    lang: e,
    locale: r,
    t: AD(t)
  };
}, JE = Symbol("localeContextKey"), Uo = (t) => {
  const e = t || Ue(JE, de());
  return DD(j(() => e.value || OD));
}, Bs = "el", RD = "is-", fa = (t, e, r, n, a) => {
  let i = `${t}-${e}`;
  return r && (i += `-${r}`), n && (i += `__${n}`), a && (i += `--${a}`), i;
}, QE = Symbol("namespaceContextKey"), rg = (t) => {
  const e = t || (mt() ? Ue(QE, de(Bs)) : de(Bs));
  return j(() => P(e) || Bs);
}, Ge = (t, e) => {
  const r = rg(e);
  return {
    namespace: r,
    b: (p = "") => fa(r.value, t, p, "", ""),
    e: (p) => p ? fa(r.value, t, "", p, "") : "",
    m: (p) => p ? fa(r.value, t, "", "", p) : "",
    be: (p, g) => p && g ? fa(r.value, t, p, g, "") : "",
    em: (p, g) => p && g ? fa(r.value, t, "", p, g) : "",
    bm: (p, g) => p && g ? fa(r.value, t, p, "", g) : "",
    bem: (p, g, y) => p && g && y ? fa(r.value, t, p, g, y) : "",
    is: (p, ...g) => {
      const y = g.length >= 1 ? g[0] : !0;
      return p && y ? `${RD}${p}` : "";
    },
    cssVar: (p) => {
      const g = {};
      for (const y in p)
        p[y] && (g[`--${r.value}-${y}`] = p[y]);
      return g;
    },
    cssVarName: (p) => `--${r.value}-${p}`,
    cssVarBlock: (p) => {
      const g = {};
      for (const y in p)
        p[y] && (g[`--${r.value}-${t}-${y}`] = p[y]);
      return g;
    },
    cssVarBlockName: (p) => `--${r.value}-${t}-${p}`
  };
}, LD = Tl({
  type: qe(Boolean),
  default: null
}), FD = Tl({
  type: qe(Function)
}), MD = (t) => {
  const e = `update:${t}`, r = `onUpdate:${t}`, n = [e], a = {
    [t]: LD,
    [r]: FD
  };
  return {
    useModelToggle: ({
      indicator: o,
      toggleReason: s,
      shouldHideWhenRouteChanges: u,
      shouldProceed: l,
      onShow: c,
      onHide: d
    }) => {
      const f = mt(), { emit: h } = f, v = f.props, p = j(() => cr(v[r])), g = j(() => v[t] === null), y = (C) => {
        o.value !== !0 && (o.value = !0, s && (s.value = C), cr(c) && c(C));
      }, m = (C) => {
        o.value !== !1 && (o.value = !1, s && (s.value = C), cr(d) && d(C));
      }, b = (C) => {
        if (v.disabled === !0 || cr(l) && !l())
          return;
        const k = p.value && It;
        k && h(e, !0), (g.value || !k) && y(C);
      }, w = (C) => {
        if (v.disabled === !0 || !It)
          return;
        const k = p.value && It;
        k && h(e, !1), (g.value || !k) && m(C);
      }, x = (C) => {
        bi(C) && (v.disabled && C ? p.value && h(e, !1) : o.value !== C && (C ? y() : m()));
      }, E = () => {
        o.value ? w() : b();
      };
      return Re(() => v[t], x), u && f.appContext.config.globalProperties.$route !== void 0 && Re(() => ({
        ...f.proxy.$route
      }), () => {
        u.value && o.value && w();
      }), St(() => {
        x(v[t]);
      }), {
        hide: w,
        show: b,
        toggle: E,
        hasUpdateHandler: p
      };
    },
    useModelToggleProps: a,
    useModelToggleEmits: n
  };
}, e2 = (t) => {
  const e = mt();
  return j(() => {
    var r, n;
    return (n = (r = e == null ? void 0 : e.proxy) == null ? void 0 : r.$props) == null ? void 0 : n[t];
  });
};
var pr = "top", Rr = "bottom", Lr = "right", gr = "left", ng = "auto", Wo = [pr, Rr, Lr, gr], Ci = "start", _o = "end", ND = "clippingParents", t2 = "viewport", Qi = "popper", BD = "reference", tm = Wo.reduce(function(t, e) {
  return t.concat([e + "-" + Ci, e + "-" + _o]);
}, []), Il = [].concat(Wo, [ng]).reduce(function(t, e) {
  return t.concat([e, e + "-" + Ci, e + "-" + _o]);
}, []), $D = "beforeRead", qD = "read", zD = "afterRead", VD = "beforeMain", HD = "main", KD = "afterMain", GD = "beforeWrite", UD = "write", WD = "afterWrite", jD = [$D, qD, zD, VD, HD, KD, GD, UD, WD];
function ln(t) {
  return t ? (t.nodeName || "").toLowerCase() : null;
}
function Xr(t) {
  if (t == null) return window;
  if (t.toString() !== "[object Window]") {
    var e = t.ownerDocument;
    return e && e.defaultView || window;
  }
  return t;
}
function xi(t) {
  var e = Xr(t).Element;
  return t instanceof e || t instanceof Element;
}
function Dr(t) {
  var e = Xr(t).HTMLElement;
  return t instanceof e || t instanceof HTMLElement;
}
function ag(t) {
  if (typeof ShadowRoot > "u") return !1;
  var e = Xr(t).ShadowRoot;
  return t instanceof e || t instanceof ShadowRoot;
}
function YD(t) {
  var e = t.state;
  Object.keys(e.elements).forEach(function(r) {
    var n = e.styles[r] || {}, a = e.attributes[r] || {}, i = e.elements[r];
    !Dr(i) || !ln(i) || (Object.assign(i.style, n), Object.keys(a).forEach(function(o) {
      var s = a[o];
      s === !1 ? i.removeAttribute(o) : i.setAttribute(o, s === !0 ? "" : s);
    }));
  });
}
function ZD(t) {
  var e = t.state, r = { popper: { position: e.options.strategy, left: "0", top: "0", margin: "0" }, arrow: { position: "absolute" }, reference: {} };
  return Object.assign(e.elements.popper.style, r.popper), e.styles = r, e.elements.arrow && Object.assign(e.elements.arrow.style, r.arrow), function() {
    Object.keys(e.elements).forEach(function(n) {
      var a = e.elements[n], i = e.attributes[n] || {}, o = Object.keys(e.styles.hasOwnProperty(n) ? e.styles[n] : r[n]), s = o.reduce(function(u, l) {
        return u[l] = "", u;
      }, {});
      !Dr(a) || !ln(a) || (Object.assign(a.style, s), Object.keys(i).forEach(function(u) {
        a.removeAttribute(u);
      }));
    });
  };
}
var r2 = { name: "applyStyles", enabled: !0, phase: "write", fn: YD, effect: ZD, requires: ["computeStyles"] };
function an(t) {
  return t.split("-")[0];
}
var ka = Math.max, il = Math.min, Ei = Math.round;
function Si(t, e) {
  e === void 0 && (e = !1);
  var r = t.getBoundingClientRect(), n = 1, a = 1;
  if (Dr(t) && e) {
    var i = t.offsetHeight, o = t.offsetWidth;
    o > 0 && (n = Ei(r.width) / o || 1), i > 0 && (a = Ei(r.height) / i || 1);
  }
  return { width: r.width / n, height: r.height / a, top: r.top / a, right: r.right / n, bottom: r.bottom / a, left: r.left / n, x: r.left / n, y: r.top / a };
}
function ig(t) {
  var e = Si(t), r = t.offsetWidth, n = t.offsetHeight;
  return Math.abs(e.width - r) <= 1 && (r = e.width), Math.abs(e.height - n) <= 1 && (n = e.height), { x: t.offsetLeft, y: t.offsetTop, width: r, height: n };
}
function n2(t, e) {
  var r = e.getRootNode && e.getRootNode();
  if (t.contains(e)) return !0;
  if (r && ag(r)) {
    var n = e;
    do {
      if (n && t.isSameNode(n)) return !0;
      n = n.parentNode || n.host;
    } while (n);
  }
  return !1;
}
function Sn(t) {
  return Xr(t).getComputedStyle(t);
}
function XD(t) {
  return ["table", "td", "th"].indexOf(ln(t)) >= 0;
}
function oa(t) {
  return ((xi(t) ? t.ownerDocument : t.document) || window.document).documentElement;
}
function Ol(t) {
  return ln(t) === "html" ? t : t.assignedSlot || t.parentNode || (ag(t) ? t.host : null) || oa(t);
}
function rm(t) {
  return !Dr(t) || Sn(t).position === "fixed" ? null : t.offsetParent;
}
function JD(t) {
  var e = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1, r = navigator.userAgent.indexOf("Trident") !== -1;
  if (r && Dr(t)) {
    var n = Sn(t);
    if (n.position === "fixed") return null;
  }
  var a = Ol(t);
  for (ag(a) && (a = a.host); Dr(a) && ["html", "body"].indexOf(ln(a)) < 0; ) {
    var i = Sn(a);
    if (i.transform !== "none" || i.perspective !== "none" || i.contain === "paint" || ["transform", "perspective"].indexOf(i.willChange) !== -1 || e && i.willChange === "filter" || e && i.filter && i.filter !== "none") return a;
    a = a.parentNode;
  }
  return null;
}
function jo(t) {
  for (var e = Xr(t), r = rm(t); r && XD(r) && Sn(r).position === "static"; ) r = rm(r);
  return r && (ln(r) === "html" || ln(r) === "body" && Sn(r).position === "static") ? e : r || JD(t) || e;
}
function og(t) {
  return ["top", "bottom"].indexOf(t) >= 0 ? "x" : "y";
}
function mo(t, e, r) {
  return ka(t, il(e, r));
}
function QD(t, e, r) {
  var n = mo(t, e, r);
  return n > r ? r : n;
}
function a2() {
  return { top: 0, right: 0, bottom: 0, left: 0 };
}
function i2(t) {
  return Object.assign({}, a2(), t);
}
function o2(t, e) {
  return e.reduce(function(r, n) {
    return r[n] = t, r;
  }, {});
}
var eR = function(t, e) {
  return t = typeof t == "function" ? t(Object.assign({}, e.rects, { placement: e.placement })) : t, i2(typeof t != "number" ? t : o2(t, Wo));
};
function tR(t) {
  var e, r = t.state, n = t.name, a = t.options, i = r.elements.arrow, o = r.modifiersData.popperOffsets, s = an(r.placement), u = og(s), l = [gr, Lr].indexOf(s) >= 0, c = l ? "height" : "width";
  if (!(!i || !o)) {
    var d = eR(a.padding, r), f = ig(i), h = u === "y" ? pr : gr, v = u === "y" ? Rr : Lr, p = r.rects.reference[c] + r.rects.reference[u] - o[u] - r.rects.popper[c], g = o[u] - r.rects.reference[u], y = jo(i), m = y ? u === "y" ? y.clientHeight || 0 : y.clientWidth || 0 : 0, b = p / 2 - g / 2, w = d[h], x = m - f[c] - d[v], E = m / 2 - f[c] / 2 + b, C = mo(w, E, x), k = u;
    r.modifiersData[n] = (e = {}, e[k] = C, e.centerOffset = C - E, e);
  }
}
function rR(t) {
  var e = t.state, r = t.options, n = r.element, a = n === void 0 ? "[data-popper-arrow]" : n;
  a != null && (typeof a == "string" && (a = e.elements.popper.querySelector(a), !a) || !n2(e.elements.popper, a) || (e.elements.arrow = a));
}
var nR = { name: "arrow", enabled: !0, phase: "main", fn: tR, effect: rR, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] };
function ki(t) {
  return t.split("-")[1];
}
var aR = { top: "auto", right: "auto", bottom: "auto", left: "auto" };
function iR(t) {
  var e = t.x, r = t.y, n = window, a = n.devicePixelRatio || 1;
  return { x: Ei(e * a) / a || 0, y: Ei(r * a) / a || 0 };
}
function nm(t) {
  var e, r = t.popper, n = t.popperRect, a = t.placement, i = t.variation, o = t.offsets, s = t.position, u = t.gpuAcceleration, l = t.adaptive, c = t.roundOffsets, d = t.isFixed, f = o.x, h = f === void 0 ? 0 : f, v = o.y, p = v === void 0 ? 0 : v, g = typeof c == "function" ? c({ x: h, y: p }) : { x: h, y: p };
  h = g.x, p = g.y;
  var y = o.hasOwnProperty("x"), m = o.hasOwnProperty("y"), b = gr, w = pr, x = window;
  if (l) {
    var E = jo(r), C = "clientHeight", k = "clientWidth";
    if (E === Xr(r) && (E = oa(r), Sn(E).position !== "static" && s === "absolute" && (C = "scrollHeight", k = "scrollWidth")), E = E, a === pr || (a === gr || a === Lr) && i === _o) {
      w = Rr;
      var S = d && E === x && x.visualViewport ? x.visualViewport.height : E[C];
      p -= S - n.height, p *= u ? 1 : -1;
    }
    if (a === gr || (a === pr || a === Rr) && i === _o) {
      b = Lr;
      var _ = d && E === x && x.visualViewport ? x.visualViewport.width : E[k];
      h -= _ - n.width, h *= u ? 1 : -1;
    }
  }
  var T = Object.assign({ position: s }, l && aR), O = c === !0 ? iR({ x: h, y: p }) : { x: h, y: p };
  if (h = O.x, p = O.y, u) {
    var D;
    return Object.assign({}, T, (D = {}, D[w] = m ? "0" : "", D[b] = y ? "0" : "", D.transform = (x.devicePixelRatio || 1) <= 1 ? "translate(" + h + "px, " + p + "px)" : "translate3d(" + h + "px, " + p + "px, 0)", D));
  }
  return Object.assign({}, T, (e = {}, e[w] = m ? p + "px" : "", e[b] = y ? h + "px" : "", e.transform = "", e));
}
function oR(t) {
  var e = t.state, r = t.options, n = r.gpuAcceleration, a = n === void 0 ? !0 : n, i = r.adaptive, o = i === void 0 ? !0 : i, s = r.roundOffsets, u = s === void 0 ? !0 : s, l = { placement: an(e.placement), variation: ki(e.placement), popper: e.elements.popper, popperRect: e.rects.popper, gpuAcceleration: a, isFixed: e.options.strategy === "fixed" };
  e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, nm(Object.assign({}, l, { offsets: e.modifiersData.popperOffsets, position: e.options.strategy, adaptive: o, roundOffsets: u })))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, nm(Object.assign({}, l, { offsets: e.modifiersData.arrow, position: "absolute", adaptive: !1, roundOffsets: u })))), e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-placement": e.placement });
}
var s2 = { name: "computeStyles", enabled: !0, phase: "beforeWrite", fn: oR, data: {} }, ys = { passive: !0 };
function sR(t) {
  var e = t.state, r = t.instance, n = t.options, a = n.scroll, i = a === void 0 ? !0 : a, o = n.resize, s = o === void 0 ? !0 : o, u = Xr(e.elements.popper), l = [].concat(e.scrollParents.reference, e.scrollParents.popper);
  return i && l.forEach(function(c) {
    c.addEventListener("scroll", r.update, ys);
  }), s && u.addEventListener("resize", r.update, ys), function() {
    i && l.forEach(function(c) {
      c.removeEventListener("scroll", r.update, ys);
    }), s && u.removeEventListener("resize", r.update, ys);
  };
}
var l2 = { name: "eventListeners", enabled: !0, phase: "write", fn: function() {
}, effect: sR, data: {} }, lR = { left: "right", right: "left", bottom: "top", top: "bottom" };
function $s(t) {
  return t.replace(/left|right|bottom|top/g, function(e) {
    return lR[e];
  });
}
var uR = { start: "end", end: "start" };
function am(t) {
  return t.replace(/start|end/g, function(e) {
    return uR[e];
  });
}
function sg(t) {
  var e = Xr(t), r = e.pageXOffset, n = e.pageYOffset;
  return { scrollLeft: r, scrollTop: n };
}
function lg(t) {
  return Si(oa(t)).left + sg(t).scrollLeft;
}
function cR(t) {
  var e = Xr(t), r = oa(t), n = e.visualViewport, a = r.clientWidth, i = r.clientHeight, o = 0, s = 0;
  return n && (a = n.width, i = n.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (o = n.offsetLeft, s = n.offsetTop)), { width: a, height: i, x: o + lg(t), y: s };
}
function dR(t) {
  var e, r = oa(t), n = sg(t), a = (e = t.ownerDocument) == null ? void 0 : e.body, i = ka(r.scrollWidth, r.clientWidth, a ? a.scrollWidth : 0, a ? a.clientWidth : 0), o = ka(r.scrollHeight, r.clientHeight, a ? a.scrollHeight : 0, a ? a.clientHeight : 0), s = -n.scrollLeft + lg(t), u = -n.scrollTop;
  return Sn(a || r).direction === "rtl" && (s += ka(r.clientWidth, a ? a.clientWidth : 0) - i), { width: i, height: o, x: s, y: u };
}
function ug(t) {
  var e = Sn(t), r = e.overflow, n = e.overflowX, a = e.overflowY;
  return /auto|scroll|overlay|hidden/.test(r + a + n);
}
function u2(t) {
  return ["html", "body", "#document"].indexOf(ln(t)) >= 0 ? t.ownerDocument.body : Dr(t) && ug(t) ? t : u2(Ol(t));
}
function bo(t, e) {
  var r;
  e === void 0 && (e = []);
  var n = u2(t), a = n === ((r = t.ownerDocument) == null ? void 0 : r.body), i = Xr(n), o = a ? [i].concat(i.visualViewport || [], ug(n) ? n : []) : n, s = e.concat(o);
  return a ? s : s.concat(bo(Ol(o)));
}
function yp(t) {
  return Object.assign({}, t, { left: t.x, top: t.y, right: t.x + t.width, bottom: t.y + t.height });
}
function fR(t) {
  var e = Si(t);
  return e.top = e.top + t.clientTop, e.left = e.left + t.clientLeft, e.bottom = e.top + t.clientHeight, e.right = e.left + t.clientWidth, e.width = t.clientWidth, e.height = t.clientHeight, e.x = e.left, e.y = e.top, e;
}
function im(t, e) {
  return e === t2 ? yp(cR(t)) : xi(e) ? fR(e) : yp(dR(oa(t)));
}
function vR(t) {
  var e = bo(Ol(t)), r = ["absolute", "fixed"].indexOf(Sn(t).position) >= 0, n = r && Dr(t) ? jo(t) : t;
  return xi(n) ? e.filter(function(a) {
    return xi(a) && n2(a, n) && ln(a) !== "body";
  }) : [];
}
function hR(t, e, r) {
  var n = e === "clippingParents" ? vR(t) : [].concat(e), a = [].concat(n, [r]), i = a[0], o = a.reduce(function(s, u) {
    var l = im(t, u);
    return s.top = ka(l.top, s.top), s.right = il(l.right, s.right), s.bottom = il(l.bottom, s.bottom), s.left = ka(l.left, s.left), s;
  }, im(t, i));
  return o.width = o.right - o.left, o.height = o.bottom - o.top, o.x = o.left, o.y = o.top, o;
}
function c2(t) {
  var e = t.reference, r = t.element, n = t.placement, a = n ? an(n) : null, i = n ? ki(n) : null, o = e.x + e.width / 2 - r.width / 2, s = e.y + e.height / 2 - r.height / 2, u;
  switch (a) {
    case pr:
      u = { x: o, y: e.y - r.height };
      break;
    case Rr:
      u = { x: o, y: e.y + e.height };
      break;
    case Lr:
      u = { x: e.x + e.width, y: s };
      break;
    case gr:
      u = { x: e.x - r.width, y: s };
      break;
    default:
      u = { x: e.x, y: e.y };
  }
  var l = a ? og(a) : null;
  if (l != null) {
    var c = l === "y" ? "height" : "width";
    switch (i) {
      case Ci:
        u[l] = u[l] - (e[c] / 2 - r[c] / 2);
        break;
      case _o:
        u[l] = u[l] + (e[c] / 2 - r[c] / 2);
        break;
    }
  }
  return u;
}
function To(t, e) {
  e === void 0 && (e = {});
  var r = e, n = r.placement, a = n === void 0 ? t.placement : n, i = r.boundary, o = i === void 0 ? ND : i, s = r.rootBoundary, u = s === void 0 ? t2 : s, l = r.elementContext, c = l === void 0 ? Qi : l, d = r.altBoundary, f = d === void 0 ? !1 : d, h = r.padding, v = h === void 0 ? 0 : h, p = i2(typeof v != "number" ? v : o2(v, Wo)), g = c === Qi ? BD : Qi, y = t.rects.popper, m = t.elements[f ? g : c], b = hR(xi(m) ? m : m.contextElement || oa(t.elements.popper), o, u), w = Si(t.elements.reference), x = c2({ reference: w, element: y, strategy: "absolute", placement: a }), E = yp(Object.assign({}, y, x)), C = c === Qi ? E : w, k = { top: b.top - C.top + p.top, bottom: C.bottom - b.bottom + p.bottom, left: b.left - C.left + p.left, right: C.right - b.right + p.right }, S = t.modifiersData.offset;
  if (c === Qi && S) {
    var _ = S[a];
    Object.keys(k).forEach(function(T) {
      var O = [Lr, Rr].indexOf(T) >= 0 ? 1 : -1, D = [pr, Rr].indexOf(T) >= 0 ? "y" : "x";
      k[T] += _[D] * O;
    });
  }
  return k;
}
function pR(t, e) {
  e === void 0 && (e = {});
  var r = e, n = r.placement, a = r.boundary, i = r.rootBoundary, o = r.padding, s = r.flipVariations, u = r.allowedAutoPlacements, l = u === void 0 ? Il : u, c = ki(n), d = c ? s ? tm : tm.filter(function(v) {
    return ki(v) === c;
  }) : Wo, f = d.filter(function(v) {
    return l.indexOf(v) >= 0;
  });
  f.length === 0 && (f = d);
  var h = f.reduce(function(v, p) {
    return v[p] = To(t, { placement: p, boundary: a, rootBoundary: i, padding: o })[an(p)], v;
  }, {});
  return Object.keys(h).sort(function(v, p) {
    return h[v] - h[p];
  });
}
function gR(t) {
  if (an(t) === ng) return [];
  var e = $s(t);
  return [am(t), e, am(e)];
}
function yR(t) {
  var e = t.state, r = t.options, n = t.name;
  if (!e.modifiersData[n]._skip) {
    for (var a = r.mainAxis, i = a === void 0 ? !0 : a, o = r.altAxis, s = o === void 0 ? !0 : o, u = r.fallbackPlacements, l = r.padding, c = r.boundary, d = r.rootBoundary, f = r.altBoundary, h = r.flipVariations, v = h === void 0 ? !0 : h, p = r.allowedAutoPlacements, g = e.options.placement, y = an(g), m = y === g, b = u || (m || !v ? [$s(g)] : gR(g)), w = [g].concat(b).reduce(function(B, $) {
      return B.concat(an($) === ng ? pR(e, { placement: $, boundary: c, rootBoundary: d, padding: l, flipVariations: v, allowedAutoPlacements: p }) : $);
    }, []), x = e.rects.reference, E = e.rects.popper, C = /* @__PURE__ */ new Map(), k = !0, S = w[0], _ = 0; _ < w.length; _++) {
      var T = w[_], O = an(T), D = ki(T) === Ci, A = [pr, Rr].indexOf(O) >= 0, F = A ? "width" : "height", R = To(e, { placement: T, boundary: c, rootBoundary: d, altBoundary: f, padding: l }), M = A ? D ? Lr : gr : D ? Rr : pr;
      x[F] > E[F] && (M = $s(M));
      var L = $s(M), V = [];
      if (i && V.push(R[O] <= 0), s && V.push(R[M] <= 0, R[L] <= 0), V.every(function(B) {
        return B;
      })) {
        S = T, k = !1;
        break;
      }
      C.set(T, V);
    }
    if (k) for (var Y = v ? 3 : 1, H = function(B) {
      var $ = w.find(function(z) {
        var W = C.get(z);
        if (W) return W.slice(0, B).every(function(Z) {
          return Z;
        });
      });
      if ($) return S = $, "break";
    }, K = Y; K > 0; K--) {
      var ne = H(K);
      if (ne === "break") break;
    }
    e.placement !== S && (e.modifiersData[n]._skip = !0, e.placement = S, e.reset = !0);
  }
}
var mR = { name: "flip", enabled: !0, phase: "main", fn: yR, requiresIfExists: ["offset"], data: { _skip: !1 } };
function om(t, e, r) {
  return r === void 0 && (r = { x: 0, y: 0 }), { top: t.top - e.height - r.y, right: t.right - e.width + r.x, bottom: t.bottom - e.height + r.y, left: t.left - e.width - r.x };
}
function sm(t) {
  return [pr, Lr, Rr, gr].some(function(e) {
    return t[e] >= 0;
  });
}
function bR(t) {
  var e = t.state, r = t.name, n = e.rects.reference, a = e.rects.popper, i = e.modifiersData.preventOverflow, o = To(e, { elementContext: "reference" }), s = To(e, { altBoundary: !0 }), u = om(o, n), l = om(s, a, i), c = sm(u), d = sm(l);
  e.modifiersData[r] = { referenceClippingOffsets: u, popperEscapeOffsets: l, isReferenceHidden: c, hasPopperEscaped: d }, e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-reference-hidden": c, "data-popper-escaped": d });
}
var wR = { name: "hide", enabled: !0, phase: "main", requiresIfExists: ["preventOverflow"], fn: bR };
function CR(t, e, r) {
  var n = an(t), a = [gr, pr].indexOf(n) >= 0 ? -1 : 1, i = typeof r == "function" ? r(Object.assign({}, e, { placement: t })) : r, o = i[0], s = i[1];
  return o = o || 0, s = (s || 0) * a, [gr, Lr].indexOf(n) >= 0 ? { x: s, y: o } : { x: o, y: s };
}
function xR(t) {
  var e = t.state, r = t.options, n = t.name, a = r.offset, i = a === void 0 ? [0, 0] : a, o = Il.reduce(function(c, d) {
    return c[d] = CR(d, e.rects, i), c;
  }, {}), s = o[e.placement], u = s.x, l = s.y;
  e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += u, e.modifiersData.popperOffsets.y += l), e.modifiersData[n] = o;
}
var ER = { name: "offset", enabled: !0, phase: "main", requires: ["popperOffsets"], fn: xR };
function SR(t) {
  var e = t.state, r = t.name;
  e.modifiersData[r] = c2({ reference: e.rects.reference, element: e.rects.popper, strategy: "absolute", placement: e.placement });
}
var d2 = { name: "popperOffsets", enabled: !0, phase: "read", fn: SR, data: {} };
function kR(t) {
  return t === "x" ? "y" : "x";
}
function _R(t) {
  var e = t.state, r = t.options, n = t.name, a = r.mainAxis, i = a === void 0 ? !0 : a, o = r.altAxis, s = o === void 0 ? !1 : o, u = r.boundary, l = r.rootBoundary, c = r.altBoundary, d = r.padding, f = r.tether, h = f === void 0 ? !0 : f, v = r.tetherOffset, p = v === void 0 ? 0 : v, g = To(e, { boundary: u, rootBoundary: l, padding: d, altBoundary: c }), y = an(e.placement), m = ki(e.placement), b = !m, w = og(y), x = kR(w), E = e.modifiersData.popperOffsets, C = e.rects.reference, k = e.rects.popper, S = typeof p == "function" ? p(Object.assign({}, e.rects, { placement: e.placement })) : p, _ = typeof S == "number" ? { mainAxis: S, altAxis: S } : Object.assign({ mainAxis: 0, altAxis: 0 }, S), T = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, O = { x: 0, y: 0 };
  if (E) {
    if (i) {
      var D, A = w === "y" ? pr : gr, F = w === "y" ? Rr : Lr, R = w === "y" ? "height" : "width", M = E[w], L = M + g[A], V = M - g[F], Y = h ? -k[R] / 2 : 0, H = m === Ci ? C[R] : k[R], K = m === Ci ? -k[R] : -C[R], ne = e.elements.arrow, B = h && ne ? ig(ne) : { width: 0, height: 0 }, $ = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : a2(), z = $[A], W = $[F], Z = mo(0, C[R], B[R]), N = b ? C[R] / 2 - Y - Z - z - _.mainAxis : H - Z - z - _.mainAxis, X = b ? -C[R] / 2 + Y + Z + W + _.mainAxis : K + Z + W + _.mainAxis, Q = e.elements.arrow && jo(e.elements.arrow), ge = Q ? w === "y" ? Q.clientTop || 0 : Q.clientLeft || 0 : 0, we = (D = T == null ? void 0 : T[w]) != null ? D : 0, fe = M + N - we - ge, ce = M + X - we, be = mo(h ? il(L, fe) : L, M, h ? ka(V, ce) : V);
      E[w] = be, O[w] = be - M;
    }
    if (s) {
      var ve, xe = w === "x" ? pr : gr, _e = w === "x" ? Rr : Lr, He = E[x], Ve = x === "y" ? "height" : "width", De = He + g[xe], Ne = He - g[_e], ue = [pr, gr].indexOf(y) !== -1, I = (ve = T == null ? void 0 : T[x]) != null ? ve : 0, G = ue ? De : He - C[Ve] - k[Ve] - I + _.altAxis, se = ue ? He + C[Ve] + k[Ve] - I - _.altAxis : Ne, ee = h && ue ? QD(G, He, se) : mo(h ? G : De, He, h ? se : Ne);
      E[x] = ee, O[x] = ee - He;
    }
    e.modifiersData[n] = O;
  }
}
var TR = { name: "preventOverflow", enabled: !0, phase: "main", fn: _R, requiresIfExists: ["offset"] };
function IR(t) {
  return { scrollLeft: t.scrollLeft, scrollTop: t.scrollTop };
}
function OR(t) {
  return t === Xr(t) || !Dr(t) ? sg(t) : IR(t);
}
function AR(t) {
  var e = t.getBoundingClientRect(), r = Ei(e.width) / t.offsetWidth || 1, n = Ei(e.height) / t.offsetHeight || 1;
  return r !== 1 || n !== 1;
}
function PR(t, e, r) {
  r === void 0 && (r = !1);
  var n = Dr(e), a = Dr(e) && AR(e), i = oa(e), o = Si(t, a), s = { scrollLeft: 0, scrollTop: 0 }, u = { x: 0, y: 0 };
  return (n || !n && !r) && ((ln(e) !== "body" || ug(i)) && (s = OR(e)), Dr(e) ? (u = Si(e, !0), u.x += e.clientLeft, u.y += e.clientTop) : i && (u.x = lg(i))), { x: o.left + s.scrollLeft - u.x, y: o.top + s.scrollTop - u.y, width: o.width, height: o.height };
}
function DR(t) {
  var e = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), n = [];
  t.forEach(function(i) {
    e.set(i.name, i);
  });
  function a(i) {
    r.add(i.name);
    var o = [].concat(i.requires || [], i.requiresIfExists || []);
    o.forEach(function(s) {
      if (!r.has(s)) {
        var u = e.get(s);
        u && a(u);
      }
    }), n.push(i);
  }
  return t.forEach(function(i) {
    r.has(i.name) || a(i);
  }), n;
}
function RR(t) {
  var e = DR(t);
  return jD.reduce(function(r, n) {
    return r.concat(e.filter(function(a) {
      return a.phase === n;
    }));
  }, []);
}
function LR(t) {
  var e;
  return function() {
    return e || (e = new Promise(function(r) {
      Promise.resolve().then(function() {
        e = void 0, r(t());
      });
    })), e;
  };
}
function FR(t) {
  var e = t.reduce(function(r, n) {
    var a = r[n.name];
    return r[n.name] = a ? Object.assign({}, a, n, { options: Object.assign({}, a.options, n.options), data: Object.assign({}, a.data, n.data) }) : n, r;
  }, {});
  return Object.keys(e).map(function(r) {
    return e[r];
  });
}
var lm = { placement: "bottom", modifiers: [], strategy: "absolute" };
function um() {
  for (var t = arguments.length, e = new Array(t), r = 0; r < t; r++) e[r] = arguments[r];
  return !e.some(function(n) {
    return !(n && typeof n.getBoundingClientRect == "function");
  });
}
function cg(t) {
  t === void 0 && (t = {});
  var e = t, r = e.defaultModifiers, n = r === void 0 ? [] : r, a = e.defaultOptions, i = a === void 0 ? lm : a;
  return function(o, s, u) {
    u === void 0 && (u = i);
    var l = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, lm, i), modifiersData: {}, elements: { reference: o, popper: s }, attributes: {}, styles: {} }, c = [], d = !1, f = { state: l, setOptions: function(p) {
      var g = typeof p == "function" ? p(l.options) : p;
      v(), l.options = Object.assign({}, i, l.options, g), l.scrollParents = { reference: xi(o) ? bo(o) : o.contextElement ? bo(o.contextElement) : [], popper: bo(s) };
      var y = RR(FR([].concat(n, l.options.modifiers)));
      return l.orderedModifiers = y.filter(function(m) {
        return m.enabled;
      }), h(), f.update();
    }, forceUpdate: function() {
      if (!d) {
        var p = l.elements, g = p.reference, y = p.popper;
        if (um(g, y)) {
          l.rects = { reference: PR(g, jo(y), l.options.strategy === "fixed"), popper: ig(y) }, l.reset = !1, l.placement = l.options.placement, l.orderedModifiers.forEach(function(k) {
            return l.modifiersData[k.name] = Object.assign({}, k.data);
          });
          for (var m = 0; m < l.orderedModifiers.length; m++) {
            if (l.reset === !0) {
              l.reset = !1, m = -1;
              continue;
            }
            var b = l.orderedModifiers[m], w = b.fn, x = b.options, E = x === void 0 ? {} : x, C = b.name;
            typeof w == "function" && (l = w({ state: l, options: E, name: C, instance: f }) || l);
          }
        }
      }
    }, update: LR(function() {
      return new Promise(function(p) {
        f.forceUpdate(), p(l);
      });
    }), destroy: function() {
      v(), d = !0;
    } };
    if (!um(o, s)) return f;
    f.setOptions(u).then(function(p) {
      !d && u.onFirstUpdate && u.onFirstUpdate(p);
    });
    function h() {
      l.orderedModifiers.forEach(function(p) {
        var g = p.name, y = p.options, m = y === void 0 ? {} : y, b = p.effect;
        if (typeof b == "function") {
          var w = b({ state: l, name: g, instance: f, options: m }), x = function() {
          };
          c.push(w || x);
        }
      });
    }
    function v() {
      c.forEach(function(p) {
        return p();
      }), c = [];
    }
    return f;
  };
}
cg();
var MR = [l2, d2, s2, r2];
cg({ defaultModifiers: MR });
var NR = [l2, d2, s2, r2, ER, mR, TR, nR, wR], BR = cg({ defaultModifiers: NR });
const $R = (t, e, r = {}) => {
  const n = {
    name: "updateState",
    enabled: !0,
    phase: "write",
    fn: ({ state: u }) => {
      const l = qR(u);
      Object.assign(o.value, l);
    },
    requires: ["computeStyles"]
  }, a = j(() => {
    const { onFirstUpdate: u, placement: l, strategy: c, modifiers: d } = P(r);
    return {
      onFirstUpdate: u,
      placement: l || "bottom",
      strategy: c || "absolute",
      modifiers: [
        ...d || [],
        n,
        { name: "applyStyles", enabled: !1 }
      ]
    };
  }), i = xn(), o = de({
    styles: {
      popper: {
        position: P(a).strategy,
        left: "0",
        top: "0"
      },
      arrow: {
        position: "absolute"
      }
    },
    attributes: {}
  }), s = () => {
    i.value && (i.value.destroy(), i.value = void 0);
  };
  return Re(a, (u) => {
    const l = P(i);
    l && l.setOptions(u);
  }, {
    deep: !0
  }), Re([t, e], ([u, l]) => {
    s(), !(!u || !l) && (i.value = BR(u, l, P(a)));
  }), Zr(() => {
    s();
  }), {
    state: j(() => {
      var u;
      return { ...((u = P(i)) == null ? void 0 : u.state) || {} };
    }),
    styles: j(() => P(o).styles),
    attributes: j(() => P(o).attributes),
    update: () => {
      var u;
      return (u = P(i)) == null ? void 0 : u.update();
    },
    forceUpdate: () => {
      var u;
      return (u = P(i)) == null ? void 0 : u.forceUpdate();
    },
    instanceRef: j(() => P(i))
  };
};
function qR(t) {
  const e = Object.keys(t.elements), r = rl(e.map((a) => [a, t.styles[a] || {}])), n = rl(e.map((a) => [a, t.attributes[a]]));
  return {
    styles: r,
    attributes: n
  };
}
function cm() {
  let t;
  const e = (n, a) => {
    r(), t = window.setTimeout(n, a);
  }, r = () => window.clearTimeout(t);
  return wl(() => r()), {
    registerTimeout: e,
    cancelTimeout: r
  };
}
const mp = {
  prefix: Math.floor(Math.random() * 1e4),
  current: 0
}, zR = Symbol("elIdInjection"), f2 = () => mt() ? Ue(zR, mp) : mp, Al = (t) => {
  const e = f2();
  !It && e === mp && Ot("IdInjection", `Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
usage: app.provide(ID_INJECTION_KEY, {
  prefix: number,
  current: number,
})`);
  const r = rg();
  return j(() => P(t) || `${r.value}-id-${e.prefix}-${e.current++}`);
};
let si = [];
const dm = (t) => {
  const e = t;
  e.key === Rt.esc && si.forEach((r) => r(e));
}, VR = (t) => {
  St(() => {
    si.length === 0 && document.addEventListener("keydown", dm), It && si.push(t);
  }), Zr(() => {
    si = si.filter((e) => e !== t), si.length === 0 && It && document.removeEventListener("keydown", dm);
  });
};
let fm;
const v2 = () => {
  const t = rg(), e = f2(), r = j(() => `${t.value}-popper-container-${e.prefix}`), n = j(() => `#${r.value}`);
  return {
    id: r,
    selector: n
  };
}, HR = (t) => {
  const e = document.createElement("div");
  return e.id = t, document.body.appendChild(e), e;
}, KR = () => {
  const { id: t, selector: e } = v2();
  return HT(() => {
    It && (process.env.NODE_ENV === "test" || !fm || !document.body.querySelector(e.value)) && (fm = HR(t.value));
  }), {
    id: t,
    selector: e
  };
}, GR = rt({
  showAfter: {
    type: Number,
    default: 0
  },
  hideAfter: {
    type: Number,
    default: 200
  },
  autoClose: {
    type: Number,
    default: 0
  }
}), UR = ({
  showAfter: t,
  hideAfter: e,
  autoClose: r,
  open: n,
  close: a
}) => {
  const { registerTimeout: i } = cm(), {
    registerTimeout: o,
    cancelTimeout: s
  } = cm();
  return {
    onOpen: (c) => {
      i(() => {
        n(c);
        const d = P(r);
        Ut(d) && d > 0 && o(() => {
          a(c);
        }, d);
      }, P(t));
    },
    onClose: (c) => {
      s(), i(() => {
        a(c);
      }, P(e));
    }
  };
}, h2 = Symbol("elForwardRef"), WR = (t) => {
  Et(h2, {
    setForwardRef: (r) => {
      t.value = r;
    }
  });
}, jR = (t) => ({
  mounted(e) {
    t(e);
  },
  updated(e) {
    t(e);
  },
  unmounted() {
    t(null);
  }
}), vm = {
  current: 0
}, hm = de(0), p2 = 2e3, pm = Symbol("elZIndexContextKey"), g2 = Symbol("zIndexContextKey"), y2 = (t) => {
  const e = mt() ? Ue(pm, vm) : vm, r = t || (mt() ? Ue(g2, void 0) : void 0), n = j(() => {
    const o = P(r);
    return Ut(o) ? o : p2;
  }), a = j(() => n.value + hm.value), i = () => (e.current++, hm.value = e.current, a.value);
  return !It && !Ue(pm) && Ot("ZIndexInjection", `Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`), {
    initialZIndex: n,
    currentZIndex: a,
    nextZIndex: i
  };
};
function YR(t) {
  let e;
  function r() {
    if (t.value == null)
      return;
    const { selectionStart: a, selectionEnd: i, value: o } = t.value;
    if (a == null || i == null)
      return;
    const s = o.slice(0, Math.max(0, a)), u = o.slice(Math.max(0, i));
    e = {
      selectionStart: a,
      selectionEnd: i,
      value: o,
      beforeTxt: s,
      afterTxt: u
    };
  }
  function n() {
    if (t.value == null || e == null)
      return;
    const { value: a } = t.value, { beforeTxt: i, afterTxt: o, selectionStart: s } = e;
    if (i == null || o == null || s == null)
      return;
    let u = a.length;
    if (a.endsWith(o))
      u = a.length - o.length;
    else if (a.startsWith(i))
      u = i.length;
    else {
      const l = i[s - 1], c = a.indexOf(l, s - 1);
      c !== -1 && (u = c + 1);
    }
    t.value.setSelectionRange(u, u);
  }
  return [r, n];
}
const Di = Tl({
  type: String,
  values: XE,
  required: !1
}), m2 = Symbol("size"), ZR = () => {
  const t = Ue(m2, {});
  return j(() => P(t.size) || "");
};
function dg(t, {
  beforeFocus: e,
  afterFocus: r,
  beforeBlur: n,
  afterBlur: a
} = {}) {
  const i = mt(), { emit: o } = i, s = xn(), u = de(!1), l = (f) => {
    cr(e) && e(f) || u.value || (u.value = !0, o("focus", f), r == null || r());
  }, c = (f) => {
    var h;
    cr(n) && n(f) || f.relatedTarget && ((h = s.value) != null && h.contains(f.relatedTarget)) || (u.value = !1, o("blur", f), a == null || a());
  }, d = () => {
    var f, h;
    (f = s.value) != null && f.contains(document.activeElement) && s.value !== document.activeElement || (h = t.value) == null || h.focus();
  };
  return Re(s, (f) => {
    f && f.setAttribute("tabindex", "-1");
  }), Ar(s, "focus", l, !0), Ar(s, "blur", c, !0), Ar(s, "click", d, !0), process.env.NODE_ENV === "test" && St(() => {
    const f = Ea(t.value) ? t.value : document.querySelector("input,textarea");
    f && (Ar(f, "focus", l, !0), Ar(f, "blur", c, !0));
  }), {
    isFocused: u,
    wrapperRef: s,
    handleFocus: l,
    handleBlur: c
  };
}
function b2({
  afterComposition: t,
  emit: e
}) {
  const r = de(!1), n = (s) => {
    e == null || e("compositionstart", s), r.value = !0;
  }, a = (s) => {
    var u;
    e == null || e("compositionupdate", s);
    const l = (u = s.target) == null ? void 0 : u.value, c = l[l.length - 1] || "";
    r.value = !kD(c);
  }, i = (s) => {
    e == null || e("compositionend", s), r.value && (r.value = !1, ot(() => t(s)));
  };
  return {
    isComposing: r,
    handleComposition: (s) => {
      s.type === "compositionend" ? i(s) : a(s);
    },
    handleCompositionStart: n,
    handleCompositionUpdate: a,
    handleCompositionEnd: i
  };
}
const w2 = Symbol("emptyValuesContextKey"), XR = "use-empty-values", JR = ["", void 0, null], QR = void 0, eL = rt({
  emptyValues: Array,
  valueOnClear: {
    type: [String, Number, Boolean, Function],
    default: void 0,
    validator: (t) => cr(t) ? !t() : !t
  }
}), tL = (t, e) => {
  const r = mt() ? Ue(w2, de({})) : de({}), n = j(() => t.emptyValues || r.value.emptyValues || JR), a = j(() => cr(t.valueOnClear) ? t.valueOnClear() : t.valueOnClear !== void 0 ? t.valueOnClear : cr(r.value.valueOnClear) ? r.value.valueOnClear() : r.value.valueOnClear !== void 0 ? r.value.valueOnClear : QR), i = (o) => n.value.includes(o);
  return n.value.includes(a.value) || Ot(XR, "value-on-clear should be a value of empty-values"), {
    emptyValues: n,
    valueOnClear: a,
    isEmptyValue: i
  };
}, rL = rt({
  ariaLabel: String,
  ariaOrientation: {
    type: String,
    values: ["horizontal", "vertical", "undefined"]
  },
  ariaControls: String
}), sa = (t) => UE(rL, t), C2 = Symbol(), ol = de();
function fg(t, e = void 0) {
  const r = mt() ? Ue(C2, ol) : ol;
  return t ? j(() => {
    var n, a;
    return (a = (n = r.value) == null ? void 0 : n[t]) != null ? a : e;
  }) : r;
}
function nL(t, e) {
  const r = fg(), n = Ge(t, j(() => {
    var s;
    return ((s = r.value) == null ? void 0 : s.namespace) || Bs;
  })), a = Uo(j(() => {
    var s;
    return (s = r.value) == null ? void 0 : s.locale;
  })), i = y2(j(() => {
    var s;
    return ((s = r.value) == null ? void 0 : s.zIndex) || p2;
  })), o = j(() => {
    var s;
    return P(e) || ((s = r.value) == null ? void 0 : s.size) || "";
  });
  return aL(j(() => P(r) || {})), {
    ns: n,
    locale: a,
    zIndex: i,
    size: o
  };
}
const aL = (t, e, r = !1) => {
  var n;
  const a = !!mt(), i = a ? fg() : void 0, o = (n = void 0) != null ? n : a ? Et : void 0;
  if (!o) {
    Ot("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup().");
    return;
  }
  const s = j(() => {
    const u = P(t);
    return i != null && i.value ? iL(i.value, u) : u;
  });
  return o(C2, s), o(JE, j(() => s.value.locale)), o(QE, j(() => s.value.namespace)), o(g2, j(() => s.value.zIndex)), o(m2, {
    size: j(() => s.value.size || "")
  }), o(w2, j(() => ({
    emptyValues: s.value.emptyValues,
    valueOnClear: s.value.valueOnClear
  }))), (r || !ol.value) && (ol.value = s.value), s;
}, iL = (t, e) => {
  const r = [.../* @__PURE__ */ new Set([...em(t), ...em(e)])], n = {};
  for (const a of r)
    n[a] = e[a] !== void 0 ? e[a] : t[a];
  return n;
};
var Ke = (t, e) => {
  const r = t.__vccOpts || t;
  for (const [n, a] of e)
    r[n] = a;
  return r;
};
const oL = rt({
  size: {
    type: qe([Number, String])
  },
  color: {
    type: String
  }
}), sL = Se({
  name: "ElIcon",
  inheritAttrs: !1
}), lL = /* @__PURE__ */ Se({
  ...sL,
  props: oL,
  setup(t) {
    const e = t, r = Ge("icon"), n = j(() => {
      const { size: a, color: i } = e;
      return !a && !i ? {} : {
        fontSize: Un(a) ? void 0 : wi(a),
        "--color": i
      };
    });
    return (a, i) => (q(), ie("i", Ur({
      class: P(r).b(),
      style: P(n)
    }, a.$attrs), [
      Fe(a.$slots, "default")
    ], 16));
  }
});
var uL = /* @__PURE__ */ Ke(lL, [["__file", "icon.vue"]]);
const Ft = Vt(uL), vg = Symbol("formContextKey"), Io = Symbol("formItemContextKey"), Oa = (t, e = {}) => {
  const r = de(void 0), n = e.prop ? r : e2("size"), a = e.global ? r : ZR(), i = e.form ? { size: void 0 } : Ue(vg, void 0), o = e.formItem ? { size: void 0 } : Ue(Io, void 0);
  return j(() => n.value || P(t) || (o == null ? void 0 : o.size) || (i == null ? void 0 : i.size) || a.value || "");
}, Yo = (t) => {
  const e = e2("disabled"), r = Ue(vg, void 0);
  return j(() => e.value || P(t) || (r == null ? void 0 : r.disabled) || !1);
}, Va = () => {
  const t = Ue(vg, void 0), e = Ue(Io, void 0);
  return {
    form: t,
    formItem: e
  };
}, Zo = (t, {
  formItemContext: e,
  disableIdGeneration: r,
  disableIdManagement: n
}) => {
  r || (r = de(!1)), n || (n = de(!1));
  const a = de();
  let i;
  const o = j(() => {
    var s;
    return !!(!(t.label || t.ariaLabel) && e && e.inputIds && ((s = e.inputIds) == null ? void 0 : s.length) <= 1);
  });
  return St(() => {
    i = Re([Gr(t, "id"), r], ([s, u]) => {
      const l = s ?? (u ? void 0 : Al().value);
      l !== a.value && (e != null && e.removeInputId && (a.value && e.removeInputId(a.value), !(n != null && n.value) && !u && l && e.addInputId(l)), a.value = l);
    }, { immediate: !0 });
  }), KT(() => {
    i && i(), e != null && e.removeInputId && a.value && e.removeInputId(a.value);
  }), {
    isLabeledByFormItem: o,
    inputId: a
  };
};
let qr;
const cL = `
  height:0 !important;
  visibility:hidden !important;
  ${wI() ? "" : "overflow:hidden !important;"}
  position:absolute !important;
  z-index:-1000 !important;
  top:0 !important;
  right:0 !important;
`, dL = [
  "letter-spacing",
  "line-height",
  "padding-top",
  "padding-bottom",
  "font-family",
  "font-weight",
  "font-size",
  "text-rendering",
  "text-transform",
  "width",
  "text-indent",
  "padding-left",
  "padding-right",
  "border-width",
  "box-sizing"
];
function fL(t) {
  const e = window.getComputedStyle(t), r = e.getPropertyValue("box-sizing"), n = Number.parseFloat(e.getPropertyValue("padding-bottom")) + Number.parseFloat(e.getPropertyValue("padding-top")), a = Number.parseFloat(e.getPropertyValue("border-bottom-width")) + Number.parseFloat(e.getPropertyValue("border-top-width"));
  return { contextStyle: dL.map((o) => `${o}:${e.getPropertyValue(o)}`).join(";"), paddingSize: n, borderSize: a, boxSizing: r };
}
function gm(t, e = 1, r) {
  var n;
  qr || (qr = document.createElement("textarea"), document.body.appendChild(qr));
  const { paddingSize: a, borderSize: i, boxSizing: o, contextStyle: s } = fL(t);
  qr.setAttribute("style", `${s};${cL}`), qr.value = t.value || t.placeholder || "";
  let u = qr.scrollHeight;
  const l = {};
  o === "border-box" ? u = u + i : o === "content-box" && (u = u - a), qr.value = "";
  const c = qr.scrollHeight - a;
  if (Ut(e)) {
    let d = c * e;
    o === "border-box" && (d = d + a + i), u = Math.max(d, u), l.minHeight = `${d}px`;
  }
  if (Ut(r)) {
    let d = c * r;
    o === "border-box" && (d = d + a + i), u = Math.min(d, u);
  }
  return l.height = `${u}px`, (n = qr.parentNode) == null || n.removeChild(qr), qr = void 0, l;
}
const vL = rt({
  id: {
    type: String,
    default: void 0
  },
  size: Di,
  disabled: Boolean,
  modelValue: {
    type: qe([
      String,
      Number,
      Object
    ]),
    default: ""
  },
  maxlength: {
    type: [String, Number]
  },
  minlength: {
    type: [String, Number]
  },
  type: {
    type: String,
    default: "text"
  },
  resize: {
    type: String,
    values: ["none", "both", "horizontal", "vertical"]
  },
  autosize: {
    type: qe([Boolean, Object]),
    default: !1
  },
  autocomplete: {
    type: String,
    default: "off"
  },
  formatter: {
    type: Function
  },
  parser: {
    type: Function
  },
  placeholder: {
    type: String
  },
  form: {
    type: String
  },
  readonly: Boolean,
  clearable: Boolean,
  showPassword: Boolean,
  showWordLimit: Boolean,
  suffixIcon: {
    type: Qn
  },
  prefixIcon: {
    type: Qn
  },
  containerRole: {
    type: String,
    default: void 0
  },
  tabindex: {
    type: [String, Number],
    default: 0
  },
  validateEvent: {
    type: Boolean,
    default: !0
  },
  inputStyle: {
    type: qe([Object, Array, String]),
    default: () => oi({})
  },
  autofocus: Boolean,
  rows: {
    type: Number,
    default: 2
  },
  ...sa(["ariaLabel"])
}), hL = {
  [Kt]: (t) => nr(t),
  input: (t) => nr(t),
  change: (t) => nr(t),
  focus: (t) => t instanceof FocusEvent,
  blur: (t) => t instanceof FocusEvent,
  clear: () => !0,
  mouseleave: (t) => t instanceof MouseEvent,
  mouseenter: (t) => t instanceof MouseEvent,
  keydown: (t) => t instanceof Event,
  compositionstart: (t) => t instanceof CompositionEvent,
  compositionupdate: (t) => t instanceof CompositionEvent,
  compositionend: (t) => t instanceof CompositionEvent
}, pL = Se({
  name: "ElInput",
  inheritAttrs: !1
}), gL = /* @__PURE__ */ Se({
  ...pL,
  props: vL,
  emits: hL,
  setup(t, { expose: e, emit: r }) {
    const n = t, a = GT(), i = Ho(), o = j(() => {
      const I = {};
      return n.containerRole === "combobox" && (I["aria-haspopup"] = a["aria-haspopup"], I["aria-owns"] = a["aria-owns"], I["aria-expanded"] = a["aria-expanded"]), I;
    }), s = j(() => [
      n.type === "textarea" ? g.b() : p.b(),
      p.m(h.value),
      p.is("disabled", v.value),
      p.is("exceed", ne.value),
      {
        [p.b("group")]: i.prepend || i.append,
        [p.m("prefix")]: i.prefix || n.prefixIcon,
        [p.m("suffix")]: i.suffix || n.suffixIcon || n.clearable || n.showPassword,
        [p.bm("suffix", "password-clear")]: V.value && Y.value,
        [p.b("hidden")]: n.type === "hidden"
      },
      a.class
    ]), u = j(() => [
      p.e("wrapper"),
      p.is("focus", S.value)
    ]), l = ID({
      excludeKeys: j(() => Object.keys(o.value))
    }), { form: c, formItem: d } = Va(), { inputId: f } = Zo(n, {
      formItemContext: d
    }), h = Oa(), v = Yo(), p = Ge("input"), g = Ge("textarea"), y = xn(), m = xn(), b = de(!1), w = de(!1), x = de(), E = xn(n.inputStyle), C = j(() => y.value || m.value), { wrapperRef: k, isFocused: S, handleFocus: _, handleBlur: T } = dg(C, {
      beforeFocus() {
        return v.value;
      },
      afterBlur() {
        var I;
        n.validateEvent && ((I = d == null ? void 0 : d.validate) == null || I.call(d, "blur").catch((G) => Ot(G)));
      }
    }), O = j(() => {
      var I;
      return (I = c == null ? void 0 : c.statusIcon) != null ? I : !1;
    }), D = j(() => (d == null ? void 0 : d.validateState) || ""), A = j(() => D.value && ZE[D.value]), F = j(() => w.value ? IT : OT), R = j(() => [
      a.style
    ]), M = j(() => [
      n.inputStyle,
      E.value,
      { resize: n.resize }
    ]), L = j(() => Yn(n.modelValue) ? "" : String(n.modelValue)), V = j(() => n.clearable && !v.value && !n.readonly && !!L.value && (S.value || b.value)), Y = j(() => n.showPassword && !v.value && !n.readonly && !!L.value && (!!L.value || S.value)), H = j(() => n.showWordLimit && !!n.maxlength && (n.type === "text" || n.type === "textarea") && !v.value && !n.readonly && !n.showPassword), K = j(() => L.value.length), ne = j(() => !!H.value && K.value > Number(n.maxlength)), B = j(() => !!i.suffix || !!n.suffixIcon || V.value || n.showPassword || H.value || !!D.value && O.value), [$, z] = YR(y);
    bn(m, (I) => {
      if (N(), !H.value || n.resize !== "both")
        return;
      const G = I[0], { width: se } = G.contentRect;
      x.value = {
        right: `calc(100% - ${se + 15 + 6}px)`
      };
    });
    const W = () => {
      const { type: I, autosize: G } = n;
      if (!(!It || I !== "textarea" || !m.value))
        if (G) {
          const se = Gt(G) ? G.minRows : void 0, ee = Gt(G) ? G.maxRows : void 0, te = gm(m.value, se, ee);
          E.value = {
            overflowY: "hidden",
            ...te
          }, ot(() => {
            m.value.offsetHeight, E.value = te;
          });
        } else
          E.value = {
            minHeight: gm(m.value).minHeight
          };
    }, N = ((I) => {
      let G = !1;
      return () => {
        var se;
        if (G || !n.autosize)
          return;
        ((se = m.value) == null ? void 0 : se.offsetParent) === null || (I(), G = !0);
      };
    })(W), X = () => {
      const I = C.value, G = n.formatter ? n.formatter(L.value) : L.value;
      !I || I.value === G || (I.value = G);
    }, Q = async (I) => {
      $();
      let { value: G } = I.target;
      if (n.formatter && (G = n.parser ? n.parser(G) : G), !we.value) {
        if (G === L.value) {
          X();
          return;
        }
        r(Kt, G), r("input", G), await ot(), X(), z();
      }
    }, ge = (I) => {
      r("change", I.target.value);
    }, {
      isComposing: we,
      handleCompositionStart: fe,
      handleCompositionUpdate: ce,
      handleCompositionEnd: be
    } = b2({ emit: r, afterComposition: Q }), ve = () => {
      w.value = !w.value, xe();
    }, xe = async () => {
      var I;
      await ot(), (I = C.value) == null || I.focus();
    }, _e = () => {
      var I;
      return (I = C.value) == null ? void 0 : I.blur();
    }, He = (I) => {
      b.value = !1, r("mouseleave", I);
    }, Ve = (I) => {
      b.value = !0, r("mouseenter", I);
    }, De = (I) => {
      r("keydown", I);
    }, Ne = () => {
      var I;
      (I = C.value) == null || I.select();
    }, ue = () => {
      r(Kt, ""), r("change", ""), r("clear"), r("input", "");
    };
    return Re(() => n.modelValue, () => {
      var I;
      ot(() => W()), n.validateEvent && ((I = d == null ? void 0 : d.validate) == null || I.call(d, "change").catch((G) => Ot(G)));
    }), Re(L, () => X()), Re(() => n.type, async () => {
      await ot(), X(), W();
    }), St(() => {
      !n.formatter && n.parser && Ot("ElInput", "If you set the parser, you also need to set the formatter."), X(), ot(W);
    }), e({
      input: y,
      textarea: m,
      ref: C,
      textareaStyle: M,
      autosize: Gr(n, "autosize"),
      isComposing: we,
      focus: xe,
      blur: _e,
      select: Ne,
      clear: ue,
      resizeTextarea: W
    }), (I, G) => (q(), ie("div", Ur(P(o), {
      class: [
        P(s),
        {
          [P(p).bm("group", "append")]: I.$slots.append,
          [P(p).bm("group", "prepend")]: I.$slots.prepend
        }
      ],
      style: P(R),
      role: I.containerRole,
      onMouseenter: Ve,
      onMouseleave: He
    }), [
      pe(" input "),
      I.type !== "textarea" ? (q(), ie(je, { key: 0 }, [
        pe(" prepend slot "),
        I.$slots.prepend ? (q(), ie("div", {
          key: 0,
          class: le(P(p).be("group", "prepend"))
        }, [
          Fe(I.$slots, "prepend")
        ], 2)) : pe("v-if", !0),
        ae("div", {
          ref_key: "wrapperRef",
          ref: k,
          class: le(P(u))
        }, [
          pe(" prefix slot "),
          I.$slots.prefix || I.prefixIcon ? (q(), ie("span", {
            key: 0,
            class: le(P(p).e("prefix"))
          }, [
            ae("span", {
              class: le(P(p).e("prefix-inner"))
            }, [
              Fe(I.$slots, "prefix"),
              I.prefixIcon ? (q(), me(P(Ft), {
                key: 0,
                class: le(P(p).e("icon"))
              }, {
                default: U(() => [
                  (q(), me(rr(I.prefixIcon)))
                ]),
                _: 1
              }, 8, ["class"])) : pe("v-if", !0)
            ], 2)
          ], 2)) : pe("v-if", !0),
          ae("input", Ur({
            id: P(f),
            ref_key: "input",
            ref: y,
            class: P(p).e("inner")
          }, P(l), {
            minlength: I.minlength,
            maxlength: I.maxlength,
            type: I.showPassword ? w.value ? "text" : "password" : I.type,
            disabled: P(v),
            readonly: I.readonly,
            autocomplete: I.autocomplete,
            tabindex: I.tabindex,
            "aria-label": I.ariaLabel,
            placeholder: I.placeholder,
            style: I.inputStyle,
            form: I.form,
            autofocus: I.autofocus,
            onCompositionstart: P(fe),
            onCompositionupdate: P(ce),
            onCompositionend: P(be),
            onInput: Q,
            onChange: ge,
            onKeydown: De
          }), null, 16, ["id", "minlength", "maxlength", "type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus", "onCompositionstart", "onCompositionupdate", "onCompositionend"]),
          pe(" suffix slot "),
          P(B) ? (q(), ie("span", {
            key: 1,
            class: le(P(p).e("suffix"))
          }, [
            ae("span", {
              class: le(P(p).e("suffix-inner"))
            }, [
              !P(V) || !P(Y) || !P(H) ? (q(), ie(je, { key: 0 }, [
                Fe(I.$slots, "suffix"),
                I.suffixIcon ? (q(), me(P(Ft), {
                  key: 0,
                  class: le(P(p).e("icon"))
                }, {
                  default: U(() => [
                    (q(), me(rr(I.suffixIcon)))
                  ]),
                  _: 1
                }, 8, ["class"])) : pe("v-if", !0)
              ], 64)) : pe("v-if", !0),
              P(V) ? (q(), me(P(Ft), {
                key: 1,
                class: le([P(p).e("icon"), P(p).e("clear")]),
                onMousedown: pt(P(Eo), ["prevent"]),
                onClick: ue
              }, {
                default: U(() => [
                  J(P(Gp))
                ]),
                _: 1
              }, 8, ["class", "onMousedown"])) : pe("v-if", !0),
              P(Y) ? (q(), me(P(Ft), {
                key: 2,
                class: le([P(p).e("icon"), P(p).e("password")]),
                onClick: ve
              }, {
                default: U(() => [
                  (q(), me(rr(P(F))))
                ]),
                _: 1
              }, 8, ["class"])) : pe("v-if", !0),
              P(H) ? (q(), ie("span", {
                key: 3,
                class: le(P(p).e("count"))
              }, [
                ae("span", {
                  class: le(P(p).e("count-inner"))
                }, ke(P(K)) + " / " + ke(I.maxlength), 3)
              ], 2)) : pe("v-if", !0),
              P(D) && P(A) && P(O) ? (q(), me(P(Ft), {
                key: 4,
                class: le([
                  P(p).e("icon"),
                  P(p).e("validateIcon"),
                  P(p).is("loading", P(D) === "validating")
                ])
              }, {
                default: U(() => [
                  (q(), me(rr(P(A))))
                ]),
                _: 1
              }, 8, ["class"])) : pe("v-if", !0)
            ], 2)
          ], 2)) : pe("v-if", !0)
        ], 2),
        pe(" append slot "),
        I.$slots.append ? (q(), ie("div", {
          key: 1,
          class: le(P(p).be("group", "append"))
        }, [
          Fe(I.$slots, "append")
        ], 2)) : pe("v-if", !0)
      ], 64)) : (q(), ie(je, { key: 1 }, [
        pe(" textarea "),
        ae("textarea", Ur({
          id: P(f),
          ref_key: "textarea",
          ref: m,
          class: [P(g).e("inner"), P(p).is("focus", P(S))]
        }, P(l), {
          minlength: I.minlength,
          maxlength: I.maxlength,
          tabindex: I.tabindex,
          disabled: P(v),
          readonly: I.readonly,
          autocomplete: I.autocomplete,
          style: P(M),
          "aria-label": I.ariaLabel,
          placeholder: I.placeholder,
          form: I.form,
          autofocus: I.autofocus,
          rows: I.rows,
          onCompositionstart: P(fe),
          onCompositionupdate: P(ce),
          onCompositionend: P(be),
          onInput: Q,
          onFocus: P(_),
          onBlur: P(T),
          onChange: ge,
          onKeydown: De
        }), null, 16, ["id", "minlength", "maxlength", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus", "rows", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onFocus", "onBlur"]),
        P(H) ? (q(), ie("span", {
          key: 0,
          style: st(x.value),
          class: le(P(p).e("count"))
        }, ke(P(K)) + " / " + ke(I.maxlength), 7)) : pe("v-if", !0)
      ], 64))
    ], 16, ["role"]));
  }
});
var yL = /* @__PURE__ */ Ke(gL, [["__file", "input.vue"]]);
const Xo = Vt(yL), Ja = 4, mL = {
  vertical: {
    offset: "offsetHeight",
    scroll: "scrollTop",
    scrollSize: "scrollHeight",
    size: "height",
    key: "vertical",
    axis: "Y",
    client: "clientY",
    direction: "top"
  },
  horizontal: {
    offset: "offsetWidth",
    scroll: "scrollLeft",
    scrollSize: "scrollWidth",
    size: "width",
    key: "horizontal",
    axis: "X",
    client: "clientX",
    direction: "left"
  }
}, bL = ({
  move: t,
  size: e,
  bar: r
}) => ({
  [r.size]: e,
  transform: `translate${r.axis}(${t}%)`
}), hg = Symbol("scrollbarContextKey"), wL = rt({
  vertical: Boolean,
  size: String,
  move: Number,
  ratio: {
    type: Number,
    required: !0
  },
  always: Boolean
}), CL = "Thumb", xL = /* @__PURE__ */ Se({
  __name: "thumb",
  props: wL,
  setup(t) {
    const e = t, r = Ue(hg), n = Ge("scrollbar");
    r || wD(CL, "can not inject scrollbar context");
    const a = de(), i = de(), o = de({}), s = de(!1);
    let u = !1, l = !1, c = It ? document.onselectstart : null;
    const d = j(() => mL[e.vertical ? "vertical" : "horizontal"]), f = j(() => bL({
      size: e.size,
      move: e.move,
      bar: d.value
    })), h = j(() => a.value[d.value.offset] ** 2 / r.wrapElement[d.value.scrollSize] / e.ratio / i.value[d.value.offset]), v = (E) => {
      var C;
      if (E.stopPropagation(), E.ctrlKey || [1, 2].includes(E.button))
        return;
      (C = window.getSelection()) == null || C.removeAllRanges(), g(E);
      const k = E.currentTarget;
      k && (o.value[d.value.axis] = k[d.value.offset] - (E[d.value.client] - k.getBoundingClientRect()[d.value.direction]));
    }, p = (E) => {
      if (!i.value || !a.value || !r.wrapElement)
        return;
      const C = Math.abs(E.target.getBoundingClientRect()[d.value.direction] - E[d.value.client]), k = i.value[d.value.offset] / 2, S = (C - k) * 100 * h.value / a.value[d.value.offset];
      r.wrapElement[d.value.scroll] = S * r.wrapElement[d.value.scrollSize] / 100;
    }, g = (E) => {
      E.stopImmediatePropagation(), u = !0, document.addEventListener("mousemove", y), document.addEventListener("mouseup", m), c = document.onselectstart, document.onselectstart = () => !1;
    }, y = (E) => {
      if (!a.value || !i.value || u === !1)
        return;
      const C = o.value[d.value.axis];
      if (!C)
        return;
      const k = (a.value.getBoundingClientRect()[d.value.direction] - E[d.value.client]) * -1, S = i.value[d.value.offset] - C, _ = (k - S) * 100 * h.value / a.value[d.value.offset];
      r.wrapElement[d.value.scroll] = _ * r.wrapElement[d.value.scrollSize] / 100;
    }, m = () => {
      u = !1, o.value[d.value.axis] = 0, document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", m), x(), l && (s.value = !1);
    }, b = () => {
      l = !1, s.value = !!e.size;
    }, w = () => {
      l = !0, s.value = u;
    };
    Zr(() => {
      x(), document.removeEventListener("mouseup", m);
    });
    const x = () => {
      document.onselectstart !== c && (document.onselectstart = c);
    };
    return Ar(Gr(r, "scrollbarElement"), "mousemove", b), Ar(Gr(r, "scrollbarElement"), "mouseleave", w), (E, C) => (q(), me(Ai, {
      name: P(n).b("fade"),
      persisted: ""
    }, {
      default: U(() => [
        Ye(ae("div", {
          ref_key: "instance",
          ref: a,
          class: le([P(n).e("bar"), P(n).is(P(d).key)]),
          onMousedown: p
        }, [
          ae("div", {
            ref_key: "thumb",
            ref: i,
            class: le(P(n).e("thumb")),
            style: st(P(f)),
            onMousedown: v
          }, null, 38)
        ], 34), [
          [dt, E.always || s.value]
        ])
      ]),
      _: 1
    }, 8, ["name"]));
  }
});
var ym = /* @__PURE__ */ Ke(xL, [["__file", "thumb.vue"]]);
const EL = rt({
  always: {
    type: Boolean,
    default: !0
  },
  minSize: {
    type: Number,
    required: !0
  }
}), SL = /* @__PURE__ */ Se({
  __name: "bar",
  props: EL,
  setup(t, { expose: e }) {
    const r = t, n = Ue(hg), a = de(0), i = de(0), o = de(""), s = de(""), u = de(1), l = de(1);
    return e({
      handleScroll: (f) => {
        if (f) {
          const h = f.offsetHeight - Ja, v = f.offsetWidth - Ja;
          i.value = f.scrollTop * 100 / h * u.value, a.value = f.scrollLeft * 100 / v * l.value;
        }
      },
      update: () => {
        const f = n == null ? void 0 : n.wrapElement;
        if (!f)
          return;
        const h = f.offsetHeight - Ja, v = f.offsetWidth - Ja, p = h ** 2 / f.scrollHeight, g = v ** 2 / f.scrollWidth, y = Math.max(p, r.minSize), m = Math.max(g, r.minSize);
        u.value = p / (h - p) / (y / (h - y)), l.value = g / (v - g) / (m / (v - m)), s.value = y + Ja < h ? `${y}px` : "", o.value = m + Ja < v ? `${m}px` : "";
      }
    }), (f, h) => (q(), ie(je, null, [
      J(ym, {
        move: a.value,
        ratio: l.value,
        size: o.value,
        always: f.always
      }, null, 8, ["move", "ratio", "size", "always"]),
      J(ym, {
        move: i.value,
        ratio: u.value,
        size: s.value,
        vertical: "",
        always: f.always
      }, null, 8, ["move", "ratio", "size", "always"])
    ], 64));
  }
});
var kL = /* @__PURE__ */ Ke(SL, [["__file", "bar.vue"]]);
const _L = rt({
  height: {
    type: [String, Number],
    default: ""
  },
  maxHeight: {
    type: [String, Number],
    default: ""
  },
  native: {
    type: Boolean,
    default: !1
  },
  wrapStyle: {
    type: qe([String, Object, Array]),
    default: ""
  },
  wrapClass: {
    type: [String, Array],
    default: ""
  },
  viewClass: {
    type: [String, Array],
    default: ""
  },
  viewStyle: {
    type: [String, Array, Object],
    default: ""
  },
  noresize: Boolean,
  tag: {
    type: String,
    default: "div"
  },
  always: Boolean,
  minSize: {
    type: Number,
    default: 20
  },
  tabindex: {
    type: [String, Number],
    default: void 0
  },
  id: String,
  role: String,
  ...sa(["ariaLabel", "ariaOrientation"])
}), TL = {
  scroll: ({
    scrollTop: t,
    scrollLeft: e
  }) => [t, e].every(Ut)
}, bp = "ElScrollbar", IL = Se({
  name: bp
}), OL = /* @__PURE__ */ Se({
  ...IL,
  props: _L,
  emits: TL,
  setup(t, { expose: e, emit: r }) {
    const n = t, a = Ge("scrollbar");
    let i, o, s = 0, u = 0;
    const l = de(), c = de(), d = de(), f = de(), h = j(() => {
      const x = {};
      return n.height && (x.height = wi(n.height)), n.maxHeight && (x.maxHeight = wi(n.maxHeight)), [n.wrapStyle, x];
    }), v = j(() => [
      n.wrapClass,
      a.e("wrap"),
      { [a.em("wrap", "hidden-default")]: !n.native }
    ]), p = j(() => [a.e("view"), n.viewClass]), g = () => {
      var x;
      c.value && ((x = f.value) == null || x.handleScroll(c.value), s = c.value.scrollTop, u = c.value.scrollLeft, r("scroll", {
        scrollTop: c.value.scrollTop,
        scrollLeft: c.value.scrollLeft
      }));
    };
    function y(x, E) {
      Gt(x) ? c.value.scrollTo(x) : Ut(x) && Ut(E) && c.value.scrollTo(x, E);
    }
    const m = (x) => {
      if (!Ut(x)) {
        Ot(bp, "value must be a number");
        return;
      }
      c.value.scrollTop = x;
    }, b = (x) => {
      if (!Ut(x)) {
        Ot(bp, "value must be a number");
        return;
      }
      c.value.scrollLeft = x;
    }, w = () => {
      var x;
      (x = f.value) == null || x.update();
    };
    return Re(() => n.noresize, (x) => {
      x ? (i == null || i(), o == null || o()) : ({ stop: i } = bn(d, w), o = Ar("resize", w));
    }, { immediate: !0 }), Re(() => [n.maxHeight, n.height], () => {
      n.native || ot(() => {
        var x;
        w(), c.value && ((x = f.value) == null || x.handleScroll(c.value));
      });
    }), Et(hg, on({
      scrollbarElement: l,
      wrapElement: c
    })), UT(() => {
      c.value && (c.value.scrollTop = s, c.value.scrollLeft = u);
    }), St(() => {
      n.native || ot(() => {
        w();
      });
    }), EE(() => w()), e({
      wrapRef: c,
      update: w,
      scrollTo: y,
      setScrollTop: m,
      setScrollLeft: b,
      handleScroll: g
    }), (x, E) => (q(), ie("div", {
      ref_key: "scrollbarRef",
      ref: l,
      class: le(P(a).b())
    }, [
      ae("div", {
        ref_key: "wrapRef",
        ref: c,
        class: le(P(v)),
        style: st(P(h)),
        tabindex: x.tabindex,
        onScroll: g
      }, [
        (q(), me(rr(x.tag), {
          id: x.id,
          ref_key: "resizeRef",
          ref: d,
          class: le(P(p)),
          style: st(x.viewStyle),
          role: x.role,
          "aria-label": x.ariaLabel,
          "aria-orientation": x.ariaOrientation
        }, {
          default: U(() => [
            Fe(x.$slots, "default")
          ]),
          _: 3
        }, 8, ["id", "class", "style", "role", "aria-label", "aria-orientation"]))
      ], 46, ["tabindex"]),
      x.native ? pe("v-if", !0) : (q(), me(kL, {
        key: 0,
        ref_key: "barRef",
        ref: f,
        always: x.always,
        "min-size": x.minSize
      }, null, 8, ["always", "min-size"]))
    ], 2));
  }
});
var AL = /* @__PURE__ */ Ke(OL, [["__file", "scrollbar.vue"]]);
const PL = Vt(AL), pg = Symbol("popper"), x2 = Symbol("popperContent"), DL = [
  "dialog",
  "grid",
  "group",
  "listbox",
  "menu",
  "navigation",
  "tooltip",
  "tree"
], E2 = rt({
  role: {
    type: String,
    values: DL,
    default: "tooltip"
  }
}), RL = Se({
  name: "ElPopper",
  inheritAttrs: !1
}), LL = /* @__PURE__ */ Se({
  ...RL,
  props: E2,
  setup(t, { expose: e }) {
    const r = t, n = de(), a = de(), i = de(), o = de(), s = j(() => r.role), u = {
      triggerRef: n,
      popperInstanceRef: a,
      contentRef: i,
      referenceRef: o,
      role: s
    };
    return e(u), Et(pg, u), (l, c) => Fe(l.$slots, "default");
  }
});
var FL = /* @__PURE__ */ Ke(LL, [["__file", "popper.vue"]]);
const S2 = rt({
  arrowOffset: {
    type: Number,
    default: 5
  }
}), ML = Se({
  name: "ElPopperArrow",
  inheritAttrs: !1
}), NL = /* @__PURE__ */ Se({
  ...ML,
  props: S2,
  setup(t, { expose: e }) {
    const r = t, n = Ge("popper"), { arrowOffset: a, arrowRef: i, arrowStyle: o } = Ue(x2, void 0);
    return Re(() => r.arrowOffset, (s) => {
      a.value = s;
    }), Zr(() => {
      i.value = void 0;
    }), e({
      arrowRef: i
    }), (s, u) => (q(), ie("span", {
      ref_key: "arrowRef",
      ref: i,
      class: le(P(n).e("arrow")),
      style: st(P(o)),
      "data-popper-arrow": ""
    }, null, 6));
  }
});
var BL = /* @__PURE__ */ Ke(NL, [["__file", "arrow.vue"]]);
const Cu = "ElOnlyChild", $L = Se({
  name: Cu,
  setup(t, {
    slots: e,
    attrs: r
  }) {
    var n;
    const a = Ue(h2), i = jR((n = a == null ? void 0 : a.setForwardRef) != null ? n : Eo);
    return () => {
      var o;
      const s = (o = e.default) == null ? void 0 : o.call(e, r);
      if (!s)
        return null;
      if (s.length > 1)
        return Ot(Cu, "requires exact only one valid child."), null;
      const u = k2(s);
      return u ? Ye(WT(u, r), [[i]]) : (Ot(Cu, "no valid child node found"), null);
    };
  }
});
function k2(t) {
  if (!t)
    return null;
  const e = t;
  for (const r of e) {
    if (Gt(r))
      switch (r.type) {
        case jT:
          continue;
        case SE:
        case "svg":
          return mm(r);
        case je:
          return k2(r.children);
        default:
          return r;
      }
    return mm(r);
  }
  return null;
}
function mm(t) {
  const e = Ge("only-child");
  return J("span", {
    class: e.e("content")
  }, [t]);
}
const _2 = rt({
  virtualRef: {
    type: qe(Object)
  },
  virtualTriggering: Boolean,
  onMouseenter: {
    type: qe(Function)
  },
  onMouseleave: {
    type: qe(Function)
  },
  onClick: {
    type: qe(Function)
  },
  onKeydown: {
    type: qe(Function)
  },
  onFocus: {
    type: qe(Function)
  },
  onBlur: {
    type: qe(Function)
  },
  onContextmenu: {
    type: qe(Function)
  },
  id: String,
  open: Boolean
}), qL = Se({
  name: "ElPopperTrigger",
  inheritAttrs: !1
}), zL = /* @__PURE__ */ Se({
  ...qL,
  props: _2,
  setup(t, { expose: e }) {
    const r = t, { role: n, triggerRef: a } = Ue(pg, void 0);
    WR(a);
    const i = j(() => s.value ? r.id : void 0), o = j(() => {
      if (n && n.value === "tooltip")
        return r.open && r.id ? r.id : void 0;
    }), s = j(() => {
      if (n && n.value !== "tooltip")
        return n.value;
    }), u = j(() => s.value ? `${r.open}` : void 0);
    let l;
    const c = [
      "onMouseenter",
      "onMouseleave",
      "onClick",
      "onKeydown",
      "onFocus",
      "onBlur",
      "onContextmenu"
    ];
    return St(() => {
      Re(() => r.virtualRef, (d) => {
        d && (a.value = Cn(d));
      }, {
        immediate: !0
      }), Re(a, (d, f) => {
        l == null || l(), l = void 0, Ea(d) && (c.forEach((h) => {
          var v;
          const p = r[h];
          p && (d.addEventListener(h.slice(2).toLowerCase(), p), (v = f == null ? void 0 : f.removeEventListener) == null || v.call(f, h.slice(2).toLowerCase(), p));
        }), l = Re([i, o, s, u], (h) => {
          [
            "aria-controls",
            "aria-describedby",
            "aria-haspopup",
            "aria-expanded"
          ].forEach((v, p) => {
            Yn(h[p]) ? d.removeAttribute(v) : d.setAttribute(v, h[p]);
          });
        }, { immediate: !0 })), Ea(f) && [
          "aria-controls",
          "aria-describedby",
          "aria-haspopup",
          "aria-expanded"
        ].forEach((h) => f.removeAttribute(h));
      }, {
        immediate: !0
      });
    }), Zr(() => {
      if (l == null || l(), l = void 0, a.value && Ea(a.value)) {
        const d = a.value;
        c.forEach((f) => {
          const h = r[f];
          h && d.removeEventListener(f.slice(2).toLowerCase(), h);
        }), a.value = void 0;
      }
    }), e({
      triggerRef: a
    }), (d, f) => d.virtualTriggering ? pe("v-if", !0) : (q(), me(P($L), Ur({ key: 0 }, d.$attrs, {
      "aria-controls": P(i),
      "aria-describedby": P(o),
      "aria-expanded": P(u),
      "aria-haspopup": P(s)
    }), {
      default: U(() => [
        Fe(d.$slots, "default")
      ]),
      _: 3
    }, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"]));
  }
});
var VL = /* @__PURE__ */ Ke(zL, [["__file", "trigger.vue"]]);
const xu = "focus-trap.focus-after-trapped", Eu = "focus-trap.focus-after-released", HL = "focus-trap.focusout-prevented", bm = {
  cancelable: !0,
  bubbles: !1
}, KL = {
  cancelable: !0,
  bubbles: !1
}, wm = "focusAfterTrapped", Cm = "focusAfterReleased", GL = Symbol("elFocusTrap"), gg = de(), Pl = de(0), yg = de(0);
let ms = 0;
const T2 = (t) => {
  const e = [], r = document.createTreeWalker(t, NodeFilter.SHOW_ELEMENT, {
    acceptNode: (n) => {
      const a = n.tagName === "INPUT" && n.type === "hidden";
      return n.disabled || n.hidden || a ? NodeFilter.FILTER_SKIP : n.tabIndex >= 0 || n === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
    }
  });
  for (; r.nextNode(); )
    e.push(r.currentNode);
  return e;
}, xm = (t, e) => {
  for (const r of t)
    if (!UL(r, e))
      return r;
}, UL = (t, e) => {
  if (process.env.NODE_ENV === "test")
    return !1;
  if (getComputedStyle(t).visibility === "hidden")
    return !0;
  for (; t; ) {
    if (e && t === e)
      return !1;
    if (getComputedStyle(t).display === "none")
      return !0;
    t = t.parentElement;
  }
  return !1;
}, WL = (t) => {
  const e = T2(t), r = xm(e, t), n = xm(e.reverse(), t);
  return [r, n];
}, jL = (t) => t instanceof HTMLInputElement && "select" in t, zn = (t, e) => {
  if (t && t.focus) {
    const r = document.activeElement;
    t.focus({ preventScroll: !0 }), yg.value = window.performance.now(), t !== r && jL(t) && e && t.select();
  }
};
function Em(t, e) {
  const r = [...t], n = t.indexOf(e);
  return n !== -1 && r.splice(n, 1), r;
}
const YL = () => {
  let t = [];
  return {
    push: (n) => {
      const a = t[0];
      a && n !== a && a.pause(), t = Em(t, n), t.unshift(n);
    },
    remove: (n) => {
      var a, i;
      t = Em(t, n), (i = (a = t[0]) == null ? void 0 : a.resume) == null || i.call(a);
    }
  };
}, ZL = (t, e = !1) => {
  const r = document.activeElement;
  for (const n of t)
    if (zn(n, e), document.activeElement !== r)
      return;
}, Sm = YL(), XL = () => Pl.value > yg.value, bs = () => {
  gg.value = "pointer", Pl.value = window.performance.now();
}, km = () => {
  gg.value = "keyboard", Pl.value = window.performance.now();
}, JL = () => (St(() => {
  ms === 0 && (document.addEventListener("mousedown", bs), document.addEventListener("touchstart", bs), document.addEventListener("keydown", km)), ms++;
}), Zr(() => {
  ms--, ms <= 0 && (document.removeEventListener("mousedown", bs), document.removeEventListener("touchstart", bs), document.removeEventListener("keydown", km));
}), {
  focusReason: gg,
  lastUserFocusTimestamp: Pl,
  lastAutomatedFocusTimestamp: yg
}), ws = (t) => new CustomEvent(HL, {
  ...KL,
  detail: t
}), QL = Se({
  name: "ElFocusTrap",
  inheritAttrs: !1,
  props: {
    loop: Boolean,
    trapped: Boolean,
    focusTrapEl: Object,
    focusStartEl: {
      type: [Object, String],
      default: "first"
    }
  },
  emits: [
    wm,
    Cm,
    "focusin",
    "focusout",
    "focusout-prevented",
    "release-requested"
  ],
  setup(t, { emit: e }) {
    const r = de();
    let n, a;
    const { focusReason: i } = JL();
    VR((v) => {
      t.trapped && !o.paused && e("release-requested", v);
    });
    const o = {
      paused: !1,
      pause() {
        this.paused = !0;
      },
      resume() {
        this.paused = !1;
      }
    }, s = (v) => {
      if (!t.loop && !t.trapped || o.paused)
        return;
      const { key: p, altKey: g, ctrlKey: y, metaKey: m, currentTarget: b, shiftKey: w } = v, { loop: x } = t, E = p === Rt.tab && !g && !y && !m, C = document.activeElement;
      if (E && C) {
        const k = b, [S, _] = WL(k);
        if (S && _) {
          if (!w && C === _) {
            const O = ws({
              focusReason: i.value
            });
            e("focusout-prevented", O), O.defaultPrevented || (v.preventDefault(), x && zn(S, !0));
          } else if (w && [S, k].includes(C)) {
            const O = ws({
              focusReason: i.value
            });
            e("focusout-prevented", O), O.defaultPrevented || (v.preventDefault(), x && zn(_, !0));
          }
        } else if (C === k) {
          const O = ws({
            focusReason: i.value
          });
          e("focusout-prevented", O), O.defaultPrevented || v.preventDefault();
        }
      }
    };
    Et(GL, {
      focusTrapRef: r,
      onKeydown: s
    }), Re(() => t.focusTrapEl, (v) => {
      v && (r.value = v);
    }, { immediate: !0 }), Re([r], ([v], [p]) => {
      v && (v.addEventListener("keydown", s), v.addEventListener("focusin", c), v.addEventListener("focusout", d)), p && (p.removeEventListener("keydown", s), p.removeEventListener("focusin", c), p.removeEventListener("focusout", d));
    });
    const u = (v) => {
      e(wm, v);
    }, l = (v) => e(Cm, v), c = (v) => {
      const p = P(r);
      if (!p)
        return;
      const g = v.target, y = v.relatedTarget, m = g && p.contains(g);
      t.trapped || y && p.contains(y) || (n = y), m && e("focusin", v), !o.paused && t.trapped && (m ? a = g : zn(a, !0));
    }, d = (v) => {
      const p = P(r);
      if (!(o.paused || !p))
        if (t.trapped) {
          const g = v.relatedTarget;
          !Yn(g) && !p.contains(g) && setTimeout(() => {
            if (!o.paused && t.trapped) {
              const y = ws({
                focusReason: i.value
              });
              e("focusout-prevented", y), y.defaultPrevented || zn(a, !0);
            }
          }, 0);
        } else {
          const g = v.target;
          g && p.contains(g) || e("focusout", v);
        }
    };
    async function f() {
      await ot();
      const v = P(r);
      if (v) {
        Sm.push(o);
        const p = v.contains(document.activeElement) ? n : document.activeElement;
        if (n = p, !v.contains(p)) {
          const y = new Event(xu, bm);
          v.addEventListener(xu, u), v.dispatchEvent(y), y.defaultPrevented || ot(() => {
            let m = t.focusStartEl;
            nr(m) || (zn(m), document.activeElement !== m && (m = "first")), m === "first" && ZL(T2(v), !0), (document.activeElement === p || m === "container") && zn(v);
          });
        }
      }
    }
    function h() {
      const v = P(r);
      if (v) {
        v.removeEventListener(xu, u);
        const p = new CustomEvent(Eu, {
          ...bm,
          detail: {
            focusReason: i.value
          }
        });
        v.addEventListener(Eu, l), v.dispatchEvent(p), !p.defaultPrevented && (i.value == "keyboard" || !XL() || v.contains(document.activeElement)) && zn(n ?? document.body), v.removeEventListener(Eu, l), Sm.remove(o);
      }
    }
    return St(() => {
      t.trapped && f(), Re(() => t.trapped, (v) => {
        v ? f() : h();
      });
    }), Zr(() => {
      t.trapped && h(), r.value && (r.value.removeEventListener("keydown", s), r.value.removeEventListener("focusin", c), r.value.removeEventListener("focusout", d), r.value = void 0);
    }), {
      onKeydown: s
    };
  }
});
function eF(t, e, r, n, a, i) {
  return Fe(t.$slots, "default", { handleKeydown: t.onKeydown });
}
var tF = /* @__PURE__ */ Ke(QL, [["render", eF], ["__file", "focus-trap.vue"]]);
const rF = ["fixed", "absolute"], nF = rt({
  boundariesPadding: {
    type: Number,
    default: 0
  },
  fallbackPlacements: {
    type: qe(Array),
    default: void 0
  },
  gpuAcceleration: {
    type: Boolean,
    default: !0
  },
  offset: {
    type: Number,
    default: 12
  },
  placement: {
    type: String,
    values: Il,
    default: "bottom"
  },
  popperOptions: {
    type: qe(Object),
    default: () => ({})
  },
  strategy: {
    type: String,
    values: rF,
    default: "absolute"
  }
}), I2 = rt({
  ...nF,
  id: String,
  style: {
    type: qe([String, Array, Object])
  },
  className: {
    type: qe([String, Array, Object])
  },
  effect: {
    type: qe(String),
    default: "dark"
  },
  visible: Boolean,
  enterable: {
    type: Boolean,
    default: !0
  },
  pure: Boolean,
  focusOnShow: {
    type: Boolean,
    default: !1
  },
  trapping: {
    type: Boolean,
    default: !1
  },
  popperClass: {
    type: qe([String, Array, Object])
  },
  popperStyle: {
    type: qe([String, Array, Object])
  },
  referenceEl: {
    type: qe(Object)
  },
  triggerTargetEl: {
    type: qe(Object)
  },
  stopPopperMouseEvent: {
    type: Boolean,
    default: !0
  },
  virtualTriggering: Boolean,
  zIndex: Number,
  ...sa(["ariaLabel"])
}), aF = {
  mouseenter: (t) => t instanceof MouseEvent,
  mouseleave: (t) => t instanceof MouseEvent,
  focus: () => !0,
  blur: () => !0,
  close: () => !0
}, iF = (t, e = []) => {
  const { placement: r, strategy: n, popperOptions: a } = t, i = {
    placement: r,
    strategy: n,
    ...a,
    modifiers: [...sF(t), ...e]
  };
  return lF(i, a == null ? void 0 : a.modifiers), i;
}, oF = (t) => {
  if (It)
    return Cn(t);
};
function sF(t) {
  const { offset: e, gpuAcceleration: r, fallbackPlacements: n } = t;
  return [
    {
      name: "offset",
      options: {
        offset: [0, e ?? 12]
      }
    },
    {
      name: "preventOverflow",
      options: {
        padding: {
          top: 2,
          bottom: 2,
          left: 5,
          right: 5
        }
      }
    },
    {
      name: "flip",
      options: {
        padding: 5,
        fallbackPlacements: n
      }
    },
    {
      name: "computeStyles",
      options: {
        gpuAcceleration: r
      }
    }
  ];
}
function lF(t, e) {
  e && (t.modifiers = [...t.modifiers, ...e ?? []]);
}
const uF = 0, cF = (t) => {
  const { popperInstanceRef: e, contentRef: r, triggerRef: n, role: a } = Ue(pg, void 0), i = de(), o = de(), s = j(() => ({
    name: "eventListeners",
    enabled: !!t.visible
  })), u = j(() => {
    var y;
    const m = P(i), b = (y = P(o)) != null ? y : uF;
    return {
      name: "arrow",
      enabled: !hD(m),
      options: {
        element: m,
        padding: b
      }
    };
  }), l = j(() => ({
    onFirstUpdate: () => {
      v();
    },
    ...iF(t, [
      P(u),
      P(s)
    ])
  })), c = j(() => oF(t.referenceEl) || P(n)), { attributes: d, state: f, styles: h, update: v, forceUpdate: p, instanceRef: g } = $R(c, r, l);
  return Re(g, (y) => e.value = y), St(() => {
    Re(() => {
      var y;
      return (y = P(c)) == null ? void 0 : y.getBoundingClientRect();
    }, () => {
      v();
    });
  }), {
    attributes: d,
    arrowRef: i,
    contentRef: r,
    instanceRef: g,
    state: f,
    styles: h,
    role: a,
    forceUpdate: p,
    update: v
  };
}, dF = (t, {
  attributes: e,
  styles: r,
  role: n
}) => {
  const { nextZIndex: a } = y2(), i = Ge("popper"), o = j(() => P(e).popper), s = de(Ut(t.zIndex) ? t.zIndex : a()), u = j(() => [
    i.b(),
    i.is("pure", t.pure),
    i.is(t.effect),
    t.popperClass
  ]), l = j(() => [
    { zIndex: P(s) },
    P(r).popper,
    t.popperStyle || {}
  ]), c = j(() => n.value === "dialog" ? "false" : void 0), d = j(() => P(r).arrow || {});
  return {
    ariaModal: c,
    arrowStyle: d,
    contentAttrs: o,
    contentClass: u,
    contentStyle: l,
    contentZIndex: s,
    updateZIndex: () => {
      s.value = Ut(t.zIndex) ? t.zIndex : a();
    }
  };
}, fF = (t, e) => {
  const r = de(!1), n = de();
  return {
    focusStartRef: n,
    trapped: r,
    onFocusAfterReleased: (l) => {
      var c;
      ((c = l.detail) == null ? void 0 : c.focusReason) !== "pointer" && (n.value = "first", e("blur"));
    },
    onFocusAfterTrapped: () => {
      e("focus");
    },
    onFocusInTrap: (l) => {
      t.visible && !r.value && (l.target && (n.value = l.target), r.value = !0);
    },
    onFocusoutPrevented: (l) => {
      t.trapping || (l.detail.focusReason === "pointer" && l.preventDefault(), r.value = !1);
    },
    onReleaseRequested: () => {
      r.value = !1, e("close");
    }
  };
}, vF = Se({
  name: "ElPopperContent"
}), hF = /* @__PURE__ */ Se({
  ...vF,
  props: I2,
  emits: aF,
  setup(t, { expose: e, emit: r }) {
    const n = t, {
      focusStartRef: a,
      trapped: i,
      onFocusAfterReleased: o,
      onFocusAfterTrapped: s,
      onFocusInTrap: u,
      onFocusoutPrevented: l,
      onReleaseRequested: c
    } = fF(n, r), { attributes: d, arrowRef: f, contentRef: h, styles: v, instanceRef: p, role: g, update: y } = cF(n), {
      ariaModal: m,
      arrowStyle: b,
      contentAttrs: w,
      contentClass: x,
      contentStyle: E,
      updateZIndex: C
    } = dF(n, {
      styles: v,
      attributes: d,
      role: g
    }), k = Ue(Io, void 0), S = de();
    Et(x2, {
      arrowStyle: b,
      arrowRef: f,
      arrowOffset: S
    }), k && Et(Io, {
      ...k,
      addInputId: Eo,
      removeInputId: Eo
    });
    let _;
    const T = (D = !0) => {
      y(), D && C();
    }, O = () => {
      T(!1), n.visible && n.focusOnShow ? i.value = !0 : n.visible === !1 && (i.value = !1);
    };
    return St(() => {
      Re(() => n.triggerTargetEl, (D, A) => {
        _ == null || _(), _ = void 0;
        const F = P(D || h.value), R = P(A || h.value);
        Ea(F) && (_ = Re([g, () => n.ariaLabel, m, () => n.id], (M) => {
          ["role", "aria-label", "aria-modal", "id"].forEach((L, V) => {
            Yn(M[V]) ? F.removeAttribute(L) : F.setAttribute(L, M[V]);
          });
        }, { immediate: !0 })), R !== F && Ea(R) && ["role", "aria-label", "aria-modal", "id"].forEach((M) => {
          R.removeAttribute(M);
        });
      }, { immediate: !0 }), Re(() => n.visible, O, { immediate: !0 });
    }), Zr(() => {
      _ == null || _(), _ = void 0;
    }), e({
      popperContentRef: h,
      popperInstanceRef: p,
      updatePopper: T,
      contentStyle: E
    }), (D, A) => (q(), ie("div", Ur({
      ref_key: "contentRef",
      ref: h
    }, P(w), {
      style: P(E),
      class: P(x),
      tabindex: "-1",
      onMouseenter: (F) => D.$emit("mouseenter", F),
      onMouseleave: (F) => D.$emit("mouseleave", F)
    }), [
      J(P(tF), {
        trapped: P(i),
        "trap-on-focus-in": !0,
        "focus-trap-el": P(h),
        "focus-start-el": P(a),
        onFocusAfterTrapped: P(s),
        onFocusAfterReleased: P(o),
        onFocusin: P(u),
        onFocusoutPrevented: P(l),
        onReleaseRequested: P(c)
      }, {
        default: U(() => [
          Fe(D.$slots, "default")
        ]),
        _: 3
      }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"])
    ], 16, ["onMouseenter", "onMouseleave"]));
  }
});
var pF = /* @__PURE__ */ Ke(hF, [["__file", "content.vue"]]);
const gF = Vt(FL), mg = Symbol("elTooltip"), fr = rt({
  ...GR,
  ...I2,
  appendTo: {
    type: qe([String, Object])
  },
  content: {
    type: String,
    default: ""
  },
  rawContent: Boolean,
  persistent: Boolean,
  visible: {
    type: qe(Boolean),
    default: null
  },
  transition: String,
  teleported: {
    type: Boolean,
    default: !0
  },
  disabled: Boolean,
  ...sa(["ariaLabel"])
}), Oo = rt({
  ..._2,
  disabled: Boolean,
  trigger: {
    type: qe([String, Array]),
    default: "hover"
  },
  triggerKeys: {
    type: qe(Array),
    default: () => [Rt.enter, Rt.space]
  }
}), {
  useModelToggleProps: yF,
  useModelToggleEmits: mF,
  useModelToggle: bF
} = MD("visible"), wF = rt({
  ...E2,
  ...yF,
  ...fr,
  ...Oo,
  ...S2,
  showArrow: {
    type: Boolean,
    default: !0
  }
}), CF = [
  ...mF,
  "before-show",
  "before-hide",
  "show",
  "hide",
  "open",
  "close"
], xF = (t, e) => hr(t) ? t.includes(e) : t === e, Qa = (t, e, r) => (n) => {
  xF(P(t), e) && r(n);
}, EF = Se({
  name: "ElTooltipTrigger"
}), SF = /* @__PURE__ */ Se({
  ...EF,
  props: Oo,
  setup(t, { expose: e }) {
    const r = t, n = Ge("tooltip"), { controlled: a, id: i, open: o, onOpen: s, onClose: u, onToggle: l } = Ue(mg, void 0), c = de(null), d = () => {
      if (P(a) || r.disabled)
        return !0;
    }, f = Gr(r, "trigger"), h = mn(d, Qa(f, "hover", s)), v = mn(d, Qa(f, "hover", u)), p = mn(d, Qa(f, "click", (w) => {
      w.button === 0 && l(w);
    })), g = mn(d, Qa(f, "focus", s)), y = mn(d, Qa(f, "focus", u)), m = mn(d, Qa(f, "contextmenu", (w) => {
      w.preventDefault(), l(w);
    })), b = mn(d, (w) => {
      const { code: x } = w;
      r.triggerKeys.includes(x) && (w.preventDefault(), l(w));
    });
    return e({
      triggerRef: c
    }), (w, x) => (q(), me(P(VL), {
      id: P(i),
      "virtual-ref": w.virtualRef,
      open: P(o),
      "virtual-triggering": w.virtualTriggering,
      class: le(P(n).e("trigger")),
      onBlur: P(y),
      onClick: P(p),
      onContextmenu: P(m),
      onFocus: P(g),
      onMouseenter: P(h),
      onMouseleave: P(v),
      onKeydown: P(b)
    }, {
      default: U(() => [
        Fe(w.$slots, "default")
      ]),
      _: 3
    }, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"]));
  }
});
var kF = /* @__PURE__ */ Ke(SF, [["__file", "trigger.vue"]]);
const _F = rt({
  to: {
    type: qe([String, Object]),
    required: !0
  },
  disabled: Boolean
}), TF = /* @__PURE__ */ Se({
  __name: "teleport",
  props: _F,
  setup(t) {
    return (e, r) => e.disabled ? Fe(e.$slots, "default", { key: 0 }) : (q(), me(YT, {
      key: 1,
      to: e.to
    }, [
      Fe(e.$slots, "default")
    ], 8, ["to"]));
  }
});
var IF = /* @__PURE__ */ Ke(TF, [["__file", "teleport.vue"]]);
const OF = Vt(IF), AF = Se({
  name: "ElTooltipContent",
  inheritAttrs: !1
}), PF = /* @__PURE__ */ Se({
  ...AF,
  props: fr,
  setup(t, { expose: e }) {
    const r = t, { selector: n } = v2(), a = Ge("tooltip"), i = de(null);
    let o;
    const {
      controlled: s,
      id: u,
      open: l,
      trigger: c,
      onClose: d,
      onOpen: f,
      onShow: h,
      onHide: v,
      onBeforeShow: p,
      onBeforeHide: g
    } = Ue(mg, void 0), y = j(() => r.transition || `${a.namespace.value}-fade-in-linear`), m = j(() => process.env.NODE_ENV === "test" ? !0 : r.persistent);
    Zr(() => {
      o == null || o();
    });
    const b = j(() => P(m) ? !0 : P(l)), w = j(() => r.disabled ? !1 : P(l)), x = j(() => r.appendTo || n.value), E = j(() => {
      var R;
      return (R = r.style) != null ? R : {};
    }), C = de(!0), k = () => {
      v(), C.value = !0;
    }, S = () => {
      if (P(s))
        return !0;
    }, _ = mn(S, () => {
      r.enterable && P(c) === "hover" && f();
    }), T = mn(S, () => {
      P(c) === "hover" && d();
    }), O = () => {
      var R, M;
      (M = (R = i.value) == null ? void 0 : R.updatePopper) == null || M.call(R), p == null || p();
    }, D = () => {
      g == null || g();
    }, A = () => {
      h(), o = sI(j(() => {
        var R;
        return (R = i.value) == null ? void 0 : R.popperContentRef;
      }), () => {
        if (P(s))
          return;
        P(c) !== "hover" && d();
      });
    }, F = () => {
      r.virtualTriggering || d();
    };
    return Re(() => P(l), (R) => {
      R ? C.value = !1 : o == null || o();
    }, {
      flush: "post"
    }), Re(() => r.content, () => {
      var R, M;
      (M = (R = i.value) == null ? void 0 : R.updatePopper) == null || M.call(R);
    }), e({
      contentRef: i
    }), (R, M) => (q(), me(P(OF), {
      disabled: !R.teleported,
      to: P(x)
    }, {
      default: U(() => [
        J(Ai, {
          name: P(y),
          onAfterLeave: k,
          onBeforeEnter: O,
          onAfterEnter: A,
          onBeforeLeave: D
        }, {
          default: U(() => [
            P(b) ? Ye((q(), me(P(pF), Ur({
              key: 0,
              id: P(u),
              ref_key: "contentRef",
              ref: i
            }, R.$attrs, {
              "aria-label": R.ariaLabel,
              "aria-hidden": C.value,
              "boundaries-padding": R.boundariesPadding,
              "fallback-placements": R.fallbackPlacements,
              "gpu-acceleration": R.gpuAcceleration,
              offset: R.offset,
              placement: R.placement,
              "popper-options": R.popperOptions,
              strategy: R.strategy,
              effect: R.effect,
              enterable: R.enterable,
              pure: R.pure,
              "popper-class": R.popperClass,
              "popper-style": [R.popperStyle, P(E)],
              "reference-el": R.referenceEl,
              "trigger-target-el": R.triggerTargetEl,
              visible: P(w),
              "z-index": R.zIndex,
              onMouseenter: P(_),
              onMouseleave: P(T),
              onBlur: F,
              onClose: P(d)
            }), {
              default: U(() => [
                Fe(R.$slots, "default")
              ]),
              _: 3
            }, 16, ["id", "aria-label", "aria-hidden", "boundaries-padding", "fallback-placements", "gpu-acceleration", "offset", "placement", "popper-options", "strategy", "effect", "enterable", "pure", "popper-class", "popper-style", "reference-el", "trigger-target-el", "visible", "z-index", "onMouseenter", "onMouseleave", "onClose"])), [
              [dt, P(w)]
            ]) : pe("v-if", !0)
          ]),
          _: 3
        }, 8, ["name"])
      ]),
      _: 3
    }, 8, ["disabled", "to"]));
  }
});
var DF = /* @__PURE__ */ Ke(PF, [["__file", "content.vue"]]);
const RF = Se({
  name: "ElTooltip"
}), LF = /* @__PURE__ */ Se({
  ...RF,
  props: wF,
  emits: CF,
  setup(t, { expose: e, emit: r }) {
    const n = t;
    KR();
    const a = Al(), i = de(), o = de(), s = () => {
      var y;
      const m = P(i);
      m && ((y = m.popperInstanceRef) == null || y.update());
    }, u = de(!1), l = de(), { show: c, hide: d, hasUpdateHandler: f } = bF({
      indicator: u,
      toggleReason: l
    }), { onOpen: h, onClose: v } = UR({
      showAfter: Gr(n, "showAfter"),
      hideAfter: Gr(n, "hideAfter"),
      autoClose: Gr(n, "autoClose"),
      open: c,
      close: d
    }), p = j(() => bi(n.visible) && !f.value);
    Et(mg, {
      controlled: p,
      id: a,
      open: ZT(u),
      trigger: Gr(n, "trigger"),
      onOpen: (y) => {
        h(y);
      },
      onClose: (y) => {
        v(y);
      },
      onToggle: (y) => {
        P(u) ? v(y) : h(y);
      },
      onShow: () => {
        r("show", l.value);
      },
      onHide: () => {
        r("hide", l.value);
      },
      onBeforeShow: () => {
        r("before-show", l.value);
      },
      onBeforeHide: () => {
        r("before-hide", l.value);
      },
      updatePopper: s
    }), Re(() => n.disabled, (y) => {
      y && u.value && (u.value = !1);
    });
    const g = (y) => {
      var m, b;
      const w = (b = (m = o.value) == null ? void 0 : m.contentRef) == null ? void 0 : b.popperContentRef, x = (y == null ? void 0 : y.relatedTarget) || document.activeElement;
      return w && w.contains(x);
    };
    return XT(() => u.value && d()), e({
      popperRef: i,
      contentRef: o,
      isFocusInsideContent: g,
      updatePopper: s,
      onOpen: h,
      onClose: v,
      hide: d
    }), (y, m) => (q(), me(P(gF), {
      ref_key: "popperRef",
      ref: i,
      role: y.role
    }, {
      default: U(() => [
        J(kF, {
          disabled: y.disabled,
          trigger: y.trigger,
          "trigger-keys": y.triggerKeys,
          "virtual-ref": y.virtualRef,
          "virtual-triggering": y.virtualTriggering
        }, {
          default: U(() => [
            y.$slots.default ? Fe(y.$slots, "default", { key: 0 }) : pe("v-if", !0)
          ]),
          _: 3
        }, 8, ["disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering"]),
        J(DF, {
          ref_key: "contentRef",
          ref: o,
          "aria-label": y.ariaLabel,
          "boundaries-padding": y.boundariesPadding,
          content: y.content,
          disabled: y.disabled,
          effect: y.effect,
          enterable: y.enterable,
          "fallback-placements": y.fallbackPlacements,
          "hide-after": y.hideAfter,
          "gpu-acceleration": y.gpuAcceleration,
          offset: y.offset,
          persistent: y.persistent,
          "popper-class": y.popperClass,
          "popper-style": y.popperStyle,
          placement: y.placement,
          "popper-options": y.popperOptions,
          pure: y.pure,
          "raw-content": y.rawContent,
          "reference-el": y.referenceEl,
          "trigger-target-el": y.triggerTargetEl,
          "show-after": y.showAfter,
          strategy: y.strategy,
          teleported: y.teleported,
          transition: y.transition,
          "virtual-triggering": y.virtualTriggering,
          "z-index": y.zIndex,
          "append-to": y.appendTo
        }, {
          default: U(() => [
            Fe(y.$slots, "content", {}, () => [
              y.rawContent ? (q(), ie("span", {
                key: 0,
                innerHTML: y.content
              }, null, 8, ["innerHTML"])) : (q(), ie("span", { key: 1 }, ke(y.content), 1))
            ]),
            y.showArrow ? (q(), me(P(BL), {
              key: 0,
              "arrow-offset": y.arrowOffset
            }, null, 8, ["arrow-offset"])) : pe("v-if", !0)
          ]),
          _: 3
        }, 8, ["aria-label", "boundaries-padding", "content", "disabled", "effect", "enterable", "fallback-placements", "hide-after", "gpu-acceleration", "offset", "persistent", "popper-class", "popper-style", "placement", "popper-options", "pure", "raw-content", "reference-el", "trigger-target-el", "show-after", "strategy", "teleported", "transition", "virtual-triggering", "z-index", "append-to"])
      ]),
      _: 3
    }, 8, ["role"]));
  }
});
var FF = /* @__PURE__ */ Ke(LF, [["__file", "tooltip.vue"]]);
const Jo = Vt(FF), O2 = Symbol("buttonGroupContextKey"), MF = (t, e) => {
  Ns({
    from: "type.text",
    replacement: "link",
    version: "3.0.0",
    scope: "props",
    ref: "https://element-plus.org/en-US/component/button.html#button-attributes"
  }, j(() => t.type === "text"));
  const r = Ue(O2, void 0), n = fg("button"), { form: a } = Va(), i = Oa(j(() => r == null ? void 0 : r.size)), o = Yo(), s = de(), u = Ho(), l = j(() => t.type || (r == null ? void 0 : r.type) || ""), c = j(() => {
    var v, p, g;
    return (g = (p = t.autoInsertSpace) != null ? p : (v = n.value) == null ? void 0 : v.autoInsertSpace) != null ? g : !1;
  }), d = j(() => t.tag === "button" ? {
    ariaDisabled: o.value || t.loading,
    disabled: o.value || t.loading,
    autofocus: t.autofocus,
    type: t.nativeType
  } : {}), f = j(() => {
    var v;
    const p = (v = u.default) == null ? void 0 : v.call(u);
    if (c.value && (p == null ? void 0 : p.length) === 1) {
      const g = p[0];
      if ((g == null ? void 0 : g.type) === SE) {
        const y = g.children;
        return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(y.trim());
      }
    }
    return !1;
  });
  return {
    _disabled: o,
    _size: i,
    _type: l,
    _ref: s,
    _props: d,
    shouldAddSpace: f,
    handleClick: (v) => {
      if (o.value || t.loading) {
        v.stopPropagation();
        return;
      }
      t.nativeType === "reset" && (a == null || a.resetFields()), e("click", v);
    }
  };
}, NF = [
  "default",
  "primary",
  "success",
  "warning",
  "info",
  "danger",
  "text",
  ""
], BF = ["button", "submit", "reset"], wp = rt({
  size: Di,
  disabled: Boolean,
  type: {
    type: String,
    values: NF,
    default: ""
  },
  icon: {
    type: Qn
  },
  nativeType: {
    type: String,
    values: BF,
    default: "button"
  },
  loading: Boolean,
  loadingIcon: {
    type: Qn,
    default: () => Kp
  },
  plain: Boolean,
  text: Boolean,
  link: Boolean,
  bg: Boolean,
  autofocus: Boolean,
  round: Boolean,
  circle: Boolean,
  color: String,
  dark: Boolean,
  autoInsertSpace: {
    type: Boolean,
    default: void 0
  },
  tag: {
    type: qe([String, Object]),
    default: "button"
  }
}), $F = {
  click: (t) => t instanceof MouseEvent
};
function Wt(t, e) {
  qF(t) && (t = "100%");
  var r = zF(t);
  return t = e === 360 ? t : Math.min(e, Math.max(0, parseFloat(t))), r && (t = parseInt(String(t * e), 10) / 100), Math.abs(t - e) < 1e-6 ? 1 : (e === 360 ? t = (t < 0 ? t % e + e : t % e) / parseFloat(String(e)) : t = t % e / parseFloat(String(e)), t);
}
function Cs(t) {
  return Math.min(1, Math.max(0, t));
}
function qF(t) {
  return typeof t == "string" && t.indexOf(".") !== -1 && parseFloat(t) === 1;
}
function zF(t) {
  return typeof t == "string" && t.indexOf("%") !== -1;
}
function A2(t) {
  return t = parseFloat(t), (isNaN(t) || t < 0 || t > 1) && (t = 1), t;
}
function xs(t) {
  return t <= 1 ? "".concat(Number(t) * 100, "%") : t;
}
function Ca(t) {
  return t.length === 1 ? "0" + t : String(t);
}
function VF(t, e, r) {
  return {
    r: Wt(t, 255) * 255,
    g: Wt(e, 255) * 255,
    b: Wt(r, 255) * 255
  };
}
function _m(t, e, r) {
  t = Wt(t, 255), e = Wt(e, 255), r = Wt(r, 255);
  var n = Math.max(t, e, r), a = Math.min(t, e, r), i = 0, o = 0, s = (n + a) / 2;
  if (n === a)
    o = 0, i = 0;
  else {
    var u = n - a;
    switch (o = s > 0.5 ? u / (2 - n - a) : u / (n + a), n) {
      case t:
        i = (e - r) / u + (e < r ? 6 : 0);
        break;
      case e:
        i = (r - t) / u + 2;
        break;
      case r:
        i = (t - e) / u + 4;
        break;
    }
    i /= 6;
  }
  return { h: i, s: o, l: s };
}
function Su(t, e, r) {
  return r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? t + (e - t) * (6 * r) : r < 1 / 2 ? e : r < 2 / 3 ? t + (e - t) * (2 / 3 - r) * 6 : t;
}
function HF(t, e, r) {
  var n, a, i;
  if (t = Wt(t, 360), e = Wt(e, 100), r = Wt(r, 100), e === 0)
    a = r, i = r, n = r;
  else {
    var o = r < 0.5 ? r * (1 + e) : r + e - r * e, s = 2 * r - o;
    n = Su(s, o, t + 1 / 3), a = Su(s, o, t), i = Su(s, o, t - 1 / 3);
  }
  return { r: n * 255, g: a * 255, b: i * 255 };
}
function Tm(t, e, r) {
  t = Wt(t, 255), e = Wt(e, 255), r = Wt(r, 255);
  var n = Math.max(t, e, r), a = Math.min(t, e, r), i = 0, o = n, s = n - a, u = n === 0 ? 0 : s / n;
  if (n === a)
    i = 0;
  else {
    switch (n) {
      case t:
        i = (e - r) / s + (e < r ? 6 : 0);
        break;
      case e:
        i = (r - t) / s + 2;
        break;
      case r:
        i = (t - e) / s + 4;
        break;
    }
    i /= 6;
  }
  return { h: i, s: u, v: o };
}
function KF(t, e, r) {
  t = Wt(t, 360) * 6, e = Wt(e, 100), r = Wt(r, 100);
  var n = Math.floor(t), a = t - n, i = r * (1 - e), o = r * (1 - a * e), s = r * (1 - (1 - a) * e), u = n % 6, l = [r, o, i, i, s, r][u], c = [s, r, r, o, i, i][u], d = [i, i, s, r, r, o][u];
  return { r: l * 255, g: c * 255, b: d * 255 };
}
function Im(t, e, r, n) {
  var a = [
    Ca(Math.round(t).toString(16)),
    Ca(Math.round(e).toString(16)),
    Ca(Math.round(r).toString(16))
  ];
  return n && a[0].startsWith(a[0].charAt(1)) && a[1].startsWith(a[1].charAt(1)) && a[2].startsWith(a[2].charAt(1)) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) : a.join("");
}
function GF(t, e, r, n, a) {
  var i = [
    Ca(Math.round(t).toString(16)),
    Ca(Math.round(e).toString(16)),
    Ca(Math.round(r).toString(16)),
    Ca(UF(n))
  ];
  return a && i[0].startsWith(i[0].charAt(1)) && i[1].startsWith(i[1].charAt(1)) && i[2].startsWith(i[2].charAt(1)) && i[3].startsWith(i[3].charAt(1)) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) + i[3].charAt(0) : i.join("");
}
function UF(t) {
  return Math.round(parseFloat(t) * 255).toString(16);
}
function Om(t) {
  return Cr(t) / 255;
}
function Cr(t) {
  return parseInt(t, 16);
}
function WF(t) {
  return {
    r: t >> 16,
    g: (t & 65280) >> 8,
    b: t & 255
  };
}
var Cp = {
  aliceblue: "#f0f8ff",
  antiquewhite: "#faebd7",
  aqua: "#00ffff",
  aquamarine: "#7fffd4",
  azure: "#f0ffff",
  beige: "#f5f5dc",
  bisque: "#ffe4c4",
  black: "#000000",
  blanchedalmond: "#ffebcd",
  blue: "#0000ff",
  blueviolet: "#8a2be2",
  brown: "#a52a2a",
  burlywood: "#deb887",
  cadetblue: "#5f9ea0",
  chartreuse: "#7fff00",
  chocolate: "#d2691e",
  coral: "#ff7f50",
  cornflowerblue: "#6495ed",
  cornsilk: "#fff8dc",
  crimson: "#dc143c",
  cyan: "#00ffff",
  darkblue: "#00008b",
  darkcyan: "#008b8b",
  darkgoldenrod: "#b8860b",
  darkgray: "#a9a9a9",
  darkgreen: "#006400",
  darkgrey: "#a9a9a9",
  darkkhaki: "#bdb76b",
  darkmagenta: "#8b008b",
  darkolivegreen: "#556b2f",
  darkorange: "#ff8c00",
  darkorchid: "#9932cc",
  darkred: "#8b0000",
  darksalmon: "#e9967a",
  darkseagreen: "#8fbc8f",
  darkslateblue: "#483d8b",
  darkslategray: "#2f4f4f",
  darkslategrey: "#2f4f4f",
  darkturquoise: "#00ced1",
  darkviolet: "#9400d3",
  deeppink: "#ff1493",
  deepskyblue: "#00bfff",
  dimgray: "#696969",
  dimgrey: "#696969",
  dodgerblue: "#1e90ff",
  firebrick: "#b22222",
  floralwhite: "#fffaf0",
  forestgreen: "#228b22",
  fuchsia: "#ff00ff",
  gainsboro: "#dcdcdc",
  ghostwhite: "#f8f8ff",
  goldenrod: "#daa520",
  gold: "#ffd700",
  gray: "#808080",
  green: "#008000",
  greenyellow: "#adff2f",
  grey: "#808080",
  honeydew: "#f0fff0",
  hotpink: "#ff69b4",
  indianred: "#cd5c5c",
  indigo: "#4b0082",
  ivory: "#fffff0",
  khaki: "#f0e68c",
  lavenderblush: "#fff0f5",
  lavender: "#e6e6fa",
  lawngreen: "#7cfc00",
  lemonchiffon: "#fffacd",
  lightblue: "#add8e6",
  lightcoral: "#f08080",
  lightcyan: "#e0ffff",
  lightgoldenrodyellow: "#fafad2",
  lightgray: "#d3d3d3",
  lightgreen: "#90ee90",
  lightgrey: "#d3d3d3",
  lightpink: "#ffb6c1",
  lightsalmon: "#ffa07a",
  lightseagreen: "#20b2aa",
  lightskyblue: "#87cefa",
  lightslategray: "#778899",
  lightslategrey: "#778899",
  lightsteelblue: "#b0c4de",
  lightyellow: "#ffffe0",
  lime: "#00ff00",
  limegreen: "#32cd32",
  linen: "#faf0e6",
  magenta: "#ff00ff",
  maroon: "#800000",
  mediumaquamarine: "#66cdaa",
  mediumblue: "#0000cd",
  mediumorchid: "#ba55d3",
  mediumpurple: "#9370db",
  mediumseagreen: "#3cb371",
  mediumslateblue: "#7b68ee",
  mediumspringgreen: "#00fa9a",
  mediumturquoise: "#48d1cc",
  mediumvioletred: "#c71585",
  midnightblue: "#191970",
  mintcream: "#f5fffa",
  mistyrose: "#ffe4e1",
  moccasin: "#ffe4b5",
  navajowhite: "#ffdead",
  navy: "#000080",
  oldlace: "#fdf5e6",
  olive: "#808000",
  olivedrab: "#6b8e23",
  orange: "#ffa500",
  orangered: "#ff4500",
  orchid: "#da70d6",
  palegoldenrod: "#eee8aa",
  palegreen: "#98fb98",
  paleturquoise: "#afeeee",
  palevioletred: "#db7093",
  papayawhip: "#ffefd5",
  peachpuff: "#ffdab9",
  peru: "#cd853f",
  pink: "#ffc0cb",
  plum: "#dda0dd",
  powderblue: "#b0e0e6",
  purple: "#800080",
  rebeccapurple: "#663399",
  red: "#ff0000",
  rosybrown: "#bc8f8f",
  royalblue: "#4169e1",
  saddlebrown: "#8b4513",
  salmon: "#fa8072",
  sandybrown: "#f4a460",
  seagreen: "#2e8b57",
  seashell: "#fff5ee",
  sienna: "#a0522d",
  silver: "#c0c0c0",
  skyblue: "#87ceeb",
  slateblue: "#6a5acd",
  slategray: "#708090",
  slategrey: "#708090",
  snow: "#fffafa",
  springgreen: "#00ff7f",
  steelblue: "#4682b4",
  tan: "#d2b48c",
  teal: "#008080",
  thistle: "#d8bfd8",
  tomato: "#ff6347",
  turquoise: "#40e0d0",
  violet: "#ee82ee",
  wheat: "#f5deb3",
  white: "#ffffff",
  whitesmoke: "#f5f5f5",
  yellow: "#ffff00",
  yellowgreen: "#9acd32"
};
function jF(t) {
  var e = { r: 0, g: 0, b: 0 }, r = 1, n = null, a = null, i = null, o = !1, s = !1;
  return typeof t == "string" && (t = XF(t)), typeof t == "object" && (gn(t.r) && gn(t.g) && gn(t.b) ? (e = VF(t.r, t.g, t.b), o = !0, s = String(t.r).substr(-1) === "%" ? "prgb" : "rgb") : gn(t.h) && gn(t.s) && gn(t.v) ? (n = xs(t.s), a = xs(t.v), e = KF(t.h, n, a), o = !0, s = "hsv") : gn(t.h) && gn(t.s) && gn(t.l) && (n = xs(t.s), i = xs(t.l), e = HF(t.h, n, i), o = !0, s = "hsl"), Object.prototype.hasOwnProperty.call(t, "a") && (r = t.a)), r = A2(r), {
    ok: o,
    format: t.format || s,
    r: Math.min(255, Math.max(e.r, 0)),
    g: Math.min(255, Math.max(e.g, 0)),
    b: Math.min(255, Math.max(e.b, 0)),
    a: r
  };
}
var YF = "[-\\+]?\\d+%?", ZF = "[-\\+]?\\d*\\.\\d+%?", Wn = "(?:".concat(ZF, ")|(?:").concat(YF, ")"), ku = "[\\s|\\(]+(".concat(Wn, ")[,|\\s]+(").concat(Wn, ")[,|\\s]+(").concat(Wn, ")\\s*\\)?"), _u = "[\\s|\\(]+(".concat(Wn, ")[,|\\s]+(").concat(Wn, ")[,|\\s]+(").concat(Wn, ")[,|\\s]+(").concat(Wn, ")\\s*\\)?"), zr = {
  CSS_UNIT: new RegExp(Wn),
  rgb: new RegExp("rgb" + ku),
  rgba: new RegExp("rgba" + _u),
  hsl: new RegExp("hsl" + ku),
  hsla: new RegExp("hsla" + _u),
  hsv: new RegExp("hsv" + ku),
  hsva: new RegExp("hsva" + _u),
  hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
  hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
};
function XF(t) {
  if (t = t.trim().toLowerCase(), t.length === 0)
    return !1;
  var e = !1;
  if (Cp[t])
    t = Cp[t], e = !0;
  else if (t === "transparent")
    return { r: 0, g: 0, b: 0, a: 0, format: "name" };
  var r = zr.rgb.exec(t);
  return r ? { r: r[1], g: r[2], b: r[3] } : (r = zr.rgba.exec(t), r ? { r: r[1], g: r[2], b: r[3], a: r[4] } : (r = zr.hsl.exec(t), r ? { h: r[1], s: r[2], l: r[3] } : (r = zr.hsla.exec(t), r ? { h: r[1], s: r[2], l: r[3], a: r[4] } : (r = zr.hsv.exec(t), r ? { h: r[1], s: r[2], v: r[3] } : (r = zr.hsva.exec(t), r ? { h: r[1], s: r[2], v: r[3], a: r[4] } : (r = zr.hex8.exec(t), r ? {
    r: Cr(r[1]),
    g: Cr(r[2]),
    b: Cr(r[3]),
    a: Om(r[4]),
    format: e ? "name" : "hex8"
  } : (r = zr.hex6.exec(t), r ? {
    r: Cr(r[1]),
    g: Cr(r[2]),
    b: Cr(r[3]),
    format: e ? "name" : "hex"
  } : (r = zr.hex4.exec(t), r ? {
    r: Cr(r[1] + r[1]),
    g: Cr(r[2] + r[2]),
    b: Cr(r[3] + r[3]),
    a: Om(r[4] + r[4]),
    format: e ? "name" : "hex8"
  } : (r = zr.hex3.exec(t), r ? {
    r: Cr(r[1] + r[1]),
    g: Cr(r[2] + r[2]),
    b: Cr(r[3] + r[3]),
    format: e ? "name" : "hex"
  } : !1)))))))));
}
function gn(t) {
  return !!zr.CSS_UNIT.exec(String(t));
}
var JF = (
  /** @class */
  function() {
    function t(e, r) {
      e === void 0 && (e = ""), r === void 0 && (r = {});
      var n;
      if (e instanceof t)
        return e;
      typeof e == "number" && (e = WF(e)), this.originalInput = e;
      var a = jF(e);
      this.originalInput = e, this.r = a.r, this.g = a.g, this.b = a.b, this.a = a.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (n = r.format) !== null && n !== void 0 ? n : a.format, this.gradientType = r.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = a.ok;
    }
    return t.prototype.isDark = function() {
      return this.getBrightness() < 128;
    }, t.prototype.isLight = function() {
      return !this.isDark();
    }, t.prototype.getBrightness = function() {
      var e = this.toRgb();
      return (e.r * 299 + e.g * 587 + e.b * 114) / 1e3;
    }, t.prototype.getLuminance = function() {
      var e = this.toRgb(), r, n, a, i = e.r / 255, o = e.g / 255, s = e.b / 255;
      return i <= 0.03928 ? r = i / 12.92 : r = Math.pow((i + 0.055) / 1.055, 2.4), o <= 0.03928 ? n = o / 12.92 : n = Math.pow((o + 0.055) / 1.055, 2.4), s <= 0.03928 ? a = s / 12.92 : a = Math.pow((s + 0.055) / 1.055, 2.4), 0.2126 * r + 0.7152 * n + 0.0722 * a;
    }, t.prototype.getAlpha = function() {
      return this.a;
    }, t.prototype.setAlpha = function(e) {
      return this.a = A2(e), this.roundA = Math.round(100 * this.a) / 100, this;
    }, t.prototype.isMonochrome = function() {
      var e = this.toHsl().s;
      return e === 0;
    }, t.prototype.toHsv = function() {
      var e = Tm(this.r, this.g, this.b);
      return { h: e.h * 360, s: e.s, v: e.v, a: this.a };
    }, t.prototype.toHsvString = function() {
      var e = Tm(this.r, this.g, this.b), r = Math.round(e.h * 360), n = Math.round(e.s * 100), a = Math.round(e.v * 100);
      return this.a === 1 ? "hsv(".concat(r, ", ").concat(n, "%, ").concat(a, "%)") : "hsva(".concat(r, ", ").concat(n, "%, ").concat(a, "%, ").concat(this.roundA, ")");
    }, t.prototype.toHsl = function() {
      var e = _m(this.r, this.g, this.b);
      return { h: e.h * 360, s: e.s, l: e.l, a: this.a };
    }, t.prototype.toHslString = function() {
      var e = _m(this.r, this.g, this.b), r = Math.round(e.h * 360), n = Math.round(e.s * 100), a = Math.round(e.l * 100);
      return this.a === 1 ? "hsl(".concat(r, ", ").concat(n, "%, ").concat(a, "%)") : "hsla(".concat(r, ", ").concat(n, "%, ").concat(a, "%, ").concat(this.roundA, ")");
    }, t.prototype.toHex = function(e) {
      return e === void 0 && (e = !1), Im(this.r, this.g, this.b, e);
    }, t.prototype.toHexString = function(e) {
      return e === void 0 && (e = !1), "#" + this.toHex(e);
    }, t.prototype.toHex8 = function(e) {
      return e === void 0 && (e = !1), GF(this.r, this.g, this.b, this.a, e);
    }, t.prototype.toHex8String = function(e) {
      return e === void 0 && (e = !1), "#" + this.toHex8(e);
    }, t.prototype.toHexShortString = function(e) {
      return e === void 0 && (e = !1), this.a === 1 ? this.toHexString(e) : this.toHex8String(e);
    }, t.prototype.toRgb = function() {
      return {
        r: Math.round(this.r),
        g: Math.round(this.g),
        b: Math.round(this.b),
        a: this.a
      };
    }, t.prototype.toRgbString = function() {
      var e = Math.round(this.r), r = Math.round(this.g), n = Math.round(this.b);
      return this.a === 1 ? "rgb(".concat(e, ", ").concat(r, ", ").concat(n, ")") : "rgba(".concat(e, ", ").concat(r, ", ").concat(n, ", ").concat(this.roundA, ")");
    }, t.prototype.toPercentageRgb = function() {
      var e = function(r) {
        return "".concat(Math.round(Wt(r, 255) * 100), "%");
      };
      return {
        r: e(this.r),
        g: e(this.g),
        b: e(this.b),
        a: this.a
      };
    }, t.prototype.toPercentageRgbString = function() {
      var e = function(r) {
        return Math.round(Wt(r, 255) * 100);
      };
      return this.a === 1 ? "rgb(".concat(e(this.r), "%, ").concat(e(this.g), "%, ").concat(e(this.b), "%)") : "rgba(".concat(e(this.r), "%, ").concat(e(this.g), "%, ").concat(e(this.b), "%, ").concat(this.roundA, ")");
    }, t.prototype.toName = function() {
      if (this.a === 0)
        return "transparent";
      if (this.a < 1)
        return !1;
      for (var e = "#" + Im(this.r, this.g, this.b, !1), r = 0, n = Object.entries(Cp); r < n.length; r++) {
        var a = n[r], i = a[0], o = a[1];
        if (e === o)
          return i;
      }
      return !1;
    }, t.prototype.toString = function(e) {
      var r = !!e;
      e = e ?? this.format;
      var n = !1, a = this.a < 1 && this.a >= 0, i = !r && a && (e.startsWith("hex") || e === "name");
      return i ? e === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (n = this.toRgbString()), e === "prgb" && (n = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (n = this.toHexString()), e === "hex3" && (n = this.toHexString(!0)), e === "hex4" && (n = this.toHex8String(!0)), e === "hex8" && (n = this.toHex8String()), e === "name" && (n = this.toName()), e === "hsl" && (n = this.toHslString()), e === "hsv" && (n = this.toHsvString()), n || this.toHexString());
    }, t.prototype.toNumber = function() {
      return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
    }, t.prototype.clone = function() {
      return new t(this.toString());
    }, t.prototype.lighten = function(e) {
      e === void 0 && (e = 10);
      var r = this.toHsl();
      return r.l += e / 100, r.l = Cs(r.l), new t(r);
    }, t.prototype.brighten = function(e) {
      e === void 0 && (e = 10);
      var r = this.toRgb();
      return r.r = Math.max(0, Math.min(255, r.r - Math.round(255 * -(e / 100)))), r.g = Math.max(0, Math.min(255, r.g - Math.round(255 * -(e / 100)))), r.b = Math.max(0, Math.min(255, r.b - Math.round(255 * -(e / 100)))), new t(r);
    }, t.prototype.darken = function(e) {
      e === void 0 && (e = 10);
      var r = this.toHsl();
      return r.l -= e / 100, r.l = Cs(r.l), new t(r);
    }, t.prototype.tint = function(e) {
      return e === void 0 && (e = 10), this.mix("white", e);
    }, t.prototype.shade = function(e) {
      return e === void 0 && (e = 10), this.mix("black", e);
    }, t.prototype.desaturate = function(e) {
      e === void 0 && (e = 10);
      var r = this.toHsl();
      return r.s -= e / 100, r.s = Cs(r.s), new t(r);
    }, t.prototype.saturate = function(e) {
      e === void 0 && (e = 10);
      var r = this.toHsl();
      return r.s += e / 100, r.s = Cs(r.s), new t(r);
    }, t.prototype.greyscale = function() {
      return this.desaturate(100);
    }, t.prototype.spin = function(e) {
      var r = this.toHsl(), n = (r.h + e) % 360;
      return r.h = n < 0 ? 360 + n : n, new t(r);
    }, t.prototype.mix = function(e, r) {
      r === void 0 && (r = 50);
      var n = this.toRgb(), a = new t(e).toRgb(), i = r / 100, o = {
        r: (a.r - n.r) * i + n.r,
        g: (a.g - n.g) * i + n.g,
        b: (a.b - n.b) * i + n.b,
        a: (a.a - n.a) * i + n.a
      };
      return new t(o);
    }, t.prototype.analogous = function(e, r) {
      e === void 0 && (e = 6), r === void 0 && (r = 30);
      var n = this.toHsl(), a = 360 / r, i = [this];
      for (n.h = (n.h - (a * e >> 1) + 720) % 360; --e; )
        n.h = (n.h + a) % 360, i.push(new t(n));
      return i;
    }, t.prototype.complement = function() {
      var e = this.toHsl();
      return e.h = (e.h + 180) % 360, new t(e);
    }, t.prototype.monochromatic = function(e) {
      e === void 0 && (e = 6);
      for (var r = this.toHsv(), n = r.h, a = r.s, i = r.v, o = [], s = 1 / e; e--; )
        o.push(new t({ h: n, s: a, v: i })), i = (i + s) % 1;
      return o;
    }, t.prototype.splitcomplement = function() {
      var e = this.toHsl(), r = e.h;
      return [
        this,
        new t({ h: (r + 72) % 360, s: e.s, l: e.l }),
        new t({ h: (r + 216) % 360, s: e.s, l: e.l })
      ];
    }, t.prototype.onBackground = function(e) {
      var r = this.toRgb(), n = new t(e).toRgb(), a = r.a + n.a * (1 - r.a);
      return new t({
        r: (r.r * r.a + n.r * n.a * (1 - r.a)) / a,
        g: (r.g * r.a + n.g * n.a * (1 - r.a)) / a,
        b: (r.b * r.a + n.b * n.a * (1 - r.a)) / a,
        a
      });
    }, t.prototype.triad = function() {
      return this.polyad(3);
    }, t.prototype.tetrad = function() {
      return this.polyad(4);
    }, t.prototype.polyad = function(e) {
      for (var r = this.toHsl(), n = r.h, a = [this], i = 360 / e, o = 1; o < e; o++)
        a.push(new t({ h: (n + o * i) % 360, s: r.s, l: r.l }));
      return a;
    }, t.prototype.equals = function(e) {
      return this.toRgbString() === new t(e).toRgbString();
    }, t;
  }()
);
function Bn(t, e = 20) {
  return t.mix("#141414", e).toString();
}
function QF(t) {
  const e = Yo(), r = Ge("button");
  return j(() => {
    let n = {}, a = t.color;
    if (a) {
      const i = a.match(/var\((.*?)\)/);
      i && (a = window.getComputedStyle(window.document.documentElement).getPropertyValue(i[1]));
      const o = new JF(a), s = t.dark ? o.tint(20).toString() : Bn(o, 20);
      if (t.plain)
        n = r.cssVarBlock({
          "bg-color": t.dark ? Bn(o, 90) : o.tint(90).toString(),
          "text-color": a,
          "border-color": t.dark ? Bn(o, 50) : o.tint(50).toString(),
          "hover-text-color": `var(${r.cssVarName("color-white")})`,
          "hover-bg-color": a,
          "hover-border-color": a,
          "active-bg-color": s,
          "active-text-color": `var(${r.cssVarName("color-white")})`,
          "active-border-color": s
        }), e.value && (n[r.cssVarBlockName("disabled-bg-color")] = t.dark ? Bn(o, 90) : o.tint(90).toString(), n[r.cssVarBlockName("disabled-text-color")] = t.dark ? Bn(o, 50) : o.tint(50).toString(), n[r.cssVarBlockName("disabled-border-color")] = t.dark ? Bn(o, 80) : o.tint(80).toString());
      else {
        const u = t.dark ? Bn(o, 30) : o.tint(30).toString(), l = o.isDark() ? `var(${r.cssVarName("color-white")})` : `var(${r.cssVarName("color-black")})`;
        if (n = r.cssVarBlock({
          "bg-color": a,
          "text-color": l,
          "border-color": a,
          "hover-bg-color": u,
          "hover-text-color": l,
          "hover-border-color": u,
          "active-bg-color": s,
          "active-border-color": s
        }), e.value) {
          const c = t.dark ? Bn(o, 50) : o.tint(50).toString();
          n[r.cssVarBlockName("disabled-bg-color")] = c, n[r.cssVarBlockName("disabled-text-color")] = t.dark ? "rgba(255, 255, 255, 0.5)" : `var(${r.cssVarName("color-white")})`, n[r.cssVarBlockName("disabled-border-color")] = c;
        }
      }
    }
    return n;
  });
}
const eM = Se({
  name: "ElButton"
}), tM = /* @__PURE__ */ Se({
  ...eM,
  props: wp,
  emits: $F,
  setup(t, { expose: e, emit: r }) {
    const n = t, a = QF(n), i = Ge("button"), { _ref: o, _size: s, _type: u, _disabled: l, _props: c, shouldAddSpace: d, handleClick: f } = MF(n, r), h = j(() => [
      i.b(),
      i.m(u.value),
      i.m(s.value),
      i.is("disabled", l.value),
      i.is("loading", n.loading),
      i.is("plain", n.plain),
      i.is("round", n.round),
      i.is("circle", n.circle),
      i.is("text", n.text),
      i.is("link", n.link),
      i.is("has-bg", n.bg)
    ]);
    return e({
      ref: o,
      size: s,
      type: u,
      disabled: l,
      shouldAddSpace: d
    }), (v, p) => (q(), me(rr(v.tag), Ur({
      ref_key: "_ref",
      ref: o
    }, P(c), {
      class: P(h),
      style: P(a),
      onClick: P(f)
    }), {
      default: U(() => [
        v.loading ? (q(), ie(je, { key: 0 }, [
          v.$slots.loading ? Fe(v.$slots, "loading", { key: 0 }) : (q(), me(P(Ft), {
            key: 1,
            class: le(P(i).is("loading"))
          }, {
            default: U(() => [
              (q(), me(rr(v.loadingIcon)))
            ]),
            _: 1
          }, 8, ["class"]))
        ], 64)) : v.icon || v.$slots.icon ? (q(), me(P(Ft), { key: 1 }, {
          default: U(() => [
            v.icon ? (q(), me(rr(v.icon), { key: 0 })) : Fe(v.$slots, "icon", { key: 1 })
          ]),
          _: 3
        })) : pe("v-if", !0),
        v.$slots.default ? (q(), ie("span", {
          key: 2,
          class: le({ [P(i).em("text", "expand")]: P(d) })
        }, [
          Fe(v.$slots, "default")
        ], 2)) : pe("v-if", !0)
      ]),
      _: 3
    }, 16, ["class", "style", "onClick"]));
  }
});
var rM = /* @__PURE__ */ Ke(tM, [["__file", "button.vue"]]);
const nM = {
  size: wp.size,
  type: wp.type
}, aM = Se({
  name: "ElButtonGroup"
}), iM = /* @__PURE__ */ Se({
  ...aM,
  props: nM,
  setup(t) {
    const e = t;
    Et(O2, on({
      size: Gr(e, "size"),
      type: Gr(e, "type")
    }));
    const r = Ge("button");
    return (n, a) => (q(), ie("div", {
      class: le(P(r).b("group"))
    }, [
      Fe(n.$slots, "default")
    ], 2));
  }
});
var P2 = /* @__PURE__ */ Ke(iM, [["__file", "button-group.vue"]]);
const mr = Vt(rM, {
  ButtonGroup: P2
});
An(P2);
var oo = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function oM(t) {
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
const Vn = /* @__PURE__ */ new Map();
if (It) {
  let t;
  document.addEventListener("mousedown", (e) => t = e), document.addEventListener("mouseup", (e) => {
    if (t) {
      for (const r of Vn.values())
        for (const { documentHandler: n } of r)
          n(e, t);
      t = void 0;
    }
  });
}
function Am(t, e) {
  let r = [];
  return Array.isArray(e.arg) ? r = e.arg : Ea(e.arg) && r.push(e.arg), function(n, a) {
    const i = e.instance.popperRef, o = n.target, s = a == null ? void 0 : a.target, u = !e || !e.instance, l = !o || !s, c = t.contains(o) || t.contains(s), d = t === o, f = r.length && r.some((v) => v == null ? void 0 : v.contains(o)) || r.length && r.includes(s), h = i && (i.contains(o) || i.contains(s));
    u || l || c || d || f || h || e.value(n, a);
  };
}
const D2 = {
  beforeMount(t, e) {
    Vn.has(t) || Vn.set(t, []), Vn.get(t).push({
      documentHandler: Am(t, e),
      bindingFn: e.value
    });
  },
  updated(t, e) {
    Vn.has(t) || Vn.set(t, []);
    const r = Vn.get(t), n = r.findIndex((i) => i.bindingFn === e.oldValue), a = {
      documentHandler: Am(t, e),
      bindingFn: e.value
    };
    n >= 0 ? r.splice(n, 1, a) : r.push(a);
  },
  unmounted(t) {
    Vn.delete(t);
  }
}, sM = rt({
  header: {
    type: String,
    default: ""
  },
  footer: {
    type: String,
    default: ""
  },
  bodyStyle: {
    type: qe([String, Object, Array]),
    default: ""
  },
  bodyClass: String,
  shadow: {
    type: String,
    values: ["always", "hover", "never"],
    default: "always"
  }
}), lM = Se({
  name: "ElCard"
}), uM = /* @__PURE__ */ Se({
  ...lM,
  props: sM,
  setup(t) {
    const e = Ge("card");
    return (r, n) => (q(), ie("div", {
      class: le([P(e).b(), P(e).is(`${r.shadow}-shadow`)])
    }, [
      r.$slots.header || r.header ? (q(), ie("div", {
        key: 0,
        class: le(P(e).e("header"))
      }, [
        Fe(r.$slots, "header", {}, () => [
          Be(ke(r.header), 1)
        ])
      ], 2)) : pe("v-if", !0),
      ae("div", {
        class: le([P(e).e("body"), r.bodyClass]),
        style: st(r.bodyStyle)
      }, [
        Fe(r.$slots, "default")
      ], 6),
      r.$slots.footer || r.footer ? (q(), ie("div", {
        key: 1,
        class: le(P(e).e("footer"))
      }, [
        Fe(r.$slots, "footer", {}, () => [
          Be(ke(r.footer), 1)
        ])
      ], 2)) : pe("v-if", !0)
    ], 2));
  }
});
var cM = /* @__PURE__ */ Ke(uM, [["__file", "card.vue"]]);
const dM = Vt(cM), R2 = {
  modelValue: {
    type: [Number, String, Boolean],
    default: void 0
  },
  label: {
    type: [String, Boolean, Number, Object],
    default: void 0
  },
  value: {
    type: [String, Boolean, Number, Object],
    default: void 0
  },
  indeterminate: Boolean,
  disabled: Boolean,
  checked: Boolean,
  name: {
    type: String,
    default: void 0
  },
  trueValue: {
    type: [String, Number],
    default: void 0
  },
  falseValue: {
    type: [String, Number],
    default: void 0
  },
  trueLabel: {
    type: [String, Number],
    default: void 0
  },
  falseLabel: {
    type: [String, Number],
    default: void 0
  },
  id: {
    type: String,
    default: void 0
  },
  border: Boolean,
  size: Di,
  tabindex: [String, Number],
  validateEvent: {
    type: Boolean,
    default: !0
  },
  ...sa(["ariaControls"])
}, L2 = {
  [Kt]: (t) => nr(t) || Ut(t) || bi(t),
  change: (t) => nr(t) || Ut(t) || bi(t)
}, Ri = Symbol("checkboxGroupContextKey"), fM = ({
  model: t,
  isChecked: e
}) => {
  const r = Ue(Ri, void 0), n = j(() => {
    var i, o;
    const s = (i = r == null ? void 0 : r.max) == null ? void 0 : i.value, u = (o = r == null ? void 0 : r.min) == null ? void 0 : o.value;
    return !Un(s) && t.value.length >= s && !e.value || !Un(u) && t.value.length <= u && e.value;
  });
  return {
    isDisabled: Yo(j(() => (r == null ? void 0 : r.disabled.value) || n.value)),
    isLimitDisabled: n
  };
}, vM = (t, {
  model: e,
  isLimitExceeded: r,
  hasOwnLabel: n,
  isDisabled: a,
  isLabeledByFormItem: i
}) => {
  const o = Ue(Ri, void 0), { formItem: s } = Va(), { emit: u } = mt();
  function l(v) {
    var p, g, y, m;
    return [!0, t.trueValue, t.trueLabel].includes(v) ? (g = (p = t.trueValue) != null ? p : t.trueLabel) != null ? g : !0 : (m = (y = t.falseValue) != null ? y : t.falseLabel) != null ? m : !1;
  }
  function c(v, p) {
    u("change", l(v), p);
  }
  function d(v) {
    if (r.value)
      return;
    const p = v.target;
    u("change", l(p.checked), v);
  }
  async function f(v) {
    r.value || !n.value && !a.value && i.value && (v.composedPath().some((y) => y.tagName === "LABEL") || (e.value = l([!1, t.falseValue, t.falseLabel].includes(e.value)), await ot(), c(e.value, v)));
  }
  const h = j(() => (o == null ? void 0 : o.validateEvent) || t.validateEvent);
  return Re(() => t.modelValue, () => {
    h.value && (s == null || s.validate("change").catch((v) => Ot(v)));
  }), {
    handleChange: d,
    onClickRoot: f
  };
}, hM = (t) => {
  const e = de(!1), { emit: r } = mt(), n = Ue(Ri, void 0), a = j(() => Un(n) === !1), i = de(!1), o = j({
    get() {
      var s, u;
      return a.value ? (s = n == null ? void 0 : n.modelValue) == null ? void 0 : s.value : (u = t.modelValue) != null ? u : e.value;
    },
    set(s) {
      var u, l;
      a.value && hr(s) ? (i.value = ((u = n == null ? void 0 : n.max) == null ? void 0 : u.value) !== void 0 && s.length > (n == null ? void 0 : n.max.value) && s.length > o.value.length, i.value === !1 && ((l = n == null ? void 0 : n.changeEvent) == null || l.call(n, s))) : (r(Kt, s), e.value = s);
    }
  });
  return {
    model: o,
    isGroup: a,
    isLimitExceeded: i
  };
}, pM = (t, e, { model: r }) => {
  const n = Ue(Ri, void 0), a = de(!1), i = j(() => al(t.value) ? t.label : t.value), o = j(() => {
    const c = r.value;
    return bi(c) ? c : hr(c) ? Gt(i.value) ? c.map(Js).some((d) => nl(d, i.value)) : c.map(Js).includes(i.value) : c != null ? c === t.trueValue || c === t.trueLabel : !!c;
  }), s = Oa(j(() => {
    var c;
    return (c = n == null ? void 0 : n.size) == null ? void 0 : c.value;
  }), {
    prop: !0
  }), u = Oa(j(() => {
    var c;
    return (c = n == null ? void 0 : n.size) == null ? void 0 : c.value;
  })), l = j(() => !!e.default || !al(i.value));
  return {
    checkboxButtonSize: s,
    isChecked: o,
    isFocused: a,
    checkboxSize: u,
    hasOwnLabel: l,
    actualValue: i
  };
}, F2 = (t, e) => {
  const { formItem: r } = Va(), { model: n, isGroup: a, isLimitExceeded: i } = hM(t), {
    isFocused: o,
    isChecked: s,
    checkboxButtonSize: u,
    checkboxSize: l,
    hasOwnLabel: c,
    actualValue: d
  } = pM(t, e, { model: n }), { isDisabled: f } = fM({ model: n, isChecked: s }), { inputId: h, isLabeledByFormItem: v } = Zo(t, {
    formItemContext: r,
    disableIdGeneration: c,
    disableIdManagement: a
  }), { handleChange: p, onClickRoot: g } = vM(t, {
    model: n,
    isLimitExceeded: i,
    hasOwnLabel: c,
    isDisabled: f,
    isLabeledByFormItem: v
  });
  return (() => {
    function m() {
      var b, w;
      hr(n.value) && !n.value.includes(d.value) ? n.value.push(d.value) : n.value = (w = (b = t.trueValue) != null ? b : t.trueLabel) != null ? w : !0;
    }
    t.checked && m();
  })(), Ns({
    from: "label act as value",
    replacement: "value",
    version: "3.0.0",
    scope: "el-checkbox",
    ref: "https://element-plus.org/en-US/component/checkbox.html"
  }, j(() => a.value && al(t.value))), Ns({
    from: "true-label",
    replacement: "true-value",
    version: "3.0.0",
    scope: "el-checkbox",
    ref: "https://element-plus.org/en-US/component/checkbox.html"
  }, j(() => !!t.trueLabel)), Ns({
    from: "false-label",
    replacement: "false-value",
    version: "3.0.0",
    scope: "el-checkbox",
    ref: "https://element-plus.org/en-US/component/checkbox.html"
  }, j(() => !!t.falseLabel)), {
    inputId: h,
    isLabeledByFormItem: v,
    isChecked: s,
    isDisabled: f,
    isFocused: o,
    checkboxButtonSize: u,
    checkboxSize: l,
    hasOwnLabel: c,
    model: n,
    actualValue: d,
    handleChange: p,
    onClickRoot: g
  };
}, gM = Se({
  name: "ElCheckbox"
}), yM = /* @__PURE__ */ Se({
  ...gM,
  props: R2,
  emits: L2,
  setup(t) {
    const e = t, r = Ho(), {
      inputId: n,
      isLabeledByFormItem: a,
      isChecked: i,
      isDisabled: o,
      isFocused: s,
      checkboxSize: u,
      hasOwnLabel: l,
      model: c,
      actualValue: d,
      handleChange: f,
      onClickRoot: h
    } = F2(e, r), v = Ge("checkbox"), p = j(() => [
      v.b(),
      v.m(u.value),
      v.is("disabled", o.value),
      v.is("bordered", e.border),
      v.is("checked", i.value)
    ]), g = j(() => [
      v.e("input"),
      v.is("disabled", o.value),
      v.is("checked", i.value),
      v.is("indeterminate", e.indeterminate),
      v.is("focus", s.value)
    ]);
    return (y, m) => (q(), me(rr(!P(l) && P(a) ? "span" : "label"), {
      class: le(P(p)),
      "aria-controls": y.indeterminate ? y.ariaControls : null,
      onClick: P(h)
    }, {
      default: U(() => {
        var b, w, x, E;
        return [
          ae("span", {
            class: le(P(g))
          }, [
            y.trueValue || y.falseValue || y.trueLabel || y.falseLabel ? Ye((q(), ie("input", {
              key: 0,
              id: P(n),
              "onUpdate:modelValue": (C) => yi(c) ? c.value = C : null,
              class: le(P(v).e("original")),
              type: "checkbox",
              indeterminate: y.indeterminate,
              name: y.name,
              tabindex: y.tabindex,
              disabled: P(o),
              "true-value": (w = (b = y.trueValue) != null ? b : y.trueLabel) != null ? w : !0,
              "false-value": (E = (x = y.falseValue) != null ? x : y.falseLabel) != null ? E : !1,
              onChange: P(f),
              onFocus: (C) => s.value = !0,
              onBlur: (C) => s.value = !1,
              onClick: pt(() => {
              }, ["stop"])
            }, null, 42, ["id", "onUpdate:modelValue", "indeterminate", "name", "tabindex", "disabled", "true-value", "false-value", "onChange", "onFocus", "onBlur", "onClick"])), [
              [Qs, P(c)]
            ]) : Ye((q(), ie("input", {
              key: 1,
              id: P(n),
              "onUpdate:modelValue": (C) => yi(c) ? c.value = C : null,
              class: le(P(v).e("original")),
              type: "checkbox",
              indeterminate: y.indeterminate,
              disabled: P(o),
              value: P(d),
              name: y.name,
              tabindex: y.tabindex,
              onChange: P(f),
              onFocus: (C) => s.value = !0,
              onBlur: (C) => s.value = !1,
              onClick: pt(() => {
              }, ["stop"])
            }, null, 42, ["id", "onUpdate:modelValue", "indeterminate", "disabled", "value", "name", "tabindex", "onChange", "onFocus", "onBlur", "onClick"])), [
              [Qs, P(c)]
            ]),
            ae("span", {
              class: le(P(v).e("inner"))
            }, null, 2)
          ], 2),
          P(l) ? (q(), ie("span", {
            key: 0,
            class: le(P(v).e("label"))
          }, [
            Fe(y.$slots, "default"),
            y.$slots.default ? pe("v-if", !0) : (q(), ie(je, { key: 0 }, [
              Be(ke(y.label), 1)
            ], 64))
          ], 2)) : pe("v-if", !0)
        ];
      }),
      _: 3
    }, 8, ["class", "aria-controls", "onClick"]));
  }
});
var mM = /* @__PURE__ */ Ke(yM, [["__file", "checkbox.vue"]]);
const bM = Se({
  name: "ElCheckboxButton"
}), wM = /* @__PURE__ */ Se({
  ...bM,
  props: R2,
  emits: L2,
  setup(t) {
    const e = t, r = Ho(), {
      isFocused: n,
      isChecked: a,
      isDisabled: i,
      checkboxButtonSize: o,
      model: s,
      actualValue: u,
      handleChange: l
    } = F2(e, r), c = Ue(Ri, void 0), d = Ge("checkbox"), f = j(() => {
      var v, p, g, y;
      const m = (p = (v = c == null ? void 0 : c.fill) == null ? void 0 : v.value) != null ? p : "";
      return {
        backgroundColor: m,
        borderColor: m,
        color: (y = (g = c == null ? void 0 : c.textColor) == null ? void 0 : g.value) != null ? y : "",
        boxShadow: m ? `-1px 0 0 0 ${m}` : void 0
      };
    }), h = j(() => [
      d.b("button"),
      d.bm("button", o.value),
      d.is("disabled", i.value),
      d.is("checked", a.value),
      d.is("focus", n.value)
    ]);
    return (v, p) => {
      var g, y, m, b;
      return q(), ie("label", {
        class: le(P(h))
      }, [
        v.trueValue || v.falseValue || v.trueLabel || v.falseLabel ? Ye((q(), ie("input", {
          key: 0,
          "onUpdate:modelValue": (w) => yi(s) ? s.value = w : null,
          class: le(P(d).be("button", "original")),
          type: "checkbox",
          name: v.name,
          tabindex: v.tabindex,
          disabled: P(i),
          "true-value": (y = (g = v.trueValue) != null ? g : v.trueLabel) != null ? y : !0,
          "false-value": (b = (m = v.falseValue) != null ? m : v.falseLabel) != null ? b : !1,
          onChange: P(l),
          onFocus: (w) => n.value = !0,
          onBlur: (w) => n.value = !1,
          onClick: pt(() => {
          }, ["stop"])
        }, null, 42, ["onUpdate:modelValue", "name", "tabindex", "disabled", "true-value", "false-value", "onChange", "onFocus", "onBlur", "onClick"])), [
          [Qs, P(s)]
        ]) : Ye((q(), ie("input", {
          key: 1,
          "onUpdate:modelValue": (w) => yi(s) ? s.value = w : null,
          class: le(P(d).be("button", "original")),
          type: "checkbox",
          name: v.name,
          tabindex: v.tabindex,
          disabled: P(i),
          value: P(u),
          onChange: P(l),
          onFocus: (w) => n.value = !0,
          onBlur: (w) => n.value = !1,
          onClick: pt(() => {
          }, ["stop"])
        }, null, 42, ["onUpdate:modelValue", "name", "tabindex", "disabled", "value", "onChange", "onFocus", "onBlur", "onClick"])), [
          [Qs, P(s)]
        ]),
        v.$slots.default || v.label ? (q(), ie("span", {
          key: 2,
          class: le(P(d).be("button", "inner")),
          style: st(P(a) ? P(f) : void 0)
        }, [
          Fe(v.$slots, "default", {}, () => [
            Be(ke(v.label), 1)
          ])
        ], 6)) : pe("v-if", !0)
      ], 2);
    };
  }
});
var M2 = /* @__PURE__ */ Ke(wM, [["__file", "checkbox-button.vue"]]);
const CM = rt({
  modelValue: {
    type: qe(Array),
    default: () => []
  },
  disabled: Boolean,
  min: Number,
  max: Number,
  size: Di,
  fill: String,
  textColor: String,
  tag: {
    type: String,
    default: "div"
  },
  validateEvent: {
    type: Boolean,
    default: !0
  },
  ...sa(["ariaLabel"])
}), xM = {
  [Kt]: (t) => hr(t),
  change: (t) => hr(t)
}, EM = Se({
  name: "ElCheckboxGroup"
}), SM = /* @__PURE__ */ Se({
  ...EM,
  props: CM,
  emits: xM,
  setup(t, { emit: e }) {
    const r = t, n = Ge("checkbox"), { formItem: a } = Va(), { inputId: i, isLabeledByFormItem: o } = Zo(r, {
      formItemContext: a
    }), s = async (l) => {
      e(Kt, l), await ot(), e("change", l);
    }, u = j({
      get() {
        return r.modelValue;
      },
      set(l) {
        s(l);
      }
    });
    return Et(Ri, {
      ...UE(Ko(r), [
        "size",
        "min",
        "max",
        "disabled",
        "validateEvent",
        "fill",
        "textColor"
      ]),
      modelValue: u,
      changeEvent: s
    }), Re(() => r.modelValue, () => {
      r.validateEvent && (a == null || a.validate("change").catch((l) => Ot(l)));
    }), (l, c) => {
      var d;
      return q(), me(rr(l.tag), {
        id: P(i),
        class: le(P(n).b("group")),
        role: "group",
        "aria-label": P(o) ? void 0 : l.ariaLabel || "checkbox-group",
        "aria-labelledby": P(o) ? (d = P(a)) == null ? void 0 : d.labelId : void 0
      }, {
        default: U(() => [
          Fe(l.$slots, "default")
        ]),
        _: 3
      }, 8, ["id", "class", "aria-label", "aria-labelledby"]);
    };
  }
});
var N2 = /* @__PURE__ */ Ke(SM, [["__file", "checkbox-group.vue"]]);
const kM = Vt(mM, {
  CheckboxButton: M2,
  CheckboxGroup: N2
});
An(M2);
An(N2);
const xp = rt({
  type: {
    type: String,
    values: ["primary", "success", "info", "warning", "danger"],
    default: "primary"
  },
  closable: Boolean,
  disableTransitions: Boolean,
  hit: Boolean,
  color: String,
  size: {
    type: String,
    values: XE
  },
  effect: {
    type: String,
    values: ["dark", "light", "plain"],
    default: "light"
  },
  round: Boolean
}), _M = {
  close: (t) => t instanceof MouseEvent,
  click: (t) => t instanceof MouseEvent
}, TM = Se({
  name: "ElTag"
}), IM = /* @__PURE__ */ Se({
  ...TM,
  props: xp,
  emits: _M,
  setup(t, { emit: e }) {
    const r = t, n = Oa(), a = Ge("tag"), i = j(() => {
      const { type: l, hit: c, effect: d, closable: f, round: h } = r;
      return [
        a.b(),
        a.is("closable", f),
        a.m(l || "primary"),
        a.m(n.value),
        a.m(d),
        a.is("hit", c),
        a.is("round", h)
      ];
    }), o = (l) => {
      e("close", l);
    }, s = (l) => {
      e("click", l);
    }, u = (l) => {
      l.component.subTree.component.bum = null;
    };
    return (l, c) => l.disableTransitions ? (q(), ie("span", {
      key: 0,
      class: le(P(i)),
      style: st({ backgroundColor: l.color }),
      onClick: s
    }, [
      ae("span", {
        class: le(P(a).e("content"))
      }, [
        Fe(l.$slots, "default")
      ], 2),
      l.closable ? (q(), me(P(Ft), {
        key: 0,
        class: le(P(a).e("close")),
        onClick: pt(o, ["stop"])
      }, {
        default: U(() => [
          J(P(Xs))
        ]),
        _: 1
      }, 8, ["class", "onClick"])) : pe("v-if", !0)
    ], 6)) : (q(), me(Ai, {
      key: 1,
      name: `${P(a).namespace.value}-zoom-in-center`,
      appear: "",
      onVnodeMounted: u
    }, {
      default: U(() => [
        ae("span", {
          class: le(P(i)),
          style: st({ backgroundColor: l.color }),
          onClick: s
        }, [
          ae("span", {
            class: le(P(a).e("content"))
          }, [
            Fe(l.$slots, "default")
          ], 2),
          l.closable ? (q(), me(P(Ft), {
            key: 0,
            class: le(P(a).e("close")),
            onClick: pt(o, ["stop"])
          }, {
            default: U(() => [
              J(P(Xs))
            ]),
            _: 1
          }, 8, ["class", "onClick"])) : pe("v-if", !0)
        ], 6)
      ]),
      _: 3
    }, 8, ["name"]));
  }
});
var OM = /* @__PURE__ */ Ke(IM, [["__file", "tag.vue"]]);
const AM = Vt(OM), B2 = Symbol("rowContextKey"), PM = [
  "start",
  "center",
  "end",
  "space-around",
  "space-between",
  "space-evenly"
], DM = ["top", "middle", "bottom"], RM = rt({
  tag: {
    type: String,
    default: "div"
  },
  gutter: {
    type: Number,
    default: 0
  },
  justify: {
    type: String,
    values: PM,
    default: "start"
  },
  align: {
    type: String,
    values: DM
  }
}), LM = Se({
  name: "ElRow"
}), FM = /* @__PURE__ */ Se({
  ...LM,
  props: RM,
  setup(t) {
    const e = t, r = Ge("row"), n = j(() => e.gutter);
    Et(B2, {
      gutter: n
    });
    const a = j(() => {
      const o = {};
      return e.gutter && (o.marginRight = o.marginLeft = `-${e.gutter / 2}px`), o;
    }), i = j(() => [
      r.b(),
      r.is(`justify-${e.justify}`, e.justify !== "start"),
      r.is(`align-${e.align}`, !!e.align)
    ]);
    return (o, s) => (q(), me(rr(o.tag), {
      class: le(P(i)),
      style: st(P(a))
    }, {
      default: U(() => [
        Fe(o.$slots, "default")
      ]),
      _: 3
    }, 8, ["class", "style"]));
  }
});
var MM = /* @__PURE__ */ Ke(FM, [["__file", "row.vue"]]);
const Dl = Vt(MM), NM = rt({
  tag: {
    type: String,
    default: "div"
  },
  span: {
    type: Number,
    default: 24
  },
  offset: {
    type: Number,
    default: 0
  },
  pull: {
    type: Number,
    default: 0
  },
  push: {
    type: Number,
    default: 0
  },
  xs: {
    type: qe([Number, Object]),
    default: () => oi({})
  },
  sm: {
    type: qe([Number, Object]),
    default: () => oi({})
  },
  md: {
    type: qe([Number, Object]),
    default: () => oi({})
  },
  lg: {
    type: qe([Number, Object]),
    default: () => oi({})
  },
  xl: {
    type: qe([Number, Object]),
    default: () => oi({})
  }
}), BM = Se({
  name: "ElCol"
}), $M = /* @__PURE__ */ Se({
  ...BM,
  props: NM,
  setup(t) {
    const e = t, { gutter: r } = Ue(B2, { gutter: j(() => 0) }), n = Ge("col"), a = j(() => {
      const o = {};
      return r.value && (o.paddingLeft = o.paddingRight = `${r.value / 2}px`), o;
    }), i = j(() => {
      const o = [];
      return ["span", "offset", "pull", "push"].forEach((l) => {
        const c = e[l];
        Ut(c) && (l === "span" ? o.push(n.b(`${e[l]}`)) : c > 0 && o.push(n.b(`${l}-${e[l]}`)));
      }), ["xs", "sm", "md", "lg", "xl"].forEach((l) => {
        Ut(e[l]) ? o.push(n.b(`${l}-${e[l]}`)) : Gt(e[l]) && Object.entries(e[l]).forEach(([c, d]) => {
          o.push(c !== "span" ? n.b(`${l}-${c}-${d}`) : n.b(`${l}-${d}`));
        });
      }), r.value && o.push(n.is("guttered")), [n.b(), o];
    });
    return (o, s) => (q(), me(rr(o.tag), {
      class: le(P(i)),
      style: st(P(a))
    }, {
      default: U(() => [
        Fe(o.$slots, "default")
      ]),
      _: 3
    }, 8, ["class", "style"]));
  }
});
var qM = /* @__PURE__ */ Ke($M, [["__file", "col.vue"]]);
const Qo = Vt(qM), zM = Se({
  name: "ElCollapseTransition"
}), VM = /* @__PURE__ */ Se({
  ...zM,
  setup(t) {
    const e = Ge("collapse-transition"), r = (a) => {
      a.style.maxHeight = "", a.style.overflow = a.dataset.oldOverflow, a.style.paddingTop = a.dataset.oldPaddingTop, a.style.paddingBottom = a.dataset.oldPaddingBottom;
    }, n = {
      beforeEnter(a) {
        a.dataset || (a.dataset = {}), a.dataset.oldPaddingTop = a.style.paddingTop, a.dataset.oldPaddingBottom = a.style.paddingBottom, a.style.height && (a.dataset.elExistsHeight = a.style.height), a.style.maxHeight = 0, a.style.paddingTop = 0, a.style.paddingBottom = 0;
      },
      enter(a) {
        requestAnimationFrame(() => {
          a.dataset.oldOverflow = a.style.overflow, a.dataset.elExistsHeight ? a.style.maxHeight = a.dataset.elExistsHeight : a.scrollHeight !== 0 ? a.style.maxHeight = `${a.scrollHeight}px` : a.style.maxHeight = 0, a.style.paddingTop = a.dataset.oldPaddingTop, a.style.paddingBottom = a.dataset.oldPaddingBottom, a.style.overflow = "hidden";
        });
      },
      afterEnter(a) {
        a.style.maxHeight = "", a.style.overflow = a.dataset.oldOverflow;
      },
      enterCancelled(a) {
        r(a);
      },
      beforeLeave(a) {
        a.dataset || (a.dataset = {}), a.dataset.oldPaddingTop = a.style.paddingTop, a.dataset.oldPaddingBottom = a.style.paddingBottom, a.dataset.oldOverflow = a.style.overflow, a.style.maxHeight = `${a.scrollHeight}px`, a.style.overflow = "hidden";
      },
      leave(a) {
        a.scrollHeight !== 0 && (a.style.maxHeight = 0, a.style.paddingTop = 0, a.style.paddingBottom = 0);
      },
      afterLeave(a) {
        r(a);
      },
      leaveCancelled(a) {
        r(a);
      }
    };
    return (a, i) => (q(), me(Ai, Ur({
      name: P(e).b()
    }, JT(n)), {
      default: U(() => [
        Fe(a.$slots, "default")
      ]),
      _: 3
    }, 16, ["name"]));
  }
});
var HM = /* @__PURE__ */ Ke(VM, [["__file", "collapse-transition.vue"]]);
const KM = Vt(HM), GM = rt({
  color: {
    type: qe(Object),
    required: !0
  },
  vertical: {
    type: Boolean,
    default: !1
  }
});
let Tu = !1;
function Ao(t, e) {
  if (!It)
    return;
  const r = function(i) {
    var o;
    (o = e.drag) == null || o.call(e, i);
  }, n = function(i) {
    var o;
    document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", n), document.removeEventListener("touchmove", r), document.removeEventListener("touchend", n), document.onselectstart = null, document.ondragstart = null, Tu = !1, (o = e.end) == null || o.call(e, i);
  }, a = function(i) {
    var o;
    Tu || (i.preventDefault(), document.onselectstart = () => !1, document.ondragstart = () => !1, document.addEventListener("mousemove", r), document.addEventListener("mouseup", n), document.addEventListener("touchmove", r), document.addEventListener("touchend", n), Tu = !0, (o = e.start) == null || o.call(e, i));
  };
  t.addEventListener("mousedown", a), t.addEventListener("touchstart", a, { passive: !1 });
}
const UM = (t) => {
  const e = mt(), { t: r } = Uo(), n = xn(), a = xn(), i = j(() => t.color.get("alpha")), o = j(() => r("el.colorpicker.alphaLabel"));
  function s(d) {
    var f;
    d.target !== n.value && u(d), (f = n.value) == null || f.focus();
  }
  function u(d) {
    if (!a.value || !n.value)
      return;
    const h = e.vnode.el.getBoundingClientRect(), { clientX: v, clientY: p } = Wp(d);
    if (t.vertical) {
      let g = p - h.top;
      g = Math.max(n.value.offsetHeight / 2, g), g = Math.min(g, h.height - n.value.offsetHeight / 2), t.color.set("alpha", Math.round((g - n.value.offsetHeight / 2) / (h.height - n.value.offsetHeight) * 100));
    } else {
      let g = v - h.left;
      g = Math.max(n.value.offsetWidth / 2, g), g = Math.min(g, h.width - n.value.offsetWidth / 2), t.color.set("alpha", Math.round((g - n.value.offsetWidth / 2) / (h.width - n.value.offsetWidth) * 100));
    }
  }
  function l(d) {
    const { code: f, shiftKey: h } = d, v = h ? 10 : 1;
    switch (f) {
      case Rt.left:
      case Rt.down:
        d.preventDefault(), d.stopPropagation(), c(-v);
        break;
      case Rt.right:
      case Rt.up:
        d.preventDefault(), d.stopPropagation(), c(v);
        break;
    }
  }
  function c(d) {
    let f = i.value + d;
    f = f < 0 ? 0 : f > 100 ? 100 : f, t.color.set("alpha", f);
  }
  return {
    thumb: n,
    bar: a,
    alpha: i,
    alphaLabel: o,
    handleDrag: u,
    handleClick: s,
    handleKeydown: l
  };
}, WM = (t, {
  bar: e,
  thumb: r,
  handleDrag: n
}) => {
  const a = mt(), i = Ge("color-alpha-slider"), o = de(0), s = de(0), u = de();
  function l() {
    if (!r.value || t.vertical)
      return 0;
    const m = a.vnode.el, b = t.color.get("alpha");
    return m ? Math.round(b * (m.offsetWidth - r.value.offsetWidth / 2) / 100) : 0;
  }
  function c() {
    if (!r.value)
      return 0;
    const m = a.vnode.el;
    if (!t.vertical)
      return 0;
    const b = t.color.get("alpha");
    return m ? Math.round(b * (m.offsetHeight - r.value.offsetHeight / 2) / 100) : 0;
  }
  function d() {
    if (t.color && t.color.value) {
      const { r: m, g: b, b: w } = t.color.toRgb();
      return `linear-gradient(to right, rgba(${m}, ${b}, ${w}, 0) 0%, rgba(${m}, ${b}, ${w}, 1) 100%)`;
    }
    return "";
  }
  function f() {
    o.value = l(), s.value = c(), u.value = d();
  }
  St(() => {
    if (!e.value || !r.value)
      return;
    const m = {
      drag: (b) => {
        n(b);
      },
      end: (b) => {
        n(b);
      }
    };
    Ao(e.value, m), Ao(r.value, m), f();
  }), Re(() => t.color.get("alpha"), () => f()), Re(() => t.color.value, () => f());
  const h = j(() => [i.b(), i.is("vertical", t.vertical)]), v = j(() => i.e("bar")), p = j(() => i.e("thumb")), g = j(() => ({ background: u.value })), y = j(() => ({
    left: wi(o.value),
    top: wi(s.value)
  }));
  return { rootKls: h, barKls: v, barStyle: g, thumbKls: p, thumbStyle: y, update: f };
}, jM = "ElColorAlphaSlider", YM = Se({
  name: jM
}), ZM = /* @__PURE__ */ Se({
  ...YM,
  props: GM,
  setup(t, { expose: e }) {
    const r = t, {
      alpha: n,
      alphaLabel: a,
      bar: i,
      thumb: o,
      handleDrag: s,
      handleClick: u,
      handleKeydown: l
    } = UM(r), { rootKls: c, barKls: d, barStyle: f, thumbKls: h, thumbStyle: v, update: p } = WM(r, {
      bar: i,
      thumb: o,
      handleDrag: s
    });
    return e({
      update: p,
      bar: i,
      thumb: o
    }), (g, y) => (q(), ie("div", {
      class: le(P(c))
    }, [
      ae("div", {
        ref_key: "bar",
        ref: i,
        class: le(P(d)),
        style: st(P(f)),
        onClick: P(u)
      }, null, 14, ["onClick"]),
      ae("div", {
        ref_key: "thumb",
        ref: o,
        class: le(P(h)),
        style: st(P(v)),
        "aria-label": P(a),
        "aria-valuenow": P(n),
        "aria-orientation": g.vertical ? "vertical" : "horizontal",
        "aria-valuemin": "0",
        "aria-valuemax": "100",
        role: "slider",
        tabindex: "0",
        onKeydown: P(l)
      }, null, 46, ["aria-label", "aria-valuenow", "aria-orientation", "onKeydown"])
    ], 2));
  }
});
var XM = /* @__PURE__ */ Ke(ZM, [["__file", "alpha-slider.vue"]]);
const JM = Se({
  name: "ElColorHueSlider",
  props: {
    color: {
      type: Object,
      required: !0
    },
    vertical: Boolean
  },
  setup(t) {
    const e = Ge("color-hue-slider"), r = mt(), n = de(), a = de(), i = de(0), o = de(0), s = j(() => t.color.get("hue"));
    Re(() => s.value, () => {
      f();
    });
    function u(h) {
      h.target !== n.value && l(h);
    }
    function l(h) {
      if (!a.value || !n.value)
        return;
      const p = r.vnode.el.getBoundingClientRect(), { clientX: g, clientY: y } = Wp(h);
      let m;
      if (t.vertical) {
        let b = y - p.top;
        b = Math.min(b, p.height - n.value.offsetHeight / 2), b = Math.max(n.value.offsetHeight / 2, b), m = Math.round((b - n.value.offsetHeight / 2) / (p.height - n.value.offsetHeight) * 360);
      } else {
        let b = g - p.left;
        b = Math.min(b, p.width - n.value.offsetWidth / 2), b = Math.max(n.value.offsetWidth / 2, b), m = Math.round((b - n.value.offsetWidth / 2) / (p.width - n.value.offsetWidth) * 360);
      }
      t.color.set("hue", m);
    }
    function c() {
      if (!n.value)
        return 0;
      const h = r.vnode.el;
      if (t.vertical)
        return 0;
      const v = t.color.get("hue");
      return h ? Math.round(v * (h.offsetWidth - n.value.offsetWidth / 2) / 360) : 0;
    }
    function d() {
      if (!n.value)
        return 0;
      const h = r.vnode.el;
      if (!t.vertical)
        return 0;
      const v = t.color.get("hue");
      return h ? Math.round(v * (h.offsetHeight - n.value.offsetHeight / 2) / 360) : 0;
    }
    function f() {
      i.value = c(), o.value = d();
    }
    return St(() => {
      if (!a.value || !n.value)
        return;
      const h = {
        drag: (v) => {
          l(v);
        },
        end: (v) => {
          l(v);
        }
      };
      Ao(a.value, h), Ao(n.value, h), f();
    }), {
      bar: a,
      thumb: n,
      thumbLeft: i,
      thumbTop: o,
      hueValue: s,
      handleClick: u,
      update: f,
      ns: e
    };
  }
});
function QM(t, e, r, n, a, i) {
  return q(), ie("div", {
    class: le([t.ns.b(), t.ns.is("vertical", t.vertical)])
  }, [
    ae("div", {
      ref: "bar",
      class: le(t.ns.e("bar")),
      onClick: t.handleClick
    }, null, 10, ["onClick"]),
    ae("div", {
      ref: "thumb",
      class: le(t.ns.e("thumb")),
      style: st({
        left: t.thumbLeft + "px",
        top: t.thumbTop + "px"
      })
    }, null, 6)
  ], 2);
}
var eN = /* @__PURE__ */ Ke(JM, [["render", QM], ["__file", "hue-slider.vue"]]);
const tN = rt({
  modelValue: String,
  id: String,
  showAlpha: Boolean,
  colorFormat: String,
  disabled: Boolean,
  size: Di,
  popperClass: {
    type: String,
    default: ""
  },
  tabindex: {
    type: [String, Number],
    default: 0
  },
  teleported: fr.teleported,
  predefine: {
    type: qe(Array)
  },
  validateEvent: {
    type: Boolean,
    default: !0
  },
  ...sa(["ariaLabel"])
}), rN = {
  [Kt]: (t) => nr(t) || Yn(t),
  [tg]: (t) => nr(t) || Yn(t),
  activeChange: (t) => nr(t) || Yn(t),
  focus: (t) => t instanceof FocusEvent,
  blur: (t) => t instanceof FocusEvent
}, $2 = Symbol("colorPickerContextKey"), Pm = function(t, e, r) {
  return [
    t,
    e * r / ((t = (2 - e) * r) < 1 ? t : 2 - t) || 0,
    t / 2
  ];
}, nN = function(t) {
  return typeof t == "string" && t.includes(".") && Number.parseFloat(t) === 1;
}, aN = function(t) {
  return typeof t == "string" && t.includes("%");
}, di = function(t, e) {
  nN(t) && (t = "100%");
  const r = aN(t);
  return t = Math.min(e, Math.max(0, Number.parseFloat(`${t}`))), r && (t = Number.parseInt(`${t * e}`, 10) / 100), Math.abs(t - e) < 1e-6 ? 1 : t % e / Number.parseFloat(e);
}, Dm = {
  10: "A",
  11: "B",
  12: "C",
  13: "D",
  14: "E",
  15: "F"
}, qs = (t) => {
  t = Math.min(Math.round(t), 255);
  const e = Math.floor(t / 16), r = t % 16;
  return `${Dm[e] || e}${Dm[r] || r}`;
}, Rm = function({ r: t, g: e, b: r }) {
  return Number.isNaN(+t) || Number.isNaN(+e) || Number.isNaN(+r) ? "" : `#${qs(t)}${qs(e)}${qs(r)}`;
}, Iu = {
  A: 10,
  B: 11,
  C: 12,
  D: 13,
  E: 14,
  F: 15
}, va = function(t) {
  return t.length === 2 ? (Iu[t[0].toUpperCase()] || +t[0]) * 16 + (Iu[t[1].toUpperCase()] || +t[1]) : Iu[t[1].toUpperCase()] || +t[1];
}, iN = function(t, e, r) {
  e = e / 100, r = r / 100;
  let n = e;
  const a = Math.max(r, 0.01);
  r *= 2, e *= r <= 1 ? r : 2 - r, n *= a <= 1 ? a : 2 - a;
  const i = (r + e) / 2, o = r === 0 ? 2 * n / (a + n) : 2 * e / (r + e);
  return {
    h: t,
    s: o * 100,
    v: i * 100
  };
}, Lm = (t, e, r) => {
  t = di(t, 255), e = di(e, 255), r = di(r, 255);
  const n = Math.max(t, e, r), a = Math.min(t, e, r);
  let i;
  const o = n, s = n - a, u = n === 0 ? 0 : s / n;
  if (n === a)
    i = 0;
  else {
    switch (n) {
      case t: {
        i = (e - r) / s + (e < r ? 6 : 0);
        break;
      }
      case e: {
        i = (r - t) / s + 2;
        break;
      }
      case r: {
        i = (t - e) / s + 4;
        break;
      }
    }
    i /= 6;
  }
  return { h: i * 360, s: u * 100, v: o * 100 };
}, eo = function(t, e, r) {
  t = di(t, 360) * 6, e = di(e, 100), r = di(r, 100);
  const n = Math.floor(t), a = t - n, i = r * (1 - e), o = r * (1 - a * e), s = r * (1 - (1 - a) * e), u = n % 6, l = [r, o, i, i, s, r][u], c = [s, r, r, o, i, i][u], d = [i, i, s, r, r, o][u];
  return {
    r: Math.round(l * 255),
    g: Math.round(c * 255),
    b: Math.round(d * 255)
  };
};
class wo {
  constructor(e = {}) {
    this._hue = 0, this._saturation = 100, this._value = 100, this._alpha = 100, this.enableAlpha = !1, this.format = "hex", this.value = "";
    for (const r in e)
      Ta(e, r) && (this[r] = e[r]);
    e.value ? this.fromString(e.value) : this.doOnChange();
  }
  set(e, r) {
    if (arguments.length === 1 && typeof e == "object") {
      for (const n in e)
        Ta(e, n) && this.set(n, e[n]);
      return;
    }
    this[`_${e}`] = r, this.doOnChange();
  }
  get(e) {
    return e === "alpha" ? Math.floor(this[`_${e}`]) : this[`_${e}`];
  }
  toRgb() {
    return eo(this._hue, this._saturation, this._value);
  }
  fromString(e) {
    if (!e) {
      this._hue = 0, this._saturation = 100, this._value = 100, this.doOnChange();
      return;
    }
    const r = (n, a, i) => {
      this._hue = Math.max(0, Math.min(360, n)), this._saturation = Math.max(0, Math.min(100, a)), this._value = Math.max(0, Math.min(100, i)), this.doOnChange();
    };
    if (e.includes("hsl")) {
      const n = e.replace(/hsla|hsl|\(|\)/gm, "").split(/\s|,/g).filter((a) => a !== "").map((a, i) => i > 2 ? Number.parseFloat(a) : Number.parseInt(a, 10));
      if (n.length === 4 ? this._alpha = Number.parseFloat(n[3]) * 100 : n.length === 3 && (this._alpha = 100), n.length >= 3) {
        const { h: a, s: i, v: o } = iN(n[0], n[1], n[2]);
        r(a, i, o);
      }
    } else if (e.includes("hsv")) {
      const n = e.replace(/hsva|hsv|\(|\)/gm, "").split(/\s|,/g).filter((a) => a !== "").map((a, i) => i > 2 ? Number.parseFloat(a) : Number.parseInt(a, 10));
      n.length === 4 ? this._alpha = Number.parseFloat(n[3]) * 100 : n.length === 3 && (this._alpha = 100), n.length >= 3 && r(n[0], n[1], n[2]);
    } else if (e.includes("rgb")) {
      const n = e.replace(/rgba|rgb|\(|\)/gm, "").split(/\s|,/g).filter((a) => a !== "").map((a, i) => i > 2 ? Number.parseFloat(a) : Number.parseInt(a, 10));
      if (n.length === 4 ? this._alpha = Number.parseFloat(n[3]) * 100 : n.length === 3 && (this._alpha = 100), n.length >= 3) {
        const { h: a, s: i, v: o } = Lm(n[0], n[1], n[2]);
        r(a, i, o);
      }
    } else if (e.includes("#")) {
      const n = e.replace("#", "").trim();
      if (!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(n))
        return;
      let a, i, o;
      n.length === 3 ? (a = va(n[0] + n[0]), i = va(n[1] + n[1]), o = va(n[2] + n[2])) : (n.length === 6 || n.length === 8) && (a = va(n.slice(0, 2)), i = va(n.slice(2, 4)), o = va(n.slice(4, 6))), n.length === 8 ? this._alpha = va(n.slice(6)) / 255 * 100 : (n.length === 3 || n.length === 6) && (this._alpha = 100);
      const { h: s, s: u, v: l } = Lm(a, i, o);
      r(s, u, l);
    }
  }
  compare(e) {
    return Math.abs(e._hue - this._hue) < 2 && Math.abs(e._saturation - this._saturation) < 1 && Math.abs(e._value - this._value) < 1 && Math.abs(e._alpha - this._alpha) < 1;
  }
  doOnChange() {
    const { _hue: e, _saturation: r, _value: n, _alpha: a, format: i } = this;
    if (this.enableAlpha)
      switch (i) {
        case "hsl": {
          const o = Pm(e, r / 100, n / 100);
          this.value = `hsla(${e}, ${Math.round(o[1] * 100)}%, ${Math.round(o[2] * 100)}%, ${this.get("alpha") / 100})`;
          break;
        }
        case "hsv": {
          this.value = `hsva(${e}, ${Math.round(r)}%, ${Math.round(n)}%, ${this.get("alpha") / 100})`;
          break;
        }
        case "hex": {
          this.value = `${Rm(eo(e, r, n))}${qs(a * 255 / 100)}`;
          break;
        }
        default: {
          const { r: o, g: s, b: u } = eo(e, r, n);
          this.value = `rgba(${o}, ${s}, ${u}, ${this.get("alpha") / 100})`;
        }
      }
    else
      switch (i) {
        case "hsl": {
          const o = Pm(e, r / 100, n / 100);
          this.value = `hsl(${e}, ${Math.round(o[1] * 100)}%, ${Math.round(o[2] * 100)}%)`;
          break;
        }
        case "hsv": {
          this.value = `hsv(${e}, ${Math.round(r)}%, ${Math.round(n)}%)`;
          break;
        }
        case "rgb": {
          const { r: o, g: s, b: u } = eo(e, r, n);
          this.value = `rgb(${o}, ${s}, ${u})`;
          break;
        }
        default:
          this.value = Rm(eo(e, r, n));
      }
  }
}
const oN = Se({
  props: {
    colors: {
      type: Array,
      required: !0
    },
    color: {
      type: Object,
      required: !0
    },
    enableAlpha: {
      type: Boolean,
      required: !0
    }
  },
  setup(t) {
    const e = Ge("color-predefine"), { currentColor: r } = Ue($2), n = de(i(t.colors, t.color));
    Re(() => r.value, (o) => {
      const s = new wo();
      s.fromString(o), n.value.forEach((u) => {
        u.selected = s.compare(u);
      });
    }), kE(() => {
      n.value = i(t.colors, t.color);
    });
    function a(o) {
      t.color.fromString(t.colors[o]);
    }
    function i(o, s) {
      return o.map((u) => {
        const l = new wo();
        return l.enableAlpha = t.enableAlpha, l.format = "rgba", l.fromString(u), l.selected = l.value === s.value, l;
      });
    }
    return {
      rgbaColors: n,
      handleSelect: a,
      ns: e
    };
  }
});
function sN(t, e, r, n, a, i) {
  return q(), ie("div", {
    class: le(t.ns.b())
  }, [
    ae("div", {
      class: le(t.ns.e("colors"))
    }, [
      (q(!0), ie(je, null, Lt(t.rgbaColors, (o, s) => (q(), ie("div", {
        key: t.colors[s],
        class: le([
          t.ns.e("color-selector"),
          t.ns.is("alpha", o._alpha < 100),
          { selected: o.selected }
        ]),
        onClick: (u) => t.handleSelect(s)
      }, [
        ae("div", {
          style: st({ backgroundColor: o.value })
        }, null, 4)
      ], 10, ["onClick"]))), 128))
    ], 2)
  ], 2);
}
var lN = /* @__PURE__ */ Ke(oN, [["render", sN], ["__file", "predefine.vue"]]);
const uN = Se({
  name: "ElSlPanel",
  props: {
    color: {
      type: Object,
      required: !0
    }
  },
  setup(t) {
    const e = Ge("color-svpanel"), r = mt(), n = de(0), a = de(0), i = de("hsl(0, 100%, 50%)"), o = j(() => {
      const l = t.color.get("hue"), c = t.color.get("value");
      return { hue: l, value: c };
    });
    function s() {
      const l = t.color.get("saturation"), c = t.color.get("value"), d = r.vnode.el, { clientWidth: f, clientHeight: h } = d;
      a.value = l * f / 100, n.value = (100 - c) * h / 100, i.value = `hsl(${t.color.get("hue")}, 100%, 50%)`;
    }
    function u(l) {
      const d = r.vnode.el.getBoundingClientRect(), { clientX: f, clientY: h } = Wp(l);
      let v = f - d.left, p = h - d.top;
      v = Math.max(0, v), v = Math.min(v, d.width), p = Math.max(0, p), p = Math.min(p, d.height), a.value = v, n.value = p, t.color.set({
        saturation: v / d.width * 100,
        value: 100 - p / d.height * 100
      });
    }
    return Re(() => o.value, () => {
      s();
    }), St(() => {
      Ao(r.vnode.el, {
        drag: (l) => {
          u(l);
        },
        end: (l) => {
          u(l);
        }
      }), s();
    }), {
      cursorTop: n,
      cursorLeft: a,
      background: i,
      colorValue: o,
      handleDrag: u,
      update: s,
      ns: e
    };
  }
});
function cN(t, e, r, n, a, i) {
  return q(), ie("div", {
    class: le(t.ns.b()),
    style: st({
      backgroundColor: t.background
    })
  }, [
    ae("div", {
      class: le(t.ns.e("white"))
    }, null, 2),
    ae("div", {
      class: le(t.ns.e("black"))
    }, null, 2),
    ae("div", {
      class: le(t.ns.e("cursor")),
      style: st({
        top: t.cursorTop + "px",
        left: t.cursorLeft + "px"
      })
    }, [
      ae("div")
    ], 6)
  ], 6);
}
var dN = /* @__PURE__ */ Ke(uN, [["render", cN], ["__file", "sv-panel.vue"]]);
const fN = Se({
  name: "ElColorPicker"
}), vN = /* @__PURE__ */ Se({
  ...fN,
  props: tN,
  emits: rN,
  setup(t, { expose: e, emit: r }) {
    const n = t, { t: a } = Uo(), i = Ge("color"), { formItem: o } = Va(), s = Oa(), u = Yo(), { inputId: l, isLabeledByFormItem: c } = Zo(n, {
      formItemContext: o
    }), d = de(), f = de(), h = de(), v = de(), p = de(), g = de(), { isFocused: y, handleFocus: m, handleBlur: b } = dg(p, {
      beforeFocus() {
        return u.value;
      },
      beforeBlur(N) {
        var X;
        return (X = v.value) == null ? void 0 : X.isFocusInsideContent(N);
      },
      afterBlur() {
        F(!1), V();
      }
    });
    let w = !0;
    const x = on(new wo({
      enableAlpha: n.showAlpha,
      format: n.colorFormat || "",
      value: n.modelValue
    })), E = de(!1), C = de(!1), k = de(""), S = j(() => !n.modelValue && !C.value ? "transparent" : A(x, n.showAlpha)), _ = j(() => !n.modelValue && !C.value ? "" : x.value), T = j(() => c.value ? void 0 : n.ariaLabel || a("el.colorpicker.defaultLabel")), O = j(() => c.value ? o == null ? void 0 : o.labelId : void 0), D = j(() => [
      i.b("picker"),
      i.is("disabled", u.value),
      i.bm("picker", s.value),
      i.is("focused", y.value)
    ]);
    function A(N, X) {
      if (!(N instanceof wo))
        throw new TypeError("color should be instance of _color Class");
      const { r: Q, g: ge, b: we } = N.toRgb();
      return X ? `rgba(${Q}, ${ge}, ${we}, ${N.get("alpha") / 100})` : `rgb(${Q}, ${ge}, ${we})`;
    }
    function F(N) {
      E.value = N;
    }
    const R = GE(F, 100, { leading: !0 });
    function M() {
      u.value || F(!0);
    }
    function L() {
      R(!1), V();
    }
    function V() {
      ot(() => {
        n.modelValue ? x.fromString(n.modelValue) : (x.value = "", ot(() => {
          C.value = !1;
        }));
      });
    }
    function Y() {
      u.value || R(!E.value);
    }
    function H() {
      x.fromString(k.value);
    }
    function K() {
      const N = x.value;
      r(Kt, N), r("change", N), n.validateEvent && (o == null || o.validate("change").catch((X) => Ot(X))), R(!1), ot(() => {
        const X = new wo({
          enableAlpha: n.showAlpha,
          format: n.colorFormat || "",
          value: n.modelValue
        });
        x.compare(X) || V();
      });
    }
    function ne() {
      R(!1), r(Kt, null), r("change", null), n.modelValue !== null && n.validateEvent && (o == null || o.validate("change").catch((N) => Ot(N))), V();
    }
    function B() {
      E.value && (L(), y.value && W());
    }
    function $(N) {
      N.preventDefault(), N.stopPropagation(), F(!1), V();
    }
    function z(N) {
      switch (N.code) {
        case Rt.enter:
        case Rt.space:
          N.preventDefault(), N.stopPropagation(), M(), g.value.focus();
          break;
        case Rt.esc:
          $(N);
          break;
      }
    }
    function W() {
      p.value.focus();
    }
    function Z() {
      p.value.blur();
    }
    return St(() => {
      n.modelValue && (k.value = _.value);
    }), Re(() => n.modelValue, (N) => {
      N ? N && N !== x.value && (w = !1, x.fromString(N)) : C.value = !1;
    }), Re(() => [n.colorFormat, n.showAlpha], () => {
      x.enableAlpha = n.showAlpha, x.format = n.colorFormat || x.format, x.doOnChange(), r(Kt, x.value);
    }), Re(() => _.value, (N) => {
      k.value = N, w && r("activeChange", N), w = !0;
    }), Re(() => x.value, () => {
      !n.modelValue && !C.value && (C.value = !0);
    }), Re(() => E.value, () => {
      ot(() => {
        var N, X, Q;
        (N = d.value) == null || N.update(), (X = f.value) == null || X.update(), (Q = h.value) == null || Q.update();
      });
    }), Et($2, {
      currentColor: _
    }), e({
      color: x,
      show: M,
      hide: L,
      focus: W,
      blur: Z
    }), (N, X) => (q(), me(P(Jo), {
      ref_key: "popper",
      ref: v,
      visible: E.value,
      "show-arrow": !1,
      "fallback-placements": ["bottom", "top", "right", "left"],
      offset: 0,
      "gpu-acceleration": !1,
      "popper-class": [P(i).be("picker", "panel"), P(i).b("dropdown"), N.popperClass],
      "stop-popper-mouse-event": !1,
      effect: "light",
      trigger: "click",
      teleported: N.teleported,
      transition: `${P(i).namespace.value}-zoom-in-top`,
      persistent: "",
      onHide: (Q) => F(!1)
    }, {
      content: U(() => [
        Ye((q(), ie("div", {
          onKeydown: ma($, ["esc"])
        }, [
          ae("div", {
            class: le(P(i).be("dropdown", "main-wrapper"))
          }, [
            J(eN, {
              ref_key: "hue",
              ref: d,
              class: "hue-slider",
              color: P(x),
              vertical: ""
            }, null, 8, ["color"]),
            J(dN, {
              ref_key: "sv",
              ref: f,
              color: P(x)
            }, null, 8, ["color"])
          ], 2),
          N.showAlpha ? (q(), me(XM, {
            key: 0,
            ref_key: "alpha",
            ref: h,
            color: P(x)
          }, null, 8, ["color"])) : pe("v-if", !0),
          N.predefine ? (q(), me(lN, {
            key: 1,
            ref: "predefine",
            "enable-alpha": N.showAlpha,
            color: P(x),
            colors: N.predefine
          }, null, 8, ["enable-alpha", "color", "colors"])) : pe("v-if", !0),
          ae("div", {
            class: le(P(i).be("dropdown", "btns"))
          }, [
            ae("span", {
              class: le(P(i).be("dropdown", "value"))
            }, [
              J(P(Xo), {
                ref_key: "inputRef",
                ref: g,
                modelValue: k.value,
                "onUpdate:modelValue": (Q) => k.value = Q,
                "validate-event": !1,
                size: "small",
                onKeyup: ma(H, ["enter"]),
                onBlur: H
              }, null, 8, ["modelValue", "onUpdate:modelValue", "onKeyup"])
            ], 2),
            J(P(mr), {
              class: le(P(i).be("dropdown", "link-btn")),
              text: "",
              size: "small",
              onClick: ne
            }, {
              default: U(() => [
                Be(ke(P(a)("el.colorpicker.clear")), 1)
              ]),
              _: 1
            }, 8, ["class"]),
            J(P(mr), {
              plain: "",
              size: "small",
              class: le(P(i).be("dropdown", "btn")),
              onClick: K
            }, {
              default: U(() => [
                Be(ke(P(a)("el.colorpicker.confirm")), 1)
              ]),
              _: 1
            }, 8, ["class"])
          ], 2)
        ], 40, ["onKeydown"])), [
          [P(D2), B]
        ])
      ]),
      default: U(() => [
        ae("div", Ur({
          id: P(l),
          ref_key: "triggerRef",
          ref: p
        }, N.$attrs, {
          class: P(D),
          role: "button",
          "aria-label": P(T),
          "aria-labelledby": P(O),
          "aria-description": P(a)("el.colorpicker.description", { color: N.modelValue || "" }),
          "aria-disabled": P(u),
          tabindex: P(u) ? -1 : N.tabindex,
          onKeydown: z,
          onFocus: P(m),
          onBlur: P(b)
        }), [
          P(u) ? (q(), ie("div", {
            key: 0,
            class: le(P(i).be("picker", "mask"))
          }, null, 2)) : pe("v-if", !0),
          ae("div", {
            class: le(P(i).be("picker", "trigger")),
            onClick: Y
          }, [
            ae("span", {
              class: le([P(i).be("picker", "color"), P(i).is("alpha", N.showAlpha)])
            }, [
              ae("span", {
                class: le(P(i).be("picker", "color-inner")),
                style: st({
                  backgroundColor: P(S)
                })
              }, [
                Ye(J(P(Ft), {
                  class: le([P(i).be("picker", "icon"), P(i).is("icon-arrow-down")])
                }, {
                  default: U(() => [
                    J(P(Vo))
                  ]),
                  _: 1
                }, 8, ["class"]), [
                  [dt, N.modelValue || C.value]
                ]),
                Ye(J(P(Ft), {
                  class: le([P(i).be("picker", "empty"), P(i).is("icon-close")])
                }, {
                  default: U(() => [
                    J(P(Xs))
                  ]),
                  _: 1
                }, 8, ["class"]), [
                  [dt, !N.modelValue && !C.value]
                ])
              ], 6)
            ], 2)
          ], 2)
        ], 16, ["id", "aria-label", "aria-labelledby", "aria-description", "aria-disabled", "tabindex", "onFocus", "onBlur"])
      ]),
      _: 1
    }, 8, ["visible", "popper-class", "teleported", "transition", "onHide"]));
  }
});
var hN = /* @__PURE__ */ Ke(vN, [["__file", "color-picker.vue"]]);
const pN = Vt(hN), gN = Se({
  name: "ElContainer"
}), yN = /* @__PURE__ */ Se({
  ...gN,
  props: {
    direction: {
      type: String
    }
  },
  setup(t) {
    const e = t, r = Ho(), n = Ge("container"), a = j(() => e.direction === "vertical" ? !0 : e.direction === "horizontal" ? !1 : r && r.default ? r.default().some((o) => {
      const s = o.type.name;
      return s === "ElHeader" || s === "ElFooter";
    }) : !1);
    return (i, o) => (q(), ie("section", {
      class: le([P(n).b(), P(n).is("vertical", P(a))])
    }, [
      Fe(i.$slots, "default")
    ], 2));
  }
});
var mN = /* @__PURE__ */ Ke(yN, [["__file", "container.vue"]]);
const bN = Se({
  name: "ElAside"
}), wN = /* @__PURE__ */ Se({
  ...bN,
  props: {
    width: {
      type: String,
      default: null
    }
  },
  setup(t) {
    const e = t, r = Ge("aside"), n = j(() => e.width ? r.cssVarBlock({ width: e.width }) : {});
    return (a, i) => (q(), ie("aside", {
      class: le(P(r).b()),
      style: st(P(n))
    }, [
      Fe(a.$slots, "default")
    ], 6));
  }
});
var q2 = /* @__PURE__ */ Ke(wN, [["__file", "aside.vue"]]);
const CN = Se({
  name: "ElFooter"
}), xN = /* @__PURE__ */ Se({
  ...CN,
  props: {
    height: {
      type: String,
      default: null
    }
  },
  setup(t) {
    const e = t, r = Ge("footer"), n = j(() => e.height ? r.cssVarBlock({ height: e.height }) : {});
    return (a, i) => (q(), ie("footer", {
      class: le(P(r).b()),
      style: st(P(n))
    }, [
      Fe(a.$slots, "default")
    ], 6));
  }
});
var z2 = /* @__PURE__ */ Ke(xN, [["__file", "footer.vue"]]);
const EN = Se({
  name: "ElHeader"
}), SN = /* @__PURE__ */ Se({
  ...EN,
  props: {
    height: {
      type: String,
      default: null
    }
  },
  setup(t) {
    const e = t, r = Ge("header"), n = j(() => e.height ? r.cssVarBlock({
      height: e.height
    }) : {});
    return (a, i) => (q(), ie("header", {
      class: le(P(r).b()),
      style: st(P(n))
    }, [
      Fe(a.$slots, "default")
    ], 6));
  }
});
var V2 = /* @__PURE__ */ Ke(SN, [["__file", "header.vue"]]);
const kN = Se({
  name: "ElMain"
}), _N = /* @__PURE__ */ Se({
  ...kN,
  setup(t) {
    const e = Ge("main");
    return (r, n) => (q(), ie("main", {
      class: le(P(e).b())
    }, [
      Fe(r.$slots, "default")
    ], 2));
  }
});
var H2 = /* @__PURE__ */ Ke(_N, [["__file", "main.vue"]]);
const bg = Vt(mN, {
  Aside: q2,
  Footer: z2,
  Header: V2,
  Main: H2
});
An(q2);
An(z2);
const K2 = An(V2), wg = An(H2), TN = /* @__PURE__ */ Se({
  inheritAttrs: !1
});
function IN(t, e, r, n, a, i) {
  return Fe(t.$slots, "default");
}
var ON = /* @__PURE__ */ Ke(TN, [["render", IN], ["__file", "collection.vue"]]);
const AN = /* @__PURE__ */ Se({
  name: "ElCollectionItem",
  inheritAttrs: !1
});
function PN(t, e, r, n, a, i) {
  return Fe(t.$slots, "default");
}
var DN = /* @__PURE__ */ Ke(AN, [["render", PN], ["__file", "collection-item.vue"]]);
const RN = "data-el-collection-item", LN = (t) => {
  const e = `El${t}Collection`, r = `${e}Item`, n = Symbol(e), a = Symbol(r), i = {
    ...ON,
    name: e,
    setup() {
      const s = de(null), u = /* @__PURE__ */ new Map();
      Et(n, {
        itemMap: u,
        getItems: () => {
          const c = P(s);
          if (!c)
            return [];
          const d = Array.from(c.querySelectorAll(`[${RN}]`));
          return [...u.values()].sort((h, v) => d.indexOf(h.ref) - d.indexOf(v.ref));
        },
        collectionRef: s
      });
    }
  }, o = {
    ...DN,
    name: r,
    setup(s, { attrs: u }) {
      const l = de(null), c = Ue(n, void 0);
      Et(a, {
        collectionItemRef: l
      }), St(() => {
        const d = P(l);
        d && c.itemMap.set(d, {
          ref: d,
          ...u
        });
      }), Zr(() => {
        const d = P(l);
        c.itemMap.delete(d);
      });
    }
  };
  return {
    COLLECTION_INJECTION_KEY: n,
    COLLECTION_ITEM_INJECTION_KEY: a,
    ElCollection: i,
    ElCollectionItem: o
  };
}, Ou = rt({
  trigger: Oo.trigger,
  effect: {
    ...fr.effect,
    default: "light"
  },
  type: {
    type: qe(String)
  },
  placement: {
    type: qe(String),
    default: "bottom"
  },
  popperOptions: {
    type: qe(Object),
    default: () => ({})
  },
  id: String,
  size: {
    type: String,
    default: ""
  },
  splitButton: Boolean,
  hideOnClick: {
    type: Boolean,
    default: !0
  },
  loop: {
    type: Boolean,
    default: !0
  },
  showTimeout: {
    type: Number,
    default: 150
  },
  hideTimeout: {
    type: Number,
    default: 150
  },
  tabindex: {
    type: qe([Number, String]),
    default: 0
  },
  maxHeight: {
    type: qe([Number, String]),
    default: ""
  },
  popperClass: {
    type: String,
    default: ""
  },
  disabled: Boolean,
  role: {
    type: String,
    default: "menu"
  },
  buttonProps: {
    type: qe(Object)
  },
  teleported: fr.teleported
});
rt({
  command: {
    type: [Object, String, Number],
    default: () => ({})
  },
  disabled: Boolean,
  divided: Boolean,
  textValue: String,
  icon: {
    type: Qn
  }
});
rt({
  onKeydown: { type: qe(Function) }
});
LN("Dropdown");
const G2 = Symbol("ElSelectGroup"), es = Symbol("ElSelect");
function FN(t, e) {
  const r = Ue(es), n = Ue(G2, { disabled: !1 }), a = j(() => c(Kn(r.props.modelValue), t.value)), i = j(() => {
    var h;
    if (r.props.multiple) {
      const v = Kn((h = r.props.modelValue) != null ? h : []);
      return !a.value && v.length >= r.props.multipleLimit && r.props.multipleLimit > 0;
    } else
      return !1;
  }), o = j(() => t.label || (Gt(t.value) ? "" : t.value)), s = j(() => t.value || t.label || ""), u = j(() => t.disabled || e.groupDisabled || i.value), l = mt(), c = (h = [], v) => {
    if (Gt(t.value)) {
      const p = r.props.valueKey;
      return h && h.some((g) => Js(wn(g, p)) === wn(v, p));
    } else
      return h && h.includes(v);
  }, d = () => {
    !t.disabled && !n.disabled && (r.states.hoveringIndex = r.optionsArray.indexOf(l.proxy));
  }, f = (h) => {
    const v = new RegExp(bD(h), "i");
    e.visible = v.test(o.value) || t.created;
  };
  return Re(() => o.value, () => {
    !t.created && !r.props.remote && r.setSelected();
  }), Re(() => t.value, (h, v) => {
    const { remote: p, valueKey: g } = r.props;
    if (h !== v && (r.onOptionDestroy(v, l.proxy), r.onOptionCreate(l.proxy)), !t.created && !p) {
      if (g && Gt(h) && Gt(v) && h[g] === v[g])
        return;
      r.setSelected();
    }
  }), Re(() => n.disabled, () => {
    e.groupDisabled = n.disabled;
  }, { immediate: !0 }), {
    select: r,
    currentLabel: o,
    currentValue: s,
    itemSelected: a,
    isDisabled: u,
    hoverItem: d,
    updateOption: f
  };
}
const MN = Se({
  name: "ElOption",
  componentName: "ElOption",
  props: {
    value: {
      required: !0,
      type: [String, Number, Boolean, Object]
    },
    label: [String, Number],
    created: Boolean,
    disabled: Boolean
  },
  setup(t) {
    const e = Ge("select"), r = Al(), n = j(() => [
      e.be("dropdown", "item"),
      e.is("disabled", P(s)),
      e.is("selected", P(o)),
      e.is("hovering", P(f))
    ]), a = on({
      index: -1,
      groupDisabled: !1,
      visible: !0,
      hover: !1
    }), {
      currentLabel: i,
      itemSelected: o,
      isDisabled: s,
      select: u,
      hoverItem: l,
      updateOption: c
    } = FN(t, a), { visible: d, hover: f } = Ko(a), h = mt().proxy;
    u.onOptionCreate(h), Zr(() => {
      const p = h.value, { selected: g } = u.states, m = (u.props.multiple ? g : [g]).some((b) => b.value === h.value);
      ot(() => {
        u.states.cachedOptions.get(p) === h && !m && u.states.cachedOptions.delete(p);
      }), u.onOptionDestroy(p, h);
    });
    function v() {
      s.value || u.handleOptionSelect(h);
    }
    return {
      ns: e,
      id: r,
      containerKls: n,
      currentLabel: i,
      itemSelected: o,
      isDisabled: s,
      select: u,
      hoverItem: l,
      updateOption: c,
      visible: d,
      hover: f,
      selectOptionClick: v,
      states: a
    };
  }
});
function NN(t, e, r, n, a, i) {
  return Ye((q(), ie("li", {
    id: t.id,
    class: le(t.containerKls),
    role: "option",
    "aria-disabled": t.isDisabled || void 0,
    "aria-selected": t.itemSelected,
    onMouseenter: t.hoverItem,
    onClick: pt(t.selectOptionClick, ["stop"])
  }, [
    Fe(t.$slots, "default", {}, () => [
      ae("span", null, ke(t.currentLabel), 1)
    ])
  ], 42, ["id", "aria-disabled", "aria-selected", "onMouseenter", "onClick"])), [
    [dt, t.visible]
  ]);
}
var Cg = /* @__PURE__ */ Ke(MN, [["render", NN], ["__file", "option.vue"]]);
const BN = Se({
  name: "ElSelectDropdown",
  componentName: "ElSelectDropdown",
  setup() {
    const t = Ue(es), e = Ge("select"), r = j(() => t.props.popperClass), n = j(() => t.props.multiple), a = j(() => t.props.fitInputWidth), i = de("");
    function o() {
      var s;
      i.value = `${(s = t.selectRef) == null ? void 0 : s.offsetWidth}px`;
    }
    return St(() => {
      o(), bn(t.selectRef, o);
    }), {
      ns: e,
      minWidth: i,
      popperClass: r,
      isMultiple: n,
      isFitInputWidth: a
    };
  }
});
function $N(t, e, r, n, a, i) {
  return q(), ie("div", {
    class: le([t.ns.b("dropdown"), t.ns.is("multiple", t.isMultiple), t.popperClass]),
    style: st({ [t.isFitInputWidth ? "width" : "minWidth"]: t.minWidth })
  }, [
    t.$slots.header ? (q(), ie("div", {
      key: 0,
      class: le(t.ns.be("dropdown", "header"))
    }, [
      Fe(t.$slots, "header")
    ], 2)) : pe("v-if", !0),
    Fe(t.$slots, "default"),
    t.$slots.footer ? (q(), ie("div", {
      key: 1,
      class: le(t.ns.be("dropdown", "footer"))
    }, [
      Fe(t.$slots, "footer")
    ], 2)) : pe("v-if", !0)
  ], 6);
}
var qN = /* @__PURE__ */ Ke(BN, [["render", $N], ["__file", "select-dropdown.vue"]]);
const zN = 11, VN = (t, e) => {
  const { t: r } = Uo(), n = Al(), a = Ge("select"), i = Ge("input"), o = on({
    inputValue: "",
    options: /* @__PURE__ */ new Map(),
    cachedOptions: /* @__PURE__ */ new Map(),
    disabledOptions: /* @__PURE__ */ new Map(),
    optionValues: [],
    selected: [],
    selectionWidth: 0,
    calculatorWidth: 0,
    collapseItemWidth: 0,
    selectedLabel: "",
    hoveringIndex: -1,
    previousQuery: null,
    inputHovering: !1,
    menuVisibleOnFocus: !1,
    isBeforeHide: !1
  }), s = de(null), u = de(null), l = de(null), c = de(null), d = de(null), f = de(null), h = de(null), v = de(null), p = de(null), g = de(null), y = de(null), m = de(null), {
    isComposing: b,
    handleCompositionStart: w,
    handleCompositionUpdate: x,
    handleCompositionEnd: E
  } = b2({
    afterComposition: (re) => se(re)
  }), { wrapperRef: C, isFocused: k } = dg(d, {
    beforeFocus() {
      return R.value;
    },
    afterFocus() {
      t.automaticDropdown && !S.value && (S.value = !0, o.menuVisibleOnFocus = !0);
    },
    beforeBlur(re) {
      var Ee, We;
      return ((Ee = l.value) == null ? void 0 : Ee.isFocusInsideContent(re)) || ((We = c.value) == null ? void 0 : We.isFocusInsideContent(re));
    },
    afterBlur() {
      S.value = !1, o.menuVisibleOnFocus = !1;
    }
  }), S = de(!1), _ = de(), { form: T, formItem: O } = Va(), { inputId: D } = Zo(t, {
    formItemContext: O
  }), { valueOnClear: A, isEmptyValue: F } = tL(t), R = j(() => t.disabled || (T == null ? void 0 : T.disabled)), M = j(() => hr(t.modelValue) ? t.modelValue.length > 0 : !F(t.modelValue)), L = j(() => t.clearable && !R.value && o.inputHovering && M.value), V = j(() => t.remote && t.filterable && !t.remoteShowSuffix ? "" : t.suffixIcon), Y = j(() => a.is("reverse", V.value && S.value)), H = j(() => (O == null ? void 0 : O.validateState) || ""), K = j(() => ZE[H.value]), ne = j(() => t.remote ? 300 : 0), B = j(() => t.loading ? t.loadingText || r("el.select.loading") : t.remote && !o.inputValue && o.options.size === 0 ? !1 : t.filterable && o.inputValue && o.options.size > 0 && $.value === 0 ? t.noMatchText || r("el.select.noMatch") : o.options.size === 0 ? t.noDataText || r("el.select.noData") : null), $ = j(() => z.value.filter((re) => re.visible).length), z = j(() => {
    const re = Array.from(o.options.values()), Ee = [];
    return o.optionValues.forEach((We) => {
      const at = re.findIndex((Qr) => Qr.value === We);
      at > -1 && Ee.push(re[at]);
    }), Ee.length >= re.length ? Ee : re;
  }), W = j(() => Array.from(o.cachedOptions.values())), Z = j(() => {
    const re = z.value.filter((Ee) => !Ee.created).some((Ee) => Ee.currentLabel === o.inputValue);
    return t.filterable && t.allowCreate && o.inputValue !== "" && !re;
  }), N = () => {
    t.filterable && cr(t.filterMethod) || t.filterable && t.remote && cr(t.remoteMethod) || z.value.forEach((re) => {
      var Ee;
      (Ee = re.updateOption) == null || Ee.call(re, o.inputValue);
    });
  }, X = Oa(), Q = j(() => ["small"].includes(X.value) ? "small" : "default"), ge = j({
    get() {
      return S.value && B.value !== !1;
    },
    set(re) {
      S.value = re;
    }
  }), we = j(() => {
    if (t.multiple && !Un(t.modelValue))
      return Kn(t.modelValue).length === 0 && !o.inputValue;
    const re = hr(t.modelValue) ? t.modelValue[0] : t.modelValue;
    return t.filterable || Un(re) ? !o.inputValue : !0;
  }), fe = j(() => {
    var re;
    const Ee = (re = t.placeholder) != null ? re : r("el.select.placeholder");
    return t.multiple || !M.value ? Ee : o.selectedLabel;
  }), ce = j(() => cp ? null : "mouseenter");
  Re(() => t.modelValue, (re, Ee) => {
    t.multiple && t.filterable && !t.reserveKeyword && (o.inputValue = "", be("")), xe(), !nl(re, Ee) && t.validateEvent && (O == null || O.validate("change").catch((We) => Ot(We)));
  }, {
    flush: "post",
    deep: !0
  }), Re(() => S.value, (re) => {
    re ? be(o.inputValue) : (o.inputValue = "", o.previousQuery = null, o.isBeforeHide = !0), e("visible-change", re);
  }), Re(() => o.options.entries(), () => {
    var re;
    if (!It)
      return;
    const Ee = ((re = s.value) == null ? void 0 : re.querySelectorAll("input")) || [];
    (!t.filterable && !t.defaultFirstOption && !Un(t.modelValue) || !Array.from(Ee).includes(document.activeElement)) && xe(), t.defaultFirstOption && (t.filterable || t.remote) && $.value && ve();
  }, {
    flush: "post"
  }), Re(() => o.hoveringIndex, (re) => {
    Ut(re) && re > -1 ? _.value = z.value[re] || {} : _.value = {}, z.value.forEach((Ee) => {
      Ee.hover = _.value === Ee;
    });
  }), kE(() => {
    o.isBeforeHide || N();
  });
  const be = (re) => {
    o.previousQuery === re || b.value || (o.previousQuery = re, t.filterable && cr(t.filterMethod) ? t.filterMethod(re) : t.filterable && t.remote && cr(t.remoteMethod) && t.remoteMethod(re), t.defaultFirstOption && (t.filterable || t.remote) && $.value ? ot(ve) : ot(He));
  }, ve = () => {
    const re = z.value.filter((at) => at.visible && !at.disabled && !at.states.groupDisabled), Ee = re.find((at) => at.created), We = re[0];
    o.hoveringIndex = Ae(z.value, Ee || We);
  }, xe = () => {
    if (t.multiple)
      o.selectedLabel = "";
    else {
      const Ee = hr(t.modelValue) ? t.modelValue[0] : t.modelValue, We = _e(Ee);
      o.selectedLabel = We.currentLabel, o.selected = [We];
      return;
    }
    const re = [];
    Un(t.modelValue) || Kn(t.modelValue).forEach((Ee) => {
      re.push(_e(Ee));
    }), o.selected = re;
  }, _e = (re) => {
    let Ee;
    const We = gu(re).toLowerCase() === "object", at = gu(re).toLowerCase() === "null", Qr = gu(re).toLowerCase() === "undefined";
    for (let pn = o.cachedOptions.size - 1; pn >= 0; pn--) {
      const _r = W.value[pn];
      if (We ? wn(_r.value, t.valueKey) === wn(re, t.valueKey) : _r.value === re) {
        Ee = {
          value: re,
          currentLabel: _r.currentLabel,
          get isDisabled() {
            return _r.isDisabled;
          }
        };
        break;
      }
    }
    if (Ee)
      return Ee;
    const Mn = We ? re.label : !at && !Qr ? re : "";
    return {
      value: re,
      currentLabel: Mn
    };
  }, He = () => {
    o.hoveringIndex = z.value.findIndex((re) => o.selected.some((Ee) => Qt(Ee) === Qt(re)));
  }, Ve = () => {
    o.selectionWidth = u.value.getBoundingClientRect().width;
  }, De = () => {
    o.calculatorWidth = f.value.getBoundingClientRect().width;
  }, Ne = () => {
    o.collapseItemWidth = y.value.getBoundingClientRect().width;
  }, ue = () => {
    var re, Ee;
    (Ee = (re = l.value) == null ? void 0 : re.updatePopper) == null || Ee.call(re);
  }, I = () => {
    var re, Ee;
    (Ee = (re = c.value) == null ? void 0 : re.updatePopper) == null || Ee.call(re);
  }, G = () => {
    o.inputValue.length > 0 && !S.value && (S.value = !0), be(o.inputValue);
  }, se = (re) => {
    if (o.inputValue = re.target.value, t.remote)
      ee();
    else
      return G();
  }, ee = GE(() => {
    G();
  }, ne.value), te = (re) => {
    nl(t.modelValue, re) || e(tg, re);
  }, ye = (re) => vD(re, (Ee) => !o.disabledOptions.has(Ee)), oe = (re) => {
    if (t.multiple && re.code !== Rt.delete && re.target.value.length <= 0) {
      const Ee = Kn(t.modelValue).slice(), We = ye(Ee);
      if (We < 0)
        return;
      const at = Ee[We];
      Ee.splice(We, 1), e(Kt, Ee), te(Ee), e("remove-tag", at);
    }
  }, he = (re, Ee) => {
    const We = o.selected.indexOf(Ee);
    if (We > -1 && !R.value) {
      const at = Kn(t.modelValue).slice();
      at.splice(We, 1), e(Kt, at), te(at), e("remove-tag", Ee.value);
    }
    re.stopPropagation(), kt();
  }, Oe = (re) => {
    re.stopPropagation();
    const Ee = t.multiple ? [] : A.value;
    if (t.multiple)
      for (const We of o.selected)
        We.isDisabled && Ee.push(We.value);
    e(Kt, Ee), te(Ee), o.hoveringIndex = -1, S.value = !1, e("clear"), kt();
  }, Pe = (re) => {
    var Ee;
    if (t.multiple) {
      const We = Kn((Ee = t.modelValue) != null ? Ee : []).slice(), at = Ae(We, re.value);
      at > -1 ? We.splice(at, 1) : (t.multipleLimit <= 0 || We.length < t.multipleLimit) && We.push(re.value), e(Kt, We), te(We), re.created && be(""), t.filterable && !t.reserveKeyword && (o.inputValue = "");
    } else
      e(Kt, re.value), te(re.value), S.value = !1;
    kt(), !S.value && ot(() => {
      $e(re);
    });
  }, Ae = (re = [], Ee) => {
    if (!Gt(Ee))
      return re.indexOf(Ee);
    const We = t.valueKey;
    let at = -1;
    return re.some((Qr, Mn) => Js(wn(Qr, We)) === wn(Ee, We) ? (at = Mn, !0) : !1), at;
  }, $e = (re) => {
    var Ee, We, at, Qr, Mn;
    const Xa = hr(re) ? re[0] : re;
    let pn = null;
    if (Xa != null && Xa.value) {
      const _r = z.value.filter((Nn) => Nn.value === Xa.value);
      _r.length > 0 && (pn = _r[0].$el);
    }
    if (l.value && pn) {
      const _r = (Qr = (at = (We = (Ee = l.value) == null ? void 0 : Ee.popperRef) == null ? void 0 : We.contentRef) == null ? void 0 : at.querySelector) == null ? void 0 : Qr.call(at, `.${a.be("dropdown", "wrap")}`);
      _r && xD(_r, pn);
    }
    (Mn = m.value) == null || Mn.handleScroll();
  }, Ie = (re) => {
    o.options.set(re.value, re), o.cachedOptions.set(re.value, re), re.disabled && o.disabledOptions.set(re.value, re);
  }, Le = (re, Ee) => {
    o.options.get(re) === Ee && o.options.delete(re);
  }, ut = j(() => {
    var re, Ee;
    return (Ee = (re = l.value) == null ? void 0 : re.popperRef) == null ? void 0 : Ee.contentRef;
  }), nt = () => {
    o.isBeforeHide = !1, ot(() => $e(o.selected));
  }, kt = () => {
    var re;
    (re = d.value) == null || re.focus();
  }, _t = () => {
    var re;
    (re = d.value) == null || re.blur();
  }, Ct = (re) => {
    Oe(re);
  }, Jt = () => {
    S.value = !1, k.value && _t();
  }, Pt = () => {
    o.inputValue.length > 0 ? o.inputValue = "" : S.value = !1;
  }, $t = () => {
    R.value || (cp && (o.inputHovering = !0), o.menuVisibleOnFocus ? o.menuVisibleOnFocus = !1 : S.value = !S.value);
  }, wr = () => {
    S.value ? z.value[o.hoveringIndex] && Pe(z.value[o.hoveringIndex]) : $t();
  }, Qt = (re) => Gt(re.value) ? wn(re.value, t.valueKey) : re.value, er = j(() => z.value.filter((re) => re.visible).every((re) => re.disabled)), kr = j(() => t.multiple ? t.collapseTags ? o.selected.slice(0, t.maxCollapseTags) : o.selected : []), Nr = j(() => t.multiple ? t.collapseTags ? o.selected.slice(t.maxCollapseTags) : [] : []), dr = (re) => {
    if (!S.value) {
      S.value = !0;
      return;
    }
    if (!(o.options.size === 0 || o.filteredOptionsCount === 0 || b.value) && !er.value) {
      re === "next" ? (o.hoveringIndex++, o.hoveringIndex === o.options.size && (o.hoveringIndex = 0)) : re === "prev" && (o.hoveringIndex--, o.hoveringIndex < 0 && (o.hoveringIndex = o.options.size - 1));
      const Ee = z.value[o.hoveringIndex];
      (Ee.disabled === !0 || Ee.states.groupDisabled === !0 || !Ee.visible) && dr(re), ot(() => $e(_.value));
    }
  }, xt = () => {
    if (!u.value)
      return 0;
    const re = window.getComputedStyle(u.value);
    return Number.parseFloat(re.gap || "6px");
  }, Tt = j(() => {
    const re = xt();
    return { maxWidth: `${y.value && t.maxCollapseTags === 1 ? o.selectionWidth - o.collapseItemWidth - re : o.selectionWidth}px` };
  }), qt = j(() => ({ maxWidth: `${o.selectionWidth}px` })), Fn = j(() => ({
    width: `${Math.max(o.calculatorWidth, zN)}px`
  }));
  return bn(u, Ve), bn(f, De), bn(p, ue), bn(C, ue), bn(g, I), bn(y, Ne), St(() => {
    xe();
  }), {
    inputId: D,
    contentId: n,
    nsSelect: a,
    nsInput: i,
    states: o,
    isFocused: k,
    expanded: S,
    optionsArray: z,
    hoverOption: _,
    selectSize: X,
    filteredOptionsCount: $,
    resetCalculatorWidth: De,
    updateTooltip: ue,
    updateTagTooltip: I,
    debouncedOnInputChange: ee,
    onInput: se,
    deletePrevTag: oe,
    deleteTag: he,
    deleteSelected: Oe,
    handleOptionSelect: Pe,
    scrollToOption: $e,
    hasModelValue: M,
    shouldShowPlaceholder: we,
    currentPlaceholder: fe,
    mouseEnterEventName: ce,
    showClose: L,
    iconComponent: V,
    iconReverse: Y,
    validateState: H,
    validateIcon: K,
    showNewOption: Z,
    updateOptions: N,
    collapseTagSize: Q,
    setSelected: xe,
    selectDisabled: R,
    emptyText: B,
    handleCompositionStart: w,
    handleCompositionUpdate: x,
    handleCompositionEnd: E,
    onOptionCreate: Ie,
    onOptionDestroy: Le,
    handleMenuEnter: nt,
    focus: kt,
    blur: _t,
    handleClearClick: Ct,
    handleClickOutside: Jt,
    handleEsc: Pt,
    toggleMenu: $t,
    selectOption: wr,
    getValueKey: Qt,
    navigateOptions: dr,
    dropdownMenuVisible: ge,
    showTagList: kr,
    collapseTagList: Nr,
    tagStyle: Tt,
    collapseTagStyle: qt,
    inputStyle: Fn,
    popperRef: ut,
    inputRef: d,
    tooltipRef: l,
    tagTooltipRef: c,
    calculatorRef: f,
    prefixRef: h,
    suffixRef: v,
    selectRef: s,
    wrapperRef: C,
    selectionRef: u,
    scrollbarRef: m,
    menuRef: p,
    tagMenuRef: g,
    collapseItemRef: y
  };
};
var HN = Se({
  name: "ElOptions",
  setup(t, { slots: e }) {
    const r = Ue(es);
    let n = [];
    return () => {
      var a, i;
      const o = (a = e.default) == null ? void 0 : a.call(e), s = [];
      function u(l) {
        hr(l) && l.forEach((c) => {
          var d, f, h, v;
          const p = (d = (c == null ? void 0 : c.type) || {}) == null ? void 0 : d.name;
          p === "ElOptionGroup" ? u(!nr(c.children) && !hr(c.children) && cr((f = c.children) == null ? void 0 : f.default) ? (h = c.children) == null ? void 0 : h.default() : c.children) : p === "ElOption" ? s.push((v = c.props) == null ? void 0 : v.value) : hr(c.children) && u(c.children);
        });
      }
      return o.length && u((i = o[0]) == null ? void 0 : i.children), nl(s, n) || (n = s, r && (r.states.optionValues = s)), o;
    };
  }
});
const KN = rt({
  name: String,
  id: String,
  modelValue: {
    type: [Array, String, Number, Boolean, Object],
    default: void 0
  },
  autocomplete: {
    type: String,
    default: "off"
  },
  automaticDropdown: Boolean,
  size: Di,
  effect: {
    type: qe(String),
    default: "light"
  },
  disabled: Boolean,
  clearable: Boolean,
  filterable: Boolean,
  allowCreate: Boolean,
  loading: Boolean,
  popperClass: {
    type: String,
    default: ""
  },
  popperOptions: {
    type: qe(Object),
    default: () => ({})
  },
  remote: Boolean,
  loadingText: String,
  noMatchText: String,
  noDataText: String,
  remoteMethod: Function,
  filterMethod: Function,
  multiple: Boolean,
  multipleLimit: {
    type: Number,
    default: 0
  },
  placeholder: {
    type: String
  },
  defaultFirstOption: Boolean,
  reserveKeyword: {
    type: Boolean,
    default: !0
  },
  valueKey: {
    type: String,
    default: "value"
  },
  collapseTags: Boolean,
  collapseTagsTooltip: Boolean,
  maxCollapseTags: {
    type: Number,
    default: 1
  },
  teleported: fr.teleported,
  persistent: {
    type: Boolean,
    default: !0
  },
  clearIcon: {
    type: Qn,
    default: Gp
  },
  fitInputWidth: Boolean,
  suffixIcon: {
    type: Qn,
    default: Vo
  },
  tagType: { ...xp.type, default: "info" },
  tagEffect: { ...xp.effect, default: "light" },
  validateEvent: {
    type: Boolean,
    default: !0
  },
  remoteShowSuffix: Boolean,
  placement: {
    type: qe(String),
    values: Il,
    default: "bottom-start"
  },
  fallbackPlacements: {
    type: qe(Array),
    default: ["bottom-start", "top-start", "right", "left"]
  },
  appendTo: String,
  ...eL,
  ...sa(["ariaLabel"])
}), Fm = "ElSelect", GN = Se({
  name: Fm,
  componentName: Fm,
  components: {
    ElSelectMenu: qN,
    ElOption: Cg,
    ElOptions: HN,
    ElTag: AM,
    ElScrollbar: PL,
    ElTooltip: Jo,
    ElIcon: Ft
  },
  directives: { ClickOutside: D2 },
  props: KN,
  emits: [
    Kt,
    tg,
    "remove-tag",
    "clear",
    "visible-change",
    "focus",
    "blur"
  ],
  setup(t, { emit: e }) {
    const r = j(() => {
      const { modelValue: i, multiple: o } = t, s = o ? [] : void 0;
      return hr(i) ? o ? i : s : o ? s : i;
    }), n = on({
      ...Ko(t),
      modelValue: r
    }), a = VN(n, e);
    return Et(es, on({
      props: n,
      states: a.states,
      optionsArray: a.optionsArray,
      handleOptionSelect: a.handleOptionSelect,
      onOptionCreate: a.onOptionCreate,
      onOptionDestroy: a.onOptionDestroy,
      selectRef: a.selectRef,
      setSelected: a.setSelected
    })), {
      ...a,
      modelValue: r
    };
  }
});
function UN(t, e, r, n, a, i) {
  const o = tr("el-tag"), s = tr("el-tooltip"), u = tr("el-icon"), l = tr("el-option"), c = tr("el-options"), d = tr("el-scrollbar"), f = tr("el-select-menu"), h = QT("click-outside");
  return Ye((q(), ie("div", {
    ref: "selectRef",
    class: le([t.nsSelect.b(), t.nsSelect.m(t.selectSize)]),
    [eI(t.mouseEnterEventName)]: (v) => t.states.inputHovering = !0,
    onMouseleave: (v) => t.states.inputHovering = !1
  }, [
    J(s, {
      ref: "tooltipRef",
      visible: t.dropdownMenuVisible,
      placement: t.placement,
      teleported: t.teleported,
      "popper-class": [t.nsSelect.e("popper"), t.popperClass],
      "popper-options": t.popperOptions,
      "fallback-placements": t.fallbackPlacements,
      effect: t.effect,
      pure: "",
      trigger: "click",
      transition: `${t.nsSelect.namespace.value}-zoom-in-top`,
      "stop-popper-mouse-event": !1,
      "gpu-acceleration": !1,
      persistent: t.persistent,
      "append-to": t.appendTo,
      onBeforeShow: t.handleMenuEnter,
      onHide: (v) => t.states.isBeforeHide = !1
    }, {
      default: U(() => {
        var v;
        return [
          ae("div", {
            ref: "wrapperRef",
            class: le([
              t.nsSelect.e("wrapper"),
              t.nsSelect.is("focused", t.isFocused),
              t.nsSelect.is("hovering", t.states.inputHovering),
              t.nsSelect.is("filterable", t.filterable),
              t.nsSelect.is("disabled", t.selectDisabled)
            ]),
            onClick: pt(t.toggleMenu, ["prevent"])
          }, [
            t.$slots.prefix ? (q(), ie("div", {
              key: 0,
              ref: "prefixRef",
              class: le(t.nsSelect.e("prefix"))
            }, [
              Fe(t.$slots, "prefix")
            ], 2)) : pe("v-if", !0),
            ae("div", {
              ref: "selectionRef",
              class: le([
                t.nsSelect.e("selection"),
                t.nsSelect.is("near", t.multiple && !t.$slots.prefix && !!t.states.selected.length)
              ])
            }, [
              t.multiple ? Fe(t.$slots, "tag", { key: 0 }, () => [
                (q(!0), ie(je, null, Lt(t.showTagList, (p) => (q(), ie("div", {
                  key: t.getValueKey(p),
                  class: le(t.nsSelect.e("selected-item"))
                }, [
                  J(o, {
                    closable: !t.selectDisabled && !p.isDisabled,
                    size: t.collapseTagSize,
                    type: t.tagType,
                    effect: t.tagEffect,
                    "disable-transitions": "",
                    style: st(t.tagStyle),
                    onClose: (g) => t.deleteTag(g, p)
                  }, {
                    default: U(() => [
                      ae("span", {
                        class: le(t.nsSelect.e("tags-text"))
                      }, [
                        Fe(t.$slots, "label", {
                          label: p.currentLabel,
                          value: p.value
                        }, () => [
                          Be(ke(p.currentLabel), 1)
                        ])
                      ], 2)
                    ]),
                    _: 2
                  }, 1032, ["closable", "size", "type", "effect", "style", "onClose"])
                ], 2))), 128)),
                t.collapseTags && t.states.selected.length > t.maxCollapseTags ? (q(), me(s, {
                  key: 0,
                  ref: "tagTooltipRef",
                  disabled: t.dropdownMenuVisible || !t.collapseTagsTooltip,
                  "fallback-placements": ["bottom", "top", "right", "left"],
                  effect: t.effect,
                  placement: "bottom",
                  teleported: t.teleported
                }, {
                  default: U(() => [
                    ae("div", {
                      ref: "collapseItemRef",
                      class: le(t.nsSelect.e("selected-item"))
                    }, [
                      J(o, {
                        closable: !1,
                        size: t.collapseTagSize,
                        type: t.tagType,
                        effect: t.tagEffect,
                        "disable-transitions": "",
                        style: st(t.collapseTagStyle)
                      }, {
                        default: U(() => [
                          ae("span", {
                            class: le(t.nsSelect.e("tags-text"))
                          }, " + " + ke(t.states.selected.length - t.maxCollapseTags), 3)
                        ]),
                        _: 1
                      }, 8, ["size", "type", "effect", "style"])
                    ], 2)
                  ]),
                  content: U(() => [
                    ae("div", {
                      ref: "tagMenuRef",
                      class: le(t.nsSelect.e("selection"))
                    }, [
                      (q(!0), ie(je, null, Lt(t.collapseTagList, (p) => (q(), ie("div", {
                        key: t.getValueKey(p),
                        class: le(t.nsSelect.e("selected-item"))
                      }, [
                        J(o, {
                          class: "in-tooltip",
                          closable: !t.selectDisabled && !p.isDisabled,
                          size: t.collapseTagSize,
                          type: t.tagType,
                          effect: t.tagEffect,
                          "disable-transitions": "",
                          onClose: (g) => t.deleteTag(g, p)
                        }, {
                          default: U(() => [
                            ae("span", {
                              class: le(t.nsSelect.e("tags-text"))
                            }, [
                              Fe(t.$slots, "label", {
                                label: p.currentLabel,
                                value: p.value
                              }, () => [
                                Be(ke(p.currentLabel), 1)
                              ])
                            ], 2)
                          ]),
                          _: 2
                        }, 1032, ["closable", "size", "type", "effect", "onClose"])
                      ], 2))), 128))
                    ], 2)
                  ]),
                  _: 3
                }, 8, ["disabled", "effect", "teleported"])) : pe("v-if", !0)
              ]) : pe("v-if", !0),
              t.selectDisabled ? pe("v-if", !0) : (q(), ie("div", {
                key: 1,
                class: le([
                  t.nsSelect.e("selected-item"),
                  t.nsSelect.e("input-wrapper"),
                  t.nsSelect.is("hidden", !t.filterable)
                ])
              }, [
                Ye(ae("input", {
                  id: t.inputId,
                  ref: "inputRef",
                  "onUpdate:modelValue": (p) => t.states.inputValue = p,
                  type: "text",
                  name: t.name,
                  class: le([t.nsSelect.e("input"), t.nsSelect.is(t.selectSize)]),
                  disabled: t.selectDisabled,
                  autocomplete: t.autocomplete,
                  style: st(t.inputStyle),
                  role: "combobox",
                  readonly: !t.filterable,
                  spellcheck: "false",
                  "aria-activedescendant": ((v = t.hoverOption) == null ? void 0 : v.id) || "",
                  "aria-controls": t.contentId,
                  "aria-expanded": t.dropdownMenuVisible,
                  "aria-label": t.ariaLabel,
                  "aria-autocomplete": "none",
                  "aria-haspopup": "listbox",
                  onKeydown: [
                    ma(pt((p) => t.navigateOptions("next"), ["stop", "prevent"]), ["down"]),
                    ma(pt((p) => t.navigateOptions("prev"), ["stop", "prevent"]), ["up"]),
                    ma(pt(t.handleEsc, ["stop", "prevent"]), ["esc"]),
                    ma(pt(t.selectOption, ["stop", "prevent"]), ["enter"]),
                    ma(pt(t.deletePrevTag, ["stop"]), ["delete"])
                  ],
                  onCompositionstart: t.handleCompositionStart,
                  onCompositionupdate: t.handleCompositionUpdate,
                  onCompositionend: t.handleCompositionEnd,
                  onInput: t.onInput,
                  onClick: pt(t.toggleMenu, ["stop"])
                }, null, 46, ["id", "onUpdate:modelValue", "name", "disabled", "autocomplete", "readonly", "aria-activedescendant", "aria-controls", "aria-expanded", "aria-label", "onKeydown", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onInput", "onClick"]), [
                  [tI, t.states.inputValue]
                ]),
                t.filterable ? (q(), ie("span", {
                  key: 0,
                  ref: "calculatorRef",
                  "aria-hidden": "true",
                  class: le(t.nsSelect.e("input-calculator")),
                  textContent: ke(t.states.inputValue)
                }, null, 10, ["textContent"])) : pe("v-if", !0)
              ], 2)),
              t.shouldShowPlaceholder ? (q(), ie("div", {
                key: 2,
                class: le([
                  t.nsSelect.e("selected-item"),
                  t.nsSelect.e("placeholder"),
                  t.nsSelect.is("transparent", !t.hasModelValue || t.expanded && !t.states.inputValue)
                ])
              }, [
                t.hasModelValue ? Fe(t.$slots, "label", {
                  key: 0,
                  label: t.currentPlaceholder,
                  value: t.modelValue
                }, () => [
                  ae("span", null, ke(t.currentPlaceholder), 1)
                ]) : (q(), ie("span", { key: 1 }, ke(t.currentPlaceholder), 1))
              ], 2)) : pe("v-if", !0)
            ], 2),
            ae("div", {
              ref: "suffixRef",
              class: le(t.nsSelect.e("suffix"))
            }, [
              t.iconComponent && !t.showClose ? (q(), me(u, {
                key: 0,
                class: le([t.nsSelect.e("caret"), t.nsSelect.e("icon"), t.iconReverse])
              }, {
                default: U(() => [
                  (q(), me(rr(t.iconComponent)))
                ]),
                _: 1
              }, 8, ["class"])) : pe("v-if", !0),
              t.showClose && t.clearIcon ? (q(), me(u, {
                key: 1,
                class: le([
                  t.nsSelect.e("caret"),
                  t.nsSelect.e("icon"),
                  t.nsSelect.e("clear")
                ]),
                onClick: t.handleClearClick
              }, {
                default: U(() => [
                  (q(), me(rr(t.clearIcon)))
                ]),
                _: 1
              }, 8, ["class", "onClick"])) : pe("v-if", !0),
              t.validateState && t.validateIcon ? (q(), me(u, {
                key: 2,
                class: le([t.nsInput.e("icon"), t.nsInput.e("validateIcon")])
              }, {
                default: U(() => [
                  (q(), me(rr(t.validateIcon)))
                ]),
                _: 1
              }, 8, ["class"])) : pe("v-if", !0)
            ], 2)
          ], 10, ["onClick"])
        ];
      }),
      content: U(() => [
        J(f, { ref: "menuRef" }, {
          default: U(() => [
            t.$slots.header ? (q(), ie("div", {
              key: 0,
              class: le(t.nsSelect.be("dropdown", "header")),
              onClick: pt(() => {
              }, ["stop"])
            }, [
              Fe(t.$slots, "header")
            ], 10, ["onClick"])) : pe("v-if", !0),
            Ye(J(d, {
              id: t.contentId,
              ref: "scrollbarRef",
              tag: "ul",
              "wrap-class": t.nsSelect.be("dropdown", "wrap"),
              "view-class": t.nsSelect.be("dropdown", "list"),
              class: le([t.nsSelect.is("empty", t.filteredOptionsCount === 0)]),
              role: "listbox",
              "aria-label": t.ariaLabel,
              "aria-orientation": "vertical"
            }, {
              default: U(() => [
                t.showNewOption ? (q(), me(l, {
                  key: 0,
                  value: t.states.inputValue,
                  created: !0
                }, null, 8, ["value"])) : pe("v-if", !0),
                J(c, null, {
                  default: U(() => [
                    Fe(t.$slots, "default")
                  ]),
                  _: 3
                })
              ]),
              _: 3
            }, 8, ["id", "wrap-class", "view-class", "class", "aria-label"]), [
              [dt, t.states.options.size > 0 && !t.loading]
            ]),
            t.$slots.loading && t.loading ? (q(), ie("div", {
              key: 1,
              class: le(t.nsSelect.be("dropdown", "loading"))
            }, [
              Fe(t.$slots, "loading")
            ], 2)) : t.loading || t.filteredOptionsCount === 0 ? (q(), ie("div", {
              key: 2,
              class: le(t.nsSelect.be("dropdown", "empty"))
            }, [
              Fe(t.$slots, "empty", {}, () => [
                ae("span", null, ke(t.emptyText), 1)
              ])
            ], 2)) : pe("v-if", !0),
            t.$slots.footer ? (q(), ie("div", {
              key: 3,
              class: le(t.nsSelect.be("dropdown", "footer")),
              onClick: pt(() => {
              }, ["stop"])
            }, [
              Fe(t.$slots, "footer")
            ], 10, ["onClick"])) : pe("v-if", !0)
          ]),
          _: 3
        }, 512)
      ]),
      _: 3
    }, 8, ["visible", "placement", "teleported", "popper-class", "popper-options", "fallback-placements", "effect", "transition", "persistent", "append-to", "onBeforeShow", "onHide"])
  ], 16, ["onMouseleave"])), [
    [h, t.handleClickOutside, t.popperRef]
  ]);
}
var WN = /* @__PURE__ */ Ke(GN, [["render", UN], ["__file", "select.vue"]]);
const jN = Se({
  name: "ElOptionGroup",
  componentName: "ElOptionGroup",
  props: {
    label: String,
    disabled: Boolean
  },
  setup(t) {
    const e = Ge("select"), r = de(null), n = mt(), a = de([]);
    Et(G2, on({
      ...Ko(t)
    }));
    const i = j(() => a.value.some((l) => l.visible === !0)), o = (l) => {
      var c, d;
      return ((c = l.type) == null ? void 0 : c.name) === "ElOption" && !!((d = l.component) != null && d.proxy);
    }, s = (l) => {
      const c = Kn(l), d = [];
      return c.forEach((f) => {
        var h, v;
        o(f) ? d.push(f.component.proxy) : (h = f.children) != null && h.length ? d.push(...s(f.children)) : (v = f.component) != null && v.subTree && d.push(...s(f.component.subTree));
      }), d;
    }, u = () => {
      a.value = s(n.subTree);
    };
    return St(() => {
      u();
    }), hI(r, u, {
      attributes: !0,
      subtree: !0,
      childList: !0
    }), {
      groupRef: r,
      visible: i,
      ns: e
    };
  }
});
function YN(t, e, r, n, a, i) {
  return Ye((q(), ie("ul", {
    ref: "groupRef",
    class: le(t.ns.be("group", "wrap"))
  }, [
    ae("li", {
      class: le(t.ns.be("group", "title"))
    }, ke(t.label), 3),
    ae("li", null, [
      ae("ul", {
        class: le(t.ns.b("group"))
      }, [
        Fe(t.$slots, "default")
      ], 2)
    ])
  ], 2)), [
    [dt, t.visible]
  ]);
}
var U2 = /* @__PURE__ */ Ke(jN, [["render", YN], ["__file", "option-group.vue"]]);
const ZN = Vt(WN, {
  Option: Cg,
  OptionGroup: U2
}), XN = An(Cg);
An(U2);
const JN = rt({
  trigger: Oo.trigger,
  placement: Ou.placement,
  disabled: Oo.disabled,
  visible: fr.visible,
  transition: fr.transition,
  popperOptions: Ou.popperOptions,
  tabindex: Ou.tabindex,
  content: fr.content,
  popperStyle: fr.popperStyle,
  popperClass: fr.popperClass,
  enterable: {
    ...fr.enterable,
    default: !0
  },
  effect: {
    ...fr.effect,
    default: "light"
  },
  teleported: fr.teleported,
  title: String,
  width: {
    type: [String, Number],
    default: 150
  },
  offset: {
    type: Number,
    default: void 0
  },
  showAfter: {
    type: Number,
    default: 0
  },
  hideAfter: {
    type: Number,
    default: 200
  },
  autoClose: {
    type: Number,
    default: 0
  },
  showArrow: {
    type: Boolean,
    default: !0
  },
  persistent: {
    type: Boolean,
    default: !0
  },
  "onUpdate:visible": {
    type: Function
  }
}), QN = {
  "update:visible": (t) => bi(t),
  "before-enter": () => !0,
  "before-leave": () => !0,
  "after-enter": () => !0,
  "after-leave": () => !0
}, e5 = "onUpdate:visible", t5 = Se({
  name: "ElPopover"
}), r5 = /* @__PURE__ */ Se({
  ...t5,
  props: JN,
  emits: QN,
  setup(t, { expose: e, emit: r }) {
    const n = t, a = j(() => n[e5]), i = Ge("popover"), o = de(), s = j(() => {
      var g;
      return (g = P(o)) == null ? void 0 : g.popperRef;
    }), u = j(() => [
      {
        width: wi(n.width)
      },
      n.popperStyle
    ]), l = j(() => [i.b(), n.popperClass, { [i.m("plain")]: !!n.content }]), c = j(() => n.transition === `${i.namespace.value}-fade-in-linear`), d = () => {
      var g;
      (g = o.value) == null || g.hide();
    }, f = () => {
      r("before-enter");
    }, h = () => {
      r("before-leave");
    }, v = () => {
      r("after-enter");
    }, p = () => {
      r("update:visible", !1), r("after-leave");
    };
    return e({
      popperRef: s,
      hide: d
    }), (g, y) => (q(), me(P(Jo), Ur({
      ref_key: "tooltipRef",
      ref: o
    }, g.$attrs, {
      trigger: g.trigger,
      placement: g.placement,
      disabled: g.disabled,
      visible: g.visible,
      transition: g.transition,
      "popper-options": g.popperOptions,
      tabindex: g.tabindex,
      content: g.content,
      offset: g.offset,
      "show-after": g.showAfter,
      "hide-after": g.hideAfter,
      "auto-close": g.autoClose,
      "show-arrow": g.showArrow,
      "aria-label": g.title,
      effect: g.effect,
      enterable: g.enterable,
      "popper-class": P(l),
      "popper-style": P(u),
      teleported: g.teleported,
      persistent: g.persistent,
      "gpu-acceleration": P(c),
      "onUpdate:visible": P(a),
      onBeforeShow: f,
      onBeforeHide: h,
      onShow: v,
      onHide: p
    }), {
      content: U(() => [
        g.title ? (q(), ie("div", {
          key: 0,
          class: le(P(i).e("title")),
          role: "title"
        }, ke(g.title), 3)) : pe("v-if", !0),
        Fe(g.$slots, "default", {}, () => [
          Be(ke(g.content), 1)
        ])
      ]),
      default: U(() => [
        g.$slots.reference ? Fe(g.$slots, "reference", { key: 0 }) : pe("v-if", !0)
      ]),
      _: 3
    }, 16, ["trigger", "placement", "disabled", "visible", "transition", "popper-options", "tabindex", "content", "offset", "show-after", "hide-after", "auto-close", "show-arrow", "aria-label", "effect", "enterable", "popper-class", "popper-style", "teleported", "persistent", "gpu-acceleration", "onUpdate:visible"]));
  }
});
var n5 = /* @__PURE__ */ Ke(r5, [["__file", "popover.vue"]]);
const Mm = (t, e) => {
  const r = e.arg || e.value, n = r == null ? void 0 : r.popperRef;
  n && (n.triggerRef = t);
};
var a5 = {
  mounted(t, e) {
    Mm(t, e);
  },
  updated(t, e) {
    Mm(t, e);
  }
};
const i5 = "popover", o5 = SD(a5, i5), Li = Vt(n5, {
  directive: o5
}), fi = "$treeNodeId", Nm = function(t, e) {
  !e || e[fi] || Object.defineProperty(e, fi, {
    value: t.id,
    enumerable: !1,
    configurable: !1,
    writable: !1
  });
}, xg = function(t, e) {
  return t ? e[t] : e[fi];
}, Ep = (t, e, r) => {
  const n = t.value.currentNode;
  r();
  const a = t.value.currentNode;
  n !== a && e("current-change", a ? a.data : null, a);
}, Sp = (t) => {
  let e = !0, r = !0, n = !0;
  for (let a = 0, i = t.length; a < i; a++) {
    const o = t[a];
    (o.checked !== !0 || o.indeterminate) && (e = !1, o.disabled || (n = !1)), (o.checked !== !1 || o.indeterminate) && (r = !1);
  }
  return { all: e, none: r, allWithoutDisable: n, half: !e && !r };
}, so = function(t) {
  if (t.childNodes.length === 0 || t.loading)
    return;
  const { all: e, none: r, half: n } = Sp(t.childNodes);
  e ? (t.checked = !0, t.indeterminate = !1) : n ? (t.checked = !1, t.indeterminate = !0) : r && (t.checked = !1, t.indeterminate = !1);
  const a = t.parent;
  !a || a.level === 0 || t.store.checkStrictly || so(a);
}, Es = function(t, e) {
  const r = t.store.props, n = t.data || {}, a = r[e];
  if (typeof a == "function")
    return a(n, t);
  if (typeof a == "string")
    return n[a];
  if (typeof a > "u") {
    const i = n[e];
    return i === void 0 ? "" : i;
  }
};
let s5 = 0;
class _a {
  constructor(e) {
    this.id = s5++, this.text = null, this.checked = !1, this.indeterminate = !1, this.data = null, this.expanded = !1, this.parent = null, this.visible = !0, this.isCurrent = !1, this.canFocus = !1;
    for (const r in e)
      Ta(e, r) && (this[r] = e[r]);
    this.level = 0, this.loaded = !1, this.childNodes = [], this.loading = !1, this.parent && (this.level = this.parent.level + 1);
  }
  initialize() {
    const e = this.store;
    if (!e)
      throw new Error("[Node]store is required!");
    e.registerNode(this);
    const r = e.props;
    if (r && typeof r.isLeaf < "u") {
      const i = Es(this, "isLeaf");
      typeof i == "boolean" && (this.isLeafByUser = i);
    }
    if (e.lazy !== !0 && this.data ? (this.setData(this.data), e.defaultExpandAll && (this.expanded = !0, this.canFocus = !0)) : this.level > 0 && e.lazy && e.defaultExpandAll && !this.isLeafByUser && this.expand(), Array.isArray(this.data) || Nm(this, this.data), !this.data)
      return;
    const n = e.defaultExpandedKeys, a = e.key;
    a && n && n.includes(this.key) && this.expand(null, e.autoExpandParent), a && e.currentNodeKey !== void 0 && this.key === e.currentNodeKey && (e.currentNode = this, e.currentNode.isCurrent = !0), e.lazy && e._initDefaultCheckedNode(this), this.updateLeafState(), this.parent && (this.level === 1 || this.parent.expanded === !0) && (this.canFocus = !0);
  }
  setData(e) {
    Array.isArray(e) || Nm(this, e), this.data = e, this.childNodes = [];
    let r;
    this.level === 0 && Array.isArray(this.data) ? r = this.data : r = Es(this, "children") || [];
    for (let n = 0, a = r.length; n < a; n++)
      this.insertChild({ data: r[n] });
  }
  get label() {
    return Es(this, "label");
  }
  get key() {
    const e = this.store.key;
    return this.data ? this.data[e] : null;
  }
  get disabled() {
    return Es(this, "disabled");
  }
  get nextSibling() {
    const e = this.parent;
    if (e) {
      const r = e.childNodes.indexOf(this);
      if (r > -1)
        return e.childNodes[r + 1];
    }
    return null;
  }
  get previousSibling() {
    const e = this.parent;
    if (e) {
      const r = e.childNodes.indexOf(this);
      if (r > -1)
        return r > 0 ? e.childNodes[r - 1] : null;
    }
    return null;
  }
  contains(e, r = !0) {
    return (this.childNodes || []).some((n) => n === e || r && n.contains(e));
  }
  remove() {
    const e = this.parent;
    e && e.removeChild(this);
  }
  insertChild(e, r, n) {
    if (!e)
      throw new Error("InsertChild error: child is required.");
    if (!(e instanceof _a)) {
      if (!n) {
        const a = this.getChildren(!0);
        a.includes(e.data) || (typeof r > "u" || r < 0 ? a.push(e.data) : a.splice(r, 0, e.data));
      }
      Object.assign(e, {
        parent: this,
        store: this.store
      }), e = on(new _a(e)), e instanceof _a && e.initialize();
    }
    e.level = this.level + 1, typeof r > "u" || r < 0 ? this.childNodes.push(e) : this.childNodes.splice(r, 0, e), this.updateLeafState();
  }
  insertBefore(e, r) {
    let n;
    r && (n = this.childNodes.indexOf(r)), this.insertChild(e, n);
  }
  insertAfter(e, r) {
    let n;
    r && (n = this.childNodes.indexOf(r), n !== -1 && (n += 1)), this.insertChild(e, n);
  }
  removeChild(e) {
    const r = this.getChildren() || [], n = r.indexOf(e.data);
    n > -1 && r.splice(n, 1);
    const a = this.childNodes.indexOf(e);
    a > -1 && (this.store && this.store.deregisterNode(e), e.parent = null, this.childNodes.splice(a, 1)), this.updateLeafState();
  }
  removeChildByData(e) {
    let r = null;
    for (let n = 0; n < this.childNodes.length; n++)
      if (this.childNodes[n].data === e) {
        r = this.childNodes[n];
        break;
      }
    r && this.removeChild(r);
  }
  expand(e, r) {
    const n = () => {
      if (r) {
        let a = this.parent;
        for (; a.level > 0; )
          a.expanded = !0, a = a.parent;
      }
      this.expanded = !0, e && e(), this.childNodes.forEach((a) => {
        a.canFocus = !0;
      });
    };
    this.shouldLoadData() ? this.loadData((a) => {
      Array.isArray(a) && (this.checked ? this.setChecked(!0, !0) : this.store.checkStrictly || so(this), n());
    }) : n();
  }
  doCreateChildren(e, r = {}) {
    e.forEach((n) => {
      this.insertChild(Object.assign({ data: n }, r), void 0, !0);
    });
  }
  collapse() {
    this.expanded = !1, this.childNodes.forEach((e) => {
      e.canFocus = !1;
    });
  }
  shouldLoadData() {
    return this.store.lazy === !0 && this.store.load && !this.loaded;
  }
  updateLeafState() {
    if (this.store.lazy === !0 && this.loaded !== !0 && typeof this.isLeafByUser < "u") {
      this.isLeaf = this.isLeafByUser;
      return;
    }
    const e = this.childNodes;
    if (!this.store.lazy || this.store.lazy === !0 && this.loaded === !0) {
      this.isLeaf = !e || e.length === 0;
      return;
    }
    this.isLeaf = !1;
  }
  setChecked(e, r, n, a) {
    if (this.indeterminate = e === "half", this.checked = e === !0, this.store.checkStrictly)
      return;
    if (!(this.shouldLoadData() && !this.store.checkDescendants)) {
      const { all: o, allWithoutDisable: s } = Sp(this.childNodes);
      !this.isLeaf && !o && s && (this.checked = !1, e = !1);
      const u = () => {
        if (r) {
          const l = this.childNodes;
          for (let f = 0, h = l.length; f < h; f++) {
            const v = l[f];
            a = a || e !== !1;
            const p = v.disabled ? v.checked : a;
            v.setChecked(p, r, !0, a);
          }
          const { half: c, all: d } = Sp(l);
          d || (this.checked = d, this.indeterminate = c);
        }
      };
      if (this.shouldLoadData()) {
        this.loadData(() => {
          u(), so(this);
        }, {
          checked: e !== !1
        });
        return;
      } else
        u();
    }
    const i = this.parent;
    !i || i.level === 0 || n || so(i);
  }
  getChildren(e = !1) {
    if (this.level === 0)
      return this.data;
    const r = this.data;
    if (!r)
      return null;
    const n = this.store.props;
    let a = "children";
    return n && (a = n.children || "children"), r[a] === void 0 && (r[a] = null), e && !r[a] && (r[a] = []), r[a];
  }
  updateChildren() {
    const e = this.getChildren() || [], r = this.childNodes.map((i) => i.data), n = {}, a = [];
    e.forEach((i, o) => {
      const s = i[fi];
      !!s && r.findIndex((l) => l[fi] === s) >= 0 ? n[s] = { index: o, data: i } : a.push({ index: o, data: i });
    }), this.store.lazy || r.forEach((i) => {
      n[i[fi]] || this.removeChildByData(i);
    }), a.forEach(({ index: i, data: o }) => {
      this.insertChild({ data: o }, i);
    }), this.updateLeafState();
  }
  loadData(e, r = {}) {
    if (this.store.lazy === !0 && this.store.load && !this.loaded && (!this.loading || Object.keys(r).length)) {
      this.loading = !0;
      const n = (i) => {
        this.childNodes = [], this.doCreateChildren(i, r), this.loaded = !0, this.loading = !1, this.updateLeafState(), e && e.call(this, i);
      }, a = () => {
        this.loading = !1;
      };
      this.store.load(this, n, a);
    } else
      e && e.call(this);
  }
  eachNode(e) {
    const r = [this];
    for (; r.length; ) {
      const n = r.shift();
      r.unshift(...n.childNodes), e(n);
    }
  }
  reInitChecked() {
    this.store.checkStrictly || so(this);
  }
}
class l5 {
  constructor(e) {
    this.currentNode = null, this.currentNodeKey = null;
    for (const r in e)
      Ta(e, r) && (this[r] = e[r]);
    this.nodesMap = {};
  }
  initialize() {
    if (this.root = new _a({
      data: this.data,
      store: this
    }), this.root.initialize(), this.lazy && this.load) {
      const e = this.load;
      e(this.root, (r) => {
        this.root.doCreateChildren(r), this._initDefaultCheckedNodes();
      });
    } else
      this._initDefaultCheckedNodes();
  }
  filter(e) {
    const r = this.filterNodeMethod, n = this.lazy, a = function(i) {
      const o = i.root ? i.root.childNodes : i.childNodes;
      if (o.forEach((s) => {
        s.visible = r.call(s, e, s.data, s), a(s);
      }), !i.visible && o.length) {
        let s = !0;
        s = !o.some((u) => u.visible), i.root ? i.root.visible = s === !1 : i.visible = s === !1;
      }
      e && i.visible && !i.isLeaf && (!n || i.loaded) && i.expand();
    };
    a(this);
  }
  setData(e) {
    e !== this.root.data ? (this.nodesMap = {}, this.root.setData(e), this._initDefaultCheckedNodes()) : this.root.updateChildren();
  }
  getNode(e) {
    if (e instanceof _a)
      return e;
    const r = Gt(e) ? xg(this.key, e) : e;
    return this.nodesMap[r] || null;
  }
  insertBefore(e, r) {
    const n = this.getNode(r);
    n.parent.insertBefore({ data: e }, n);
  }
  insertAfter(e, r) {
    const n = this.getNode(r);
    n.parent.insertAfter({ data: e }, n);
  }
  remove(e) {
    const r = this.getNode(e);
    r && r.parent && (r === this.currentNode && (this.currentNode = null), r.parent.removeChild(r));
  }
  append(e, r) {
    const n = al(r) ? this.root : this.getNode(r);
    n && n.insertChild({ data: e });
  }
  _initDefaultCheckedNodes() {
    const e = this.defaultCheckedKeys || [], r = this.nodesMap;
    e.forEach((n) => {
      const a = r[n];
      a && a.setChecked(!0, !this.checkStrictly);
    });
  }
  _initDefaultCheckedNode(e) {
    (this.defaultCheckedKeys || []).includes(e.key) && e.setChecked(!0, !this.checkStrictly);
  }
  setDefaultCheckedKey(e) {
    e !== this.defaultCheckedKeys && (this.defaultCheckedKeys = e, this._initDefaultCheckedNodes());
  }
  registerNode(e) {
    const r = this.key;
    !e || !e.data || (r ? e.key !== void 0 && (this.nodesMap[e.key] = e) : this.nodesMap[e.id] = e);
  }
  deregisterNode(e) {
    !this.key || !e || !e.data || (e.childNodes.forEach((n) => {
      this.deregisterNode(n);
    }), delete this.nodesMap[e.key]);
  }
  getCheckedNodes(e = !1, r = !1) {
    const n = [], a = function(i) {
      (i.root ? i.root.childNodes : i.childNodes).forEach((s) => {
        (s.checked || r && s.indeterminate) && (!e || e && s.isLeaf) && n.push(s.data), a(s);
      });
    };
    return a(this), n;
  }
  getCheckedKeys(e = !1) {
    return this.getCheckedNodes(e).map((r) => (r || {})[this.key]);
  }
  getHalfCheckedNodes() {
    const e = [], r = function(n) {
      (n.root ? n.root.childNodes : n.childNodes).forEach((i) => {
        i.indeterminate && e.push(i.data), r(i);
      });
    };
    return r(this), e;
  }
  getHalfCheckedKeys() {
    return this.getHalfCheckedNodes().map((e) => (e || {})[this.key]);
  }
  _getAllNodes() {
    const e = [], r = this.nodesMap;
    for (const n in r)
      Ta(r, n) && e.push(r[n]);
    return e;
  }
  updateChildren(e, r) {
    const n = this.nodesMap[e];
    if (!n)
      return;
    const a = n.childNodes;
    for (let i = a.length - 1; i >= 0; i--) {
      const o = a[i];
      this.remove(o.data);
    }
    for (let i = 0, o = r.length; i < o; i++) {
      const s = r[i];
      this.append(s, n.data);
    }
  }
  _setCheckedKeys(e, r = !1, n) {
    const a = this._getAllNodes().sort((u, l) => u.level - l.level), i = /* @__PURE__ */ Object.create(null), o = Object.keys(n);
    a.forEach((u) => u.setChecked(!1, !1));
    const s = (u) => {
      u.childNodes.forEach((l) => {
        var c;
        i[l.data[e]] = !0, (c = l.childNodes) != null && c.length && s(l);
      });
    };
    for (let u = 0, l = a.length; u < l; u++) {
      const c = a[u], d = c.data[e].toString();
      if (!o.includes(d)) {
        c.checked && !i[d] && c.setChecked(!1, !1);
        continue;
      }
      if (c.childNodes.length && s(c), c.isLeaf || this.checkStrictly) {
        c.setChecked(!0, !1);
        continue;
      }
      if (c.setChecked(!0, !0), r) {
        c.setChecked(!1, !1);
        const h = function(v) {
          v.childNodes.forEach((g) => {
            g.isLeaf || g.setChecked(!1, !1), h(g);
          });
        };
        h(c);
      }
    }
  }
  setCheckedNodes(e, r = !1) {
    const n = this.key, a = {};
    e.forEach((i) => {
      a[(i || {})[n]] = !0;
    }), this._setCheckedKeys(n, r, a);
  }
  setCheckedKeys(e, r = !1) {
    this.defaultCheckedKeys = e;
    const n = this.key, a = {};
    e.forEach((i) => {
      a[i] = !0;
    }), this._setCheckedKeys(n, r, a);
  }
  setDefaultExpandedKeys(e) {
    e = e || [], this.defaultExpandedKeys = e, e.forEach((r) => {
      const n = this.getNode(r);
      n && n.expand(null, this.autoExpandParent);
    });
  }
  setChecked(e, r, n) {
    const a = this.getNode(e);
    a && a.setChecked(!!r, n);
  }
  getCurrentNode() {
    return this.currentNode;
  }
  setCurrentNode(e) {
    const r = this.currentNode;
    r && (r.isCurrent = !1), this.currentNode = e, this.currentNode.isCurrent = !0;
  }
  setUserCurrentNode(e, r = !0) {
    const n = e[this.key], a = this.nodesMap[n];
    this.setCurrentNode(a), r && this.currentNode.level > 1 && this.currentNode.parent.expand(null, !0);
  }
  setCurrentNodeKey(e, r = !0) {
    if (e == null) {
      this.currentNode && (this.currentNode.isCurrent = !1), this.currentNode = null;
      return;
    }
    const n = this.getNode(e);
    n && (this.setCurrentNode(n), r && this.currentNode.level > 1 && this.currentNode.parent.expand(null, !0));
  }
}
const u5 = Se({
  name: "ElTreeNodeContent",
  props: {
    node: {
      type: Object,
      required: !0
    },
    renderContent: Function
  },
  setup(t) {
    const e = Ge("tree"), r = Ue("NodeInstance"), n = Ue("RootTree");
    return () => {
      const a = t.node, { data: i, store: o } = a;
      return t.renderContent ? t.renderContent(ba, { _self: r, node: a, data: i, store: o }) : Fe(n.ctx.slots, "default", { node: a, data: i }, () => [
        ba("span", { class: e.be("node", "label") }, [a.label])
      ]);
    };
  }
});
var c5 = /* @__PURE__ */ Ke(u5, [["__file", "tree-node-content.vue"]]);
function W2(t) {
  const e = Ue("TreeNodeMap", null), r = {
    treeNodeExpand: (n) => {
      t.node !== n && t.node.collapse();
    },
    children: []
  };
  return e && e.children.push(r), Et("TreeNodeMap", r), {
    broadcastExpanded: (n) => {
      if (t.accordion)
        for (const a of r.children)
          a.treeNodeExpand(n);
    }
  };
}
const j2 = Symbol("dragEvents");
function d5({ props: t, ctx: e, el$: r, dropIndicator$: n, store: a }) {
  const i = Ge("tree"), o = de({
    showDropIndicator: !1,
    draggingNode: null,
    dropNode: null,
    allowDrop: !0,
    dropType: null
  });
  return Et(j2, {
    treeNodeDragStart: ({ event: c, treeNode: d }) => {
      if (typeof t.allowDrag == "function" && !t.allowDrag(d.node))
        return c.preventDefault(), !1;
      c.dataTransfer.effectAllowed = "move";
      try {
        c.dataTransfer.setData("text/plain", "");
      } catch {
      }
      o.value.draggingNode = d, e.emit("node-drag-start", d.node, c);
    },
    treeNodeDragOver: ({ event: c, treeNode: d }) => {
      const f = d, h = o.value.dropNode;
      h && h.node.id !== f.node.id && Sa(h.$el, i.is("drop-inner"));
      const v = o.value.draggingNode;
      if (!v || !f)
        return;
      let p = !0, g = !0, y = !0, m = !0;
      typeof t.allowDrop == "function" && (p = t.allowDrop(v.node, f.node, "prev"), m = g = t.allowDrop(v.node, f.node, "inner"), y = t.allowDrop(v.node, f.node, "next")), c.dataTransfer.dropEffect = g || p || y ? "move" : "none", (p || g || y) && (h == null ? void 0 : h.node.id) !== f.node.id && (h && e.emit("node-drag-leave", v.node, h.node, c), e.emit("node-drag-enter", v.node, f.node, c)), p || g || y ? o.value.dropNode = f : o.value.dropNode = null, f.node.nextSibling === v.node && (y = !1), f.node.previousSibling === v.node && (p = !1), f.node.contains(v.node, !1) && (g = !1), (v.node === f.node || v.node.contains(f.node)) && (p = !1, g = !1, y = !1);
      const b = f.$el.querySelector(`.${i.be("node", "content")}`).getBoundingClientRect(), w = r.value.getBoundingClientRect();
      let x;
      const E = p ? g ? 0.25 : y ? 0.45 : 1 : -1, C = y ? g ? 0.75 : p ? 0.55 : 0 : 1;
      let k = -9999;
      const S = c.clientY - b.top;
      S < b.height * E ? x = "before" : S > b.height * C ? x = "after" : g ? x = "inner" : x = "none";
      const _ = f.$el.querySelector(`.${i.be("node", "expand-icon")}`).getBoundingClientRect(), T = n.value;
      x === "before" ? k = _.top - w.top : x === "after" && (k = _.bottom - w.top), T.style.top = `${k}px`, T.style.left = `${_.right - w.left}px`, x === "inner" ? gp(f.$el, i.is("drop-inner")) : Sa(f.$el, i.is("drop-inner")), o.value.showDropIndicator = x === "before" || x === "after", o.value.allowDrop = o.value.showDropIndicator || m, o.value.dropType = x, e.emit("node-drag-over", v.node, f.node, c);
    },
    treeNodeDragEnd: (c) => {
      const { draggingNode: d, dropType: f, dropNode: h } = o.value;
      if (c.preventDefault(), c.dataTransfer && (c.dataTransfer.dropEffect = "move"), d && h) {
        const v = { data: d.node.data };
        f !== "none" && d.node.remove(), f === "before" ? h.node.parent.insertBefore(v, h.node) : f === "after" ? h.node.parent.insertAfter(v, h.node) : f === "inner" && h.node.insertChild(v), f !== "none" && (a.value.registerNode(v), a.value.key && d.node.eachNode((p) => {
          var g;
          (g = a.value.nodesMap[p.data[a.value.key]]) == null || g.setChecked(p.checked, !a.value.checkStrictly);
        })), Sa(h.$el, i.is("drop-inner")), e.emit("node-drag-end", d.node, h.node, f, c), f !== "none" && e.emit("node-drop", d.node, h.node, f, c);
      }
      d && !h && e.emit("node-drag-end", d.node, null, f, c), o.value.showDropIndicator = !1, o.value.draggingNode = null, o.value.dropNode = null, o.value.allowDrop = !0;
    }
  }), {
    dragState: o
  };
}
const f5 = Se({
  name: "ElTreeNode",
  components: {
    ElCollapseTransition: KM,
    ElCheckbox: kM,
    NodeContent: c5,
    ElIcon: Ft,
    Loading: Kp
  },
  props: {
    node: {
      type: _a,
      default: () => ({})
    },
    props: {
      type: Object,
      default: () => ({})
    },
    accordion: Boolean,
    renderContent: Function,
    renderAfterExpand: Boolean,
    showCheckbox: {
      type: Boolean,
      default: !1
    }
  },
  emits: ["node-expand"],
  setup(t, e) {
    const r = Ge("tree"), { broadcastExpanded: n } = W2(t), a = Ue("RootTree"), i = de(!1), o = de(!1), s = de(null), u = de(null), l = de(null), c = Ue(j2), d = mt();
    Et("NodeInstance", d), a || Ot("Tree", "Can not find node's tree."), t.node.expanded && (i.value = !0, o.value = !0);
    const f = a.props.props.children || "children";
    Re(() => {
      const S = t.node.data[f];
      return S && [...S];
    }, () => {
      t.node.updateChildren();
    }), Re(() => t.node.indeterminate, (S) => {
      p(t.node.checked, S);
    }), Re(() => t.node.checked, (S) => {
      p(S, t.node.indeterminate);
    }), Re(() => t.node.childNodes.length, () => t.node.reInitChecked()), Re(() => t.node.expanded, (S) => {
      ot(() => i.value = S), S && (o.value = !0);
    });
    const h = (S) => xg(a.props.nodeKey, S.data), v = (S) => {
      const _ = t.props.class;
      if (!_)
        return {};
      let T;
      if (cr(_)) {
        const { data: O } = S;
        T = _(O, S);
      } else
        T = _;
      return nr(T) ? { [T]: !0 } : T;
    }, p = (S, _) => {
      (s.value !== S || u.value !== _) && a.ctx.emit("check-change", t.node.data, S, _), s.value = S, u.value = _;
    }, g = (S) => {
      Ep(a.store, a.ctx.emit, () => a.store.value.setCurrentNode(t.node)), a.currentNode.value = t.node, a.props.expandOnClickNode && m(), a.props.checkOnClickNode && !t.node.disabled && b(null, {
        target: { checked: !t.node.checked }
      }), a.ctx.emit("node-click", t.node.data, t.node, d, S);
    }, y = (S) => {
      a.instance.vnode.props.onNodeContextmenu && (S.stopPropagation(), S.preventDefault()), a.ctx.emit("node-contextmenu", S, t.node.data, t.node, d);
    }, m = () => {
      t.node.isLeaf || (i.value ? (a.ctx.emit("node-collapse", t.node.data, t.node, d), t.node.collapse()) : t.node.expand(() => {
        e.emit("node-expand", t.node.data, t.node, d);
      }));
    }, b = (S, _) => {
      t.node.setChecked(_.target.checked, !a.props.checkStrictly), ot(() => {
        const T = a.store.value;
        a.ctx.emit("check", t.node.data, {
          checkedNodes: T.getCheckedNodes(),
          checkedKeys: T.getCheckedKeys(),
          halfCheckedNodes: T.getHalfCheckedNodes(),
          halfCheckedKeys: T.getHalfCheckedKeys()
        });
      });
    };
    return {
      ns: r,
      node$: l,
      tree: a,
      expanded: i,
      childNodeRendered: o,
      oldChecked: s,
      oldIndeterminate: u,
      getNodeKey: h,
      getNodeClass: v,
      handleSelectChange: p,
      handleClick: g,
      handleContextMenu: y,
      handleExpandIconClick: m,
      handleCheckChange: b,
      handleChildNodeExpand: (S, _, T) => {
        n(_), a.ctx.emit("node-expand", S, _, T);
      },
      handleDragStart: (S) => {
        a.props.draggable && c.treeNodeDragStart({ event: S, treeNode: t });
      },
      handleDragOver: (S) => {
        S.preventDefault(), a.props.draggable && c.treeNodeDragOver({
          event: S,
          treeNode: { $el: l.value, node: t.node }
        });
      },
      handleDrop: (S) => {
        S.preventDefault();
      },
      handleDragEnd: (S) => {
        a.props.draggable && c.treeNodeDragEnd(S);
      },
      CaretRight: AT
    };
  }
});
function v5(t, e, r, n, a, i) {
  const o = tr("el-icon"), s = tr("el-checkbox"), u = tr("loading"), l = tr("node-content"), c = tr("el-tree-node"), d = tr("el-collapse-transition");
  return Ye((q(), ie("div", {
    ref: "node$",
    class: le([
      t.ns.b("node"),
      t.ns.is("expanded", t.expanded),
      t.ns.is("current", t.node.isCurrent),
      t.ns.is("hidden", !t.node.visible),
      t.ns.is("focusable", !t.node.disabled),
      t.ns.is("checked", !t.node.disabled && t.node.checked),
      t.getNodeClass(t.node)
    ]),
    role: "treeitem",
    tabindex: "-1",
    "aria-expanded": t.expanded,
    "aria-disabled": t.node.disabled,
    "aria-checked": t.node.checked,
    draggable: t.tree.props.draggable,
    "data-key": t.getNodeKey(t.node),
    onClick: pt(t.handleClick, ["stop"]),
    onContextmenu: t.handleContextMenu,
    onDragstart: pt(t.handleDragStart, ["stop"]),
    onDragover: pt(t.handleDragOver, ["stop"]),
    onDragend: pt(t.handleDragEnd, ["stop"]),
    onDrop: pt(t.handleDrop, ["stop"])
  }, [
    ae("div", {
      class: le(t.ns.be("node", "content")),
      style: st({ paddingLeft: (t.node.level - 1) * t.tree.props.indent + "px" })
    }, [
      t.tree.props.icon || t.CaretRight ? (q(), me(o, {
        key: 0,
        class: le([
          t.ns.be("node", "expand-icon"),
          t.ns.is("leaf", t.node.isLeaf),
          {
            expanded: !t.node.isLeaf && t.expanded
          }
        ]),
        onClick: pt(t.handleExpandIconClick, ["stop"])
      }, {
        default: U(() => [
          (q(), me(rr(t.tree.props.icon || t.CaretRight)))
        ]),
        _: 1
      }, 8, ["class", "onClick"])) : pe("v-if", !0),
      t.showCheckbox ? (q(), me(s, {
        key: 1,
        "model-value": t.node.checked,
        indeterminate: t.node.indeterminate,
        disabled: !!t.node.disabled,
        onClick: pt(() => {
        }, ["stop"]),
        onChange: t.handleCheckChange
      }, null, 8, ["model-value", "indeterminate", "disabled", "onClick", "onChange"])) : pe("v-if", !0),
      t.node.loading ? (q(), me(o, {
        key: 2,
        class: le([t.ns.be("node", "loading-icon"), t.ns.is("loading")])
      }, {
        default: U(() => [
          J(u)
        ]),
        _: 1
      }, 8, ["class"])) : pe("v-if", !0),
      J(l, {
        node: t.node,
        "render-content": t.renderContent
      }, null, 8, ["node", "render-content"])
    ], 6),
    J(d, null, {
      default: U(() => [
        !t.renderAfterExpand || t.childNodeRendered ? Ye((q(), ie("div", {
          key: 0,
          class: le(t.ns.be("node", "children")),
          role: "group",
          "aria-expanded": t.expanded
        }, [
          (q(!0), ie(je, null, Lt(t.node.childNodes, (f) => (q(), me(c, {
            key: t.getNodeKey(f),
            "render-content": t.renderContent,
            "render-after-expand": t.renderAfterExpand,
            "show-checkbox": t.showCheckbox,
            node: f,
            accordion: t.accordion,
            props: t.props,
            onNodeExpand: t.handleChildNodeExpand
          }, null, 8, ["render-content", "render-after-expand", "show-checkbox", "node", "accordion", "props", "onNodeExpand"]))), 128))
        ], 10, ["aria-expanded"])), [
          [dt, t.expanded]
        ]) : pe("v-if", !0)
      ]),
      _: 1
    })
  ], 42, ["aria-expanded", "aria-disabled", "aria-checked", "draggable", "data-key", "onClick", "onContextmenu", "onDragstart", "onDragover", "onDragend", "onDrop"])), [
    [dt, t.node.visible]
  ]);
}
var h5 = /* @__PURE__ */ Ke(f5, [["render", v5], ["__file", "tree-node.vue"]]);
function p5({ el$: t }, e) {
  const r = Ge("tree"), n = xn([]), a = xn([]);
  St(() => {
    o();
  }), EE(() => {
    n.value = Array.from(t.value.querySelectorAll("[role=treeitem]")), a.value = Array.from(t.value.querySelectorAll("input[type=checkbox]"));
  }), Re(a, (s) => {
    s.forEach((u) => {
      u.setAttribute("tabindex", "-1");
    });
  }), Ar(t, "keydown", (s) => {
    const u = s.target;
    if (!u.className.includes(r.b("node")))
      return;
    const l = s.code;
    n.value = Array.from(t.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`));
    const c = n.value.indexOf(u);
    let d;
    if ([Rt.up, Rt.down].includes(l)) {
      if (s.preventDefault(), l === Rt.up) {
        d = c === -1 ? 0 : c !== 0 ? c - 1 : n.value.length - 1;
        const h = d;
        for (; !e.value.getNode(n.value[d].dataset.key).canFocus; ) {
          if (d--, d === h) {
            d = -1;
            break;
          }
          d < 0 && (d = n.value.length - 1);
        }
      } else {
        d = c === -1 ? 0 : c < n.value.length - 1 ? c + 1 : 0;
        const h = d;
        for (; !e.value.getNode(n.value[d].dataset.key).canFocus; ) {
          if (d++, d === h) {
            d = -1;
            break;
          }
          d >= n.value.length && (d = 0);
        }
      }
      d !== -1 && n.value[d].focus();
    }
    [Rt.left, Rt.right].includes(l) && (s.preventDefault(), u.click());
    const f = u.querySelector('[type="checkbox"]');
    [Rt.enter, Rt.space].includes(l) && f && (s.preventDefault(), f.click());
  });
  const o = () => {
    var s;
    n.value = Array.from(t.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)), a.value = Array.from(t.value.querySelectorAll("input[type=checkbox]"));
    const u = t.value.querySelectorAll(`.${r.is("checked")}[role=treeitem]`);
    if (u.length) {
      u[0].setAttribute("tabindex", "0");
      return;
    }
    (s = n.value[0]) == null || s.setAttribute("tabindex", "0");
  };
}
const g5 = Se({
  name: "ElTree",
  components: { ElTreeNode: h5 },
  props: {
    data: {
      type: Array,
      default: () => []
    },
    emptyText: {
      type: String
    },
    renderAfterExpand: {
      type: Boolean,
      default: !0
    },
    nodeKey: String,
    checkStrictly: Boolean,
    defaultExpandAll: Boolean,
    expandOnClickNode: {
      type: Boolean,
      default: !0
    },
    checkOnClickNode: Boolean,
    checkDescendants: {
      type: Boolean,
      default: !1
    },
    autoExpandParent: {
      type: Boolean,
      default: !0
    },
    defaultCheckedKeys: Array,
    defaultExpandedKeys: Array,
    currentNodeKey: [String, Number],
    renderContent: Function,
    showCheckbox: {
      type: Boolean,
      default: !1
    },
    draggable: {
      type: Boolean,
      default: !1
    },
    allowDrag: Function,
    allowDrop: Function,
    props: {
      type: Object,
      default: () => ({
        children: "children",
        label: "label",
        disabled: "disabled"
      })
    },
    lazy: {
      type: Boolean,
      default: !1
    },
    highlightCurrent: Boolean,
    load: Function,
    filterNodeMethod: Function,
    accordion: Boolean,
    indent: {
      type: Number,
      default: 18
    },
    icon: {
      type: Qn
    }
  },
  emits: [
    "check-change",
    "current-change",
    "node-click",
    "node-contextmenu",
    "node-collapse",
    "node-expand",
    "check",
    "node-drag-start",
    "node-drag-end",
    "node-drop",
    "node-drag-leave",
    "node-drag-enter",
    "node-drag-over"
  ],
  setup(t, e) {
    const { t: r } = Uo(), n = Ge("tree"), a = Ue(es, null), i = de(new l5({
      key: t.nodeKey,
      data: t.data,
      lazy: t.lazy,
      props: t.props,
      load: t.load,
      currentNodeKey: t.currentNodeKey,
      checkStrictly: t.checkStrictly,
      checkDescendants: t.checkDescendants,
      defaultCheckedKeys: t.defaultCheckedKeys,
      defaultExpandedKeys: t.defaultExpandedKeys,
      autoExpandParent: t.autoExpandParent,
      defaultExpandAll: t.defaultExpandAll,
      filterNodeMethod: t.filterNodeMethod
    }));
    i.value.initialize();
    const o = de(i.value.root), s = de(null), u = de(null), l = de(null), { broadcastExpanded: c } = W2(t), { dragState: d } = d5({
      props: t,
      ctx: e,
      el$: u,
      dropIndicator$: l,
      store: i
    });
    p5({ el$: u }, i);
    const f = j(() => {
      const { childNodes: L } = o.value, V = a ? a.hasFilteredOptions !== 0 : !1;
      return (!L || L.length === 0 || L.every(({ visible: Y }) => !Y)) && !V;
    });
    Re(() => t.currentNodeKey, (L) => {
      i.value.setCurrentNodeKey(L);
    }), Re(() => t.defaultCheckedKeys, (L) => {
      i.value.setDefaultCheckedKey(L);
    }), Re(() => t.defaultExpandedKeys, (L) => {
      i.value.setDefaultExpandedKeys(L);
    }), Re(() => t.data, (L) => {
      i.value.setData(L);
    }, { deep: !0 }), Re(() => t.checkStrictly, (L) => {
      i.value.checkStrictly = L;
    });
    const h = (L) => {
      if (!t.filterNodeMethod)
        throw new Error("[Tree] filterNodeMethod is required when filter");
      i.value.filter(L);
    }, v = (L) => xg(t.nodeKey, L.data), p = (L) => {
      if (!t.nodeKey)
        throw new Error("[Tree] nodeKey is required in getNodePath");
      const V = i.value.getNode(L);
      if (!V)
        return [];
      const Y = [V.data];
      let H = V.parent;
      for (; H && H !== o.value; )
        Y.push(H.data), H = H.parent;
      return Y.reverse();
    }, g = (L, V) => i.value.getCheckedNodes(L, V), y = (L) => i.value.getCheckedKeys(L), m = () => {
      const L = i.value.getCurrentNode();
      return L ? L.data : null;
    }, b = () => {
      if (!t.nodeKey)
        throw new Error("[Tree] nodeKey is required in getCurrentKey");
      const L = m();
      return L ? L[t.nodeKey] : null;
    }, w = (L, V) => {
      if (!t.nodeKey)
        throw new Error("[Tree] nodeKey is required in setCheckedNodes");
      i.value.setCheckedNodes(L, V);
    }, x = (L, V) => {
      if (!t.nodeKey)
        throw new Error("[Tree] nodeKey is required in setCheckedKeys");
      i.value.setCheckedKeys(L, V);
    }, E = (L, V, Y) => {
      i.value.setChecked(L, V, Y);
    }, C = () => i.value.getHalfCheckedNodes(), k = () => i.value.getHalfCheckedKeys(), S = (L, V = !0) => {
      if (!t.nodeKey)
        throw new Error("[Tree] nodeKey is required in setCurrentNode");
      Ep(i, e.emit, () => {
        c(L), i.value.setUserCurrentNode(L, V);
      });
    }, _ = (L, V = !0) => {
      if (!t.nodeKey)
        throw new Error("[Tree] nodeKey is required in setCurrentKey");
      Ep(i, e.emit, () => {
        c(), i.value.setCurrentNodeKey(L, V);
      });
    }, T = (L) => i.value.getNode(L), O = (L) => {
      i.value.remove(L);
    }, D = (L, V) => {
      i.value.append(L, V);
    }, A = (L, V) => {
      i.value.insertBefore(L, V);
    }, F = (L, V) => {
      i.value.insertAfter(L, V);
    }, R = (L, V, Y) => {
      c(V), e.emit("node-expand", L, V, Y);
    }, M = (L, V) => {
      if (!t.nodeKey)
        throw new Error("[Tree] nodeKey is required in updateKeyChild");
      i.value.updateChildren(L, V);
    };
    return Et("RootTree", {
      ctx: e,
      props: t,
      store: i,
      root: o,
      currentNode: s,
      instance: mt()
    }), Et(Io, void 0), {
      ns: n,
      store: i,
      root: o,
      currentNode: s,
      dragState: d,
      el$: u,
      dropIndicator$: l,
      isEmpty: f,
      filter: h,
      getNodeKey: v,
      getNodePath: p,
      getCheckedNodes: g,
      getCheckedKeys: y,
      getCurrentNode: m,
      getCurrentKey: b,
      setCheckedNodes: w,
      setCheckedKeys: x,
      setChecked: E,
      getHalfCheckedNodes: C,
      getHalfCheckedKeys: k,
      setCurrentNode: S,
      setCurrentKey: _,
      t: r,
      getNode: T,
      remove: O,
      append: D,
      insertBefore: A,
      insertAfter: F,
      handleNodeExpand: R,
      updateKeyChildren: M
    };
  }
});
function y5(t, e, r, n, a, i) {
  const o = tr("el-tree-node");
  return q(), ie("div", {
    ref: "el$",
    class: le([
      t.ns.b(),
      t.ns.is("dragging", !!t.dragState.draggingNode),
      t.ns.is("drop-not-allow", !t.dragState.allowDrop),
      t.ns.is("drop-inner", t.dragState.dropType === "inner"),
      { [t.ns.m("highlight-current")]: t.highlightCurrent }
    ]),
    role: "tree"
  }, [
    (q(!0), ie(je, null, Lt(t.root.childNodes, (s) => (q(), me(o, {
      key: t.getNodeKey(s),
      node: s,
      props: t.props,
      accordion: t.accordion,
      "render-after-expand": t.renderAfterExpand,
      "show-checkbox": t.showCheckbox,
      "render-content": t.renderContent,
      onNodeExpand: t.handleNodeExpand
    }, null, 8, ["node", "props", "accordion", "render-after-expand", "show-checkbox", "render-content", "onNodeExpand"]))), 128)),
    t.isEmpty ? (q(), ie("div", {
      key: 0,
      class: le(t.ns.e("empty-block"))
    }, [
      Fe(t.$slots, "empty", {}, () => {
        var s;
        return [
          ae("span", {
            class: le(t.ns.e("empty-text"))
          }, ke((s = t.emptyText) != null ? s : t.t("el.tree.emptyText")), 3)
        ];
      })
    ], 2)) : pe("v-if", !0),
    Ye(ae("div", {
      ref: "dropIndicator$",
      class: le(t.ns.e("drop-indicator"))
    }, null, 2), [
      [dt, t.dragState.showDropIndicator]
    ])
  ], 2);
}
var m5 = /* @__PURE__ */ Ke(g5, [["render", y5], ["__file", "tree.vue"]]);
const b5 = Vt(m5);
function w5(t) {
  let e;
  const r = de(!1), n = on({
    ...t,
    originalPosition: "",
    originalOverflow: "",
    visible: !1
  });
  function a(f) {
    n.text = f;
  }
  function i() {
    const f = n.parent, h = d.ns;
    if (!f.vLoadingAddClassList) {
      let v = f.getAttribute("loading-number");
      v = Number.parseInt(v) - 1, v ? f.setAttribute("loading-number", v.toString()) : (Sa(f, h.bm("parent", "relative")), f.removeAttribute("loading-number")), Sa(f, h.bm("parent", "hidden"));
    }
    o(), c.unmount();
  }
  function o() {
    var f, h;
    (h = (f = d.$el) == null ? void 0 : f.parentNode) == null || h.removeChild(d.$el);
  }
  function s() {
    var f;
    t.beforeClose && !t.beforeClose() || (r.value = !0, clearTimeout(e), e = setTimeout(u, 400), n.visible = !1, (f = t.closed) == null || f.call(t));
  }
  function u() {
    if (!r.value)
      return;
    const f = n.parent;
    r.value = !1, f.vLoadingAddClassList = void 0, i();
  }
  const l = Se({
    name: "ElLoading",
    setup(f, { expose: h }) {
      const { ns: v, zIndex: p } = nL("loading");
      return h({
        ns: v,
        zIndex: p
      }), () => {
        const g = n.spinner || n.svg, y = ba("svg", {
          class: "circular",
          viewBox: n.svgViewBox ? n.svgViewBox : "0 0 50 50",
          ...g ? { innerHTML: g } : {}
        }, [
          ba("circle", {
            class: "path",
            cx: "25",
            cy: "25",
            r: "20",
            fill: "none"
          })
        ]), m = n.text ? ba("p", { class: v.b("text") }, [n.text]) : void 0;
        return ba(Ai, {
          name: v.b("fade"),
          onAfterLeave: u
        }, {
          default: U(() => [
            Ye(J("div", {
              style: {
                backgroundColor: n.background || ""
              },
              class: [
                v.b("mask"),
                n.customClass,
                n.fullscreen ? "is-fullscreen" : ""
              ]
            }, [
              ba("div", {
                class: v.b("spinner")
              }, [y, m])
            ]), [[dt, n.visible]])
          ])
        });
      };
    }
  }), c = rI(l), d = c.mount(document.createElement("div"));
  return {
    ...Ko(n),
    setText: a,
    removeElLoadingChild: o,
    close: s,
    handleAfterLeave: u,
    vm: d,
    get $el() {
      return d.$el;
    }
  };
}
let Ss;
const C5 = function(t = {}) {
  if (!It)
    return;
  const e = x5(t);
  if (e.fullscreen && Ss)
    return Ss;
  const r = w5({
    ...e,
    closed: () => {
      var a;
      (a = e.closed) == null || a.call(e), e.fullscreen && (Ss = void 0);
    }
  });
  E5(e, e.parent, r), Bm(e, e.parent, r), e.parent.vLoadingAddClassList = () => Bm(e, e.parent, r);
  let n = e.parent.getAttribute("loading-number");
  return n ? n = `${Number.parseInt(n) + 1}` : n = "1", e.parent.setAttribute("loading-number", n), e.parent.appendChild(r.$el), ot(() => r.visible.value = e.visible), e.fullscreen && (Ss = r), r;
}, x5 = (t) => {
  var e, r, n, a;
  let i;
  return nr(t.target) ? i = (e = document.querySelector(t.target)) != null ? e : document.body : i = t.target || document.body, {
    parent: i === document.body || t.body ? document.body : i,
    background: t.background || "",
    svg: t.svg || "",
    svgViewBox: t.svgViewBox || "",
    spinner: t.spinner || !1,
    text: t.text || "",
    fullscreen: i === document.body && ((r = t.fullscreen) != null ? r : !0),
    lock: (n = t.lock) != null ? n : !1,
    customClass: t.customClass || "",
    visible: (a = t.visible) != null ? a : !0,
    beforeClose: t.beforeClose,
    closed: t.closed,
    target: i
  };
}, E5 = async (t, e, r) => {
  const { nextZIndex: n } = r.vm.zIndex || r.vm._.exposed.zIndex, a = {};
  if (t.fullscreen)
    r.originalPosition.value = Ji(document.body, "position"), r.originalOverflow.value = Ji(document.body, "overflow"), a.zIndex = n();
  else if (t.parent === document.body) {
    r.originalPosition.value = Ji(document.body, "position"), await ot();
    for (const i of ["top", "left"]) {
      const o = i === "top" ? "scrollTop" : "scrollLeft";
      a[i] = `${t.target.getBoundingClientRect()[i] + document.body[o] + document.documentElement[o] - Number.parseInt(Ji(document.body, `margin-${i}`), 10)}px`;
    }
    for (const i of ["height", "width"])
      a[i] = `${t.target.getBoundingClientRect()[i]}px`;
  } else
    r.originalPosition.value = Ji(e, "position");
  for (const [i, o] of Object.entries(a))
    r.$el.style[i] = o;
}, Bm = (t, e, r) => {
  const n = r.vm.ns || r.vm._.exposed.ns;
  ["absolute", "fixed", "sticky"].includes(r.originalPosition.value) ? Sa(e, n.bm("parent", "relative")) : gp(e, n.bm("parent", "relative")), t.fullscreen && t.lock ? gp(e, n.bm("parent", "hidden")) : Sa(e, n.bm("parent", "hidden"));
}, zs = Symbol("ElLoading"), $m = (t, e) => {
  var r, n, a, i;
  const o = e.instance, s = (f) => Gt(e.value) ? e.value[f] : void 0, u = (f) => {
    const h = nr(f) && (o == null ? void 0 : o[f]) || f;
    return h && de(h);
  }, l = (f) => u(s(f) || t.getAttribute(`element-loading-${TI(f)}`)), c = (r = s("fullscreen")) != null ? r : e.modifiers.fullscreen, d = {
    text: l("text"),
    svg: l("svg"),
    svgViewBox: l("svgViewBox"),
    spinner: l("spinner"),
    background: l("background"),
    customClass: l("customClass"),
    fullscreen: c,
    target: (n = s("target")) != null ? n : c ? void 0 : t,
    body: (a = s("body")) != null ? a : e.modifiers.body,
    lock: (i = s("lock")) != null ? i : e.modifiers.lock
  };
  t[zs] = {
    options: d,
    instance: C5(d)
  };
}, S5 = (t, e) => {
  for (const r of Object.keys(e))
    yi(e[r]) && (e[r].value = t[r]);
}, Eg = {
  mounted(t, e) {
    e.value && $m(t, e);
  },
  updated(t, e) {
    const r = t[zs];
    e.oldValue !== e.value && (e.value && !e.oldValue ? $m(t, e) : e.value && e.oldValue ? Gt(e.value) && S5(e.value, r.options) : r == null || r.instance.close());
  },
  unmounted(t) {
    var e;
    (e = t[zs]) == null || e.instance.close(), t[zs] = null;
  }
}, Er = (t, e) => {
  const r = t.__vccOpts || t;
  for (const [n, a] of e)
    r[n] = a;
  return r;
}, k5 = "Copy to clipboard", _5 = "Copied!", T5 = {
  name: "CopyToClipboard",
  props: {
    content: {
      type: String,
      default: ""
    },
    label: {
      type: String,
      default: k5
    },
    /**
     * `theme: light` will show white button,
     * to use when the button is over other readable text content.
     * Default button is transparent.
     */
    theme: {
      type: String,
      default: ""
    }
  },
  data: function() {
    return {
      textLabel: this.label,
      autoHideTimeout: 0,
      tooltipContainer: null
    };
  },
  mounted() {
    const t = document.querySelector(".mapcontent");
    t ? this.tooltipContainer = t : this.tooltipContainer = document.body;
  },
  methods: {
    copyToClipboard: async function() {
      let t = !0;
      this.autoHideTimeout = 600;
      try {
        const e = this.content.replaceAll(`
`, ""), r = document.createElement("div");
        r.innerHTML = this.content;
        const n = r.textContent || r.innerText || "", a = new Blob([e], { type: "text/html" }), i = new Blob([n], { type: "text/plain" }), o = new ClipboardItem({
          "text/html": a,
          "text/plain": i
        });
        await navigator.clipboard.write([o]);
      } catch (e) {
        console.error(
          "Error when trying to use navigator.clipboard.write()",
          e
        ), t = !1;
      }
      t ? (this.textLabel = _5, this.$emit("copied", { status: "success" })) : (this.textLabel = "Error trying to copy to clipboard!", this.$emit("copied", { status: "error" }));
    },
    resetSettings: function() {
      this.autoHideTimeout = 0, this.textLabel = this.label;
    }
  }
}, I5 = { class: "visually-hidden" };
function O5(t, e, r, n, a, i) {
  const o = PT, s = Ft, u = mr, l = Jo;
  return q(), me(l, {
    content: t.textLabel,
    placement: "bottom",
    "hide-after": t.autoHideTimeout,
    effect: "clipboard-tooltip",
    onHide: i.resetSettings,
    teleported: !0,
    "append-to": t.tooltipContainer
  }, {
    default: U(() => [
      J(u, {
        class: le(["copy-clipboard-button", r.theme]),
        size: "small",
        onClick: i.copyToClipboard,
        disabled: !r.content
      }, {
        default: U(() => [
          J(s, {
            color: r.content ? "#8300bf" : "#dab3ec"
          }, {
            default: U(() => [
              J(o)
            ]),
            _: 1
          }, 8, ["color"]),
          ae("span", I5, ke(t.textLabel), 1)
        ]),
        _: 1
      }, 8, ["class", "onClick", "disabled"])
    ]),
    _: 1
  }, 8, ["content", "hide-after", "onHide", "append-to"]);
}
const Sg = /* @__PURE__ */ Er(T5, [["render", O5], ["__scopeId", "data-v-c791b9aa"]]), A5 = {
  name: "AnnotationPopup",
  props: {
    annotationEntry: {
      type: Array
    }
  },
  inject: ["$annotator", "userApiKey"],
  data: function() {
    return {
      displayPair: {
        "Feature ID": "featureId",
        Label: "label",
        Ontology: "models",
        Name: "name",
        Resource: "resourceId"
      },
      editing: !1,
      evidencePrefixes: [
        { value: "DOI:", label: "DOI:" },
        { value: "PMID:", label: "PMID:" },
        { value: "", label: "Other:" }
      ],
      evidencePrefix: "DOI:",
      evidence: [],
      authenticated: !1,
      newEvidence: "",
      comment: "",
      prevSubs: [],
      showSubmissions: !0,
      errorMessage: "",
      creator: void 0,
      copyContent: "",
      entryIndex: 0
    };
  },
  computed: {
    entry: function() {
      return this.annotationEntry[this.entryIndex];
    },
    previousLabel: function() {
      var t;
      return this.entryIndex === 0 ? "This is the first item. Click 'Next' to see more information." : (t = this.annotationEntry[this.entryIndex - 1]) == null ? void 0 : t.label;
    },
    nextLabel: function() {
      var t;
      return this.entryIndex === this.annotationEntry.length - 1 ? "This is the last item. Click 'Previous' to see more information." : (t = this.annotationEntry[this.entryIndex + 1]) == null ? void 0 : t.label;
    },
    isEditable: function() {
      return this.entry.resourceId && this.entry.featureId;
    },
    isPositionUpdated: function() {
      return this.entry.resourceId && this.entry.type === "updated" && this.entry.positionUpdated;
    },
    isDeleted: function() {
      return this.entry.resourceId && this.entry.type === "deleted";
    },
    ontologyLink: function() {
      const t = this.entry.models;
      if (t && t.startsWith("UBERON"))
        return `http://purl.obolibrary.org/obo/${this.entry.models.replace(":", "_")}`;
    },
    updatedCopyContent: function() {
      return this.getUpdateCopyContent();
    },
    offlineAnnotationEnabled: function() {
      return this.entry ? this.entry.offline : !1;
    }
  },
  methods: {
    previous: function() {
      if (this.entryIndex !== 0) {
        this.entryIndex = this.entryIndex - 1, this.emitActiveItemChange();
        const t = this.annotationEntry[this.entryIndex], e = {
          event_name: "portal_maps_annotation_previous",
          category: String((t == null ? void 0 : t.featureId) || "")
        };
        this.trackEvent(e);
      }
    },
    next: function() {
      if (this.entryIndex !== this.annotationEntry.length - 1) {
        this.entryIndex = this.entryIndex + 1, this.emitActiveItemChange();
        const t = this.annotationEntry[this.entryIndex], e = {
          event_name: "portal_maps_annotation_next",
          category: String((t == null ? void 0 : t.featureId) || "")
        };
        this.trackEvent(e);
      }
    },
    emitActiveItemChange: function() {
      const t = { tabType: "annotation" }, e = this.annotationEntry[this.entryIndex], r = { ...t, ...e };
      this.$emit("hover-changed", r);
    },
    processEvidences: function(t) {
      var r;
      const e = [];
      return (r = t == null ? void 0 : t.body) != null && r.evidence && t.body.evidence.forEach((n) => {
        if (typeof n == "object")
          e.push(n);
        else {
          const a = {};
          if (n.includes("https://doi.org/")) {
            const i = n.replace("https://doi.org/", "DOI:");
            a[i] = n;
          } else if (n.includes("https://pubmed.ncbi.nlm.nih.gov/")) {
            const i = n.replace("https://pubmed.ncbi.nlm.nih.gov/", "PMID:");
            a[i] = n;
          }
          Object.keys(a).length > 0 ? e.push(a) : e.push(n);
        }
      }), e;
    },
    evidenceEntered: function(t) {
      t && (this.evidence.push(this.evidencePrefix + t), this.newEvidence = "");
    },
    formatTime: function(t) {
      const e = {
        year: "numeric",
        month: "long",
        day: "numeric",
        hour: "numeric",
        minute: "numeric",
        second: "numeric"
      };
      return new Date(t).toLocaleDateString(void 0, e);
    },
    updatePrevSubmissions: function() {
      var t;
      if (this.offlineAnnotationEnabled) {
        const e = JSON.parse(sessionStorage.getItem("anonymous-annotation")) || [];
        this.prevSubs = e.filter((r) => r.resource === this.entry.resourceId && r.item.id === this.entry.featureId);
      } else this.$annotator && this.authenticated && this.entry.resourceId && this.entry.featureId && ((t = this.$annotator) == null || t.itemAnnotations(
        this.userApiKey,
        this.entry.resourceId,
        this.entry.featureId
      ).then((e) => {
        this.prevSubs = e;
      }).catch((e) => {
        console.log(e);
      }));
    },
    submit: function() {
      var t;
      if (this.entry.type === "updated" && this.entry.positionUpdated ? this.comment = this.comment ? `Position Updated: ${this.comment}` : "Position Updated" : this.entry.type === "deleted" && (this.comment = this.comment ? `Feature Deleted: ${this.comment}` : "Feature Deleted"), (this.evidence.length > 0 || this.comment) && this.entry.resourceId && this.entry.featureId) {
        const e = [];
        this.evidence.forEach((n) => {
          if (n.includes("DOI:")) {
            const a = n.replace("DOI:", "https://doi.org/");
            e.push(new URL(a));
          } else if (n.includes("PMID:")) {
            const a = n.replace(
              "PMID:",
              "https://pubmed.ncbi.nlm.nih.gov/"
            );
            e.push(new URL(a));
          } else
            e.push(n);
        });
        const r = {
          resource: this.entry.resourceId,
          item: Object.assign(
            { id: this.entry.featureId },
            Object.fromEntries(
              Object.entries(this.entry).filter(
                ([n]) => ["label", "models"].includes(n)
              )
            )
          ),
          body: {
            evidence: e,
            comment: this.comment
          },
          feature: this.entry.feature
        };
        Object.assign(r.body, this.entry.body), this.entry.type === "deleted" && (r.feature = void 0), this.creator && (r.creator = this.creator), (t = this.$annotator) == null || t.addAnnotation(this.userApiKey, r).then(() => {
          this.errorMessage = "", this.resetSubmission(), this.updatePrevSubmissions();
        }).catch(() => {
          this.errorMessage = "There is a problem with the submission, please try again later";
        }), this.$emit("annotation", r);
      }
    },
    removeEvidence: function(t) {
      this.evidence.splice(t, 1);
    },
    resetSubmission: function() {
      this.editing = !1, this.evidence = [], this.newFeature = "", this.comment = "";
    },
    getUpdateCopyContent: function() {
      if (!this.entry)
        return "";
      const t = [];
      if (this.entry.featureId && t.push(`<div><strong>Feature ID:</strong>${this.entry.featureId}</div>`), this.entry.label && t.push(`<div><strong>Label:</strong>${this.entry.label}</div>`), this.entry.models && (t.push(`<div><strong>Ontology:</strong>${this.entry.models}</div>`), this.ontologyLink && t.push(`<div><strong>Ontology Link:</strong>${this.ontologyLink}</div>`)), this.entry.resourceId && t.push(`<div><strong>Resource:</strong>${this.entry.resourceId}</div>`), this.prevSubs.length) {
        let e = `<div><strong>Annotations:</strong></div>
<br>`;
        this.prevSubs.map((r, n) => {
          if (r.creator && (e += `<div><strong>Created:</strong>${this.formatTime(r.created)}</div>
<br>`, e += `<div><strong>Creator:</strong>${r.creator.name}</div>
<br>`, e += `<div><strong>Email:</strong>${r.creator.email}</div>
<br>`), r.body.evidence.length) {
            let a = "";
            r.body.evidence.forEach((i, o) => {
              a += `${typeof i == "object" ? Object.values(i)[0] : i}`, o !== r.body.evidence.length - 1 && (a += ", ");
            }), e += `<div><strong>Evidence:</strong>${a}</div>
<br>`;
          }
          e += `<div><strong>Comment:</strong>${r.body.comment}</div>
<br>`;
        }), t.push(`<div>${e}</div>`);
      }
      return t.join(`

<br>`);
    },
    onCopied: function() {
      const t = this.annotationEntry[this.entryIndex], e = {
        event_name: "portal_maps_annotation_copy_content",
        category: String((t == null ? void 0 : t.featureId) || "")
      };
      this.trackEvent(e);
    },
    trackEvent: function(t) {
      const e = {
        event: "interaction_event",
        location: "map_annotation",
        ...t
      };
      this.$emit("trackEvent", e);
    }
  },
  watch: {
    annotationEntry: {
      deep: !0,
      immediate: !0,
      handler: function(t, e) {
        t !== e && (this.entryIndex = 0, t != null && t.length && this.emitActiveItemChange());
      }
    },
    entry: {
      deep: !0,
      immediate: !0,
      handler: function(t, e) {
        t && t !== e && (this.resetSubmission(), this.updatePrevSubmissions());
      }
    }
  },
  mounted: function() {
    var t;
    (t = this.$annotator) == null || t.authenticate(this.userApiKey).then((e) => {
      e.name && e.email && e.canUpdate ? (this.creator = e, e.orcid || (this.creator.orcid = "0000-0000-0000-0000"), this.authenticated = !0) : this.errorMessage = "", this.updatePrevSubmissions();
    });
  }
}, Ha = (t) => (Ba("data-v-2a2f8754"), t = t(), $a(), t), P5 = {
  key: 0,
  class: "toggle-button"
}, D5 = { class: "block" }, R5 = /* @__PURE__ */ Ha(() => /* @__PURE__ */ ae("div", { class: "title" }, "Feature Annotations", -1)), L5 = { class: "title-buttons" }, F5 = { key: 0 }, M5 = ["href"], N5 = /* @__PURE__ */ Ha(() => /* @__PURE__ */ ae("strong", { class: "sub-title" }, "Previous submissions:", -1)), B5 = /* @__PURE__ */ Ha(() => /* @__PURE__ */ ae("strong", null, "Evidence:  ", -1)), $5 = ["href"], q5 = { key: 1 }, z5 = { key: 2 }, V5 = /* @__PURE__ */ Ha(() => /* @__PURE__ */ ae("strong", null, "Comment:  ", -1)), H5 = /* @__PURE__ */ Ha(() => /* @__PURE__ */ ae("strong", { class: "sub-title" }, "Suggest changes:", -1)), K5 = /* @__PURE__ */ Ha(() => /* @__PURE__ */ ae("strong", null, "Evidence:", -1)), G5 = /* @__PURE__ */ Ha(() => /* @__PURE__ */ ae("strong", null, "Comment:", -1)), U5 = { class: "sub-title" };
function W5(t, e, r, n, a, i) {
  const o = mr, s = Li, u = Sg, l = Dl, c = Up, d = Ft, f = Vo, h = DT, v = RT, p = LT, g = Qo, y = Xs, m = XN, b = ZN, w = Xo, x = wg;
  return q(), me(x, { class: "main" }, {
    default: U(() => [
      r.annotationEntry.length > 1 ? (q(), ie("div", P5, [
        J(s, {
          width: "auto",
          trigger: "hover",
          teleported: !1
        }, {
          reference: U(() => [
            J(o, {
              class: "button",
              onClick: i.previous,
              disabled: this.entryIndex === 0
            }, {
              default: U(() => [
                Be(" Previous ")
              ]),
              _: 1
            }, 8, ["onClick", "disabled"])
          ]),
          default: U(() => [
            ae("span", null, ke(i.previousLabel), 1)
          ]),
          _: 1
        }),
        J(s, {
          width: "auto",
          trigger: "hover",
          teleported: !1
        }, {
          reference: U(() => [
            J(o, {
              class: "button",
              onClick: i.next,
              disabled: this.entryIndex === this.annotationEntry.length - 1
            }, {
              default: U(() => [
                Be(" Next ")
              ]),
              _: 1
            }, 8, ["onClick", "disabled"])
          ]),
          default: U(() => [
            ae("span", null, ke(i.nextLabel), 1)
          ]),
          _: 1
        })
      ])) : pe("", !0),
      ae("div", D5, [
        J(l, { class: "info-field" }, {
          default: U(() => [
            R5,
            ae("div", L5, [
              J(u, {
                onCopied: i.onCopied,
                content: i.updatedCopyContent
              }, null, 8, ["onCopied", "content"])
            ])
          ]),
          _: 1
        }),
        i.entry ? (q(), ie(je, { key: 0 }, [
          (q(!0), ie(je, null, Lt(t.displayPair, (E, C) => Ye((q(), me(l, {
            class: "dialog-text",
            key: E
          }, {
            default: U(() => [
              ae("strong", null, ke(C) + ": ", 1),
              Be("  "),
              C !== "Ontology" ? (q(), ie("span", F5, ke(i.entry[E]), 1)) : (q(), ie("a", {
                key: 1,
                href: i.ontologyLink,
                target: "_blank"
              }, ke(i.entry[E]), 9, M5))
            ]),
            _: 2
          }, 1024)), [
            [dt, i.entry[E]]
          ])), 128)),
          t.prevSubs.length > 0 ? (q(), ie(je, { key: 0 }, [
            Ye(ae("div", {
              class: "hide",
              onClick: e[0] || (e[0] = (E) => t.showSubmissions = !1)
            }, [
              Be(" Hide previous submissions "),
              J(d, null, {
                default: U(() => [
                  J(c)
                ]),
                _: 1
              })
            ], 512), [
              [dt, t.showSubmissions]
            ]),
            Ye(ae("div", {
              class: "hide",
              onClick: e[1] || (e[1] = (E) => t.showSubmissions = !0)
            }, [
              Be(" Show previous " + ke(t.prevSubs.length) + " submission(s) ", 1),
              J(d, null, {
                default: U(() => [
                  J(f)
                ]),
                _: 1
              })
            ], 512), [
              [dt, !t.showSubmissions]
            ]),
            t.showSubmissions ? (q(), ie(je, { key: 0 }, [
              J(l, { class: "dialog-spacer" }),
              J(l, { class: "dialog-text" }, {
                default: U(() => [
                  N5
                ]),
                _: 1
              }),
              (q(!0), ie(je, null, Lt(t.prevSubs, (E, C) => (q(), ie("div", {
                class: "entry",
                key: C
              }, [
                E.creator ? (q(), me(l, {
                  key: 0,
                  class: "dialog-text"
                }, {
                  default: U(() => [
                    ae("strong", null, ke(i.formatTime(E.created)), 1),
                    Be(" " + ke(E.creator.name), 1)
                  ]),
                  _: 2
                }, 1024)) : pe("", !0),
                J(l, { class: "dialog-text" }, {
                  default: U(() => [
                    B5,
                    (q(!0), ie(je, null, Lt(i.processEvidences(E), (k, S) => (q(), me(l, {
                      key: k,
                      class: "dialog-text"
                    }, {
                      default: U(() => [
                        typeof k == "object" ? (q(), ie("a", {
                          key: 0,
                          href: Object.values(k)[0],
                          target: "_blank"
                        }, ke(Object.keys(k)[0]), 9, $5)) : (q(), ie("span", q5, ke(k), 1)),
                        S !== E.body.evidence.length - 1 ? (q(), ie("span", z5, ", ")) : pe("", !0)
                      ]),
                      _: 2
                    }, 1024))), 128))
                  ]),
                  _: 2
                }, 1024),
                J(l, { class: "dialog-text" }, {
                  default: U(() => [
                    V5,
                    Be(" " + ke(E.body.comment), 1)
                  ]),
                  _: 2
                }, 1024)
              ]))), 128))
            ], 64)) : pe("", !0)
          ], 64)) : pe("", !0),
          t.authenticated || i.offlineAnnotationEnabled ? (q(), ie(je, { key: 1 }, [
            i.isEditable ? (q(), ie(je, { key: 0 }, [
              J(l, { class: "dialog-spacer" }),
              t.editing ? (q(), ie(je, { key: 1 }, [
                J(l, { class: "dialog-text" }, {
                  default: U(() => [
                    H5
                  ]),
                  _: 1
                }),
                i.isDeleted ? pe("", !0) : (q(), ie(je, { key: 0 }, [
                  J(l, { class: "dialog-text" }, {
                    default: U(() => [
                      K5
                    ]),
                    _: 1
                  }),
                  (q(!0), ie(je, null, Lt(t.evidence, (E, C) => (q(), me(l, { key: E }, {
                    default: U(() => [
                      J(g, { span: 20 }, {
                        default: U(() => [
                          Be(ke(t.evidence[C]), 1)
                        ]),
                        _: 2
                      }, 1024),
                      J(g, { span: 4 }, {
                        default: U(() => [
                          J(d, { class: "standard-icon" }, {
                            default: U(() => [
                              J(y, {
                                onClick: (k) => i.removeEvidence(C)
                              }, null, 8, ["onClick"])
                            ]),
                            _: 2
                          }, 1024)
                        ]),
                        _: 2
                      }, 1024)
                    ]),
                    _: 2
                  }, 1024))), 128)),
                  J(l, null, {
                    default: U(() => [
                      J(w, {
                        size: "small",
                        placeholder: "Enter",
                        modelValue: t.newEvidence,
                        "onUpdate:modelValue": e[4] || (e[4] = (E) => t.newEvidence = E),
                        onChange: e[5] || (e[5] = (E) => i.evidenceEntered(E))
                      }, {
                        prepend: U(() => [
                          J(b, {
                            teleported: !1,
                            modelValue: t.evidencePrefix,
                            "onUpdate:modelValue": e[3] || (e[3] = (E) => t.evidencePrefix = E),
                            placeholder: "Other:",
                            class: "select-box",
                            "popper-class": "flatmap_dropdown"
                          }, {
                            default: U(() => [
                              (q(!0), ie(je, null, Lt(t.evidencePrefixes, (E) => (q(), me(m, {
                                key: E.label,
                                value: E.value
                              }, {
                                default: U(() => [
                                  J(l, null, {
                                    default: U(() => [
                                      J(g, { span: 12 }, {
                                        default: U(() => [
                                          Be(ke(E.label), 1)
                                        ]),
                                        _: 2
                                      }, 1024)
                                    ]),
                                    _: 2
                                  }, 1024)
                                ]),
                                _: 2
                              }, 1032, ["value"]))), 128))
                            ]),
                            _: 1
                          }, 8, ["modelValue"])
                        ]),
                        _: 1
                      }, 8, ["modelValue"])
                    ]),
                    _: 1
                  })
                ], 64)),
                J(l, null, {
                  default: U(() => [
                    G5
                  ]),
                  _: 1
                }),
                J(l, { class: "dialog-text" }, {
                  default: U(() => [
                    J(w, {
                      type: "textarea",
                      autosize: { minRows: 2, maxRows: 4 },
                      placeholder: "Enter",
                      modelValue: t.comment,
                      "onUpdate:modelValue": e[6] || (e[6] = (E) => t.comment = E)
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                }),
                J(l, { class: "dialog-text" }, {
                  default: U(() => [
                    J(o, {
                      class: "button",
                      type: "primary",
                      plain: "",
                      onClick: i.submit
                    }, {
                      default: U(() => [
                        Be(" Submit ")
                      ]),
                      _: 1
                    }, 8, ["onClick"])
                  ]),
                  _: 1
                })
              ], 64)) : (q(), me(l, { key: 0 }, {
                default: U(() => [
                  J(d, { class: "standard-icon" }, {
                    default: U(() => [
                      J(h, {
                        onClick: e[2] || (e[2] = (E) => t.editing = !0)
                      })
                    ]),
                    _: 1
                  }),
                  i.isDeleted ? (q(), me(d, {
                    key: 0,
                    class: "standard-icon"
                  }, {
                    default: U(() => [
                      J(v, { onClick: i.submit }, null, 8, ["onClick"])
                    ]),
                    _: 1
                  })) : i.isPositionUpdated ? (q(), me(d, {
                    key: 1,
                    class: "standard-icon"
                  }, {
                    default: U(() => [
                      J(p, { onClick: i.submit }, null, 8, ["onClick"])
                    ]),
                    _: 1
                  })) : pe("", !0)
                ]),
                _: 1
              })),
              t.errorMessage ? (q(), me(l, {
                key: 2,
                class: "dialog-text"
              }, {
                default: U(() => [
                  ae("strong", U5, ke(t.errorMessage), 1)
                ]),
                _: 1
              })) : pe("", !0)
            ], 64)) : pe("", !0)
          ], 64)) : pe("", !0)
        ], 64)) : pe("", !0)
      ])
    ]),
    _: 1
  });
}
const j5 = /* @__PURE__ */ Er(A5, [["render", W5], ["__scopeId", "data-v-2a2f8754"]]), Y5 = {
  name: "CreateTooltipContent",
  components: {
    Button: mr,
    Col: Qo,
    Container: bg,
    Header: K2,
    Input: Xo,
    Main: wg
  },
  props: {
    createData: {
      type: Object
    }
  },
  watch: {
    "createData.shape": {
      handler: function(t, e) {
        this.group = t, e !== void 0 && this.$emit("cancel-create");
      },
      immediate: !0
    }
  },
  computed: {
    confirmText: function() {
      return this.createData.editingIndex > -1 ? "Edit" : "Confirm";
    }
  },
  data: function() {
    return {
      group: "default",
      region: "",
      showPoint: !1
    };
  },
  methods: {
    confirm: function() {
      this.$emit(
        "confirm-create",
        {
          region: "__annotation/" + this.region,
          group: this.group,
          shape: this.createData.shape,
          editingIndex: this.createData.editingIndex
        }
      ), this.group = this.createData.shape;
    },
    cancel: function() {
      this.$emit("cancel-create");
    }
  }
}, Z5 = (t) => (Ba("data-v-d61c5879"), t = t(), $a(), t), X5 = /* @__PURE__ */ Z5(() => /* @__PURE__ */ ae("span", { class: "create-text" }, " Primitives will be created in the __annotation region ", -1));
function J5(t, e, r, n, a, i) {
  const o = K2, s = Qo, u = Dl, l = Xo, c = mr, d = wg, f = bg;
  return q(), me(f, { class: "create-container" }, {
    default: U(() => [
      J(o, {
        height: "30px",
        class: "header"
      }, {
        default: U(() => [
          ae("div", null, "Create " + ke(r.createData.shape), 1)
        ]),
        _: 1
      }),
      J(d, { class: "slides-block" }, {
        default: U(() => [
          X5,
          Ye(J(u, { class: "row" }, {
            default: U(() => [
              J(s, {
                offset: 0,
                span: 8
              }, {
                default: U(() => [
                  Be(" Position: ")
                ]),
                _: 1
              }),
              J(s, {
                offset: 0,
                span: 16
              }, {
                default: U(() => [
                  (q(!0), ie(je, null, Lt(r.createData.points, ({ value: h, i: v }) => (q(), me(u, {
                    key: v,
                    class: "value"
                  }, {
                    default: U(() => [
                      Be(ke(v), 1)
                    ]),
                    _: 2
                  }, 1024))), 128))
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 512), [
            [dt, t.showPoint]
          ]),
          J(u, { class: "row" }, {
            default: U(() => [
              J(s, {
                offset: 0,
                span: 8
              }, {
                default: U(() => [
                  Be(" Region: ")
                ]),
                _: 1
              }),
              J(s, {
                offset: 0,
                span: 16
              }, {
                default: U(() => [
                  J(l, {
                    modelValue: t.region,
                    "onUpdate:modelValue": e[0] || (e[0] = (h) => t.region = h),
                    placeholder: "__annotation",
                    size: "small"
                  }, null, 8, ["modelValue"])
                ]),
                _: 1
              })
            ]),
            _: 1
          }),
          J(u, { class: "row" }, {
            default: U(() => [
              J(s, {
                offset: 0,
                span: 8
              }, {
                default: U(() => [
                  Be(" Group: ")
                ]),
                _: 1
              }),
              J(s, {
                offset: 0,
                span: 16
              }, {
                default: U(() => [
                  J(l, {
                    modelValue: t.group,
                    "onUpdate:modelValue": e[1] || (e[1] = (h) => t.group = h),
                    placeholder: r.createData.shape,
                    size: "small"
                  }, null, 8, ["modelValue", "placeholder"])
                ]),
                _: 1
              })
            ]),
            _: 1
          }),
          J(u, null, {
            default: U(() => [
              J(s, {
                offset: 0,
                span: 12
              }, {
                default: U(() => [
                  J(c, {
                    type: "primary",
                    plain: "",
                    onClick: i.confirm
                  }, {
                    default: U(() => [
                      Be(ke(i.confirmText), 1)
                    ]),
                    _: 1
                  }, 8, ["onClick"])
                ]),
                _: 1
              }),
              J(s, {
                offset: 0,
                span: 12
              }, {
                default: U(() => [
                  J(c, {
                    type: "primary",
                    plain: "",
                    onClick: i.cancel
                  }, {
                    default: U(() => [
                      Be(" Cancel ")
                    ]),
                    _: 1
                  }, 8, ["onClick"])
                ]),
                _: 1
              })
            ]),
            _: 1
          })
        ]),
        _: 1
      })
    ]),
    _: 1
  });
}
const M7 = /* @__PURE__ */ Er(Y5, [["render", J5], ["__scopeId", "data-v-d61c5879"]]);
function Nt(t) {
  "@babel/helpers - typeof";
  return Nt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
    return typeof e;
  } : function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, Nt(t);
}
function kg(t, e) {
  if (!(t instanceof e))
    throw new TypeError("Cannot call a class as a function");
}
function Q5(t, e) {
  for (var r = 0; r < e.length; r++) {
    var n = e[r];
    n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n);
  }
}
function _g(t, e, r) {
  return e && Q5(t.prototype, e), Object.defineProperty(t, "prototype", {
    writable: !1
  }), t;
}
function Y2(t, e, r) {
  return e in t ? Object.defineProperty(t, e, {
    value: r,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : t[e] = r, t;
}
function Vr(t, e) {
  return eB(t) || tB(t, e) || Z2(t, e) || rB();
}
function eB(t) {
  if (Array.isArray(t)) return t;
}
function tB(t, e) {
  var r = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
  if (r != null) {
    var n = [], a = !0, i = !1, o, s;
    try {
      for (r = r.call(t); !(a = (o = r.next()).done) && (n.push(o.value), !(e && n.length === e)); a = !0)
        ;
    } catch (u) {
      i = !0, s = u;
    } finally {
      try {
        !a && r.return != null && r.return();
      } finally {
        if (i) throw s;
      }
    }
    return n;
  }
}
function Z2(t, e) {
  if (t) {
    if (typeof t == "string") return qm(t, e);
    var r = Object.prototype.toString.call(t).slice(8, -1);
    if (r === "Object" && t.constructor && (r = t.constructor.name), r === "Map" || r === "Set") return Array.from(t);
    if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return qm(t, e);
  }
}
function qm(t, e) {
  (e == null || e > t.length) && (e = t.length);
  for (var r = 0, n = new Array(e); r < e; r++) n[r] = t[r];
  return n;
}
function rB() {
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function X2(t, e) {
  var r = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
  if (!r) {
    if (Array.isArray(t) || (r = Z2(t)) || e) {
      r && (t = r);
      var n = 0, a = function() {
      };
      return {
        s: a,
        n: function() {
          return n >= t.length ? {
            done: !0
          } : {
            done: !1,
            value: t[n++]
          };
        },
        e: function(u) {
          throw u;
        },
        f: a
      };
    }
    throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
  }
  var i = !0, o = !1, s;
  return {
    s: function() {
      r = r.call(t);
    },
    n: function() {
      var u = r.next();
      return i = u.done, u;
    },
    e: function(u) {
      o = !0, s = u;
    },
    f: function() {
      try {
        !i && r.return != null && r.return();
      } finally {
        if (o) throw s;
      }
    }
  };
}
var Dt = typeof window > "u" ? null : window, zm = Dt ? Dt.navigator : null;
Dt && Dt.document;
var nB = Nt(""), J2 = Nt({}), aB = Nt(function() {
}), iB = typeof HTMLElement > "u" ? "undefined" : Nt(HTMLElement), ts = function(e) {
  return e && e.instanceString && yt(e.instanceString) ? e.instanceString() : null;
}, Me = function(e) {
  return e != null && Nt(e) == nB;
}, yt = function(e) {
  return e != null && Nt(e) === aB;
}, lt = function(e) {
  return !xr(e) && (Array.isArray ? Array.isArray(e) : e != null && e instanceof Array);
}, Xe = function(e) {
  return e != null && Nt(e) === J2 && !lt(e) && e.constructor === Object;
}, oB = function(e) {
  return e != null && Nt(e) === J2;
}, Ce = function(e) {
  return e != null && Nt(e) === Nt(1) && !isNaN(e);
}, sB = function(e) {
  return Ce(e) && Math.floor(e) === e;
}, sl = function(e) {
  if (iB !== "undefined")
    return e != null && e instanceof HTMLElement;
}, xr = function(e) {
  return rs(e) || Q2(e);
}, rs = function(e) {
  return ts(e) === "collection" && e._private.single;
}, Q2 = function(e) {
  return ts(e) === "collection" && !e._private.single;
}, Tg = function(e) {
  return ts(e) === "core";
}, eS = function(e) {
  return ts(e) === "stylesheet";
}, lB = function(e) {
  return ts(e) === "event";
}, ea = function(e) {
  return e == null ? !0 : !!(e === "" || e.match(/^\s+$/));
}, uB = function(e) {
  return typeof HTMLElement > "u" ? !1 : e instanceof HTMLElement;
}, cB = function(e) {
  return Xe(e) && Ce(e.x1) && Ce(e.x2) && Ce(e.y1) && Ce(e.y2);
}, dB = function(e) {
  return oB(e) && yt(e.then);
}, fB = function() {
  return zm && zm.userAgent.match(/msie|trident|edge/i);
}, Po = function(e, r) {
  r || (r = function() {
    if (arguments.length === 1)
      return arguments[0];
    if (arguments.length === 0)
      return "undefined";
    for (var i = [], o = 0; o < arguments.length; o++)
      i.push(arguments[o]);
    return i.join("$");
  });
  var n = function a() {
    var i = this, o = arguments, s, u = r.apply(i, o), l = a.cache;
    return (s = l[u]) || (s = l[u] = e.apply(i, o)), s;
  };
  return n.cache = {}, n;
}, Ig = Po(function(t) {
  return t.replace(/([A-Z])/g, function(e) {
    return "-" + e.toLowerCase();
  });
}), Rl = Po(function(t) {
  return t.replace(/(-\w)/g, function(e) {
    return e[1].toUpperCase();
  });
}), tS = Po(function(t, e) {
  return t + e[0].toUpperCase() + e.substring(1);
}, function(t, e) {
  return t + "$" + e;
}), Vm = function(e) {
  return ea(e) ? e : e.charAt(0).toUpperCase() + e.substring(1);
}, Mt = "(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))", vB = "rgb[a]?\\((" + Mt + "[%]?)\\s*,\\s*(" + Mt + "[%]?)\\s*,\\s*(" + Mt + "[%]?)(?:\\s*,\\s*(" + Mt + "))?\\)", hB = "rgb[a]?\\((?:" + Mt + "[%]?)\\s*,\\s*(?:" + Mt + "[%]?)\\s*,\\s*(?:" + Mt + "[%]?)(?:\\s*,\\s*(?:" + Mt + "))?\\)", pB = "hsl[a]?\\((" + Mt + ")\\s*,\\s*(" + Mt + "[%])\\s*,\\s*(" + Mt + "[%])(?:\\s*,\\s*(" + Mt + "))?\\)", gB = "hsl[a]?\\((?:" + Mt + ")\\s*,\\s*(?:" + Mt + "[%])\\s*,\\s*(?:" + Mt + "[%])(?:\\s*,\\s*(?:" + Mt + "))?\\)", yB = "\\#[0-9a-fA-F]{3}", mB = "\\#[0-9a-fA-F]{6}", rS = function(e, r) {
  return e < r ? -1 : e > r ? 1 : 0;
}, bB = function(e, r) {
  return -1 * rS(e, r);
}, ze = Object.assign != null ? Object.assign.bind(Object) : function(t) {
  for (var e = arguments, r = 1; r < e.length; r++) {
    var n = e[r];
    if (n != null)
      for (var a = Object.keys(n), i = 0; i < a.length; i++) {
        var o = a[i];
        t[o] = n[o];
      }
  }
  return t;
}, wB = function(e) {
  if (!(!(e.length === 4 || e.length === 7) || e[0] !== "#")) {
    var r = e.length === 4, n, a, i, o = 16;
    return r ? (n = parseInt(e[1] + e[1], o), a = parseInt(e[2] + e[2], o), i = parseInt(e[3] + e[3], o)) : (n = parseInt(e[1] + e[2], o), a = parseInt(e[3] + e[4], o), i = parseInt(e[5] + e[6], o)), [n, a, i];
  }
}, CB = function(e) {
  var r, n, a, i, o, s, u, l;
  function c(v, p, g) {
    return g < 0 && (g += 1), g > 1 && (g -= 1), g < 1 / 6 ? v + (p - v) * 6 * g : g < 1 / 2 ? p : g < 2 / 3 ? v + (p - v) * (2 / 3 - g) * 6 : v;
  }
  var d = new RegExp("^" + pB + "$").exec(e);
  if (d) {
    if (n = parseInt(d[1]), n < 0 ? n = (360 - -1 * n % 360) % 360 : n > 360 && (n = n % 360), n /= 360, a = parseFloat(d[2]), a < 0 || a > 100 || (a = a / 100, i = parseFloat(d[3]), i < 0 || i > 100) || (i = i / 100, o = d[4], o !== void 0 && (o = parseFloat(o), o < 0 || o > 1)))
      return;
    if (a === 0)
      s = u = l = Math.round(i * 255);
    else {
      var f = i < 0.5 ? i * (1 + a) : i + a - i * a, h = 2 * i - f;
      s = Math.round(255 * c(h, f, n + 1 / 3)), u = Math.round(255 * c(h, f, n)), l = Math.round(255 * c(h, f, n - 1 / 3));
    }
    r = [s, u, l, o];
  }
  return r;
}, xB = function(e) {
  var r, n = new RegExp("^" + vB + "$").exec(e);
  if (n) {
    r = [];
    for (var a = [], i = 1; i <= 3; i++) {
      var o = n[i];
      if (o[o.length - 1] === "%" && (a[i] = !0), o = parseFloat(o), a[i] && (o = o / 100 * 255), o < 0 || o > 255)
        return;
      r.push(Math.floor(o));
    }
    var s = a[1] || a[2] || a[3], u = a[1] && a[2] && a[3];
    if (s && !u)
      return;
    var l = n[4];
    if (l !== void 0) {
      if (l = parseFloat(l), l < 0 || l > 1)
        return;
      r.push(l);
    }
  }
  return r;
}, EB = function(e) {
  return kB[e.toLowerCase()];
}, SB = function(e) {
  return (lt(e) ? e : null) || EB(e) || wB(e) || xB(e) || CB(e);
}, kB = {
  // special colour names
  transparent: [0, 0, 0, 0],
  // NB alpha === 0
  // regular colours
  aliceblue: [240, 248, 255],
  antiquewhite: [250, 235, 215],
  aqua: [0, 255, 255],
  aquamarine: [127, 255, 212],
  azure: [240, 255, 255],
  beige: [245, 245, 220],
  bisque: [255, 228, 196],
  black: [0, 0, 0],
  blanchedalmond: [255, 235, 205],
  blue: [0, 0, 255],
  blueviolet: [138, 43, 226],
  brown: [165, 42, 42],
  burlywood: [222, 184, 135],
  cadetblue: [95, 158, 160],
  chartreuse: [127, 255, 0],
  chocolate: [210, 105, 30],
  coral: [255, 127, 80],
  cornflowerblue: [100, 149, 237],
  cornsilk: [255, 248, 220],
  crimson: [220, 20, 60],
  cyan: [0, 255, 255],
  darkblue: [0, 0, 139],
  darkcyan: [0, 139, 139],
  darkgoldenrod: [184, 134, 11],
  darkgray: [169, 169, 169],
  darkgreen: [0, 100, 0],
  darkgrey: [169, 169, 169],
  darkkhaki: [189, 183, 107],
  darkmagenta: [139, 0, 139],
  darkolivegreen: [85, 107, 47],
  darkorange: [255, 140, 0],
  darkorchid: [153, 50, 204],
  darkred: [139, 0, 0],
  darksalmon: [233, 150, 122],
  darkseagreen: [143, 188, 143],
  darkslateblue: [72, 61, 139],
  darkslategray: [47, 79, 79],
  darkslategrey: [47, 79, 79],
  darkturquoise: [0, 206, 209],
  darkviolet: [148, 0, 211],
  deeppink: [255, 20, 147],
  deepskyblue: [0, 191, 255],
  dimgray: [105, 105, 105],
  dimgrey: [105, 105, 105],
  dodgerblue: [30, 144, 255],
  firebrick: [178, 34, 34],
  floralwhite: [255, 250, 240],
  forestgreen: [34, 139, 34],
  fuchsia: [255, 0, 255],
  gainsboro: [220, 220, 220],
  ghostwhite: [248, 248, 255],
  gold: [255, 215, 0],
  goldenrod: [218, 165, 32],
  gray: [128, 128, 128],
  grey: [128, 128, 128],
  green: [0, 128, 0],
  greenyellow: [173, 255, 47],
  honeydew: [240, 255, 240],
  hotpink: [255, 105, 180],
  indianred: [205, 92, 92],
  indigo: [75, 0, 130],
  ivory: [255, 255, 240],
  khaki: [240, 230, 140],
  lavender: [230, 230, 250],
  lavenderblush: [255, 240, 245],
  lawngreen: [124, 252, 0],
  lemonchiffon: [255, 250, 205],
  lightblue: [173, 216, 230],
  lightcoral: [240, 128, 128],
  lightcyan: [224, 255, 255],
  lightgoldenrodyellow: [250, 250, 210],
  lightgray: [211, 211, 211],
  lightgreen: [144, 238, 144],
  lightgrey: [211, 211, 211],
  lightpink: [255, 182, 193],
  lightsalmon: [255, 160, 122],
  lightseagreen: [32, 178, 170],
  lightskyblue: [135, 206, 250],
  lightslategray: [119, 136, 153],
  lightslategrey: [119, 136, 153],
  lightsteelblue: [176, 196, 222],
  lightyellow: [255, 255, 224],
  lime: [0, 255, 0],
  limegreen: [50, 205, 50],
  linen: [250, 240, 230],
  magenta: [255, 0, 255],
  maroon: [128, 0, 0],
  mediumaquamarine: [102, 205, 170],
  mediumblue: [0, 0, 205],
  mediumorchid: [186, 85, 211],
  mediumpurple: [147, 112, 219],
  mediumseagreen: [60, 179, 113],
  mediumslateblue: [123, 104, 238],
  mediumspringgreen: [0, 250, 154],
  mediumturquoise: [72, 209, 204],
  mediumvioletred: [199, 21, 133],
  midnightblue: [25, 25, 112],
  mintcream: [245, 255, 250],
  mistyrose: [255, 228, 225],
  moccasin: [255, 228, 181],
  navajowhite: [255, 222, 173],
  navy: [0, 0, 128],
  oldlace: [253, 245, 230],
  olive: [128, 128, 0],
  olivedrab: [107, 142, 35],
  orange: [255, 165, 0],
  orangered: [255, 69, 0],
  orchid: [218, 112, 214],
  palegoldenrod: [238, 232, 170],
  palegreen: [152, 251, 152],
  paleturquoise: [175, 238, 238],
  palevioletred: [219, 112, 147],
  papayawhip: [255, 239, 213],
  peachpuff: [255, 218, 185],
  peru: [205, 133, 63],
  pink: [255, 192, 203],
  plum: [221, 160, 221],
  powderblue: [176, 224, 230],
  purple: [128, 0, 128],
  red: [255, 0, 0],
  rosybrown: [188, 143, 143],
  royalblue: [65, 105, 225],
  saddlebrown: [139, 69, 19],
  salmon: [250, 128, 114],
  sandybrown: [244, 164, 96],
  seagreen: [46, 139, 87],
  seashell: [255, 245, 238],
  sienna: [160, 82, 45],
  silver: [192, 192, 192],
  skyblue: [135, 206, 235],
  slateblue: [106, 90, 205],
  slategray: [112, 128, 144],
  slategrey: [112, 128, 144],
  snow: [255, 250, 250],
  springgreen: [0, 255, 127],
  steelblue: [70, 130, 180],
  tan: [210, 180, 140],
  teal: [0, 128, 128],
  thistle: [216, 191, 216],
  tomato: [255, 99, 71],
  turquoise: [64, 224, 208],
  violet: [238, 130, 238],
  wheat: [245, 222, 179],
  white: [255, 255, 255],
  whitesmoke: [245, 245, 245],
  yellow: [255, 255, 0],
  yellowgreen: [154, 205, 50]
}, nS = function(e) {
  for (var r = e.map, n = e.keys, a = n.length, i = 0; i < a; i++) {
    var o = n[i];
    if (Xe(o))
      throw Error("Tried to set map with object key");
    i < n.length - 1 ? (r[o] == null && (r[o] = {}), r = r[o]) : r[o] = e.value;
  }
}, aS = function(e) {
  for (var r = e.map, n = e.keys, a = n.length, i = 0; i < a; i++) {
    var o = n[i];
    if (Xe(o))
      throw Error("Tried to get map with object key");
    if (r = r[o], r == null)
      return r;
  }
  return r;
};
function _B(t) {
  var e = typeof t;
  return t != null && (e == "object" || e == "function");
}
var Aa = _B, lo = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function TB(t, e) {
  return e = { exports: {} }, t(e, e.exports), e.exports;
}
var IB = typeof lo == "object" && lo && lo.Object === Object && lo, OB = IB, AB = typeof self == "object" && self && self.Object === Object && self, PB = OB || AB || Function("return this")(), Ll = PB, DB = function() {
  return Ll.Date.now();
}, Au = DB, RB = /\s/;
function LB(t) {
  for (var e = t.length; e-- && RB.test(t.charAt(e)); )
    ;
  return e;
}
var FB = LB, MB = /^\s+/;
function NB(t) {
  return t && t.slice(0, FB(t) + 1).replace(MB, "");
}
var BB = NB, $B = Ll.Symbol, _i = $B, iS = Object.prototype, qB = iS.hasOwnProperty, zB = iS.toString, to = _i ? _i.toStringTag : void 0;
function VB(t) {
  var e = qB.call(t, to), r = t[to];
  try {
    t[to] = void 0;
    var n = !0;
  } catch {
  }
  var a = zB.call(t);
  return n && (e ? t[to] = r : delete t[to]), a;
}
var HB = VB, KB = Object.prototype, GB = KB.toString;
function UB(t) {
  return GB.call(t);
}
var WB = UB, jB = "[object Null]", YB = "[object Undefined]", Hm = _i ? _i.toStringTag : void 0;
function ZB(t) {
  return t == null ? t === void 0 ? YB : jB : Hm && Hm in Object(t) ? HB(t) : WB(t);
}
var oS = ZB;
function XB(t) {
  return t != null && typeof t == "object";
}
var JB = XB, QB = "[object Symbol]";
function e$(t) {
  return typeof t == "symbol" || JB(t) && oS(t) == QB;
}
var ns = e$, Km = NaN, t$ = /^[-+]0x[0-9a-f]+$/i, r$ = /^0b[01]+$/i, n$ = /^0o[0-7]+$/i, a$ = parseInt;
function i$(t) {
  if (typeof t == "number")
    return t;
  if (ns(t))
    return Km;
  if (Aa(t)) {
    var e = typeof t.valueOf == "function" ? t.valueOf() : t;
    t = Aa(e) ? e + "" : e;
  }
  if (typeof t != "string")
    return t === 0 ? t : +t;
  t = BB(t);
  var r = r$.test(t);
  return r || n$.test(t) ? a$(t.slice(2), r ? 2 : 8) : t$.test(t) ? Km : +t;
}
var Gm = i$, o$ = "Expected a function", s$ = Math.max, l$ = Math.min;
function u$(t, e, r) {
  var n, a, i, o, s, u, l = 0, c = !1, d = !1, f = !0;
  if (typeof t != "function")
    throw new TypeError(o$);
  e = Gm(e) || 0, Aa(r) && (c = !!r.leading, d = "maxWait" in r, i = d ? s$(Gm(r.maxWait) || 0, e) : i, f = "trailing" in r ? !!r.trailing : f);
  function h(E) {
    var C = n, k = a;
    return n = a = void 0, l = E, o = t.apply(k, C), o;
  }
  function v(E) {
    return l = E, s = setTimeout(y, e), c ? h(E) : o;
  }
  function p(E) {
    var C = E - u, k = E - l, S = e - C;
    return d ? l$(S, i - k) : S;
  }
  function g(E) {
    var C = E - u, k = E - l;
    return u === void 0 || C >= e || C < 0 || d && k >= i;
  }
  function y() {
    var E = Au();
    if (g(E))
      return m(E);
    s = setTimeout(y, p(E));
  }
  function m(E) {
    return s = void 0, f && n ? h(E) : (n = a = void 0, o);
  }
  function b() {
    s !== void 0 && clearTimeout(s), l = 0, n = u = a = s = void 0;
  }
  function w() {
    return s === void 0 ? o : m(Au());
  }
  function x() {
    var E = Au(), C = g(E);
    if (n = arguments, a = this, u = E, C) {
      if (s === void 0)
        return v(u);
      if (d)
        return clearTimeout(s), s = setTimeout(y, e), h(u);
    }
    return s === void 0 && (s = setTimeout(y, e)), o;
  }
  return x.cancel = b, x.flush = w, x;
}
var Fl = u$, Pu = Dt ? Dt.performance : null, sS = Pu && Pu.now ? function() {
  return Pu.now();
} : function() {
  return Date.now();
}, c$ = function() {
  if (Dt) {
    if (Dt.requestAnimationFrame)
      return function(t) {
        Dt.requestAnimationFrame(t);
      };
    if (Dt.mozRequestAnimationFrame)
      return function(t) {
        Dt.mozRequestAnimationFrame(t);
      };
    if (Dt.webkitRequestAnimationFrame)
      return function(t) {
        Dt.webkitRequestAnimationFrame(t);
      };
    if (Dt.msRequestAnimationFrame)
      return function(t) {
        Dt.msRequestAnimationFrame(t);
      };
  }
  return function(t) {
    t && setTimeout(function() {
      t(sS());
    }, 1e3 / 60);
  };
}(), ll = function(e) {
  return c$(e);
}, kn = sS, li = 9261, lS = 65599, uo = 5381, uS = function(e) {
  for (var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : li, n = r, a; a = e.next(), !a.done; )
    n = n * lS + a.value | 0;
  return n;
}, Do = function(e) {
  var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : li;
  return r * lS + e | 0;
}, Ro = function(e) {
  var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : uo;
  return (r << 5) + r + e | 0;
}, d$ = function(e, r) {
  return e * 2097152 + r;
}, $n = function(e) {
  return e[0] * 2097152 + e[1];
}, ks = function(e, r) {
  return [Do(e[0], r[0]), Ro(e[1], r[1])];
}, f$ = function(e, r) {
  var n = {
    value: 0,
    done: !1
  }, a = 0, i = e.length, o = {
    next: function() {
      return a < i ? n.value = e[a++] : n.done = !0, n;
    }
  };
  return uS(o, r);
}, Pa = function(e, r) {
  var n = {
    value: 0,
    done: !1
  }, a = 0, i = e.length, o = {
    next: function() {
      return a < i ? n.value = e.charCodeAt(a++) : n.done = !0, n;
    }
  };
  return uS(o, r);
}, cS = function() {
  return v$(arguments);
}, v$ = function(e) {
  for (var r, n = 0; n < e.length; n++) {
    var a = e[n];
    n === 0 ? r = Pa(a) : r = Pa(a, r);
  }
  return r;
}, Um = !0, h$ = console.warn != null, p$ = console.trace != null, Og = Number.MAX_SAFE_INTEGER || 9007199254740991, dS = function() {
  return !0;
}, ul = function() {
  return !1;
}, Wm = function() {
  return 0;
}, Ag = function() {
}, bt = function(e) {
  throw new Error(e);
}, fS = function(e) {
  if (e !== void 0)
    Um = !!e;
  else
    return Um;
}, tt = function(e) {
  fS() && (h$ ? console.warn(e) : (console.log(e), p$ && console.trace()));
}, g$ = function(e) {
  return ze({}, e);
}, rn = function(e) {
  return e == null ? e : lt(e) ? e.slice() : Xe(e) ? g$(e) : e;
}, y$ = function(e) {
  return e.slice();
}, vS = function(e, r) {
  for (
    // loop :)
    r = e = "";
    // b - result , a - numeric letiable
    e++ < 36;
    //
    r += e * 51 & 52 ? (
      //  return a random number or 4
      (e ^ 15 ? (
        // generate a random number from 0 to 15
        8 ^ Math.random() * (e ^ 20 ? 16 : 4)
      ) : 4).toString(16)
    ) : "-"
  )
    ;
  return r;
}, m$ = {}, hS = function() {
  return m$;
}, Zt = function(e) {
  var r = Object.keys(e);
  return function(n) {
    for (var a = {}, i = 0; i < r.length; i++) {
      var o = r[i], s = n == null ? void 0 : n[o];
      a[o] = s === void 0 ? e[o] : s;
    }
    return a;
  };
}, ta = function(e, r, n) {
  for (var a = e.length - 1; a >= 0; a--)
    e[a] === r && e.splice(a, 1);
}, Pg = function(e) {
  e.splice(0, e.length);
}, b$ = function(e, r) {
  for (var n = 0; n < r.length; n++) {
    var a = r[n];
    e.push(a);
  }
}, Kr = function(e, r, n) {
  return n && (r = tS(n, r)), e[r];
}, Gn = function(e, r, n, a) {
  n && (r = tS(n, r)), e[r] = a;
}, w$ = /* @__PURE__ */ function() {
  function t() {
    kg(this, t), this._obj = {};
  }
  return _g(t, [{
    key: "set",
    value: function(r, n) {
      return this._obj[r] = n, this;
    }
  }, {
    key: "delete",
    value: function(r) {
      return this._obj[r] = void 0, this;
    }
  }, {
    key: "clear",
    value: function() {
      this._obj = {};
    }
  }, {
    key: "has",
    value: function(r) {
      return this._obj[r] !== void 0;
    }
  }, {
    key: "get",
    value: function(r) {
      return this._obj[r];
    }
  }]), t;
}(), nn = typeof Map < "u" ? Map : w$, C$ = "undefined", x$ = /* @__PURE__ */ function() {
  function t(e) {
    if (kg(this, t), this._obj = /* @__PURE__ */ Object.create(null), this.size = 0, e != null) {
      var r;
      e.instanceString != null && e.instanceString() === this.instanceString() ? r = e.toArray() : r = e;
      for (var n = 0; n < r.length; n++)
        this.add(r[n]);
    }
  }
  return _g(t, [{
    key: "instanceString",
    value: function() {
      return "set";
    }
  }, {
    key: "add",
    value: function(r) {
      var n = this._obj;
      n[r] !== 1 && (n[r] = 1, this.size++);
    }
  }, {
    key: "delete",
    value: function(r) {
      var n = this._obj;
      n[r] === 1 && (n[r] = 0, this.size--);
    }
  }, {
    key: "clear",
    value: function() {
      this._obj = /* @__PURE__ */ Object.create(null);
    }
  }, {
    key: "has",
    value: function(r) {
      return this._obj[r] === 1;
    }
  }, {
    key: "toArray",
    value: function() {
      var r = this;
      return Object.keys(this._obj).filter(function(n) {
        return r.has(n);
      });
    }
  }, {
    key: "forEach",
    value: function(r, n) {
      return this.toArray().forEach(r, n);
    }
  }]), t;
}(), Fi = (typeof Set > "u" ? "undefined" : Nt(Set)) !== C$ ? Set : x$, Ml = function(e, r) {
  var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0;
  if (e === void 0 || r === void 0 || !Tg(e)) {
    bt("An element must have a core reference and parameters set");
    return;
  }
  var a = r.group;
  if (a == null && (r.data && r.data.source != null && r.data.target != null ? a = "edges" : a = "nodes"), a !== "nodes" && a !== "edges") {
    bt("An element must be of type `nodes` or `edges`; you specified `" + a + "`");
    return;
  }
  this.length = 1, this[0] = this;
  var i = this._private = {
    cy: e,
    single: !0,
    // indicates this is an element
    data: r.data || {},
    // data object
    position: r.position || {
      x: 0,
      y: 0
    },
    // (x, y) position pair
    autoWidth: void 0,
    // width and height of nodes calculated by the renderer when set to special 'auto' value
    autoHeight: void 0,
    autoPadding: void 0,
    compoundBoundsClean: !1,
    // whether the compound dimensions need to be recalculated the next time dimensions are read
    listeners: [],
    // array of bound listeners
    group: a,
    // string; 'nodes' or 'edges'
    style: {},
    // properties as set by the style
    rstyle: {},
    // properties for style sent from the renderer to the core
    styleCxts: [],
    // applied style contexts from the styler
    styleKeys: {},
    // per-group keys of style property values
    removed: !0,
    // whether it's inside the vis; true if removed (set true here since we call restore)
    selected: !!r.selected,
    // whether it's selected
    selectable: r.selectable === void 0 ? !0 : !!r.selectable,
    // whether it's selectable
    locked: !!r.locked,
    // whether the element is locked (cannot be moved)
    grabbed: !1,
    // whether the element is grabbed by the mouse; renderer sets this privately
    grabbable: r.grabbable === void 0 ? !0 : !!r.grabbable,
    // whether the element can be grabbed
    pannable: r.pannable === void 0 ? a === "edges" : !!r.pannable,
    // whether the element has passthrough panning enabled
    active: !1,
    // whether the element is active from user interaction
    classes: new Fi(),
    // map ( className => true )
    animation: {
      // object for currently-running animations
      current: [],
      queue: []
    },
    rscratch: {},
    // object in which the renderer can store information
    scratch: r.scratch || {},
    // scratch objects
    edges: [],
    // array of connected edges
    children: [],
    // array of children
    parent: r.parent && r.parent.isNode() ? r.parent : null,
    // parent ref
    traversalCache: {},
    // cache of output of traversal functions
    backgrounding: !1,
    // whether background images are loading
    bbCache: null,
    // cache of the current bounding box
    bbCacheShift: {
      x: 0,
      y: 0
    },
    // shift applied to cached bb to be applied on next get
    bodyBounds: null,
    // bounds cache of element body, w/o overlay
    overlayBounds: null,
    // bounds cache of element body, including overlay
    labelBounds: {
      // bounds cache of labels
      all: null,
      source: null,
      target: null,
      main: null
    },
    arrowBounds: {
      // bounds cache of edge arrows
      source: null,
      target: null,
      "mid-source": null,
      "mid-target": null
    }
  };
  if (i.position.x == null && (i.position.x = 0), i.position.y == null && (i.position.y = 0), r.renderedPosition) {
    var o = r.renderedPosition, s = e.pan(), u = e.zoom();
    i.position = {
      x: (o.x - s.x) / u,
      y: (o.y - s.y) / u
    };
  }
  var l = [];
  lt(r.classes) ? l = r.classes : Me(r.classes) && (l = r.classes.split(/\s+/));
  for (var c = 0, d = l.length; c < d; c++) {
    var f = l[c];
    !f || f === "" || i.classes.add(f);
  }
  this.createEmitter();
  var h = r.style || r.css;
  h && (tt("Setting a `style` bypass at element creation should be done only when absolutely necessary.  Try to use the stylesheet instead."), this.style(h)), (n === void 0 || n) && this.restore();
}, jm = function(e) {
  return e = {
    bfs: e.bfs || !e.dfs,
    dfs: e.dfs || !e.bfs
  }, function(n, a, i) {
    var o;
    Xe(n) && !xr(n) && (o = n, n = o.roots || o.root, a = o.visit, i = o.directed), i = arguments.length === 2 && !yt(a) ? a : i, a = yt(a) ? a : function() {
    };
    for (var s = this._private.cy, u = n = Me(n) ? this.filter(n) : n, l = [], c = [], d = {}, f = {}, h = {}, v = 0, p, g = this.byGroup(), y = g.nodes, m = g.edges, b = 0; b < u.length; b++) {
      var w = u[b], x = w.id();
      w.isNode() && (l.unshift(w), e.bfs && (h[x] = !0, c.push(w)), f[x] = 0);
    }
    for (var E = function() {
      var D = e.bfs ? l.shift() : l.pop(), A = D.id();
      if (e.dfs) {
        if (h[A])
          return "continue";
        h[A] = !0, c.push(D);
      }
      var F = f[A], R = d[A], M = R != null ? R.source() : null, L = R != null ? R.target() : null, V = R == null ? void 0 : D.same(M) ? L[0] : M[0], Y = void 0;
      if (Y = a(D, R, V, v++, F), Y === !0)
        return p = D, "break";
      if (Y === !1)
        return "break";
      for (var H = D.connectedEdges().filter(function(z) {
        return (!i || z.source().same(D)) && m.has(z);
      }), K = 0; K < H.length; K++) {
        var ne = H[K], B = ne.connectedNodes().filter(function(z) {
          return !z.same(D) && y.has(z);
        }), $ = B.id();
        B.length !== 0 && !h[$] && (B = B[0], l.push(B), e.bfs && (h[$] = !0, c.push(B)), d[$] = ne, f[$] = f[A] + 1);
      }
    }; l.length !== 0; ) {
      var C = E();
      if (C !== "continue" && C === "break")
        break;
    }
    for (var k = s.collection(), S = 0; S < c.length; S++) {
      var _ = c[S], T = d[_.id()];
      T != null && k.push(T), k.push(_);
    }
    return {
      path: s.collection(k),
      found: s.collection(p)
    };
  };
}, Lo = {
  breadthFirstSearch: jm({
    bfs: !0
  }),
  depthFirstSearch: jm({
    dfs: !0
  })
};
Lo.bfs = Lo.breadthFirstSearch;
Lo.dfs = Lo.depthFirstSearch;
var E$ = TB(function(t, e) {
  (function() {
    var r, n, a, i, o, s, u, l, c, d, f, h, v, p, g;
    a = Math.floor, d = Math.min, n = function(y, m) {
      return y < m ? -1 : y > m ? 1 : 0;
    }, c = function(y, m, b, w, x) {
      var E;
      if (b == null && (b = 0), x == null && (x = n), b < 0)
        throw new Error("lo must be non-negative");
      for (w == null && (w = y.length); b < w; )
        E = a((b + w) / 2), x(m, y[E]) < 0 ? w = E : b = E + 1;
      return [].splice.apply(y, [b, b - b].concat(m)), m;
    }, s = function(y, m, b) {
      return b == null && (b = n), y.push(m), p(y, 0, y.length - 1, b);
    }, o = function(y, m) {
      var b, w;
      return m == null && (m = n), b = y.pop(), y.length ? (w = y[0], y[0] = b, g(y, 0, m)) : w = b, w;
    }, l = function(y, m, b) {
      var w;
      return b == null && (b = n), w = y[0], y[0] = m, g(y, 0, b), w;
    }, u = function(y, m, b) {
      var w;
      return b == null && (b = n), y.length && b(y[0], m) < 0 && (w = [y[0], m], m = w[0], y[0] = w[1], g(y, 0, b)), m;
    }, i = function(y, m) {
      var b, w, x, E, C, k;
      for (m == null && (m = n), E = (function() {
        k = [];
        for (var S = 0, _ = a(y.length / 2); 0 <= _ ? S < _ : S > _; 0 <= _ ? S++ : S--)
          k.push(S);
        return k;
      }).apply(this).reverse(), C = [], w = 0, x = E.length; w < x; w++)
        b = E[w], C.push(g(y, b, m));
      return C;
    }, v = function(y, m, b) {
      var w;
      if (b == null && (b = n), w = y.indexOf(m), w !== -1)
        return p(y, 0, w, b), g(y, w, b);
    }, f = function(y, m, b) {
      var w, x, E, C, k;
      if (b == null && (b = n), x = y.slice(0, m), !x.length)
        return x;
      for (i(x, b), k = y.slice(m), E = 0, C = k.length; E < C; E++)
        w = k[E], u(x, w, b);
      return x.sort(b).reverse();
    }, h = function(y, m, b) {
      var w, x, E, C, k, S, _, T, O;
      if (b == null && (b = n), m * 10 <= y.length) {
        if (E = y.slice(0, m).sort(b), !E.length)
          return E;
        for (x = E[E.length - 1], _ = y.slice(m), C = 0, S = _.length; C < S; C++)
          w = _[C], b(w, x) < 0 && (c(E, w, 0, null, b), E.pop(), x = E[E.length - 1]);
        return E;
      }
      for (i(y, b), O = [], k = 0, T = d(m, y.length); 0 <= T ? k < T : k > T; 0 <= T ? ++k : --k)
        O.push(o(y, b));
      return O;
    }, p = function(y, m, b, w) {
      var x, E, C;
      for (w == null && (w = n), x = y[b]; b > m; ) {
        if (C = b - 1 >> 1, E = y[C], w(x, E) < 0) {
          y[b] = E, b = C;
          continue;
        }
        break;
      }
      return y[b] = x;
    }, g = function(y, m, b) {
      var w, x, E, C, k;
      for (b == null && (b = n), x = y.length, k = m, E = y[m], w = 2 * m + 1; w < x; )
        C = w + 1, C < x && !(b(y[w], y[C]) < 0) && (w = C), y[m] = y[w], m = w, w = 2 * m + 1;
      return y[m] = E, p(y, k, m, b);
    }, r = function() {
      y.push = s, y.pop = o, y.replace = l, y.pushpop = u, y.heapify = i, y.updateItem = v, y.nlargest = f, y.nsmallest = h;
      function y(m) {
        this.cmp = m ?? n, this.nodes = [];
      }
      return y.prototype.push = function(m) {
        return s(this.nodes, m, this.cmp);
      }, y.prototype.pop = function() {
        return o(this.nodes, this.cmp);
      }, y.prototype.peek = function() {
        return this.nodes[0];
      }, y.prototype.contains = function(m) {
        return this.nodes.indexOf(m) !== -1;
      }, y.prototype.replace = function(m) {
        return l(this.nodes, m, this.cmp);
      }, y.prototype.pushpop = function(m) {
        return u(this.nodes, m, this.cmp);
      }, y.prototype.heapify = function() {
        return i(this.nodes, this.cmp);
      }, y.prototype.updateItem = function(m) {
        return v(this.nodes, m, this.cmp);
      }, y.prototype.clear = function() {
        return this.nodes = [];
      }, y.prototype.empty = function() {
        return this.nodes.length === 0;
      }, y.prototype.size = function() {
        return this.nodes.length;
      }, y.prototype.clone = function() {
        var m;
        return m = new y(), m.nodes = this.nodes.slice(0), m;
      }, y.prototype.toArray = function() {
        return this.nodes.slice(0);
      }, y.prototype.insert = y.prototype.push, y.prototype.top = y.prototype.peek, y.prototype.front = y.prototype.peek, y.prototype.has = y.prototype.contains, y.prototype.copy = y.prototype.clone, y;
    }(), function(y, m) {
      return t.exports = m();
    }(this, function() {
      return r;
    });
  }).call(lo);
}), as = E$, S$ = Zt({
  root: null,
  weight: function(e) {
    return 1;
  },
  directed: !1
}), k$ = {
  dijkstra: function(e) {
    if (!Xe(e)) {
      var r = arguments;
      e = {
        root: r[0],
        weight: r[1],
        directed: r[2]
      };
    }
    var n = S$(e), a = n.root, i = n.weight, o = n.directed, s = this, u = i, l = Me(a) ? this.filter(a)[0] : a[0], c = {}, d = {}, f = {}, h = this.byGroup(), v = h.nodes, p = h.edges;
    p.unmergeBy(function(F) {
      return F.isLoop();
    });
    for (var g = function(R) {
      return c[R.id()];
    }, y = function(R, M) {
      c[R.id()] = M, m.updateItem(R);
    }, m = new as(function(F, R) {
      return g(F) - g(R);
    }), b = 0; b < v.length; b++) {
      var w = v[b];
      c[w.id()] = w.same(l) ? 0 : 1 / 0, m.push(w);
    }
    for (var x = function(R, M) {
      for (var L = (o ? R.edgesTo(M) : R.edgesWith(M)).intersect(p), V = 1 / 0, Y, H = 0; H < L.length; H++) {
        var K = L[H], ne = u(K);
        (ne < V || !Y) && (V = ne, Y = K);
      }
      return {
        edge: Y,
        dist: V
      };
    }; m.size() > 0; ) {
      var E = m.pop(), C = g(E), k = E.id();
      if (f[k] = C, C !== 1 / 0)
        for (var S = E.neighborhood().intersect(v), _ = 0; _ < S.length; _++) {
          var T = S[_], O = T.id(), D = x(E, T), A = C + D.dist;
          A < g(T) && (y(T, A), d[O] = {
            node: E,
            edge: D.edge
          });
        }
    }
    return {
      distanceTo: function(R) {
        var M = Me(R) ? v.filter(R)[0] : R[0];
        return f[M.id()];
      },
      pathTo: function(R) {
        var M = Me(R) ? v.filter(R)[0] : R[0], L = [], V = M, Y = V.id();
        if (M.length > 0)
          for (L.unshift(M); d[Y]; ) {
            var H = d[Y];
            L.unshift(H.edge), L.unshift(H.node), V = H.node, Y = V.id();
          }
        return s.spawn(L);
      }
    };
  }
}, _$ = {
  // kruskal's algorithm (finds min spanning tree, assuming undirected graph)
  // implemented from pseudocode from wikipedia
  kruskal: function(e) {
    e = e || function(b) {
      return 1;
    };
    for (var r = this.byGroup(), n = r.nodes, a = r.edges, i = n.length, o = new Array(i), s = n, u = function(w) {
      for (var x = 0; x < o.length; x++) {
        var E = o[x];
        if (E.has(w))
          return x;
      }
    }, l = 0; l < i; l++)
      o[l] = this.spawn(n[l]);
    for (var c = a.sort(function(b, w) {
      return e(b) - e(w);
    }), d = 0; d < c.length; d++) {
      var f = c[d], h = f.source()[0], v = f.target()[0], p = u(h), g = u(v), y = o[p], m = o[g];
      p !== g && (s.merge(f), y.merge(m), o.splice(g, 1));
    }
    return s;
  }
}, T$ = Zt({
  root: null,
  goal: null,
  weight: function(e) {
    return 1;
  },
  heuristic: function(e) {
    return 0;
  },
  directed: !1
}), I$ = {
  // Implemented from pseudocode from wikipedia
  aStar: function(e) {
    var r = this.cy(), n = T$(e), a = n.root, i = n.goal, o = n.heuristic, s = n.directed, u = n.weight;
    a = r.collection(a)[0], i = r.collection(i)[0];
    var l = a.id(), c = i.id(), d = {}, f = {}, h = {}, v = new as(function(Y, H) {
      return f[Y.id()] - f[H.id()];
    }), p = new Fi(), g = {}, y = {}, m = function(H, K) {
      v.push(H), p.add(K);
    }, b, w, x = function() {
      b = v.pop(), w = b.id(), p.delete(w);
    }, E = function(H) {
      return p.has(H);
    };
    m(a, l), d[l] = 0, f[l] = o(a);
    for (var C = 0; v.size() > 0; ) {
      if (x(), C++, w === c) {
        for (var k = [], S = i, _ = c, T = y[_]; k.unshift(S), T != null && k.unshift(T), S = g[_], S != null; )
          _ = S.id(), T = y[_];
        return {
          found: !0,
          distance: d[w],
          path: this.spawn(k),
          steps: C
        };
      }
      h[w] = !0;
      for (var O = b._private.edges, D = 0; D < O.length; D++) {
        var A = O[D];
        if (this.hasElementWithId(A.id()) && !(s && A.data("source") !== w)) {
          var F = A.source(), R = A.target(), M = F.id() !== w ? F : R, L = M.id();
          if (this.hasElementWithId(L) && !h[L]) {
            var V = d[w] + u(A);
            if (!E(L)) {
              d[L] = V, f[L] = V + o(M), m(M, L), g[L] = b, y[L] = A;
              continue;
            }
            V < d[L] && (d[L] = V, f[L] = V + o(M), g[L] = b, y[L] = A);
          }
        }
      }
    }
    return {
      found: !1,
      distance: void 0,
      path: void 0,
      steps: C
    };
  }
}, O$ = Zt({
  weight: function(e) {
    return 1;
  },
  directed: !1
}), A$ = {
  // Implemented from pseudocode from wikipedia
  floydWarshall: function(e) {
    for (var r = this.cy(), n = O$(e), a = n.weight, i = n.directed, o = a, s = this.byGroup(), u = s.nodes, l = s.edges, c = u.length, d = c * c, f = function(ne) {
      return u.indexOf(ne);
    }, h = function(ne) {
      return u[ne];
    }, v = new Array(d), p = 0; p < d; p++) {
      var g = p % c, y = (p - g) / c;
      y === g ? v[p] = 0 : v[p] = 1 / 0;
    }
    for (var m = new Array(d), b = new Array(d), w = 0; w < l.length; w++) {
      var x = l[w], E = x.source()[0], C = x.target()[0];
      if (E !== C) {
        var k = f(E), S = f(C), _ = k * c + S, T = o(x);
        if (v[_] > T && (v[_] = T, m[_] = S, b[_] = x), !i) {
          var O = S * c + k;
          !i && v[O] > T && (v[O] = T, m[O] = k, b[O] = x);
        }
      }
    }
    for (var D = 0; D < c; D++)
      for (var A = 0; A < c; A++)
        for (var F = A * c + D, R = 0; R < c; R++) {
          var M = A * c + R, L = D * c + R;
          v[F] + v[L] < v[M] && (v[M] = v[F] + v[L], m[M] = m[F]);
        }
    var V = function(ne) {
      return (Me(ne) ? r.filter(ne) : ne)[0];
    }, Y = function(ne) {
      return f(V(ne));
    }, H = {
      distance: function(ne, B) {
        var $ = Y(ne), z = Y(B);
        return v[$ * c + z];
      },
      path: function(ne, B) {
        var $ = Y(ne), z = Y(B), W = h($);
        if ($ === z)
          return W.collection();
        if (m[$ * c + z] == null)
          return r.collection();
        var Z = r.collection(), N = $, X;
        for (Z.merge(W); $ !== z; )
          N = $, $ = m[$ * c + z], X = b[N * c + $], Z.merge(X), Z.merge(h($));
        return Z;
      }
    };
    return H;
  }
  // floydWarshall
}, P$ = Zt({
  weight: function(e) {
    return 1;
  },
  directed: !1,
  root: null
}), D$ = {
  // Implemented from pseudocode from wikipedia
  bellmanFord: function(e) {
    var r = this, n = P$(e), a = n.weight, i = n.directed, o = n.root, s = a, u = this, l = this.cy(), c = this.byGroup(), d = c.edges, f = c.nodes, h = f.length, v = new nn(), p = !1, g = [];
    o = l.collection(o)[0], d.unmergeBy(function(ve) {
      return ve.isLoop();
    });
    for (var y = d.length, m = function(xe) {
      var _e = v.get(xe.id());
      return _e || (_e = {}, v.set(xe.id(), _e)), _e;
    }, b = function(xe) {
      return (Me(xe) ? l.$(xe) : xe)[0];
    }, w = function(xe) {
      return m(b(xe)).dist;
    }, x = function(xe) {
      for (var _e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : o, He = b(xe), Ve = [], De = He; ; ) {
        if (De == null)
          return r.spawn();
        var Ne = m(De), ue = Ne.edge, I = Ne.pred;
        if (Ve.unshift(De[0]), De.same(_e) && Ve.length > 0)
          break;
        ue != null && Ve.unshift(ue), De = I;
      }
      return u.spawn(Ve);
    }, E = 0; E < h; E++) {
      var C = f[E], k = m(C);
      C.same(o) ? k.dist = 0 : k.dist = 1 / 0, k.pred = null, k.edge = null;
    }
    for (var S = !1, _ = function(xe, _e, He, Ve, De, Ne) {
      var ue = Ve.dist + Ne;
      ue < De.dist && !He.same(Ve.edge) && (De.dist = ue, De.pred = xe, De.edge = He, S = !0);
    }, T = 1; T < h; T++) {
      S = !1;
      for (var O = 0; O < y; O++) {
        var D = d[O], A = D.source(), F = D.target(), R = s(D), M = m(A), L = m(F);
        _(A, F, D, M, L, R), i || _(F, A, D, L, M, R);
      }
      if (!S)
        break;
    }
    if (S)
      for (var V = [], Y = 0; Y < y; Y++) {
        var H = d[Y], K = H.source(), ne = H.target(), B = s(H), $ = m(K).dist, z = m(ne).dist;
        if ($ + B < z || !i && z + B < $)
          if (p || (tt("Graph contains a negative weight cycle for Bellman-Ford"), p = !0), e.findNegativeWeightCycles !== !1) {
            var W = [];
            $ + B < z && W.push(K), !i && z + B < $ && W.push(ne);
            for (var Z = W.length, N = 0; N < Z; N++) {
              var X = W[N], Q = [X];
              Q.push(m(X).edge);
              for (var ge = m(X).pred; Q.indexOf(ge) === -1; )
                Q.push(ge), Q.push(m(ge).edge), ge = m(ge).pred;
              Q = Q.slice(Q.indexOf(ge));
              for (var we = Q[0].id(), fe = 0, ce = 2; ce < Q.length; ce += 2)
                Q[ce].id() < we && (we = Q[ce].id(), fe = ce);
              Q = Q.slice(fe).concat(Q.slice(0, fe)), Q.push(Q[0]);
              var be = Q.map(function(ve) {
                return ve.id();
              }).join(",");
              V.indexOf(be) === -1 && (g.push(u.spawn(Q)), V.push(be));
            }
          } else
            break;
      }
    return {
      distanceTo: w,
      pathTo: x,
      hasNegativeWeightCycle: p,
      negativeWeightCycles: g
    };
  }
  // bellmanFord
}, R$ = Math.sqrt(2), L$ = function(e, r, n) {
  n.length === 0 && bt("Karger-Stein must be run on a connected (sub)graph");
  for (var a = n[e], i = a[1], o = a[2], s = r[i], u = r[o], l = n, c = l.length - 1; c >= 0; c--) {
    var d = l[c], f = d[1], h = d[2];
    (r[f] === s && r[h] === u || r[f] === u && r[h] === s) && l.splice(c, 1);
  }
  for (var v = 0; v < l.length; v++) {
    var p = l[v];
    p[1] === u ? (l[v] = p.slice(), l[v][1] = s) : p[2] === u && (l[v] = p.slice(), l[v][2] = s);
  }
  for (var g = 0; g < r.length; g++)
    r[g] === u && (r[g] = s);
  return l;
}, Du = function(e, r, n, a) {
  for (; n > a; ) {
    var i = Math.floor(Math.random() * r.length);
    r = L$(i, e, r), n--;
  }
  return r;
}, F$ = {
  // Computes the minimum cut of an undirected graph
  // Returns the correct answer with high probability
  kargerStein: function() {
    var e = this, r = this.byGroup(), n = r.nodes, a = r.edges;
    a.unmergeBy(function(L) {
      return L.isLoop();
    });
    var i = n.length, o = a.length, s = Math.ceil(Math.pow(Math.log(i) / Math.LN2, 2)), u = Math.floor(i / R$);
    if (i < 2) {
      bt("At least 2 nodes are required for Karger-Stein algorithm");
      return;
    }
    for (var l = [], c = 0; c < o; c++) {
      var d = a[c];
      l.push([c, n.indexOf(d.source()), n.indexOf(d.target())]);
    }
    for (var f = 1 / 0, h = [], v = new Array(i), p = new Array(i), g = new Array(i), y = function(V, Y) {
      for (var H = 0; H < i; H++)
        Y[H] = V[H];
    }, m = 0; m <= s; m++) {
      for (var b = 0; b < i; b++)
        p[b] = b;
      var w = Du(p, l.slice(), i, u), x = w.slice();
      y(p, g);
      var E = Du(p, w, u, 2), C = Du(g, x, u, 2);
      E.length <= C.length && E.length < f ? (f = E.length, h = E, y(p, v)) : C.length <= E.length && C.length < f && (f = C.length, h = C, y(g, v));
    }
    for (var k = this.spawn(h.map(function(L) {
      return a[L[0]];
    })), S = this.spawn(), _ = this.spawn(), T = v[0], O = 0; O < v.length; O++) {
      var D = v[O], A = n[O];
      D === T ? S.merge(A) : _.merge(A);
    }
    var F = function(V) {
      var Y = e.spawn();
      return V.forEach(function(H) {
        Y.merge(H), H.connectedEdges().forEach(function(K) {
          e.contains(K) && !k.contains(K) && Y.merge(K);
        });
      }), Y;
    }, R = [F(S), F(_)], M = {
      cut: k,
      components: R,
      // n.b. partitions are included to be compatible with the old api spec
      // (could be removed in a future major version)
      partition1: S,
      partition2: _
    };
    return M;
  }
}, M$ = function(e) {
  return {
    x: e.x,
    y: e.y
  };
}, Nl = function(e, r, n) {
  return {
    x: e.x * r + n.x,
    y: e.y * r + n.y
  };
}, pS = function(e, r, n) {
  return {
    x: (e.x - n.x) / r,
    y: (e.y - n.y) / r
  };
}, ui = function(e) {
  return {
    x: e[0],
    y: e[1]
  };
}, N$ = function(e) {
  for (var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : e.length, a = 1 / 0, i = r; i < n; i++) {
    var o = e[i];
    isFinite(o) && (a = Math.min(o, a));
  }
  return a;
}, B$ = function(e) {
  for (var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : e.length, a = -1 / 0, i = r; i < n; i++) {
    var o = e[i];
    isFinite(o) && (a = Math.max(o, a));
  }
  return a;
}, $$ = function(e) {
  for (var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : e.length, a = 0, i = 0, o = r; o < n; o++) {
    var s = e[o];
    isFinite(s) && (a += s, i++);
  }
  return a / i;
}, q$ = function(e) {
  var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : e.length, a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !0, i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, o = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : !0;
  a ? e = e.slice(r, n) : (n < e.length && e.splice(n, e.length - n), r > 0 && e.splice(0, r));
  for (var s = 0, u = e.length - 1; u >= 0; u--) {
    var l = e[u];
    o ? isFinite(l) || (e[u] = -1 / 0, s++) : e.splice(u, 1);
  }
  i && e.sort(function(f, h) {
    return f - h;
  });
  var c = e.length, d = Math.floor(c / 2);
  return c % 2 !== 0 ? e[d + 1 + s] : (e[d - 1 + s] + e[d + s]) / 2;
}, z$ = function(e) {
  return Math.PI * e / 180;
}, _s = function(e, r) {
  return Math.atan2(r, e) - Math.PI / 2;
}, Dg = Math.log2 || function(t) {
  return Math.log(t) / Math.log(2);
}, gS = function(e) {
  return e > 0 ? 1 : e < 0 ? -1 : 0;
}, Da = function(e, r) {
  return Math.sqrt(pa(e, r));
}, pa = function(e, r) {
  var n = r.x - e.x, a = r.y - e.y;
  return n * n + a * a;
}, V$ = function(e) {
  for (var r = e.length, n = 0, a = 0; a < r; a++)
    n += e[a];
  for (var i = 0; i < r; i++)
    e[i] = e[i] / n;
  return e;
}, zt = function(e, r, n, a) {
  return (1 - a) * (1 - a) * e + 2 * (1 - a) * a * r + a * a * n;
}, vi = function(e, r, n, a) {
  return {
    x: zt(e.x, r.x, n.x, a),
    y: zt(e.y, r.y, n.y, a)
  };
}, H$ = function(e, r, n, a) {
  var i = {
    x: r.x - e.x,
    y: r.y - e.y
  }, o = Da(e, r), s = {
    x: i.x / o,
    y: i.y / o
  };
  return n = n ?? 0, a = a ?? n * o, {
    x: e.x + s.x * a,
    y: e.y + s.y * a
  };
}, Fo = function(e, r, n) {
  return Math.max(e, Math.min(n, r));
}, br = function(e) {
  if (e == null)
    return {
      x1: 1 / 0,
      y1: 1 / 0,
      x2: -1 / 0,
      y2: -1 / 0,
      w: 0,
      h: 0
    };
  if (e.x1 != null && e.y1 != null) {
    if (e.x2 != null && e.y2 != null && e.x2 >= e.x1 && e.y2 >= e.y1)
      return {
        x1: e.x1,
        y1: e.y1,
        x2: e.x2,
        y2: e.y2,
        w: e.x2 - e.x1,
        h: e.y2 - e.y1
      };
    if (e.w != null && e.h != null && e.w >= 0 && e.h >= 0)
      return {
        x1: e.x1,
        y1: e.y1,
        x2: e.x1 + e.w,
        y2: e.y1 + e.h,
        w: e.w,
        h: e.h
      };
  }
}, K$ = function(e) {
  return {
    x1: e.x1,
    x2: e.x2,
    w: e.w,
    y1: e.y1,
    y2: e.y2,
    h: e.h
  };
}, G$ = function(e) {
  e.x1 = 1 / 0, e.y1 = 1 / 0, e.x2 = -1 / 0, e.y2 = -1 / 0, e.w = 0, e.h = 0;
}, U$ = function(e, r, n) {
  return {
    x1: e.x1 + r,
    x2: e.x2 + r,
    y1: e.y1 + n,
    y2: e.y2 + n,
    w: e.w,
    h: e.h
  };
}, yS = function(e, r) {
  e.x1 = Math.min(e.x1, r.x1), e.x2 = Math.max(e.x2, r.x2), e.w = e.x2 - e.x1, e.y1 = Math.min(e.y1, r.y1), e.y2 = Math.max(e.y2, r.y2), e.h = e.y2 - e.y1;
}, W$ = function(e, r, n) {
  e.x1 = Math.min(e.x1, r), e.x2 = Math.max(e.x2, r), e.w = e.x2 - e.x1, e.y1 = Math.min(e.y1, n), e.y2 = Math.max(e.y2, n), e.h = e.y2 - e.y1;
}, Vs = function(e) {
  var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
  return e.x1 -= r, e.x2 += r, e.y1 -= r, e.y2 += r, e.w = e.x2 - e.x1, e.h = e.y2 - e.y1, e;
}, Hs = function(e) {
  var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [0], n, a, i, o;
  if (r.length === 1)
    n = a = i = o = r[0];
  else if (r.length === 2)
    n = i = r[0], o = a = r[1];
  else if (r.length === 4) {
    var s = Vr(r, 4);
    n = s[0], a = s[1], i = s[2], o = s[3];
  }
  return e.x1 -= o, e.x2 += a, e.y1 -= n, e.y2 += i, e.w = e.x2 - e.x1, e.h = e.y2 - e.y1, e;
}, Ym = function(e, r) {
  e.x1 = r.x1, e.y1 = r.y1, e.x2 = r.x2, e.y2 = r.y2, e.w = e.x2 - e.x1, e.h = e.y2 - e.y1;
}, Rg = function(e, r) {
  return !(e.x1 > r.x2 || r.x1 > e.x2 || e.x2 < r.x1 || r.x2 < e.x1 || e.y2 < r.y1 || r.y2 < e.y1 || e.y1 > r.y2 || r.y1 > e.y2);
}, Ti = function(e, r, n) {
  return e.x1 <= r && r <= e.x2 && e.y1 <= n && n <= e.y2;
}, j$ = function(e, r) {
  return Ti(e, r.x, r.y);
}, mS = function(e, r) {
  return Ti(e, r.x1, r.y1) && Ti(e, r.x2, r.y2);
}, bS = function(e, r, n, a, i, o, s) {
  var u = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : "auto", l = u === "auto" ? Ra(i, o) : u, c = i / 2, d = o / 2;
  l = Math.min(l, c, d);
  var f = l !== c, h = l !== d, v;
  if (f) {
    var p = n - c + l - s, g = a - d - s, y = n + c - l + s, m = g;
    if (v = jn(e, r, n, a, p, g, y, m, !1), v.length > 0)
      return v;
  }
  if (h) {
    var b = n + c + s, w = a - d + l - s, x = b, E = a + d - l + s;
    if (v = jn(e, r, n, a, b, w, x, E, !1), v.length > 0)
      return v;
  }
  if (f) {
    var C = n - c + l - s, k = a + d + s, S = n + c - l + s, _ = k;
    if (v = jn(e, r, n, a, C, k, S, _, !1), v.length > 0)
      return v;
  }
  if (h) {
    var T = n - c - s, O = a - d + l - s, D = T, A = a + d - l + s;
    if (v = jn(e, r, n, a, T, O, D, A, !1), v.length > 0)
      return v;
  }
  var F;
  {
    var R = n - c + l, M = a - d + l;
    if (F = co(e, r, n, a, R, M, l + s), F.length > 0 && F[0] <= R && F[1] <= M)
      return [F[0], F[1]];
  }
  {
    var L = n + c - l, V = a - d + l;
    if (F = co(e, r, n, a, L, V, l + s), F.length > 0 && F[0] >= L && F[1] <= V)
      return [F[0], F[1]];
  }
  {
    var Y = n + c - l, H = a + d - l;
    if (F = co(e, r, n, a, Y, H, l + s), F.length > 0 && F[0] >= Y && F[1] >= H)
      return [F[0], F[1]];
  }
  {
    var K = n - c + l, ne = a + d - l;
    if (F = co(e, r, n, a, K, ne, l + s), F.length > 0 && F[0] <= K && F[1] >= ne)
      return [F[0], F[1]];
  }
  return [];
}, Y$ = function(e, r, n, a, i, o, s) {
  var u = s, l = Math.min(n, i), c = Math.max(n, i), d = Math.min(a, o), f = Math.max(a, o);
  return l - u <= e && e <= c + u && d - u <= r && r <= f + u;
}, Z$ = function(e, r, n, a, i, o, s, u, l) {
  var c = {
    x1: Math.min(n, s, i) - l,
    x2: Math.max(n, s, i) + l,
    y1: Math.min(a, u, o) - l,
    y2: Math.max(a, u, o) + l
  };
  return !(e < c.x1 || e > c.x2 || r < c.y1 || r > c.y2);
}, X$ = function(e, r, n, a) {
  n -= a;
  var i = r * r - 4 * e * n;
  if (i < 0)
    return [];
  var o = Math.sqrt(i), s = 2 * e, u = (-r + o) / s, l = (-r - o) / s;
  return [u, l];
}, J$ = function(e, r, n, a, i) {
  var o = 1e-5;
  e === 0 && (e = o), r /= e, n /= e, a /= e;
  var s, u, l, c, d, f, h, v;
  if (u = (3 * n - r * r) / 9, l = -(27 * a) + r * (9 * n - 2 * (r * r)), l /= 54, s = u * u * u + l * l, i[1] = 0, h = r / 3, s > 0) {
    d = l + Math.sqrt(s), d = d < 0 ? -Math.pow(-d, 1 / 3) : Math.pow(d, 1 / 3), f = l - Math.sqrt(s), f = f < 0 ? -Math.pow(-f, 1 / 3) : Math.pow(f, 1 / 3), i[0] = -h + d + f, h += (d + f) / 2, i[4] = i[2] = -h, h = Math.sqrt(3) * (-f + d) / 2, i[3] = h, i[5] = -h;
    return;
  }
  if (i[5] = i[3] = 0, s === 0) {
    v = l < 0 ? -Math.pow(-l, 1 / 3) : Math.pow(l, 1 / 3), i[0] = -h + 2 * v, i[4] = i[2] = -(v + h);
    return;
  }
  u = -u, c = u * u * u, c = Math.acos(l / Math.sqrt(c)), v = 2 * Math.sqrt(u), i[0] = -h + v * Math.cos(c / 3), i[2] = -h + v * Math.cos((c + 2 * Math.PI) / 3), i[4] = -h + v * Math.cos((c + 4 * Math.PI) / 3);
}, Q$ = function(e, r, n, a, i, o, s, u) {
  var l = 1 * n * n - 4 * n * i + 2 * n * s + 4 * i * i - 4 * i * s + s * s + a * a - 4 * a * o + 2 * a * u + 4 * o * o - 4 * o * u + u * u, c = 1 * 9 * n * i - 3 * n * n - 3 * n * s - 6 * i * i + 3 * i * s + 9 * a * o - 3 * a * a - 3 * a * u - 6 * o * o + 3 * o * u, d = 1 * 3 * n * n - 6 * n * i + n * s - n * e + 2 * i * i + 2 * i * e - s * e + 3 * a * a - 6 * a * o + a * u - a * r + 2 * o * o + 2 * o * r - u * r, f = 1 * n * i - n * n + n * e - i * e + a * o - a * a + a * r - o * r, h = [];
  J$(l, c, d, f, h);
  for (var v = 1e-7, p = [], g = 0; g < 6; g += 2)
    Math.abs(h[g + 1]) < v && h[g] >= 0 && h[g] <= 1 && p.push(h[g]);
  p.push(1), p.push(0);
  for (var y = -1, m, b, w, x = 0; x < p.length; x++)
    m = Math.pow(1 - p[x], 2) * n + 2 * (1 - p[x]) * p[x] * i + p[x] * p[x] * s, b = Math.pow(1 - p[x], 2) * a + 2 * (1 - p[x]) * p[x] * o + p[x] * p[x] * u, w = Math.pow(m - e, 2) + Math.pow(b - r, 2), y >= 0 ? w < y && (y = w) : y = w;
  return y;
}, eq = function(e, r, n, a, i, o) {
  var s = [e - n, r - a], u = [i - n, o - a], l = u[0] * u[0] + u[1] * u[1], c = s[0] * s[0] + s[1] * s[1], d = s[0] * u[0] + s[1] * u[1], f = d * d / l;
  return d < 0 ? c : f > l ? (e - i) * (e - i) + (r - o) * (r - o) : c - f;
}, vr = function(e, r, n) {
  for (var a, i, o, s, u, l = 0, c = 0; c < n.length / 2; c++)
    if (a = n[c * 2], i = n[c * 2 + 1], c + 1 < n.length / 2 ? (o = n[(c + 1) * 2], s = n[(c + 1) * 2 + 1]) : (o = n[(c + 1 - n.length / 2) * 2], s = n[(c + 1 - n.length / 2) * 2 + 1]), !(a == e && o == e)) if (a >= e && e >= o || a <= e && e <= o)
      u = (e - a) / (o - a) * (s - i) + i, u > r && l++;
    else
      continue;
  return l % 2 !== 0;
}, _n = function(e, r, n, a, i, o, s, u, l) {
  var c = new Array(n.length), d;
  u[0] != null ? (d = Math.atan(u[1] / u[0]), u[0] < 0 ? d = d + Math.PI / 2 : d = -d - Math.PI / 2) : d = u;
  for (var f = Math.cos(-d), h = Math.sin(-d), v = 0; v < c.length / 2; v++)
    c[v * 2] = o / 2 * (n[v * 2] * f - n[v * 2 + 1] * h), c[v * 2 + 1] = s / 2 * (n[v * 2 + 1] * f + n[v * 2] * h), c[v * 2] += a, c[v * 2 + 1] += i;
  var p;
  if (l > 0) {
    var g = dl(c, -l);
    p = cl(g);
  } else
    p = c;
  return vr(e, r, p);
}, tq = function(e, r, n, a, i, o, s, u) {
  for (var l = new Array(n.length * 2), c = 0; c < u.length; c++) {
    var d = u[c];
    l[c * 4 + 0] = d.startX, l[c * 4 + 1] = d.startY, l[c * 4 + 2] = d.stopX, l[c * 4 + 3] = d.stopY;
    var f = Math.pow(d.cx - e, 2) + Math.pow(d.cy - r, 2);
    if (f <= Math.pow(d.radius, 2))
      return !0;
  }
  return vr(e, r, l);
}, cl = function(e) {
  for (var r = new Array(e.length / 2), n, a, i, o, s, u, l, c, d = 0; d < e.length / 4; d++) {
    n = e[d * 4], a = e[d * 4 + 1], i = e[d * 4 + 2], o = e[d * 4 + 3], d < e.length / 4 - 1 ? (s = e[(d + 1) * 4], u = e[(d + 1) * 4 + 1], l = e[(d + 1) * 4 + 2], c = e[(d + 1) * 4 + 3]) : (s = e[0], u = e[1], l = e[2], c = e[3]);
    var f = jn(n, a, i, o, s, u, l, c, !0);
    r[d * 2] = f[0], r[d * 2 + 1] = f[1];
  }
  return r;
}, dl = function(e, r) {
  for (var n = new Array(e.length * 2), a, i, o, s, u = 0; u < e.length / 2; u++) {
    a = e[u * 2], i = e[u * 2 + 1], u < e.length / 2 - 1 ? (o = e[(u + 1) * 2], s = e[(u + 1) * 2 + 1]) : (o = e[0], s = e[1]);
    var l = s - i, c = -(o - a), d = Math.sqrt(l * l + c * c), f = l / d, h = c / d;
    n[u * 4] = a + f * r, n[u * 4 + 1] = i + h * r, n[u * 4 + 2] = o + f * r, n[u * 4 + 3] = s + h * r;
  }
  return n;
}, rq = function(e, r, n, a, i, o) {
  var s = n - e, u = a - r;
  s /= i, u /= o;
  var l = Math.sqrt(s * s + u * u), c = l - 1;
  if (c < 0)
    return [];
  var d = c / l;
  return [(n - e) * d + e, (a - r) * d + r];
}, xa = function(e, r, n, a, i, o, s) {
  return e -= i, r -= o, e /= n / 2 + s, r /= a / 2 + s, e * e + r * r <= 1;
}, co = function(e, r, n, a, i, o, s) {
  var u = [n - e, a - r], l = [e - i, r - o], c = u[0] * u[0] + u[1] * u[1], d = 2 * (l[0] * u[0] + l[1] * u[1]), f = l[0] * l[0] + l[1] * l[1] - s * s, h = d * d - 4 * c * f;
  if (h < 0)
    return [];
  var v = (-d + Math.sqrt(h)) / (2 * c), p = (-d - Math.sqrt(h)) / (2 * c), g = Math.min(v, p), y = Math.max(v, p), m = [];
  if (g >= 0 && g <= 1 && m.push(g), y >= 0 && y <= 1 && m.push(y), m.length === 0)
    return [];
  var b = m[0] * u[0] + e, w = m[0] * u[1] + r;
  if (m.length > 1) {
    if (m[0] == m[1])
      return [b, w];
    var x = m[1] * u[0] + e, E = m[1] * u[1] + r;
    return [b, w, x, E];
  } else
    return [b, w];
}, Ru = function(e, r, n) {
  return r <= e && e <= n || n <= e && e <= r ? e : e <= r && r <= n || n <= r && r <= e ? r : n;
}, jn = function(e, r, n, a, i, o, s, u, l) {
  var c = e - i, d = n - e, f = s - i, h = r - o, v = a - r, p = u - o, g = f * h - p * c, y = d * h - v * c, m = p * d - f * v;
  if (m !== 0) {
    var b = g / m, w = y / m, x = 1e-3, E = 0 - x, C = 1 + x;
    return E <= b && b <= C && E <= w && w <= C ? [e + b * d, r + b * v] : l ? [e + b * d, r + b * v] : [];
  } else
    return g === 0 || y === 0 ? Ru(e, n, s) === s ? [s, u] : Ru(e, n, i) === i ? [i, o] : Ru(i, s, n) === n ? [n, a] : [] : [];
}, Mo = function(e, r, n, a, i, o, s, u) {
  var l = [], c, d = new Array(n.length), f = !0;
  o == null && (f = !1);
  var h;
  if (f) {
    for (var v = 0; v < d.length / 2; v++)
      d[v * 2] = n[v * 2] * o + a, d[v * 2 + 1] = n[v * 2 + 1] * s + i;
    if (u > 0) {
      var p = dl(d, -u);
      h = cl(p);
    } else
      h = d;
  } else
    h = n;
  for (var g, y, m, b, w = 0; w < h.length / 2; w++)
    g = h[w * 2], y = h[w * 2 + 1], w < h.length / 2 - 1 ? (m = h[(w + 1) * 2], b = h[(w + 1) * 2 + 1]) : (m = h[0], b = h[1]), c = jn(e, r, a, i, g, y, m, b), c.length !== 0 && l.push(c[0], c[1]);
  return l;
}, nq = function(e, r, n, a, i, o, s, u, l) {
  var c = [], d, f = new Array(n.length * 2);
  l.forEach(function(m, b) {
    b === 0 ? (f[f.length - 2] = m.startX, f[f.length - 1] = m.startY) : (f[b * 4 - 2] = m.startX, f[b * 4 - 1] = m.startY), f[b * 4] = m.stopX, f[b * 4 + 1] = m.stopY, d = co(e, r, a, i, m.cx, m.cy, m.radius), d.length !== 0 && c.push(d[0], d[1]);
  });
  for (var h = 0; h < f.length / 4; h++)
    d = jn(e, r, a, i, f[h * 4], f[h * 4 + 1], f[h * 4 + 2], f[h * 4 + 3], !1), d.length !== 0 && c.push(d[0], d[1]);
  if (c.length > 2) {
    for (var v = [c[0], c[1]], p = Math.pow(v[0] - e, 2) + Math.pow(v[1] - r, 2), g = 1; g < c.length / 2; g++) {
      var y = Math.pow(c[g * 2] - e, 2) + Math.pow(c[g * 2 + 1] - r, 2);
      y <= p && (v[0] = c[g * 2], v[1] = c[g * 2 + 1], p = y);
    }
    return v;
  }
  return c;
}, Ts = function(e, r, n) {
  var a = [e[0] - r[0], e[1] - r[1]], i = Math.sqrt(a[0] * a[0] + a[1] * a[1]), o = (i - n) / i;
  return o < 0 && (o = 1e-5), [r[0] + o * a[0], r[1] + o * a[1]];
}, ur = function(e, r) {
  var n = kp(e, r);
  return n = wS(n), n;
}, wS = function(e) {
  for (var r, n, a = e.length / 2, i = 1 / 0, o = 1 / 0, s = -1 / 0, u = -1 / 0, l = 0; l < a; l++)
    r = e[2 * l], n = e[2 * l + 1], i = Math.min(i, r), s = Math.max(s, r), o = Math.min(o, n), u = Math.max(u, n);
  for (var c = 2 / (s - i), d = 2 / (u - o), f = 0; f < a; f++)
    r = e[2 * f] = e[2 * f] * c, n = e[2 * f + 1] = e[2 * f + 1] * d, i = Math.min(i, r), s = Math.max(s, r), o = Math.min(o, n), u = Math.max(u, n);
  if (o < -1)
    for (var h = 0; h < a; h++)
      n = e[2 * h + 1] = e[2 * h + 1] + (-1 - o);
  return e;
}, kp = function(e, r) {
  var n = 1 / e * 2 * Math.PI, a = e % 2 === 0 ? Math.PI / 2 + n / 2 : Math.PI / 2;
  a += r;
  for (var i = new Array(e * 2), o, s = 0; s < e; s++)
    o = s * n + a, i[2 * s] = Math.cos(o), i[2 * s + 1] = Math.sin(-o);
  return i;
}, Ra = function(e, r) {
  return Math.min(e / 4, r / 4, 8);
}, CS = function(e, r) {
  return Math.min(e / 10, r / 10, 8);
}, Lg = function() {
  return 8;
}, aq = function(e, r, n) {
  return [e - 2 * r + n, 2 * (r - e), e];
}, _p = function(e, r) {
  return {
    heightOffset: Math.min(15, 0.05 * r),
    widthOffset: Math.min(100, 0.25 * e),
    ctrlPtOffsetPct: 0.05
  };
}, iq = Zt({
  dampingFactor: 0.8,
  precision: 1e-6,
  iterations: 200,
  weight: function(e) {
    return 1;
  }
}), oq = {
  pageRank: function(e) {
    for (var r = iq(e), n = r.dampingFactor, a = r.precision, i = r.iterations, o = r.weight, s = this._private.cy, u = this.byGroup(), l = u.nodes, c = u.edges, d = l.length, f = d * d, h = c.length, v = new Array(f), p = new Array(d), g = (1 - n) / d, y = 0; y < d; y++) {
      for (var m = 0; m < d; m++) {
        var b = y * d + m;
        v[b] = 0;
      }
      p[y] = 0;
    }
    for (var w = 0; w < h; w++) {
      var x = c[w], E = x.data("source"), C = x.data("target");
      if (E !== C) {
        var k = l.indexOfId(E), S = l.indexOfId(C), _ = o(x), T = S * d + k;
        v[T] += _, p[k] += _;
      }
    }
    for (var O = 1 / d + g, D = 0; D < d; D++)
      if (p[D] === 0)
        for (var A = 0; A < d; A++) {
          var F = A * d + D;
          v[F] = O;
        }
      else
        for (var R = 0; R < d; R++) {
          var M = R * d + D;
          v[M] = v[M] / p[D] + g;
        }
    for (var L = new Array(d), V = new Array(d), Y, H = 0; H < d; H++)
      L[H] = 1;
    for (var K = 0; K < i; K++) {
      for (var ne = 0; ne < d; ne++)
        V[ne] = 0;
      for (var B = 0; B < d; B++)
        for (var $ = 0; $ < d; $++) {
          var z = B * d + $;
          V[B] += v[z] * L[$];
        }
      V$(V), Y = L, L = V, V = Y;
      for (var W = 0, Z = 0; Z < d; Z++) {
        var N = Y[Z] - L[Z];
        W += N * N;
      }
      if (W < a)
        break;
    }
    var X = {
      rank: function(ge) {
        return ge = s.collection(ge)[0], L[l.indexOf(ge)];
      }
    };
    return X;
  }
  // pageRank
}, Zm = Zt({
  root: null,
  weight: function(e) {
    return 1;
  },
  directed: !1,
  alpha: 0
}), hi = {
  degreeCentralityNormalized: function(e) {
    e = Zm(e);
    var r = this.cy(), n = this.nodes(), a = n.length;
    if (e.directed) {
      for (var c = {}, d = {}, f = 0, h = 0, v = 0; v < a; v++) {
        var p = n[v], g = p.id();
        e.root = p;
        var y = this.degreeCentrality(e);
        f < y.indegree && (f = y.indegree), h < y.outdegree && (h = y.outdegree), c[g] = y.indegree, d[g] = y.outdegree;
      }
      return {
        indegree: function(b) {
          return f == 0 ? 0 : (Me(b) && (b = r.filter(b)), c[b.id()] / f);
        },
        outdegree: function(b) {
          return h === 0 ? 0 : (Me(b) && (b = r.filter(b)), d[b.id()] / h);
        }
      };
    } else {
      for (var i = {}, o = 0, s = 0; s < a; s++) {
        var u = n[s];
        e.root = u;
        var l = this.degreeCentrality(e);
        o < l.degree && (o = l.degree), i[u.id()] = l.degree;
      }
      return {
        degree: function(b) {
          return o === 0 ? 0 : (Me(b) && (b = r.filter(b)), i[b.id()] / o);
        }
      };
    }
  },
  // degreeCentralityNormalized
  // Implemented from the algorithm in Opsahl's paper
  // "Node centrality in weighted networks: Generalizing degree and shortest paths"
  // check the heading 2 "Degree"
  degreeCentrality: function(e) {
    e = Zm(e);
    var r = this.cy(), n = this, a = e, i = a.root, o = a.weight, s = a.directed, u = a.alpha;
    if (i = r.collection(i)[0], s) {
      for (var h = i.connectedEdges(), v = h.filter(function(E) {
        return E.target().same(i) && n.has(E);
      }), p = h.filter(function(E) {
        return E.source().same(i) && n.has(E);
      }), g = v.length, y = p.length, m = 0, b = 0, w = 0; w < v.length; w++)
        m += o(v[w]);
      for (var x = 0; x < p.length; x++)
        b += o(p[x]);
      return {
        indegree: Math.pow(g, 1 - u) * Math.pow(m, u),
        outdegree: Math.pow(y, 1 - u) * Math.pow(b, u)
      };
    } else {
      for (var l = i.connectedEdges().intersection(n), c = l.length, d = 0, f = 0; f < l.length; f++)
        d += o(l[f]);
      return {
        degree: Math.pow(c, 1 - u) * Math.pow(d, u)
      };
    }
  }
  // degreeCentrality
};
hi.dc = hi.degreeCentrality;
hi.dcn = hi.degreeCentralityNormalised = hi.degreeCentralityNormalized;
var Xm = Zt({
  harmonic: !0,
  weight: function() {
    return 1;
  },
  directed: !1,
  root: null
}), pi = {
  closenessCentralityNormalized: function(e) {
    for (var r = Xm(e), n = r.harmonic, a = r.weight, i = r.directed, o = this.cy(), s = {}, u = 0, l = this.nodes(), c = this.floydWarshall({
      weight: a,
      directed: i
    }), d = 0; d < l.length; d++) {
      for (var f = 0, h = l[d], v = 0; v < l.length; v++)
        if (d !== v) {
          var p = c.distance(h, l[v]);
          n ? f += 1 / p : f += p;
        }
      n || (f = 1 / f), u < f && (u = f), s[h.id()] = f;
    }
    return {
      closeness: function(y) {
        return u == 0 ? 0 : (Me(y) ? y = o.filter(y)[0].id() : y = y.id(), s[y] / u);
      }
    };
  },
  // Implemented from pseudocode from wikipedia
  closenessCentrality: function(e) {
    var r = Xm(e), n = r.root, a = r.weight, i = r.directed, o = r.harmonic;
    n = this.filter(n)[0];
    for (var s = this.dijkstra({
      root: n,
      weight: a,
      directed: i
    }), u = 0, l = this.nodes(), c = 0; c < l.length; c++) {
      var d = l[c];
      if (!d.same(n)) {
        var f = s.distanceTo(d);
        o ? u += 1 / f : u += f;
      }
    }
    return o ? u : 1 / u;
  }
  // closenessCentrality
};
pi.cc = pi.closenessCentrality;
pi.ccn = pi.closenessCentralityNormalised = pi.closenessCentralityNormalized;
var sq = Zt({
  weight: null,
  directed: !1
}), Tp = {
  // Implemented from the algorithm in the paper "On Variants of Shortest-Path Betweenness Centrality and their Generic Computation" by Ulrik Brandes
  betweennessCentrality: function(e) {
    for (var r = sq(e), n = r.directed, a = r.weight, i = a != null, o = this.cy(), s = this.nodes(), u = {}, l = {}, c = 0, d = {
      set: function(b, w) {
        l[b] = w, w > c && (c = w);
      },
      get: function(b) {
        return l[b];
      }
    }, f = 0; f < s.length; f++) {
      var h = s[f], v = h.id();
      n ? u[v] = h.outgoers().nodes() : u[v] = h.openNeighborhood().nodes(), d.set(v, 0);
    }
    for (var p = function(b) {
      for (var w = s[b].id(), x = [], E = {}, C = {}, k = {}, S = new as(function($, z) {
        return k[$] - k[z];
      }), _ = 0; _ < s.length; _++) {
        var T = s[_].id();
        E[T] = [], C[T] = 0, k[T] = 1 / 0;
      }
      for (C[w] = 1, k[w] = 0, S.push(w); !S.empty(); ) {
        var O = S.pop();
        if (x.push(O), i)
          for (var D = 0; D < u[O].length; D++) {
            var A = u[O][D], F = o.getElementById(O), R = void 0;
            F.edgesTo(A).length > 0 ? R = F.edgesTo(A)[0] : R = A.edgesTo(F)[0];
            var M = a(R);
            A = A.id(), k[A] > k[O] + M && (k[A] = k[O] + M, S.nodes.indexOf(A) < 0 ? S.push(A) : S.updateItem(A), C[A] = 0, E[A] = []), k[A] == k[O] + M && (C[A] = C[A] + C[O], E[A].push(O));
          }
        else
          for (var L = 0; L < u[O].length; L++) {
            var V = u[O][L].id();
            k[V] == 1 / 0 && (S.push(V), k[V] = k[O] + 1), k[V] == k[O] + 1 && (C[V] = C[V] + C[O], E[V].push(O));
          }
      }
      for (var Y = {}, H = 0; H < s.length; H++)
        Y[s[H].id()] = 0;
      for (; x.length > 0; ) {
        for (var K = x.pop(), ne = 0; ne < E[K].length; ne++) {
          var B = E[K][ne];
          Y[B] = Y[B] + C[B] / C[K] * (1 + Y[K]);
        }
        K != s[b].id() && d.set(K, d.get(K) + Y[K]);
      }
    }, g = 0; g < s.length; g++)
      p(g);
    var y = {
      betweenness: function(b) {
        var w = o.collection(b).id();
        return d.get(w);
      },
      betweennessNormalized: function(b) {
        if (c == 0)
          return 0;
        var w = o.collection(b).id();
        return d.get(w) / c;
      }
    };
    return y.betweennessNormalised = y.betweennessNormalized, y;
  }
  // betweennessCentrality
};
Tp.bc = Tp.betweennessCentrality;
var lq = Zt({
  expandFactor: 2,
  // affects time of computation and cluster granularity to some extent: M * M
  inflateFactor: 2,
  // affects cluster granularity (the greater the value, the more clusters): M(i,j) / E(j)
  multFactor: 1,
  // optional self loops for each node. Use a neutral value to improve cluster computations.
  maxIterations: 20,
  // maximum number of iterations of the MCL algorithm in a single run
  attributes: [
    // attributes/features used to group nodes, ie. similarity values between nodes
    function(t) {
      return 1;
    }
  ]
}), uq = function(e) {
  return lq(e);
}, cq = function(e, r) {
  for (var n = 0, a = 0; a < r.length; a++)
    n += r[a](e);
  return n;
}, dq = function(e, r, n) {
  for (var a = 0; a < r; a++)
    e[a * r + a] = n;
}, xS = function(e, r) {
  for (var n, a = 0; a < r; a++) {
    n = 0;
    for (var i = 0; i < r; i++)
      n += e[i * r + a];
    for (var o = 0; o < r; o++)
      e[o * r + a] = e[o * r + a] / n;
  }
}, fq = function(e, r, n) {
  for (var a = new Array(n * n), i = 0; i < n; i++) {
    for (var o = 0; o < n; o++)
      a[i * n + o] = 0;
    for (var s = 0; s < n; s++)
      for (var u = 0; u < n; u++)
        a[i * n + u] += e[i * n + s] * r[s * n + u];
  }
  return a;
}, vq = function(e, r, n) {
  for (var a = e.slice(0), i = 1; i < n; i++)
    e = fq(e, a, r);
  return e;
}, hq = function(e, r, n) {
  for (var a = new Array(r * r), i = 0; i < r * r; i++)
    a[i] = Math.pow(e[i], n);
  return xS(a, r), a;
}, pq = function(e, r, n, a) {
  for (var i = 0; i < n; i++) {
    var o = Math.round(e[i] * Math.pow(10, a)) / Math.pow(10, a), s = Math.round(r[i] * Math.pow(10, a)) / Math.pow(10, a);
    if (o !== s)
      return !1;
  }
  return !0;
}, gq = function(e, r, n, a) {
  for (var i = [], o = 0; o < r; o++) {
    for (var s = [], u = 0; u < r; u++)
      Math.round(e[o * r + u] * 1e3) / 1e3 > 0 && s.push(n[u]);
    s.length !== 0 && i.push(a.collection(s));
  }
  return i;
}, yq = function(e, r) {
  for (var n = 0; n < e.length; n++)
    if (!r[n] || e[n].id() !== r[n].id())
      return !1;
  return !0;
}, mq = function(e) {
  for (var r = 0; r < e.length; r++)
    for (var n = 0; n < e.length; n++)
      r != n && yq(e[r], e[n]) && e.splice(n, 1);
  return e;
}, Jm = function(e) {
  for (var r = this.nodes(), n = this.edges(), a = this.cy(), i = uq(e), o = {}, s = 0; s < r.length; s++)
    o[r[s].id()] = s;
  for (var u = r.length, l = u * u, c = new Array(l), d, f = 0; f < l; f++)
    c[f] = 0;
  for (var h = 0; h < n.length; h++) {
    var v = n[h], p = o[v.source().id()], g = o[v.target().id()], y = cq(v, i.attributes);
    c[p * u + g] += y, c[g * u + p] += y;
  }
  dq(c, u, i.multFactor), xS(c, u);
  for (var m = !0, b = 0; m && b < i.maxIterations; )
    m = !1, d = vq(c, u, i.expandFactor), c = hq(d, u, i.inflateFactor), pq(c, d, l, 4) || (m = !0), b++;
  var w = gq(c, u, r, a);
  return w = mq(w), w;
}, bq = {
  markovClustering: Jm,
  mcl: Jm
}, wq = function(e) {
  return e;
}, ES = function(e, r) {
  return Math.abs(r - e);
}, Qm = function(e, r, n) {
  return e + ES(r, n);
}, e0 = function(e, r, n) {
  return e + Math.pow(n - r, 2);
}, Cq = function(e) {
  return Math.sqrt(e);
}, xq = function(e, r, n) {
  return Math.max(e, ES(r, n));
}, ro = function(e, r, n, a, i) {
  for (var o = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : wq, s = a, u, l, c = 0; c < e; c++)
    u = r(c), l = n(c), s = i(s, u, l);
  return o(s);
}, Ii = {
  euclidean: function(e, r, n) {
    return e >= 2 ? ro(e, r, n, 0, e0, Cq) : ro(e, r, n, 0, Qm);
  },
  squaredEuclidean: function(e, r, n) {
    return ro(e, r, n, 0, e0);
  },
  manhattan: function(e, r, n) {
    return ro(e, r, n, 0, Qm);
  },
  max: function(e, r, n) {
    return ro(e, r, n, -1 / 0, xq);
  }
};
Ii["squared-euclidean"] = Ii.squaredEuclidean;
Ii.squaredeuclidean = Ii.squaredEuclidean;
function Bl(t, e, r, n, a, i) {
  var o;
  return yt(t) ? o = t : o = Ii[t] || Ii.euclidean, e === 0 && yt(t) ? o(a, i) : o(e, r, n, a, i);
}
var Eq = Zt({
  k: 2,
  m: 2,
  sensitivityThreshold: 1e-4,
  distance: "euclidean",
  maxIterations: 10,
  attributes: [],
  testMode: !1,
  testCentroids: null
}), Fg = function(e) {
  return Eq(e);
}, fl = function(e, r, n, a, i) {
  var o = i !== "kMedoids", s = o ? function(d) {
    return n[d];
  } : function(d) {
    return a[d](n);
  }, u = function(f) {
    return a[f](r);
  }, l = n, c = r;
  return Bl(e, a.length, s, u, l, c);
}, Lu = function(e, r, n) {
  for (var a = n.length, i = new Array(a), o = new Array(a), s = new Array(r), u = null, l = 0; l < a; l++)
    i[l] = e.min(n[l]).value, o[l] = e.max(n[l]).value;
  for (var c = 0; c < r; c++) {
    u = [];
    for (var d = 0; d < a; d++)
      u[d] = Math.random() * (o[d] - i[d]) + i[d];
    s[c] = u;
  }
  return s;
}, SS = function(e, r, n, a, i) {
  for (var o = 1 / 0, s = 0, u = 0; u < r.length; u++) {
    var l = fl(n, e, r[u], a, i);
    l < o && (o = l, s = u);
  }
  return s;
}, kS = function(e, r, n) {
  for (var a = [], i = null, o = 0; o < r.length; o++)
    i = r[o], n[i.id()] === e && a.push(i);
  return a;
}, Sq = function(e, r, n) {
  return Math.abs(r - e) <= n;
}, kq = function(e, r, n) {
  for (var a = 0; a < e.length; a++)
    for (var i = 0; i < e[a].length; i++) {
      var o = Math.abs(e[a][i] - r[a][i]);
      if (o > n)
        return !1;
    }
  return !0;
}, _q = function(e, r, n) {
  for (var a = 0; a < n; a++)
    if (e === r[a]) return !0;
  return !1;
}, t0 = function(e, r) {
  var n = new Array(r);
  if (e.length < 50)
    for (var a = 0; a < r; a++) {
      for (var i = e[Math.floor(Math.random() * e.length)]; _q(i, n, a); )
        i = e[Math.floor(Math.random() * e.length)];
      n[a] = i;
    }
  else
    for (var o = 0; o < r; o++)
      n[o] = e[Math.floor(Math.random() * e.length)];
  return n;
}, r0 = function(e, r, n) {
  for (var a = 0, i = 0; i < r.length; i++)
    a += fl("manhattan", r[i], e, n, "kMedoids");
  return a;
}, Tq = function(e) {
  var r = this.cy(), n = this.nodes(), a = null, i = Fg(e), o = new Array(i.k), s = {}, u;
  i.testMode ? typeof i.testCentroids == "number" ? (i.testCentroids, u = Lu(n, i.k, i.attributes)) : Nt(i.testCentroids) === "object" ? u = i.testCentroids : u = Lu(n, i.k, i.attributes) : u = Lu(n, i.k, i.attributes);
  for (var l = !0, c = 0; l && c < i.maxIterations; ) {
    for (var d = 0; d < n.length; d++)
      a = n[d], s[a.id()] = SS(a, u, i.distance, i.attributes, "kMeans");
    l = !1;
    for (var f = 0; f < i.k; f++) {
      var h = kS(f, n, s);
      if (h.length !== 0) {
        for (var v = i.attributes.length, p = u[f], g = new Array(v), y = new Array(v), m = 0; m < v; m++) {
          y[m] = 0;
          for (var b = 0; b < h.length; b++)
            a = h[b], y[m] += i.attributes[m](a);
          g[m] = y[m] / h.length, Sq(g[m], p[m], i.sensitivityThreshold) || (l = !0);
        }
        u[f] = g, o[f] = r.collection(h);
      }
    }
    c++;
  }
  return o;
}, Iq = function(e) {
  var r = this.cy(), n = this.nodes(), a = null, i = Fg(e), o = new Array(i.k), s, u = {}, l, c = new Array(i.k);
  i.testMode ? typeof i.testCentroids == "number" || (Nt(i.testCentroids) === "object" ? s = i.testCentroids : s = t0(n, i.k)) : s = t0(n, i.k);
  for (var d = !0, f = 0; d && f < i.maxIterations; ) {
    for (var h = 0; h < n.length; h++)
      a = n[h], u[a.id()] = SS(a, s, i.distance, i.attributes, "kMedoids");
    d = !1;
    for (var v = 0; v < s.length; v++) {
      var p = kS(v, n, u);
      if (p.length !== 0) {
        c[v] = r0(s[v], p, i.attributes);
        for (var g = 0; g < p.length; g++)
          l = r0(p[g], p, i.attributes), l < c[v] && (c[v] = l, s[v] = p[g], d = !0);
        o[v] = r.collection(p);
      }
    }
    f++;
  }
  return o;
}, Oq = function(e, r, n, a, i) {
  for (var o, s, u = 0; u < r.length; u++)
    for (var l = 0; l < e.length; l++)
      a[u][l] = Math.pow(n[u][l], i.m);
  for (var c = 0; c < e.length; c++)
    for (var d = 0; d < i.attributes.length; d++) {
      o = 0, s = 0;
      for (var f = 0; f < r.length; f++)
        o += a[f][c] * i.attributes[d](r[f]), s += a[f][c];
      e[c][d] = o / s;
    }
}, Aq = function(e, r, n, a, i) {
  for (var o = 0; o < e.length; o++)
    r[o] = e[o].slice();
  for (var s, u, l, c = 2 / (i.m - 1), d = 0; d < n.length; d++)
    for (var f = 0; f < a.length; f++) {
      s = 0;
      for (var h = 0; h < n.length; h++)
        u = fl(i.distance, a[f], n[d], i.attributes, "cmeans"), l = fl(i.distance, a[f], n[h], i.attributes, "cmeans"), s += Math.pow(u / l, c);
      e[f][d] = 1 / s;
    }
}, Pq = function(e, r, n, a) {
  for (var i = new Array(n.k), o = 0; o < i.length; o++)
    i[o] = [];
  for (var s, u, l = 0; l < r.length; l++) {
    s = -1 / 0, u = -1;
    for (var c = 0; c < r[0].length; c++)
      r[l][c] > s && (s = r[l][c], u = c);
    i[u].push(e[l]);
  }
  for (var d = 0; d < i.length; d++)
    i[d] = a.collection(i[d]);
  return i;
}, n0 = function(e) {
  var r = this.cy(), n = this.nodes(), a = Fg(e), i, o, s, u, l;
  u = new Array(n.length);
  for (var c = 0; c < n.length; c++)
    u[c] = new Array(a.k);
  s = new Array(n.length);
  for (var d = 0; d < n.length; d++)
    s[d] = new Array(a.k);
  for (var f = 0; f < n.length; f++) {
    for (var h = 0, v = 0; v < a.k; v++)
      s[f][v] = Math.random(), h += s[f][v];
    for (var p = 0; p < a.k; p++)
      s[f][p] = s[f][p] / h;
  }
  o = new Array(a.k);
  for (var g = 0; g < a.k; g++)
    o[g] = new Array(a.attributes.length);
  l = new Array(n.length);
  for (var y = 0; y < n.length; y++)
    l[y] = new Array(a.k);
  for (var m = !0, b = 0; m && b < a.maxIterations; )
    m = !1, Oq(o, n, s, l, a), Aq(s, u, o, n, a), kq(s, u, a.sensitivityThreshold) || (m = !0), b++;
  return i = Pq(n, s, a, r), {
    clusters: i,
    degreeOfMembership: s
  };
}, Dq = {
  kMeans: Tq,
  kMedoids: Iq,
  fuzzyCMeans: n0,
  fcm: n0
}, Rq = Zt({
  distance: "euclidean",
  // distance metric to compare nodes
  linkage: "min",
  // linkage criterion : how to determine the distance between clusters of nodes
  mode: "threshold",
  // mode:'threshold' => clusters must be threshold distance apart
  threshold: 1 / 0,
  // the distance threshold
  // mode:'dendrogram' => the nodes are organised as leaves in a tree (siblings are close), merging makes clusters
  addDendrogram: !1,
  // whether to add the dendrogram to the graph for viz
  dendrogramDepth: 0,
  // depth at which dendrogram branches are merged into the returned clusters
  attributes: []
  // array of attr functions
}), Lq = {
  single: "min",
  complete: "max"
}, Fq = function(e) {
  var r = Rq(e), n = Lq[r.linkage];
  return n != null && (r.linkage = n), r;
}, a0 = function(e, r, n, a, i) {
  for (var o = 0, s = 1 / 0, u, l = i.attributes, c = function(S, _) {
    return Bl(i.distance, l.length, function(T) {
      return l[T](S);
    }, function(T) {
      return l[T](_);
    }, S, _);
  }, d = 0; d < e.length; d++) {
    var f = e[d].key, h = n[f][a[f]];
    h < s && (o = f, s = h);
  }
  if (i.mode === "threshold" && s >= i.threshold || i.mode === "dendrogram" && e.length === 1)
    return !1;
  var v = r[o], p = r[a[o]], g;
  i.mode === "dendrogram" ? g = {
    left: v,
    right: p,
    key: v.key
  } : g = {
    value: v.value.concat(p.value),
    key: v.key
  }, e[v.index] = g, e.splice(p.index, 1), r[v.key] = g;
  for (var y = 0; y < e.length; y++) {
    var m = e[y];
    v.key === m.key ? u = 1 / 0 : i.linkage === "min" ? (u = n[v.key][m.key], n[v.key][m.key] > n[p.key][m.key] && (u = n[p.key][m.key])) : i.linkage === "max" ? (u = n[v.key][m.key], n[v.key][m.key] < n[p.key][m.key] && (u = n[p.key][m.key])) : i.linkage === "mean" ? u = (n[v.key][m.key] * v.size + n[p.key][m.key] * p.size) / (v.size + p.size) : i.mode === "dendrogram" ? u = c(m.value, v.value) : u = c(m.value[0], v.value[0]), n[v.key][m.key] = n[m.key][v.key] = u;
  }
  for (var b = 0; b < e.length; b++) {
    var w = e[b].key;
    if (a[w] === v.key || a[w] === p.key) {
      for (var x = w, E = 0; E < e.length; E++) {
        var C = e[E].key;
        n[w][C] < n[w][x] && (x = C);
      }
      a[w] = x;
    }
    e[b].index = b;
  }
  return v.key = p.key = v.index = p.index = null, !0;
}, Is = function t(e, r, n) {
  e && (e.value ? r.push(e.value) : (e.left && t(e.left, r), e.right && t(e.right, r)));
}, Mq = function t(e, r) {
  if (!e) return "";
  if (e.left && e.right) {
    var n = t(e.left, r), a = t(e.right, r), i = r.add({
      group: "nodes",
      data: {
        id: n + "," + a
      }
    });
    return r.add({
      group: "edges",
      data: {
        source: n,
        target: i.id()
      }
    }), r.add({
      group: "edges",
      data: {
        source: a,
        target: i.id()
      }
    }), i.id();
  } else if (e.value)
    return e.value.id();
}, Nq = function t(e, r, n) {
  if (!e) return [];
  var a = [], i = [], o = [];
  return r === 0 ? (e.left && Is(e.left, a), e.right && Is(e.right, i), o = a.concat(i), [n.collection(o)]) : r === 1 ? e.value ? [n.collection(e.value)] : (e.left && Is(e.left, a), e.right && Is(e.right, i), [n.collection(a), n.collection(i)]) : e.value ? [n.collection(e.value)] : (e.left && (a = t(e.left, r - 1, n)), e.right && (i = t(e.right, r - 1, n)), a.concat(i));
}, i0 = function(e) {
  for (var r = this.cy(), n = this.nodes(), a = Fq(e), i = a.attributes, o = function(b, w) {
    return Bl(a.distance, i.length, function(x) {
      return i[x](b);
    }, function(x) {
      return i[x](w);
    }, b, w);
  }, s = [], u = [], l = [], c = [], d = 0; d < n.length; d++) {
    var f = {
      value: a.mode === "dendrogram" ? n[d] : [n[d]],
      key: d,
      index: d
    };
    s[d] = f, c[d] = f, u[d] = [], l[d] = 0;
  }
  for (var h = 0; h < s.length; h++)
    for (var v = 0; v <= h; v++) {
      var p = void 0;
      a.mode === "dendrogram" ? p = h === v ? 1 / 0 : o(s[h].value, s[v].value) : p = h === v ? 1 / 0 : o(s[h].value[0], s[v].value[0]), u[h][v] = p, u[v][h] = p, p < u[h][l[h]] && (l[h] = v);
    }
  for (var g = a0(s, c, u, l, a); g; )
    g = a0(s, c, u, l, a);
  var y;
  return a.mode === "dendrogram" ? (y = Nq(s[0], a.dendrogramDepth, r), a.addDendrogram && Mq(s[0], r)) : (y = new Array(s.length), s.forEach(function(m, b) {
    m.key = m.index = null, y[b] = r.collection(m.value);
  })), y;
}, Bq = {
  hierarchicalClustering: i0,
  hca: i0
}, $q = Zt({
  distance: "euclidean",
  // distance metric to compare attributes between two nodes
  preference: "median",
  // suitability of a data point to serve as an exemplar
  damping: 0.8,
  // damping factor between [0.5, 1)
  maxIterations: 1e3,
  // max number of iterations to run
  minIterations: 100,
  // min number of iterations to run in order for clustering to stop
  attributes: [
    // functions to quantify the similarity between any two points
    // e.g. node => node.data('weight')
  ]
}), qq = function(e) {
  var r = e.damping, n = e.preference;
  0.5 <= r && r < 1 || bt("Damping must range on [0.5, 1).  Got: ".concat(r));
  var a = ["median", "mean", "min", "max"];
  return a.some(function(i) {
    return i === n;
  }) || Ce(n) || bt("Preference must be one of [".concat(a.map(function(i) {
    return "'".concat(i, "'");
  }).join(", "), "] or a number.  Got: ").concat(n)), $q(e);
}, zq = function(e, r, n, a) {
  var i = function(s, u) {
    return a[u](s);
  };
  return -Bl(e, a.length, function(o) {
    return i(r, o);
  }, function(o) {
    return i(n, o);
  }, r, n);
}, Vq = function(e, r) {
  var n = null;
  return r === "median" ? n = q$(e) : r === "mean" ? n = $$(e) : r === "min" ? n = N$(e) : r === "max" ? n = B$(e) : n = r, n;
}, Hq = function(e, r, n) {
  for (var a = [], i = 0; i < e; i++)
    r[i * e + i] + n[i * e + i] > 0 && a.push(i);
  return a;
}, o0 = function(e, r, n) {
  for (var a = [], i = 0; i < e; i++) {
    for (var o = -1, s = -1 / 0, u = 0; u < n.length; u++) {
      var l = n[u];
      r[i * e + l] > s && (o = l, s = r[i * e + l]);
    }
    o > 0 && a.push(o);
  }
  for (var c = 0; c < n.length; c++)
    a[n[c]] = n[c];
  return a;
}, Kq = function(e, r, n) {
  for (var a = o0(e, r, n), i = 0; i < n.length; i++) {
    for (var o = [], s = 0; s < a.length; s++)
      a[s] === n[i] && o.push(s);
    for (var u = -1, l = -1 / 0, c = 0; c < o.length; c++) {
      for (var d = 0, f = 0; f < o.length; f++)
        d += r[o[f] * e + o[c]];
      d > l && (u = c, l = d);
    }
    n[i] = o[u];
  }
  return a = o0(e, r, n), a;
}, s0 = function(e) {
  for (var r = this.cy(), n = this.nodes(), a = qq(e), i = {}, o = 0; o < n.length; o++)
    i[n[o].id()] = o;
  var s, u, l, c, d, f;
  s = n.length, u = s * s, l = new Array(u);
  for (var h = 0; h < u; h++)
    l[h] = -1 / 0;
  for (var v = 0; v < s; v++)
    for (var p = 0; p < s; p++)
      v !== p && (l[v * s + p] = zq(a.distance, n[v], n[p], a.attributes));
  c = Vq(l, a.preference);
  for (var g = 0; g < s; g++)
    l[g * s + g] = c;
  d = new Array(u);
  for (var y = 0; y < u; y++)
    d[y] = 0;
  f = new Array(u);
  for (var m = 0; m < u; m++)
    f[m] = 0;
  for (var b = new Array(s), w = new Array(s), x = new Array(s), E = 0; E < s; E++)
    b[E] = 0, w[E] = 0, x[E] = 0;
  for (var C = new Array(s * a.minIterations), k = 0; k < C.length; k++)
    C[k] = 0;
  var S;
  for (S = 0; S < a.maxIterations; S++) {
    for (var _ = 0; _ < s; _++) {
      for (var T = -1 / 0, O = -1 / 0, D = -1, A = 0, F = 0; F < s; F++)
        b[F] = d[_ * s + F], A = f[_ * s + F] + l[_ * s + F], A >= T ? (O = T, T = A, D = F) : A > O && (O = A);
      for (var R = 0; R < s; R++)
        d[_ * s + R] = (1 - a.damping) * (l[_ * s + R] - T) + a.damping * b[R];
      d[_ * s + D] = (1 - a.damping) * (l[_ * s + D] - O) + a.damping * b[D];
    }
    for (var M = 0; M < s; M++) {
      for (var L = 0, V = 0; V < s; V++)
        b[V] = f[V * s + M], w[V] = Math.max(0, d[V * s + M]), L += w[V];
      L -= w[M], w[M] = d[M * s + M], L += w[M];
      for (var Y = 0; Y < s; Y++)
        f[Y * s + M] = (1 - a.damping) * Math.min(0, L - w[Y]) + a.damping * b[Y];
      f[M * s + M] = (1 - a.damping) * (L - w[M]) + a.damping * b[M];
    }
    for (var H = 0, K = 0; K < s; K++) {
      var ne = f[K * s + K] + d[K * s + K] > 0 ? 1 : 0;
      C[S % a.minIterations * s + K] = ne, H += ne;
    }
    if (H > 0 && (S >= a.minIterations - 1 || S == a.maxIterations - 1)) {
      for (var B = 0, $ = 0; $ < s; $++) {
        x[$] = 0;
        for (var z = 0; z < a.minIterations; z++)
          x[$] += C[z * s + $];
        (x[$] === 0 || x[$] === a.minIterations) && B++;
      }
      if (B === s)
        break;
    }
  }
  for (var W = Hq(s, d, f), Z = Kq(s, l, W), N = {}, X = 0; X < W.length; X++)
    N[W[X]] = [];
  for (var Q = 0; Q < n.length; Q++) {
    var ge = i[n[Q].id()], we = Z[ge];
    we != null && N[we].push(n[Q]);
  }
  for (var fe = new Array(W.length), ce = 0; ce < W.length; ce++)
    fe[ce] = r.collection(N[W[ce]]);
  return fe;
}, Gq = {
  affinityPropagation: s0,
  ap: s0
}, Uq = Zt({
  root: void 0,
  directed: !1
}), Wq = {
  hierholzer: function(e) {
    if (!Xe(e)) {
      var r = arguments;
      e = {
        root: r[0],
        directed: r[1]
      };
    }
    var n = Uq(e), a = n.root, i = n.directed, o = this, s = !1, u, l, c;
    a && (c = Me(a) ? this.filter(a)[0].id() : a[0].id());
    var d = {}, f = {};
    i ? o.forEach(function(m) {
      var b = m.id();
      if (m.isNode()) {
        var w = m.indegree(!0), x = m.outdegree(!0), E = w - x, C = x - w;
        E == 1 ? u ? s = !0 : u = b : C == 1 ? l ? s = !0 : l = b : (C > 1 || E > 1) && (s = !0), d[b] = [], m.outgoers().forEach(function(k) {
          k.isEdge() && d[b].push(k.id());
        });
      } else
        f[b] = [void 0, m.target().id()];
    }) : o.forEach(function(m) {
      var b = m.id();
      if (m.isNode()) {
        var w = m.degree(!0);
        w % 2 && (u ? l ? s = !0 : l = b : u = b), d[b] = [], m.connectedEdges().forEach(function(x) {
          return d[b].push(x.id());
        });
      } else
        f[b] = [m.source().id(), m.target().id()];
    });
    var h = {
      found: !1,
      trail: void 0
    };
    if (s) return h;
    if (l && u)
      if (i) {
        if (c && l != c)
          return h;
        c = l;
      } else {
        if (c && l != c && u != c)
          return h;
        c || (c = l);
      }
    else
      c || (c = o[0].id());
    var v = function(b) {
      for (var w = b, x = [b], E, C, k; d[w].length; )
        E = d[w].shift(), C = f[E][0], k = f[E][1], w != k ? (d[k] = d[k].filter(function(S) {
          return S != E;
        }), w = k) : !i && w != C && (d[C] = d[C].filter(function(S) {
          return S != E;
        }), w = C), x.unshift(E), x.unshift(w);
      return x;
    }, p = [], g = [];
    for (g = v(c); g.length != 1; )
      d[g[0]].length == 0 ? (p.unshift(o.getElementById(g.shift())), p.unshift(o.getElementById(g.shift()))) : g = v(g.shift()).concat(g);
    p.unshift(o.getElementById(g.shift()));
    for (var y in d)
      if (d[y].length)
        return h;
    return h.found = !0, h.trail = this.spawn(p, !0), h;
  }
}, Os = function() {
  var e = this, r = {}, n = 0, a = 0, i = [], o = [], s = {}, u = function(f, h) {
    for (var v = o.length - 1, p = [], g = e.spawn(); o[v].x != f || o[v].y != h; )
      p.push(o.pop().edge), v--;
    p.push(o.pop().edge), p.forEach(function(y) {
      var m = y.connectedNodes().intersection(e);
      g.merge(y), m.forEach(function(b) {
        var w = b.id(), x = b.connectedEdges().intersection(e);
        g.merge(b), r[w].cutVertex ? g.merge(x.filter(function(E) {
          return E.isLoop();
        })) : g.merge(x);
      });
    }), i.push(g);
  }, l = function d(f, h, v) {
    f === v && (a += 1), r[h] = {
      id: n,
      low: n++,
      cutVertex: !1
    };
    var p = e.getElementById(h).connectedEdges().intersection(e);
    if (p.size() === 0)
      i.push(e.spawn(e.getElementById(h)));
    else {
      var g, y, m, b;
      p.forEach(function(w) {
        g = w.source().id(), y = w.target().id(), m = g === h ? y : g, m !== v && (b = w.id(), s[b] || (s[b] = !0, o.push({
          x: h,
          y: m,
          edge: w
        })), m in r ? r[h].low = Math.min(r[h].low, r[m].id) : (d(f, m, h), r[h].low = Math.min(r[h].low, r[m].low), r[h].id <= r[m].low && (r[h].cutVertex = !0, u(h, m))));
      });
    }
  };
  e.forEach(function(d) {
    if (d.isNode()) {
      var f = d.id();
      f in r || (a = 0, l(f, f), r[f].cutVertex = a > 1);
    }
  });
  var c = Object.keys(r).filter(function(d) {
    return r[d].cutVertex;
  }).map(function(d) {
    return e.getElementById(d);
  });
  return {
    cut: e.spawn(c),
    components: i
  };
}, jq = {
  hopcroftTarjanBiconnected: Os,
  htbc: Os,
  htb: Os,
  hopcroftTarjanBiconnectedComponents: Os
}, As = function() {
  var e = this, r = {}, n = 0, a = [], i = [], o = e.spawn(e), s = function u(l) {
    i.push(l), r[l] = {
      index: n,
      low: n++,
      explored: !1
    };
    var c = e.getElementById(l).connectedEdges().intersection(e);
    if (c.forEach(function(p) {
      var g = p.target().id();
      g !== l && (g in r || u(g), r[g].explored || (r[l].low = Math.min(r[l].low, r[g].low)));
    }), r[l].index === r[l].low) {
      for (var d = e.spawn(); ; ) {
        var f = i.pop();
        if (d.merge(e.getElementById(f)), r[f].low = r[l].index, r[f].explored = !0, f === l)
          break;
      }
      var h = d.edgesWith(d), v = d.merge(h);
      a.push(v), o = o.difference(v);
    }
  };
  return e.forEach(function(u) {
    if (u.isNode()) {
      var l = u.id();
      l in r || s(l);
    }
  }), {
    cut: o,
    components: a
  };
}, Yq = {
  tarjanStronglyConnected: As,
  tsc: As,
  tscc: As,
  tarjanStronglyConnectedComponents: As
}, _S = {};
[Lo, k$, _$, I$, A$, D$, F$, oq, hi, pi, Tp, bq, Dq, Bq, Gq, Wq, jq, Yq].forEach(function(t) {
  ze(_S, t);
});
/*!
Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
Licensed under The MIT License (http://opensource.org/licenses/MIT)
*/
var TS = 0, IS = 1, OS = 2, Tn = function t(e) {
  if (!(this instanceof t)) return new t(e);
  this.id = "Thenable/1.0.7", this.state = TS, this.fulfillValue = void 0, this.rejectReason = void 0, this.onFulfilled = [], this.onRejected = [], this.proxy = {
    then: this.then.bind(this)
  }, typeof e == "function" && e.call(this, this.fulfill.bind(this), this.reject.bind(this));
};
Tn.prototype = {
  /*  promise resolving methods  */
  fulfill: function(e) {
    return l0(this, IS, "fulfillValue", e);
  },
  reject: function(e) {
    return l0(this, OS, "rejectReason", e);
  },
  /*  "The then Method" [Promises/A+ 1.1, 1.2, 2.2]  */
  then: function(e, r) {
    var n = this, a = new Tn();
    return n.onFulfilled.push(c0(e, a, "fulfill")), n.onRejected.push(c0(r, a, "reject")), AS(n), a.proxy;
  }
};
var l0 = function(e, r, n, a) {
  return e.state === TS && (e.state = r, e[n] = a, AS(e)), e;
}, AS = function(e) {
  e.state === IS ? u0(e, "onFulfilled", e.fulfillValue) : e.state === OS && u0(e, "onRejected", e.rejectReason);
}, u0 = function(e, r, n) {
  if (e[r].length !== 0) {
    var a = e[r];
    e[r] = [];
    var i = function() {
      for (var s = 0; s < a.length; s++)
        a[s](n);
    };
    typeof setImmediate == "function" ? setImmediate(i) : setTimeout(i, 0);
  }
}, c0 = function(e, r, n) {
  return function(a) {
    if (typeof e != "function")
      r[n].call(r, a);
    else {
      var i;
      try {
        i = e(a);
      } catch (o) {
        r.reject(o);
        return;
      }
      Zq(r, i);
    }
  };
}, Zq = function t(e, r) {
  if (e === r || e.proxy === r) {
    e.reject(new TypeError("cannot resolve promise with itself"));
    return;
  }
  var n;
  if (Nt(r) === "object" && r !== null || typeof r == "function")
    try {
      n = r.then;
    } catch (i) {
      e.reject(i);
      return;
    }
  if (typeof n == "function") {
    var a = !1;
    try {
      n.call(
        r,
        /*  resolvePromise  */
        /*  [Promises/A+ 2.3.3.3.1]  */
        function(i) {
          a || (a = !0, i === r ? e.reject(new TypeError("circular thenable chain")) : t(e, i));
        },
        /*  rejectPromise  */
        /*  [Promises/A+ 2.3.3.3.2]  */
        function(i) {
          a || (a = !0, e.reject(i));
        }
      );
    } catch (i) {
      a || e.reject(i);
    }
    return;
  }
  e.fulfill(r);
};
Tn.all = function(t) {
  return new Tn(function(e, r) {
    for (var n = new Array(t.length), a = 0, i = function(u, l) {
      n[u] = l, a++, a === t.length && e(n);
    }, o = 0; o < t.length; o++)
      (function(s) {
        var u = t[s], l = u != null && u.then != null;
        if (l)
          u.then(function(d) {
            i(s, d);
          }, function(d) {
            r(d);
          });
        else {
          var c = u;
          i(s, c);
        }
      })(o);
  });
};
Tn.resolve = function(t) {
  return new Tn(function(e, r) {
    e(t);
  });
};
Tn.reject = function(t) {
  return new Tn(function(e, r) {
    r(t);
  });
};
var Mi = typeof Promise < "u" ? Promise : Tn, Ip = function(e, r, n) {
  var a = Tg(e), i = !a, o = this._private = ze({
    duration: 1e3
  }, r, n);
  if (o.target = e, o.style = o.style || o.css, o.started = !1, o.playing = !1, o.hooked = !1, o.applying = !1, o.progress = 0, o.completes = [], o.frames = [], o.complete && yt(o.complete) && o.completes.push(o.complete), i) {
    var s = e.position();
    o.startPosition = o.startPosition || {
      x: s.x,
      y: s.y
    }, o.startStyle = o.startStyle || e.cy().style().getAnimationStartStyle(e, o.style);
  }
  if (a) {
    var u = e.pan();
    o.startPan = {
      x: u.x,
      y: u.y
    }, o.startZoom = e.zoom();
  }
  this.length = 1, this[0] = this;
}, La = Ip.prototype;
ze(La, {
  instanceString: function() {
    return "animation";
  },
  hook: function() {
    var e = this._private;
    if (!e.hooked) {
      var r, n = e.target._private.animation;
      e.queue ? r = n.queue : r = n.current, r.push(this), xr(e.target) && e.target.cy().addToAnimationPool(e.target), e.hooked = !0;
    }
    return this;
  },
  play: function() {
    var e = this._private;
    return e.progress === 1 && (e.progress = 0), e.playing = !0, e.started = !1, e.stopped = !1, this.hook(), this;
  },
  playing: function() {
    return this._private.playing;
  },
  apply: function() {
    var e = this._private;
    return e.applying = !0, e.started = !1, e.stopped = !1, this.hook(), this;
  },
  applying: function() {
    return this._private.applying;
  },
  pause: function() {
    var e = this._private;
    return e.playing = !1, e.started = !1, this;
  },
  stop: function() {
    var e = this._private;
    return e.playing = !1, e.started = !1, e.stopped = !0, this;
  },
  rewind: function() {
    return this.progress(0);
  },
  fastforward: function() {
    return this.progress(1);
  },
  time: function(e) {
    var r = this._private;
    return e === void 0 ? r.progress * r.duration : this.progress(e / r.duration);
  },
  progress: function(e) {
    var r = this._private, n = r.playing;
    return e === void 0 ? r.progress : (n && this.pause(), r.progress = e, r.started = !1, n && this.play(), this);
  },
  completed: function() {
    return this._private.progress === 1;
  },
  reverse: function() {
    var e = this._private, r = e.playing;
    r && this.pause(), e.progress = 1 - e.progress, e.started = !1;
    var n = function(l, c) {
      var d = e[l];
      d != null && (e[l] = e[c], e[c] = d);
    };
    if (n("zoom", "startZoom"), n("pan", "startPan"), n("position", "startPosition"), e.style)
      for (var a = 0; a < e.style.length; a++) {
        var i = e.style[a], o = i.name, s = e.startStyle[o];
        e.startStyle[o] = i, e.style[a] = s;
      }
    return r && this.play(), this;
  },
  promise: function(e) {
    var r = this._private, n;
    switch (e) {
      case "frame":
        n = r.frames;
        break;
      default:
      case "complete":
      case "completed":
        n = r.completes;
    }
    return new Mi(function(a, i) {
      n.push(function() {
        a();
      });
    });
  }
});
La.complete = La.completed;
La.run = La.play;
La.running = La.playing;
var Xq = {
  animated: function() {
    return function() {
      var r = this, n = r.length !== void 0, a = n ? r : [r], i = this._private.cy || this;
      if (!i.styleEnabled())
        return !1;
      var o = a[0];
      if (o)
        return o._private.animation.current.length > 0;
    };
  },
  // animated
  clearQueue: function() {
    return function() {
      var r = this, n = r.length !== void 0, a = n ? r : [r], i = this._private.cy || this;
      if (!i.styleEnabled())
        return this;
      for (var o = 0; o < a.length; o++) {
        var s = a[o];
        s._private.animation.queue = [];
      }
      return this;
    };
  },
  // clearQueue
  delay: function() {
    return function(r, n) {
      var a = this._private.cy || this;
      return a.styleEnabled() ? this.animate({
        delay: r,
        duration: r,
        complete: n
      }) : this;
    };
  },
  // delay
  delayAnimation: function() {
    return function(r, n) {
      var a = this._private.cy || this;
      return a.styleEnabled() ? this.animation({
        delay: r,
        duration: r,
        complete: n
      }) : this;
    };
  },
  // delay
  animation: function() {
    return function(r, n) {
      var a = this, i = a.length !== void 0, o = i ? a : [a], s = this._private.cy || this, u = !i, l = !u;
      if (!s.styleEnabled())
        return this;
      var c = s.style();
      r = ze({}, r, n);
      var d = Object.keys(r).length === 0;
      if (d)
        return new Ip(o[0], r);
      switch (r.duration === void 0 && (r.duration = 400), r.duration) {
        case "slow":
          r.duration = 600;
          break;
        case "fast":
          r.duration = 200;
          break;
      }
      if (l && (r.style = c.getPropsList(r.style || r.css), r.css = void 0), l && r.renderedPosition != null) {
        var f = r.renderedPosition, h = s.pan(), v = s.zoom();
        r.position = pS(f, v, h);
      }
      if (u && r.panBy != null) {
        var p = r.panBy, g = s.pan();
        r.pan = {
          x: g.x + p.x,
          y: g.y + p.y
        };
      }
      var y = r.center || r.centre;
      if (u && y != null) {
        var m = s.getCenterPan(y.eles, r.zoom);
        m != null && (r.pan = m);
      }
      if (u && r.fit != null) {
        var b = r.fit, w = s.getFitViewport(b.eles || b.boundingBox, b.padding);
        w != null && (r.pan = w.pan, r.zoom = w.zoom);
      }
      if (u && Xe(r.zoom)) {
        var x = s.getZoomedViewport(r.zoom);
        x != null ? (x.zoomed && (r.zoom = x.zoom), x.panned && (r.pan = x.pan)) : r.zoom = null;
      }
      return new Ip(o[0], r);
    };
  },
  // animate
  animate: function() {
    return function(r, n) {
      var a = this, i = a.length !== void 0, o = i ? a : [a], s = this._private.cy || this;
      if (!s.styleEnabled())
        return this;
      n && (r = ze({}, r, n));
      for (var u = 0; u < o.length; u++) {
        var l = o[u], c = l.animated() && (r.queue === void 0 || r.queue), d = l.animation(r, c ? {
          queue: !0
        } : void 0);
        d.play();
      }
      return this;
    };
  },
  // animate
  stop: function() {
    return function(r, n) {
      var a = this, i = a.length !== void 0, o = i ? a : [a], s = this._private.cy || this;
      if (!s.styleEnabled())
        return this;
      for (var u = 0; u < o.length; u++) {
        for (var l = o[u], c = l._private, d = c.animation.current, f = 0; f < d.length; f++) {
          var h = d[f], v = h._private;
          n && (v.duration = 0);
        }
        r && (c.animation.queue = []), n || (c.animation.current = []);
      }
      return s.notify("draw"), this;
    };
  }
  // stop
}, Jq = Array.isArray, $l = Jq, Qq = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, e3 = /^\w*$/;
function t3(t, e) {
  if ($l(t))
    return !1;
  var r = typeof t;
  return r == "number" || r == "symbol" || r == "boolean" || t == null || ns(t) ? !0 : e3.test(t) || !Qq.test(t) || e != null && t in Object(e);
}
var r3 = t3, n3 = "[object AsyncFunction]", a3 = "[object Function]", i3 = "[object GeneratorFunction]", o3 = "[object Proxy]";
function s3(t) {
  if (!Aa(t))
    return !1;
  var e = oS(t);
  return e == a3 || e == i3 || e == n3 || e == o3;
}
var l3 = s3, u3 = Ll["__core-js_shared__"], Fu = u3, d0 = function() {
  var t = /[^.]+$/.exec(Fu && Fu.keys && Fu.keys.IE_PROTO || "");
  return t ? "Symbol(src)_1." + t : "";
}();
function c3(t) {
  return !!d0 && d0 in t;
}
var d3 = c3, f3 = Function.prototype, v3 = f3.toString;
function h3(t) {
  if (t != null) {
    try {
      return v3.call(t);
    } catch {
    }
    try {
      return t + "";
    } catch {
    }
  }
  return "";
}
var p3 = h3, g3 = /[\\^$.*+?()[\]{}|]/g, y3 = /^\[object .+?Constructor\]$/, m3 = Function.prototype, b3 = Object.prototype, w3 = m3.toString, C3 = b3.hasOwnProperty, x3 = RegExp(
  "^" + w3.call(C3).replace(g3, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function E3(t) {
  if (!Aa(t) || d3(t))
    return !1;
  var e = l3(t) ? x3 : y3;
  return e.test(p3(t));
}
var S3 = E3;
function k3(t, e) {
  return t == null ? void 0 : t[e];
}
var _3 = k3;
function T3(t, e) {
  var r = _3(t, e);
  return S3(r) ? r : void 0;
}
var Mg = T3, I3 = Mg(Object, "create"), No = I3;
function O3() {
  this.__data__ = No ? No(null) : {}, this.size = 0;
}
var A3 = O3;
function P3(t) {
  var e = this.has(t) && delete this.__data__[t];
  return this.size -= e ? 1 : 0, e;
}
var D3 = P3, R3 = "__lodash_hash_undefined__", L3 = Object.prototype, F3 = L3.hasOwnProperty;
function M3(t) {
  var e = this.__data__;
  if (No) {
    var r = e[t];
    return r === R3 ? void 0 : r;
  }
  return F3.call(e, t) ? e[t] : void 0;
}
var N3 = M3, B3 = Object.prototype, $3 = B3.hasOwnProperty;
function q3(t) {
  var e = this.__data__;
  return No ? e[t] !== void 0 : $3.call(e, t);
}
var z3 = q3, V3 = "__lodash_hash_undefined__";
function H3(t, e) {
  var r = this.__data__;
  return this.size += this.has(t) ? 0 : 1, r[t] = No && e === void 0 ? V3 : e, this;
}
var K3 = H3;
function Ni(t) {
  var e = -1, r = t == null ? 0 : t.length;
  for (this.clear(); ++e < r; ) {
    var n = t[e];
    this.set(n[0], n[1]);
  }
}
Ni.prototype.clear = A3;
Ni.prototype.delete = D3;
Ni.prototype.get = N3;
Ni.prototype.has = z3;
Ni.prototype.set = K3;
var f0 = Ni;
function G3() {
  this.__data__ = [], this.size = 0;
}
var U3 = G3;
function W3(t, e) {
  return t === e || t !== t && e !== e;
}
var PS = W3;
function j3(t, e) {
  for (var r = t.length; r--; )
    if (PS(t[r][0], e))
      return r;
  return -1;
}
var ql = j3, Y3 = Array.prototype, Z3 = Y3.splice;
function X3(t) {
  var e = this.__data__, r = ql(e, t);
  if (r < 0)
    return !1;
  var n = e.length - 1;
  return r == n ? e.pop() : Z3.call(e, r, 1), --this.size, !0;
}
var J3 = X3;
function Q3(t) {
  var e = this.__data__, r = ql(e, t);
  return r < 0 ? void 0 : e[r][1];
}
var e4 = Q3;
function t4(t) {
  return ql(this.__data__, t) > -1;
}
var r4 = t4;
function n4(t, e) {
  var r = this.__data__, n = ql(r, t);
  return n < 0 ? (++this.size, r.push([t, e])) : r[n][1] = e, this;
}
var a4 = n4;
function Bi(t) {
  var e = -1, r = t == null ? 0 : t.length;
  for (this.clear(); ++e < r; ) {
    var n = t[e];
    this.set(n[0], n[1]);
  }
}
Bi.prototype.clear = U3;
Bi.prototype.delete = J3;
Bi.prototype.get = e4;
Bi.prototype.has = r4;
Bi.prototype.set = a4;
var i4 = Bi, o4 = Mg(Ll, "Map"), s4 = o4;
function l4() {
  this.size = 0, this.__data__ = {
    hash: new f0(),
    map: new (s4 || i4)(),
    string: new f0()
  };
}
var u4 = l4;
function c4(t) {
  var e = typeof t;
  return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
}
var d4 = c4;
function f4(t, e) {
  var r = t.__data__;
  return d4(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
}
var zl = f4;
function v4(t) {
  var e = zl(this, t).delete(t);
  return this.size -= e ? 1 : 0, e;
}
var h4 = v4;
function p4(t) {
  return zl(this, t).get(t);
}
var g4 = p4;
function y4(t) {
  return zl(this, t).has(t);
}
var m4 = y4;
function b4(t, e) {
  var r = zl(this, t), n = r.size;
  return r.set(t, e), this.size += r.size == n ? 0 : 1, this;
}
var w4 = b4;
function $i(t) {
  var e = -1, r = t == null ? 0 : t.length;
  for (this.clear(); ++e < r; ) {
    var n = t[e];
    this.set(n[0], n[1]);
  }
}
$i.prototype.clear = u4;
$i.prototype.delete = h4;
$i.prototype.get = g4;
$i.prototype.has = m4;
$i.prototype.set = w4;
var DS = $i, C4 = "Expected a function";
function Ng(t, e) {
  if (typeof t != "function" || e != null && typeof e != "function")
    throw new TypeError(C4);
  var r = function() {
    var n = arguments, a = e ? e.apply(this, n) : n[0], i = r.cache;
    if (i.has(a))
      return i.get(a);
    var o = t.apply(this, n);
    return r.cache = i.set(a, o) || i, o;
  };
  return r.cache = new (Ng.Cache || DS)(), r;
}
Ng.Cache = DS;
var x4 = Ng, E4 = 500;
function S4(t) {
  var e = x4(t, function(n) {
    return r.size === E4 && r.clear(), n;
  }), r = e.cache;
  return e;
}
var k4 = S4, _4 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, T4 = /\\(\\)?/g, I4 = k4(function(t) {
  var e = [];
  return t.charCodeAt(0) === 46 && e.push(""), t.replace(_4, function(r, n, a, i) {
    e.push(a ? i.replace(T4, "$1") : n || r);
  }), e;
}), RS = I4;
function O4(t, e) {
  for (var r = -1, n = t == null ? 0 : t.length, a = Array(n); ++r < n; )
    a[r] = e(t[r], r, t);
  return a;
}
var LS = O4, A4 = 1 / 0, v0 = _i ? _i.prototype : void 0, h0 = v0 ? v0.toString : void 0;
function FS(t) {
  if (typeof t == "string")
    return t;
  if ($l(t))
    return LS(t, FS) + "";
  if (ns(t))
    return h0 ? h0.call(t) : "";
  var e = t + "";
  return e == "0" && 1 / t == -A4 ? "-0" : e;
}
var P4 = FS;
function D4(t) {
  return t == null ? "" : P4(t);
}
var MS = D4;
function R4(t, e) {
  return $l(t) ? t : r3(t, e) ? [t] : RS(MS(t));
}
var NS = R4, L4 = 1 / 0;
function F4(t) {
  if (typeof t == "string" || ns(t))
    return t;
  var e = t + "";
  return e == "0" && 1 / t == -L4 ? "-0" : e;
}
var Bg = F4;
function M4(t, e) {
  e = NS(e, t);
  for (var r = 0, n = e.length; t != null && r < n; )
    t = t[Bg(e[r++])];
  return r && r == n ? t : void 0;
}
var N4 = M4;
function B4(t, e, r) {
  var n = t == null ? void 0 : N4(t, e);
  return n === void 0 ? r : n;
}
var $4 = B4, q4 = function() {
  try {
    var t = Mg(Object, "defineProperty");
    return t({}, "", {}), t;
  } catch {
  }
}(), p0 = q4;
function z4(t, e, r) {
  e == "__proto__" && p0 ? p0(t, e, {
    configurable: !0,
    enumerable: !0,
    value: r,
    writable: !0
  }) : t[e] = r;
}
var V4 = z4, H4 = Object.prototype, K4 = H4.hasOwnProperty;
function G4(t, e, r) {
  var n = t[e];
  (!(K4.call(t, e) && PS(n, r)) || r === void 0 && !(e in t)) && V4(t, e, r);
}
var U4 = G4, W4 = 9007199254740991, j4 = /^(?:0|[1-9]\d*)$/;
function Y4(t, e) {
  var r = typeof t;
  return e = e ?? W4, !!e && (r == "number" || r != "symbol" && j4.test(t)) && t > -1 && t % 1 == 0 && t < e;
}
var Z4 = Y4;
function X4(t, e, r, n) {
  if (!Aa(t))
    return t;
  e = NS(e, t);
  for (var a = -1, i = e.length, o = i - 1, s = t; s != null && ++a < i; ) {
    var u = Bg(e[a]), l = r;
    if (u === "__proto__" || u === "constructor" || u === "prototype")
      return t;
    if (a != o) {
      var c = s[u];
      l = n ? n(c, u, s) : void 0, l === void 0 && (l = Aa(c) ? c : Z4(e[a + 1]) ? [] : {});
    }
    U4(s, u, l), s = s[u];
  }
  return t;
}
var J4 = X4;
function Q4(t, e, r) {
  return t == null ? t : J4(t, e, r);
}
var ez = Q4;
function tz(t, e) {
  var r = -1, n = t.length;
  for (e || (e = Array(n)); ++r < n; )
    e[r] = t[r];
  return e;
}
var rz = tz;
function nz(t) {
  return $l(t) ? LS(t, Bg) : ns(t) ? [t] : rz(RS(MS(t)));
}
var az = nz, iz = {
  // access data field
  data: function(e) {
    var r = {
      field: "data",
      bindingEvent: "data",
      allowBinding: !1,
      allowSetting: !1,
      allowGetting: !1,
      settingEvent: "data",
      settingTriggersEvent: !1,
      triggerFnName: "trigger",
      immutableKeys: {},
      // key => true if immutable
      updateStyle: !1,
      beforeGet: function(a) {
      },
      beforeSet: function(a, i) {
      },
      onSet: function(a) {
      },
      canSet: function(a) {
        return !0;
      }
    };
    return e = ze({}, r, e), function(a, i) {
      var o = e, s = this, u = s.length !== void 0, l = u ? s : [s], c = u ? s[0] : s;
      if (Me(a)) {
        var d = a.indexOf(".") !== -1, f = d && az(a);
        if (o.allowGetting && i === void 0) {
          var h;
          return c && (o.beforeGet(c), f && c._private[o.field][a] === void 0 ? h = $4(c._private[o.field], f) : h = c._private[o.field][a]), h;
        } else if (o.allowSetting && i !== void 0) {
          var v = !o.immutableKeys[a];
          if (v) {
            var p = Y2({}, a, i);
            o.beforeSet(s, p);
            for (var g = 0, y = l.length; g < y; g++) {
              var m = l[g];
              o.canSet(m) && (f && c._private[o.field][a] === void 0 ? ez(m._private[o.field], f, i) : m._private[o.field][a] = i);
            }
            o.updateStyle && s.updateStyle(), o.onSet(s), o.settingTriggersEvent && s[o.triggerFnName](o.settingEvent);
          }
        }
      } else if (o.allowSetting && Xe(a)) {
        var b = a, w, x, E = Object.keys(b);
        o.beforeSet(s, b);
        for (var C = 0; C < E.length; C++) {
          w = E[C], x = b[w];
          var k = !o.immutableKeys[w];
          if (k)
            for (var S = 0; S < l.length; S++) {
              var _ = l[S];
              o.canSet(_) && (_._private[o.field][w] = x);
            }
        }
        o.updateStyle && s.updateStyle(), o.onSet(s), o.settingTriggersEvent && s[o.triggerFnName](o.settingEvent);
      } else if (o.allowBinding && yt(a)) {
        var T = a;
        s.on(o.bindingEvent, T);
      } else if (o.allowGetting && a === void 0) {
        var O;
        return c && (o.beforeGet(c), O = c._private[o.field]), O;
      }
      return s;
    };
  },
  // data
  // remove data field
  removeData: function(e) {
    var r = {
      field: "data",
      event: "data",
      triggerFnName: "trigger",
      triggerEvent: !1,
      immutableKeys: {}
      // key => true if immutable
    };
    return e = ze({}, r, e), function(a) {
      var i = e, o = this, s = o.length !== void 0, u = s ? o : [o];
      if (Me(a)) {
        for (var l = a.split(/\s+/), c = l.length, d = 0; d < c; d++) {
          var f = l[d];
          if (!ea(f)) {
            var h = !i.immutableKeys[f];
            if (h)
              for (var v = 0, p = u.length; v < p; v++)
                u[v]._private[i.field][f] = void 0;
          }
        }
        i.triggerEvent && o[i.triggerFnName](i.event);
      } else if (a === void 0) {
        for (var g = 0, y = u.length; g < y; g++)
          for (var m = u[g]._private[i.field], b = Object.keys(m), w = 0; w < b.length; w++) {
            var x = b[w], E = !i.immutableKeys[x];
            E && (m[x] = void 0);
          }
        i.triggerEvent && o[i.triggerFnName](i.event);
      }
      return o;
    };
  }
  // removeData
}, oz = {
  eventAliasesOn: function(e) {
    var r = e;
    r.addListener = r.listen = r.bind = r.on, r.unlisten = r.unbind = r.off = r.removeListener, r.trigger = r.emit, r.pon = r.promiseOn = function(n, a) {
      var i = this, o = Array.prototype.slice.call(arguments, 0);
      return new Mi(function(s, u) {
        var l = function(h) {
          i.off.apply(i, d), s(h);
        }, c = o.concat([l]), d = c.concat([]);
        i.on.apply(i, c);
      });
    };
  }
}, et = {};
[Xq, iz, oz].forEach(function(t) {
  ze(et, t);
});
var sz = {
  animate: et.animate(),
  animation: et.animation(),
  animated: et.animated(),
  clearQueue: et.clearQueue(),
  delay: et.delay(),
  delayAnimation: et.delayAnimation(),
  stop: et.stop()
}, Ks = {
  classes: function(e) {
    var r = this;
    if (e === void 0) {
      var n = [];
      return r[0]._private.classes.forEach(function(v) {
        return n.push(v);
      }), n;
    } else lt(e) || (e = (e || "").match(/\S+/g) || []);
    for (var a = [], i = new Fi(e), o = 0; o < r.length; o++) {
      for (var s = r[o], u = s._private, l = u.classes, c = !1, d = 0; d < e.length; d++) {
        var f = e[d], h = l.has(f);
        if (!h) {
          c = !0;
          break;
        }
      }
      c || (c = l.size !== e.length), c && (u.classes = i, a.push(s));
    }
    return a.length > 0 && this.spawn(a).updateStyle().emit("class"), r;
  },
  addClass: function(e) {
    return this.toggleClass(e, !0);
  },
  hasClass: function(e) {
    var r = this[0];
    return r != null && r._private.classes.has(e);
  },
  toggleClass: function(e, r) {
    lt(e) || (e = e.match(/\S+/g) || []);
    for (var n = this, a = r === void 0, i = [], o = 0, s = n.length; o < s; o++)
      for (var u = n[o], l = u._private.classes, c = !1, d = 0; d < e.length; d++) {
        var f = e[d], h = l.has(f), v = !1;
        r || a && !h ? (l.add(f), v = !0) : (!r || a && h) && (l.delete(f), v = !0), !c && v && (i.push(u), c = !0);
      }
    return i.length > 0 && this.spawn(i).updateStyle().emit("class"), n;
  },
  removeClass: function(e) {
    return this.toggleClass(e, !1);
  },
  flashClass: function(e, r) {
    var n = this;
    if (r == null)
      r = 250;
    else if (r === 0)
      return n;
    return n.addClass(e), setTimeout(function() {
      n.removeClass(e);
    }, r), n;
  }
};
Ks.className = Ks.classNames = Ks.classes;
var Ze = {
  metaChar: "[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",
  // chars we need to escape in let names, etc
  comparatorOp: "=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",
  // binary comparison op (used in data selectors)
  boolOp: "\\?|\\!|\\^",
  // boolean (unary) operators (used in data selectors)
  string: `"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,
  // string literals (used in data selectors) -- doublequotes | singlequotes
  number: Mt,
  // number literal (used in data selectors) --- e.g. 0.1234, 1234, 12e123
  meta: "degree|indegree|outdegree",
  // allowed metadata fields (i.e. allowed functions to use from Collection)
  separator: "\\s*,\\s*",
  // queries are separated by commas, e.g. edge[foo = 'bar'], node.someClass
  descendant: "\\s+",
  child: "\\s+>\\s+",
  subject: "\\$",
  group: "node|edge|\\*",
  directedEdge: "\\s+->\\s+",
  undirectedEdge: "\\s+<->\\s+"
};
Ze.variable = "(?:[\\w-.]|(?:\\\\" + Ze.metaChar + "))+";
Ze.className = "(?:[\\w-]|(?:\\\\" + Ze.metaChar + "))+";
Ze.value = Ze.string + "|" + Ze.number;
Ze.id = Ze.variable;
(function() {
  var t, e, r;
  for (t = Ze.comparatorOp.split("|"), r = 0; r < t.length; r++)
    e = t[r], Ze.comparatorOp += "|@" + e;
  for (t = Ze.comparatorOp.split("|"), r = 0; r < t.length; r++)
    e = t[r], !(e.indexOf("!") >= 0) && e !== "=" && (Ze.comparatorOp += "|\\!" + e);
})();
var it = function() {
  return {
    checks: []
  };
}, Te = {
  /** E.g. node */
  GROUP: 0,
  /** A collection of elements */
  COLLECTION: 1,
  /** A filter(ele) function */
  FILTER: 2,
  /** E.g. [foo > 1] */
  DATA_COMPARE: 3,
  /** E.g. [foo] */
  DATA_EXIST: 4,
  /** E.g. [?foo] */
  DATA_BOOL: 5,
  /** E.g. [[degree > 2]] */
  META_COMPARE: 6,
  /** E.g. :selected */
  STATE: 7,
  /** E.g. #foo */
  ID: 8,
  /** E.g. .foo */
  CLASS: 9,
  /** E.g. #foo <-> #bar */
  UNDIRECTED_EDGE: 10,
  /** E.g. #foo -> #bar */
  DIRECTED_EDGE: 11,
  /** E.g. $#foo -> #bar */
  NODE_SOURCE: 12,
  /** E.g. #foo -> $#bar */
  NODE_TARGET: 13,
  /** E.g. $#foo <-> #bar */
  NODE_NEIGHBOR: 14,
  /** E.g. #foo > #bar */
  CHILD: 15,
  /** E.g. #foo #bar */
  DESCENDANT: 16,
  /** E.g. $#foo > #bar */
  PARENT: 17,
  /** E.g. $#foo #bar */
  ANCESTOR: 18,
  /** E.g. #foo > $bar > #baz */
  COMPOUND_SPLIT: 19,
  /** Always matches, useful placeholder for subject in `COMPOUND_SPLIT` */
  TRUE: 20
}, Op = [{
  selector: ":selected",
  matches: function(e) {
    return e.selected();
  }
}, {
  selector: ":unselected",
  matches: function(e) {
    return !e.selected();
  }
}, {
  selector: ":selectable",
  matches: function(e) {
    return e.selectable();
  }
}, {
  selector: ":unselectable",
  matches: function(e) {
    return !e.selectable();
  }
}, {
  selector: ":locked",
  matches: function(e) {
    return e.locked();
  }
}, {
  selector: ":unlocked",
  matches: function(e) {
    return !e.locked();
  }
}, {
  selector: ":visible",
  matches: function(e) {
    return e.visible();
  }
}, {
  selector: ":hidden",
  matches: function(e) {
    return !e.visible();
  }
}, {
  selector: ":transparent",
  matches: function(e) {
    return e.transparent();
  }
}, {
  selector: ":grabbed",
  matches: function(e) {
    return e.grabbed();
  }
}, {
  selector: ":free",
  matches: function(e) {
    return !e.grabbed();
  }
}, {
  selector: ":removed",
  matches: function(e) {
    return e.removed();
  }
}, {
  selector: ":inside",
  matches: function(e) {
    return !e.removed();
  }
}, {
  selector: ":grabbable",
  matches: function(e) {
    return e.grabbable();
  }
}, {
  selector: ":ungrabbable",
  matches: function(e) {
    return !e.grabbable();
  }
}, {
  selector: ":animated",
  matches: function(e) {
    return e.animated();
  }
}, {
  selector: ":unanimated",
  matches: function(e) {
    return !e.animated();
  }
}, {
  selector: ":parent",
  matches: function(e) {
    return e.isParent();
  }
}, {
  selector: ":childless",
  matches: function(e) {
    return e.isChildless();
  }
}, {
  selector: ":child",
  matches: function(e) {
    return e.isChild();
  }
}, {
  selector: ":orphan",
  matches: function(e) {
    return e.isOrphan();
  }
}, {
  selector: ":nonorphan",
  matches: function(e) {
    return e.isChild();
  }
}, {
  selector: ":compound",
  matches: function(e) {
    return e.isNode() ? e.isParent() : e.source().isParent() || e.target().isParent();
  }
}, {
  selector: ":loop",
  matches: function(e) {
    return e.isLoop();
  }
}, {
  selector: ":simple",
  matches: function(e) {
    return e.isSimple();
  }
}, {
  selector: ":active",
  matches: function(e) {
    return e.active();
  }
}, {
  selector: ":inactive",
  matches: function(e) {
    return !e.active();
  }
}, {
  selector: ":backgrounding",
  matches: function(e) {
    return e.backgrounding();
  }
}, {
  selector: ":nonbackgrounding",
  matches: function(e) {
    return !e.backgrounding();
  }
}].sort(function(t, e) {
  return bB(t.selector, e.selector);
}), lz = function() {
  for (var t = {}, e, r = 0; r < Op.length; r++)
    e = Op[r], t[e.selector] = e.matches;
  return t;
}(), uz = function(e, r) {
  return lz[e](r);
}, cz = "(" + Op.map(function(t) {
  return t.selector;
}).join("|") + ")", ei = function(e) {
  return e.replace(new RegExp("\\\\(" + Ze.metaChar + ")", "g"), function(r, n) {
    return n;
  });
}, qn = function(e, r, n) {
  e[e.length - 1] = n;
}, Ap = [{
  name: "group",
  // just used for identifying when debugging
  query: !0,
  regex: "(" + Ze.group + ")",
  populate: function(e, r, n) {
    var a = Vr(n, 1), i = a[0];
    r.checks.push({
      type: Te.GROUP,
      value: i === "*" ? i : i + "s"
    });
  }
}, {
  name: "state",
  query: !0,
  regex: cz,
  populate: function(e, r, n) {
    var a = Vr(n, 1), i = a[0];
    r.checks.push({
      type: Te.STATE,
      value: i
    });
  }
}, {
  name: "id",
  query: !0,
  regex: "\\#(" + Ze.id + ")",
  populate: function(e, r, n) {
    var a = Vr(n, 1), i = a[0];
    r.checks.push({
      type: Te.ID,
      value: ei(i)
    });
  }
}, {
  name: "className",
  query: !0,
  regex: "\\.(" + Ze.className + ")",
  populate: function(e, r, n) {
    var a = Vr(n, 1), i = a[0];
    r.checks.push({
      type: Te.CLASS,
      value: ei(i)
    });
  }
}, {
  name: "dataExists",
  query: !0,
  regex: "\\[\\s*(" + Ze.variable + ")\\s*\\]",
  populate: function(e, r, n) {
    var a = Vr(n, 1), i = a[0];
    r.checks.push({
      type: Te.DATA_EXIST,
      field: ei(i)
    });
  }
}, {
  name: "dataCompare",
  query: !0,
  regex: "\\[\\s*(" + Ze.variable + ")\\s*(" + Ze.comparatorOp + ")\\s*(" + Ze.value + ")\\s*\\]",
  populate: function(e, r, n) {
    var a = Vr(n, 3), i = a[0], o = a[1], s = a[2], u = new RegExp("^" + Ze.string + "$").exec(s) != null;
    u ? s = s.substring(1, s.length - 1) : s = parseFloat(s), r.checks.push({
      type: Te.DATA_COMPARE,
      field: ei(i),
      operator: o,
      value: s
    });
  }
}, {
  name: "dataBool",
  query: !0,
  regex: "\\[\\s*(" + Ze.boolOp + ")\\s*(" + Ze.variable + ")\\s*\\]",
  populate: function(e, r, n) {
    var a = Vr(n, 2), i = a[0], o = a[1];
    r.checks.push({
      type: Te.DATA_BOOL,
      field: ei(o),
      operator: i
    });
  }
}, {
  name: "metaCompare",
  query: !0,
  regex: "\\[\\[\\s*(" + Ze.meta + ")\\s*(" + Ze.comparatorOp + ")\\s*(" + Ze.number + ")\\s*\\]\\]",
  populate: function(e, r, n) {
    var a = Vr(n, 3), i = a[0], o = a[1], s = a[2];
    r.checks.push({
      type: Te.META_COMPARE,
      field: ei(i),
      operator: o,
      value: parseFloat(s)
    });
  }
}, {
  name: "nextQuery",
  separator: !0,
  regex: Ze.separator,
  populate: function(e, r) {
    var n = e.currentSubject, a = e.edgeCount, i = e.compoundCount, o = e[e.length - 1];
    n != null && (o.subject = n, e.currentSubject = null), o.edgeCount = a, o.compoundCount = i, e.edgeCount = 0, e.compoundCount = 0;
    var s = e[e.length++] = it();
    return s;
  }
}, {
  name: "directedEdge",
  separator: !0,
  regex: Ze.directedEdge,
  populate: function(e, r) {
    if (e.currentSubject == null) {
      var n = it(), a = r, i = it();
      return n.checks.push({
        type: Te.DIRECTED_EDGE,
        source: a,
        target: i
      }), qn(e, r, n), e.edgeCount++, i;
    } else {
      var o = it(), s = r, u = it();
      return o.checks.push({
        type: Te.NODE_SOURCE,
        source: s,
        target: u
      }), qn(e, r, o), e.edgeCount++, u;
    }
  }
}, {
  name: "undirectedEdge",
  separator: !0,
  regex: Ze.undirectedEdge,
  populate: function(e, r) {
    if (e.currentSubject == null) {
      var n = it(), a = r, i = it();
      return n.checks.push({
        type: Te.UNDIRECTED_EDGE,
        nodes: [a, i]
      }), qn(e, r, n), e.edgeCount++, i;
    } else {
      var o = it(), s = r, u = it();
      return o.checks.push({
        type: Te.NODE_NEIGHBOR,
        node: s,
        neighbor: u
      }), qn(e, r, o), u;
    }
  }
}, {
  name: "child",
  separator: !0,
  regex: Ze.child,
  populate: function(e, r) {
    if (e.currentSubject == null) {
      var n = it(), a = it(), i = e[e.length - 1];
      return n.checks.push({
        type: Te.CHILD,
        parent: i,
        child: a
      }), qn(e, r, n), e.compoundCount++, a;
    } else if (e.currentSubject === r) {
      var o = it(), s = e[e.length - 1], u = it(), l = it(), c = it(), d = it();
      return o.checks.push({
        type: Te.COMPOUND_SPLIT,
        left: s,
        right: u,
        subject: l
      }), l.checks = r.checks, r.checks = [{
        type: Te.TRUE
      }], d.checks.push({
        type: Te.TRUE
      }), u.checks.push({
        type: Te.PARENT,
        // type is swapped on right side queries
        parent: d,
        child: c
        // empty for now
      }), qn(e, s, o), e.currentSubject = l, e.compoundCount++, c;
    } else {
      var f = it(), h = it(), v = [{
        type: Te.PARENT,
        parent: f,
        child: h
      }];
      return f.checks = r.checks, r.checks = v, e.compoundCount++, h;
    }
  }
}, {
  name: "descendant",
  separator: !0,
  regex: Ze.descendant,
  populate: function(e, r) {
    if (e.currentSubject == null) {
      var n = it(), a = it(), i = e[e.length - 1];
      return n.checks.push({
        type: Te.DESCENDANT,
        ancestor: i,
        descendant: a
      }), qn(e, r, n), e.compoundCount++, a;
    } else if (e.currentSubject === r) {
      var o = it(), s = e[e.length - 1], u = it(), l = it(), c = it(), d = it();
      return o.checks.push({
        type: Te.COMPOUND_SPLIT,
        left: s,
        right: u,
        subject: l
      }), l.checks = r.checks, r.checks = [{
        type: Te.TRUE
      }], d.checks.push({
        type: Te.TRUE
      }), u.checks.push({
        type: Te.ANCESTOR,
        // type is swapped on right side queries
        ancestor: d,
        descendant: c
        // empty for now
      }), qn(e, s, o), e.currentSubject = l, e.compoundCount++, c;
    } else {
      var f = it(), h = it(), v = [{
        type: Te.ANCESTOR,
        ancestor: f,
        descendant: h
      }];
      return f.checks = r.checks, r.checks = v, e.compoundCount++, h;
    }
  }
}, {
  name: "subject",
  modifier: !0,
  regex: Ze.subject,
  populate: function(e, r) {
    if (e.currentSubject != null && e.currentSubject !== r)
      return tt("Redefinition of subject in selector `" + e.toString() + "`"), !1;
    e.currentSubject = r;
    var n = e[e.length - 1], a = n.checks[0], i = a == null ? null : a.type;
    i === Te.DIRECTED_EDGE ? a.type = Te.NODE_TARGET : i === Te.UNDIRECTED_EDGE && (a.type = Te.NODE_NEIGHBOR, a.node = a.nodes[1], a.neighbor = a.nodes[0], a.nodes = null);
  }
}];
Ap.forEach(function(t) {
  return t.regexObj = new RegExp("^" + t.regex);
});
var dz = function(e) {
  for (var r, n, a, i = 0; i < Ap.length; i++) {
    var o = Ap[i], s = o.name, u = e.match(o.regexObj);
    if (u != null) {
      n = u, r = o, a = s;
      var l = u[0];
      e = e.substring(l.length);
      break;
    }
  }
  return {
    expr: r,
    match: n,
    name: a,
    remaining: e
  };
}, fz = function(e) {
  var r = e.match(/^\s+/);
  if (r) {
    var n = r[0];
    e = e.substring(n.length);
  }
  return e;
}, vz = function(e) {
  var r = this, n = r.inputText = e, a = r[0] = it();
  for (r.length = 1, n = fz(n); ; ) {
    var i = dz(n);
    if (i.expr == null)
      return tt("The selector `" + e + "`is invalid"), !1;
    var o = i.match.slice(1), s = i.expr.populate(r, a, o);
    if (s === !1)
      return !1;
    if (s != null && (a = s), n = i.remaining, n.match(/^\s*$/))
      break;
  }
  var u = r[r.length - 1];
  r.currentSubject != null && (u.subject = r.currentSubject), u.edgeCount = r.edgeCount, u.compoundCount = r.compoundCount;
  for (var l = 0; l < r.length; l++) {
    var c = r[l];
    if (c.compoundCount > 0 && c.edgeCount > 0)
      return tt("The selector `" + e + "` is invalid because it uses both a compound selector and an edge selector"), !1;
    if (c.edgeCount > 1)
      return tt("The selector `" + e + "` is invalid because it uses multiple edge selectors"), !1;
    c.edgeCount === 1 && tt("The selector `" + e + "` is deprecated.  Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons.  Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.");
  }
  return !0;
}, hz = function() {
  if (this.toStringCache != null)
    return this.toStringCache;
  for (var e = function(c) {
    return c ?? "";
  }, r = function(c) {
    return Me(c) ? '"' + c + '"' : e(c);
  }, n = function(c) {
    return " " + c + " ";
  }, a = function(c, d) {
    var f = c.type, h = c.value;
    switch (f) {
      case Te.GROUP: {
        var v = e(h);
        return v.substring(0, v.length - 1);
      }
      case Te.DATA_COMPARE: {
        var p = c.field, g = c.operator;
        return "[" + p + n(e(g)) + r(h) + "]";
      }
      case Te.DATA_BOOL: {
        var y = c.operator, m = c.field;
        return "[" + e(y) + m + "]";
      }
      case Te.DATA_EXIST: {
        var b = c.field;
        return "[" + b + "]";
      }
      case Te.META_COMPARE: {
        var w = c.operator, x = c.field;
        return "[[" + x + n(e(w)) + r(h) + "]]";
      }
      case Te.STATE:
        return h;
      case Te.ID:
        return "#" + h;
      case Te.CLASS:
        return "." + h;
      case Te.PARENT:
      case Te.CHILD:
        return i(c.parent, d) + n(">") + i(c.child, d);
      case Te.ANCESTOR:
      case Te.DESCENDANT:
        return i(c.ancestor, d) + " " + i(c.descendant, d);
      case Te.COMPOUND_SPLIT: {
        var E = i(c.left, d), C = i(c.subject, d), k = i(c.right, d);
        return E + (E.length > 0 ? " " : "") + C + k;
      }
      case Te.TRUE:
        return "";
    }
  }, i = function(c, d) {
    return c.checks.reduce(function(f, h, v) {
      return f + (d === c && v === 0 ? "$" : "") + a(h, d);
    }, "");
  }, o = "", s = 0; s < this.length; s++) {
    var u = this[s];
    o += i(u, u.subject), this.length > 1 && s < this.length - 1 && (o += ", ");
  }
  return this.toStringCache = o, o;
}, pz = {
  parse: vz,
  toString: hz
}, BS = function(e, r, n) {
  var a, i = Me(e), o = Ce(e), s = Me(n), u, l, c = !1, d = !1, f = !1;
  switch (r.indexOf("!") >= 0 && (r = r.replace("!", ""), d = !0), r.indexOf("@") >= 0 && (r = r.replace("@", ""), c = !0), (i || s || c) && (u = !i && !o ? "" : "" + e, l = "" + n), c && (e = u = u.toLowerCase(), n = l = l.toLowerCase()), r) {
    case "*=":
      a = u.indexOf(l) >= 0;
      break;
    case "$=":
      a = u.indexOf(l, u.length - l.length) >= 0;
      break;
    case "^=":
      a = u.indexOf(l) === 0;
      break;
    case "=":
      a = e === n;
      break;
    case ">":
      f = !0, a = e > n;
      break;
    case ">=":
      f = !0, a = e >= n;
      break;
    case "<":
      f = !0, a = e < n;
      break;
    case "<=":
      f = !0, a = e <= n;
      break;
    default:
      a = !1;
      break;
  }
  return d && (e != null || !f) && (a = !a), a;
}, gz = function(e, r) {
  switch (r) {
    case "?":
      return !!e;
    case "!":
      return !e;
    case "^":
      return e === void 0;
  }
}, yz = function(e) {
  return e !== void 0;
}, $g = function(e, r) {
  return e.data(r);
}, mz = function(e, r) {
  return e[r]();
}, wt = [], ht = function(e, r) {
  return e.checks.every(function(n) {
    return wt[n.type](n, r);
  });
};
wt[Te.GROUP] = function(t, e) {
  var r = t.value;
  return r === "*" || r === e.group();
};
wt[Te.STATE] = function(t, e) {
  var r = t.value;
  return uz(r, e);
};
wt[Te.ID] = function(t, e) {
  var r = t.value;
  return e.id() === r;
};
wt[Te.CLASS] = function(t, e) {
  var r = t.value;
  return e.hasClass(r);
};
wt[Te.META_COMPARE] = function(t, e) {
  var r = t.field, n = t.operator, a = t.value;
  return BS(mz(e, r), n, a);
};
wt[Te.DATA_COMPARE] = function(t, e) {
  var r = t.field, n = t.operator, a = t.value;
  return BS($g(e, r), n, a);
};
wt[Te.DATA_BOOL] = function(t, e) {
  var r = t.field, n = t.operator;
  return gz($g(e, r), n);
};
wt[Te.DATA_EXIST] = function(t, e) {
  var r = t.field;
  return t.operator, yz($g(e, r));
};
wt[Te.UNDIRECTED_EDGE] = function(t, e) {
  var r = t.nodes[0], n = t.nodes[1], a = e.source(), i = e.target();
  return ht(r, a) && ht(n, i) || ht(n, a) && ht(r, i);
};
wt[Te.NODE_NEIGHBOR] = function(t, e) {
  return ht(t.node, e) && e.neighborhood().some(function(r) {
    return r.isNode() && ht(t.neighbor, r);
  });
};
wt[Te.DIRECTED_EDGE] = function(t, e) {
  return ht(t.source, e.source()) && ht(t.target, e.target());
};
wt[Te.NODE_SOURCE] = function(t, e) {
  return ht(t.source, e) && e.outgoers().some(function(r) {
    return r.isNode() && ht(t.target, r);
  });
};
wt[Te.NODE_TARGET] = function(t, e) {
  return ht(t.target, e) && e.incomers().some(function(r) {
    return r.isNode() && ht(t.source, r);
  });
};
wt[Te.CHILD] = function(t, e) {
  return ht(t.child, e) && ht(t.parent, e.parent());
};
wt[Te.PARENT] = function(t, e) {
  return ht(t.parent, e) && e.children().some(function(r) {
    return ht(t.child, r);
  });
};
wt[Te.DESCENDANT] = function(t, e) {
  return ht(t.descendant, e) && e.ancestors().some(function(r) {
    return ht(t.ancestor, r);
  });
};
wt[Te.ANCESTOR] = function(t, e) {
  return ht(t.ancestor, e) && e.descendants().some(function(r) {
    return ht(t.descendant, r);
  });
};
wt[Te.COMPOUND_SPLIT] = function(t, e) {
  return ht(t.subject, e) && ht(t.left, e) && ht(t.right, e);
};
wt[Te.TRUE] = function() {
  return !0;
};
wt[Te.COLLECTION] = function(t, e) {
  var r = t.value;
  return r.has(e);
};
wt[Te.FILTER] = function(t, e) {
  var r = t.value;
  return r(e);
};
var bz = function(e) {
  var r = this;
  if (r.length === 1 && r[0].checks.length === 1 && r[0].checks[0].type === Te.ID)
    return e.getElementById(r[0].checks[0].value).collection();
  var n = function(i) {
    for (var o = 0; o < r.length; o++) {
      var s = r[o];
      if (ht(s, i))
        return !0;
    }
    return !1;
  };
  return r.text() == null && (n = function() {
    return !0;
  }), e.filter(n);
}, wz = function(e) {
  for (var r = this, n = 0; n < r.length; n++) {
    var a = r[n];
    if (ht(a, e))
      return !0;
  }
  return !1;
}, Cz = {
  matches: wz,
  filter: bz
}, ra = function(e) {
  this.inputText = e, this.currentSubject = null, this.compoundCount = 0, this.edgeCount = 0, this.length = 0, e == null || Me(e) && e.match(/^\s*$/) || (xr(e) ? this.addQuery({
    checks: [{
      type: Te.COLLECTION,
      value: e.collection()
    }]
  }) : yt(e) ? this.addQuery({
    checks: [{
      type: Te.FILTER,
      value: e
    }]
  }) : Me(e) ? this.parse(e) || (this.invalid = !0) : bt("A selector must be created from a string; found "));
}, na = ra.prototype;
[pz, Cz].forEach(function(t) {
  return ze(na, t);
});
na.text = function() {
  return this.inputText;
};
na.size = function() {
  return this.length;
};
na.eq = function(t) {
  return this[t];
};
na.sameText = function(t) {
  return !this.invalid && !t.invalid && this.text() === t.text();
};
na.addQuery = function(t) {
  this[this.length++] = t;
};
na.selector = na.toString;
var Zn = {
  allAre: function(e) {
    var r = new ra(e);
    return this.every(function(n) {
      return r.matches(n);
    });
  },
  is: function(e) {
    var r = new ra(e);
    return this.some(function(n) {
      return r.matches(n);
    });
  },
  some: function(e, r) {
    for (var n = 0; n < this.length; n++) {
      var a = r ? e.apply(r, [this[n], n, this]) : e(this[n], n, this);
      if (a)
        return !0;
    }
    return !1;
  },
  every: function(e, r) {
    for (var n = 0; n < this.length; n++) {
      var a = r ? e.apply(r, [this[n], n, this]) : e(this[n], n, this);
      if (!a)
        return !1;
    }
    return !0;
  },
  same: function(e) {
    if (this === e)
      return !0;
    e = this.cy().collection(e);
    var r = this.length, n = e.length;
    return r !== n ? !1 : r === 1 ? this[0] === e[0] : this.every(function(a) {
      return e.hasElementWithId(a.id());
    });
  },
  anySame: function(e) {
    return e = this.cy().collection(e), this.some(function(r) {
      return e.hasElementWithId(r.id());
    });
  },
  allAreNeighbors: function(e) {
    e = this.cy().collection(e);
    var r = this.neighborhood();
    return e.every(function(n) {
      return r.hasElementWithId(n.id());
    });
  },
  contains: function(e) {
    e = this.cy().collection(e);
    var r = this;
    return e.every(function(n) {
      return r.hasElementWithId(n.id());
    });
  }
};
Zn.allAreNeighbours = Zn.allAreNeighbors;
Zn.has = Zn.contains;
Zn.equal = Zn.equals = Zn.same;
var Pr = function(e, r) {
  return function(a, i, o, s) {
    var u = a, l = this, c;
    if (u == null ? c = "" : xr(u) && u.length === 1 && (c = u.id()), l.length === 1 && c) {
      var d = l[0]._private, f = d.traversalCache = d.traversalCache || {}, h = f[r] = f[r] || [], v = Pa(c), p = h[v];
      return p || (h[v] = e.call(l, a, i, o, s));
    } else
      return e.call(l, a, i, o, s);
  };
}, Oi = {
  parent: function(e) {
    var r = [];
    if (this.length === 1) {
      var n = this[0]._private.parent;
      if (n)
        return n;
    }
    for (var a = 0; a < this.length; a++) {
      var i = this[a], o = i._private.parent;
      o && r.push(o);
    }
    return this.spawn(r, !0).filter(e);
  },
  parents: function(e) {
    for (var r = [], n = this.parent(); n.nonempty(); ) {
      for (var a = 0; a < n.length; a++) {
        var i = n[a];
        r.push(i);
      }
      n = n.parent();
    }
    return this.spawn(r, !0).filter(e);
  },
  commonAncestors: function(e) {
    for (var r, n = 0; n < this.length; n++) {
      var a = this[n], i = a.parents();
      r = r || i, r = r.intersect(i);
    }
    return r.filter(e);
  },
  orphans: function(e) {
    return this.stdFilter(function(r) {
      return r.isOrphan();
    }).filter(e);
  },
  nonorphans: function(e) {
    return this.stdFilter(function(r) {
      return r.isChild();
    }).filter(e);
  },
  children: Pr(function(t) {
    for (var e = [], r = 0; r < this.length; r++)
      for (var n = this[r], a = n._private.children, i = 0; i < a.length; i++)
        e.push(a[i]);
    return this.spawn(e, !0).filter(t);
  }, "children"),
  siblings: function(e) {
    return this.parent().children().not(this).filter(e);
  },
  isParent: function() {
    var e = this[0];
    if (e)
      return e.isNode() && e._private.children.length !== 0;
  },
  isChildless: function() {
    var e = this[0];
    if (e)
      return e.isNode() && e._private.children.length === 0;
  },
  isChild: function() {
    var e = this[0];
    if (e)
      return e.isNode() && e._private.parent != null;
  },
  isOrphan: function() {
    var e = this[0];
    if (e)
      return e.isNode() && e._private.parent == null;
  },
  descendants: function(e) {
    var r = [];
    function n(a) {
      for (var i = 0; i < a.length; i++) {
        var o = a[i];
        r.push(o), o.children().nonempty() && n(o.children());
      }
    }
    return n(this.children()), this.spawn(r, !0).filter(e);
  }
};
function qg(t, e, r, n) {
  for (var a = [], i = new Fi(), o = t.cy(), s = o.hasCompoundNodes(), u = 0; u < t.length; u++) {
    var l = t[u];
    r ? a.push(l) : s && n(a, i, l);
  }
  for (; a.length > 0; ) {
    var c = a.shift();
    e(c), i.add(c.id()), s && n(a, i, c);
  }
  return t;
}
function $S(t, e, r) {
  if (r.isParent())
    for (var n = r._private.children, a = 0; a < n.length; a++) {
      var i = n[a];
      e.has(i.id()) || t.push(i);
    }
}
Oi.forEachDown = function(t) {
  var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
  return qg(this, t, e, $S);
};
function qS(t, e, r) {
  if (r.isChild()) {
    var n = r._private.parent;
    e.has(n.id()) || t.push(n);
  }
}
Oi.forEachUp = function(t) {
  var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
  return qg(this, t, e, qS);
};
function xz(t, e, r) {
  qS(t, e, r), $S(t, e, r);
}
Oi.forEachUpAndDown = function(t) {
  var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
  return qg(this, t, e, xz);
};
Oi.ancestors = Oi.parents;
var Bo, zS;
Bo = zS = {
  data: et.data({
    field: "data",
    bindingEvent: "data",
    allowBinding: !0,
    allowSetting: !0,
    settingEvent: "data",
    settingTriggersEvent: !0,
    triggerFnName: "trigger",
    allowGetting: !0,
    immutableKeys: {
      id: !0,
      source: !0,
      target: !0,
      parent: !0
    },
    updateStyle: !0
  }),
  removeData: et.removeData({
    field: "data",
    event: "data",
    triggerFnName: "trigger",
    triggerEvent: !0,
    immutableKeys: {
      id: !0,
      source: !0,
      target: !0,
      parent: !0
    },
    updateStyle: !0
  }),
  scratch: et.data({
    field: "scratch",
    bindingEvent: "scratch",
    allowBinding: !0,
    allowSetting: !0,
    settingEvent: "scratch",
    settingTriggersEvent: !0,
    triggerFnName: "trigger",
    allowGetting: !0,
    updateStyle: !0
  }),
  removeScratch: et.removeData({
    field: "scratch",
    event: "scratch",
    triggerFnName: "trigger",
    triggerEvent: !0,
    updateStyle: !0
  }),
  rscratch: et.data({
    field: "rscratch",
    allowBinding: !1,
    allowSetting: !0,
    settingTriggersEvent: !1,
    allowGetting: !0
  }),
  removeRscratch: et.removeData({
    field: "rscratch",
    triggerEvent: !1
  }),
  id: function() {
    var e = this[0];
    if (e)
      return e._private.data.id;
  }
};
Bo.attr = Bo.data;
Bo.removeAttr = Bo.removeData;
var Ez = zS, Vl = {};
function Mu(t) {
  return function(e) {
    var r = this;
    if (e === void 0 && (e = !0), r.length !== 0)
      if (r.isNode() && !r.removed()) {
        for (var n = 0, a = r[0], i = a._private.edges, o = 0; o < i.length; o++) {
          var s = i[o];
          !e && s.isLoop() || (n += t(a, s));
        }
        return n;
      } else
        return;
  };
}
ze(Vl, {
  degree: Mu(function(t, e) {
    return e.source().same(e.target()) ? 2 : 1;
  }),
  indegree: Mu(function(t, e) {
    return e.target().same(t) ? 1 : 0;
  }),
  outdegree: Mu(function(t, e) {
    return e.source().same(t) ? 1 : 0;
  })
});
function ti(t, e) {
  return function(r) {
    for (var n, a = this.nodes(), i = 0; i < a.length; i++) {
      var o = a[i], s = o[t](r);
      s !== void 0 && (n === void 0 || e(s, n)) && (n = s);
    }
    return n;
  };
}
ze(Vl, {
  minDegree: ti("degree", function(t, e) {
    return t < e;
  }),
  maxDegree: ti("degree", function(t, e) {
    return t > e;
  }),
  minIndegree: ti("indegree", function(t, e) {
    return t < e;
  }),
  maxIndegree: ti("indegree", function(t, e) {
    return t > e;
  }),
  minOutdegree: ti("outdegree", function(t, e) {
    return t < e;
  }),
  maxOutdegree: ti("outdegree", function(t, e) {
    return t > e;
  })
});
ze(Vl, {
  totalDegree: function(e) {
    for (var r = 0, n = this.nodes(), a = 0; a < n.length; a++)
      r += n[a].degree(e);
    return r;
  }
});
var Wr, VS, HS = function(e, r, n) {
  for (var a = 0; a < e.length; a++) {
    var i = e[a];
    if (!i.locked()) {
      var o = i._private.position, s = {
        x: r.x != null ? r.x - o.x : 0,
        y: r.y != null ? r.y - o.y : 0
      };
      i.isParent() && !(s.x === 0 && s.y === 0) && i.children().shift(s, n), i.dirtyBoundingBoxCache();
    }
  }
}, g0 = {
  field: "position",
  bindingEvent: "position",
  allowBinding: !0,
  allowSetting: !0,
  settingEvent: "position",
  settingTriggersEvent: !0,
  triggerFnName: "emitAndNotify",
  allowGetting: !0,
  validKeys: ["x", "y"],
  beforeGet: function(e) {
    e.updateCompoundBounds();
  },
  beforeSet: function(e, r) {
    HS(e, r, !1);
  },
  onSet: function(e) {
    e.dirtyCompoundBoundsCache();
  },
  canSet: function(e) {
    return !e.locked();
  }
};
Wr = VS = {
  position: et.data(g0),
  // position but no notification to renderer
  silentPosition: et.data(ze({}, g0, {
    allowBinding: !1,
    allowSetting: !0,
    settingTriggersEvent: !1,
    allowGetting: !1,
    beforeSet: function(e, r) {
      HS(e, r, !0);
    },
    onSet: function(e) {
      e.dirtyCompoundBoundsCache();
    }
  })),
  positions: function(e, r) {
    if (Xe(e))
      r ? this.silentPosition(e) : this.position(e);
    else if (yt(e)) {
      var n = e, a = this.cy();
      a.startBatch();
      for (var i = 0; i < this.length; i++) {
        var o = this[i], s = void 0;
        (s = n(o, i)) && (r ? o.silentPosition(s) : o.position(s));
      }
      a.endBatch();
    }
    return this;
  },
  silentPositions: function(e) {
    return this.positions(e, !0);
  },
  shift: function(e, r, n) {
    var a;
    if (Xe(e) ? (a = {
      x: Ce(e.x) ? e.x : 0,
      y: Ce(e.y) ? e.y : 0
    }, n = r) : Me(e) && Ce(r) && (a = {
      x: 0,
      y: 0
    }, a[e] = r), a != null) {
      var i = this.cy();
      i.startBatch();
      for (var o = 0; o < this.length; o++) {
        var s = this[o];
        if (!(i.hasCompoundNodes() && s.isChild() && s.ancestors().anySame(this))) {
          var u = s.position(), l = {
            x: u.x + a.x,
            y: u.y + a.y
          };
          n ? s.silentPosition(l) : s.position(l);
        }
      }
      i.endBatch();
    }
    return this;
  },
  silentShift: function(e, r) {
    return Xe(e) ? this.shift(e, !0) : Me(e) && Ce(r) && this.shift(e, r, !0), this;
  },
  // get/set the rendered (i.e. on screen) positon of the element
  renderedPosition: function(e, r) {
    var n = this[0], a = this.cy(), i = a.zoom(), o = a.pan(), s = Xe(e) ? e : void 0, u = s !== void 0 || r !== void 0 && Me(e);
    if (n && n.isNode())
      if (u)
        for (var l = 0; l < this.length; l++) {
          var c = this[l];
          r !== void 0 ? c.position(e, (r - o[e]) / i) : s !== void 0 && c.position(pS(s, i, o));
        }
      else {
        var d = n.position();
        return s = Nl(d, i, o), e === void 0 ? s : s[e];
      }
    else if (!u)
      return;
    return this;
  },
  // get/set the position relative to the parent
  relativePosition: function(e, r) {
    var n = this[0], a = this.cy(), i = Xe(e) ? e : void 0, o = i !== void 0 || r !== void 0 && Me(e), s = a.hasCompoundNodes();
    if (n && n.isNode())
      if (o)
        for (var u = 0; u < this.length; u++) {
          var l = this[u], c = s ? l.parent() : null, d = c && c.length > 0, f = d;
          d && (c = c[0]);
          var h = f ? c.position() : {
            x: 0,
            y: 0
          };
          r !== void 0 ? l.position(e, r + h[e]) : i !== void 0 && l.position({
            x: i.x + h.x,
            y: i.y + h.y
          });
        }
      else {
        var v = n.position(), p = s ? n.parent() : null, g = p && p.length > 0, y = g;
        g && (p = p[0]);
        var m = y ? p.position() : {
          x: 0,
          y: 0
        };
        return i = {
          x: v.x - m.x,
          y: v.y - m.y
        }, e === void 0 ? i : i[e];
      }
    else if (!o)
      return;
    return this;
  }
};
Wr.modelPosition = Wr.point = Wr.position;
Wr.modelPositions = Wr.points = Wr.positions;
Wr.renderedPoint = Wr.renderedPosition;
Wr.relativePoint = Wr.relativePosition;
var Sz = VS, gi, la;
gi = la = {};
la.renderedBoundingBox = function(t) {
  var e = this.boundingBox(t), r = this.cy(), n = r.zoom(), a = r.pan(), i = e.x1 * n + a.x, o = e.x2 * n + a.x, s = e.y1 * n + a.y, u = e.y2 * n + a.y;
  return {
    x1: i,
    x2: o,
    y1: s,
    y2: u,
    w: o - i,
    h: u - s
  };
};
la.dirtyCompoundBoundsCache = function() {
  var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, e = this.cy();
  return !e.styleEnabled() || !e.hasCompoundNodes() ? this : (this.forEachUp(function(r) {
    if (r.isParent()) {
      var n = r._private;
      n.compoundBoundsClean = !1, n.bbCache = null, t || r.emitAndNotify("bounds");
    }
  }), this);
};
la.updateCompoundBounds = function() {
  var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, e = this.cy();
  if (!e.styleEnabled() || !e.hasCompoundNodes())
    return this;
  if (!t && e.batching())
    return this;
  function r(o) {
    if (!o.isParent())
      return;
    var s = o._private, u = o.children(), l = o.pstyle("compound-sizing-wrt-labels").value === "include", c = {
      width: {
        val: o.pstyle("min-width").pfValue,
        left: o.pstyle("min-width-bias-left"),
        right: o.pstyle("min-width-bias-right")
      },
      height: {
        val: o.pstyle("min-height").pfValue,
        top: o.pstyle("min-height-bias-top"),
        bottom: o.pstyle("min-height-bias-bottom")
      }
    }, d = u.boundingBox({
      includeLabels: l,
      includeOverlays: !1,
      // updating the compound bounds happens outside of the regular
      // cache cycle (i.e. before fired events)
      useCache: !1
    }), f = s.position;
    (d.w === 0 || d.h === 0) && (d = {
      w: o.pstyle("width").pfValue,
      h: o.pstyle("height").pfValue
    }, d.x1 = f.x - d.w / 2, d.x2 = f.x + d.w / 2, d.y1 = f.y - d.h / 2, d.y2 = f.y + d.h / 2);
    function h(S, _, T) {
      var O = 0, D = 0, A = _ + T;
      return S > 0 && A > 0 && (O = _ / A * S, D = T / A * S), {
        biasDiff: O,
        biasComplementDiff: D
      };
    }
    function v(S, _, T, O) {
      if (T.units === "%")
        switch (O) {
          case "width":
            return S > 0 ? T.pfValue * S : 0;
          case "height":
            return _ > 0 ? T.pfValue * _ : 0;
          case "average":
            return S > 0 && _ > 0 ? T.pfValue * (S + _) / 2 : 0;
          case "min":
            return S > 0 && _ > 0 ? S > _ ? T.pfValue * _ : T.pfValue * S : 0;
          case "max":
            return S > 0 && _ > 0 ? S > _ ? T.pfValue * S : T.pfValue * _ : 0;
          default:
            return 0;
        }
      else return T.units === "px" ? T.pfValue : 0;
    }
    var p = c.width.left.value;
    c.width.left.units === "px" && c.width.val > 0 && (p = p * 100 / c.width.val);
    var g = c.width.right.value;
    c.width.right.units === "px" && c.width.val > 0 && (g = g * 100 / c.width.val);
    var y = c.height.top.value;
    c.height.top.units === "px" && c.height.val > 0 && (y = y * 100 / c.height.val);
    var m = c.height.bottom.value;
    c.height.bottom.units === "px" && c.height.val > 0 && (m = m * 100 / c.height.val);
    var b = h(c.width.val - d.w, p, g), w = b.biasDiff, x = b.biasComplementDiff, E = h(c.height.val - d.h, y, m), C = E.biasDiff, k = E.biasComplementDiff;
    s.autoPadding = v(d.w, d.h, o.pstyle("padding"), o.pstyle("padding-relative-to").value), s.autoWidth = Math.max(d.w, c.width.val), f.x = (-w + d.x1 + d.x2 + x) / 2, s.autoHeight = Math.max(d.h, c.height.val), f.y = (-C + d.y1 + d.y2 + k) / 2;
  }
  for (var n = 0; n < this.length; n++) {
    var a = this[n], i = a._private;
    (!i.compoundBoundsClean || t) && (r(a), e.batching() || (i.compoundBoundsClean = !0));
  }
  return this;
};
var Or = function(e) {
  return e === 1 / 0 || e === -1 / 0 ? 0 : e;
}, Hr = function(e, r, n, a, i) {
  a - r === 0 || i - n === 0 || r == null || n == null || a == null || i == null || (e.x1 = r < e.x1 ? r : e.x1, e.x2 = a > e.x2 ? a : e.x2, e.y1 = n < e.y1 ? n : e.y1, e.y2 = i > e.y2 ? i : e.y2, e.w = e.x2 - e.x1, e.h = e.y2 - e.y1);
}, ga = function(e, r) {
  return r == null ? e : Hr(e, r.x1, r.y1, r.x2, r.y2);
}, no = function(e, r, n) {
  return Kr(e, r, n);
}, Ps = function(e, r, n) {
  if (!r.cy().headless()) {
    var a = r._private, i = a.rstyle, o = i.arrowWidth / 2, s = r.pstyle(n + "-arrow-shape").value, u, l;
    if (s !== "none") {
      n === "source" ? (u = i.srcX, l = i.srcY) : n === "target" ? (u = i.tgtX, l = i.tgtY) : (u = i.midX, l = i.midY);
      var c = a.arrowBounds = a.arrowBounds || {}, d = c[n] = c[n] || {};
      d.x1 = u - o, d.y1 = l - o, d.x2 = u + o, d.y2 = l + o, d.w = d.x2 - d.x1, d.h = d.y2 - d.y1, Vs(d, 1), Hr(e, d.x1, d.y1, d.x2, d.y2);
    }
  }
}, Nu = function(e, r, n) {
  if (!r.cy().headless()) {
    var a;
    n ? a = n + "-" : a = "";
    var i = r._private, o = i.rstyle, s = r.pstyle(a + "label").strValue;
    if (s) {
      var u = r.pstyle("text-halign"), l = r.pstyle("text-valign"), c = no(o, "labelWidth", n), d = no(o, "labelHeight", n), f = no(o, "labelX", n), h = no(o, "labelY", n), v = r.pstyle(a + "text-margin-x").pfValue, p = r.pstyle(a + "text-margin-y").pfValue, g = r.isEdge(), y = r.pstyle(a + "text-rotation"), m = r.pstyle("text-outline-width").pfValue, b = r.pstyle("text-border-width").pfValue, w = b / 2, x = r.pstyle("text-background-padding").pfValue, E = 2, C = d, k = c, S = k / 2, _ = C / 2, T, O, D, A;
      if (g)
        T = f - S, O = f + S, D = h - _, A = h + _;
      else {
        switch (u.value) {
          case "left":
            T = f - k, O = f;
            break;
          case "center":
            T = f - S, O = f + S;
            break;
          case "right":
            T = f, O = f + k;
            break;
        }
        switch (l.value) {
          case "top":
            D = h - C, A = h;
            break;
          case "center":
            D = h - _, A = h + _;
            break;
          case "bottom":
            D = h, A = h + C;
            break;
        }
      }
      T += v - Math.max(m, w) - x - E, O += v + Math.max(m, w) + x + E, D += p - Math.max(m, w) - x - E, A += p + Math.max(m, w) + x + E;
      var F = n || "main", R = i.labelBounds, M = R[F] = R[F] || {};
      M.x1 = T, M.y1 = D, M.x2 = O, M.y2 = A, M.w = O - T, M.h = A - D;
      var L = g && y.strValue === "autorotate", V = y.pfValue != null && y.pfValue !== 0;
      if (L || V) {
        var Y = L ? no(i.rstyle, "labelAngle", n) : y.pfValue, H = Math.cos(Y), K = Math.sin(Y), ne = (T + O) / 2, B = (D + A) / 2;
        if (!g) {
          switch (u.value) {
            case "left":
              ne = O;
              break;
            case "right":
              ne = T;
              break;
          }
          switch (l.value) {
            case "top":
              B = A;
              break;
            case "bottom":
              B = D;
              break;
          }
        }
        var $ = function(we, fe) {
          return we = we - ne, fe = fe - B, {
            x: we * H - fe * K + ne,
            y: we * K + fe * H + B
          };
        }, z = $(T, D), W = $(T, A), Z = $(O, D), N = $(O, A);
        T = Math.min(z.x, W.x, Z.x, N.x), O = Math.max(z.x, W.x, Z.x, N.x), D = Math.min(z.y, W.y, Z.y, N.y), A = Math.max(z.y, W.y, Z.y, N.y);
      }
      var X = F + "Rot", Q = R[X] = R[X] || {};
      Q.x1 = T, Q.y1 = D, Q.x2 = O, Q.y2 = A, Q.w = O - T, Q.h = A - D, Hr(e, T, D, O, A), Hr(i.labelBounds.all, T, D, O, A);
    }
    return e;
  }
}, kz = function(e, r) {
  if (!r.cy().headless()) {
    var n = r.pstyle("outline-opacity").value, a = r.pstyle("outline-width").value;
    if (n > 0 && a > 0) {
      var i = r.pstyle("outline-offset").value, o = r.pstyle("shape").value, s = a + i, u = (e.w + s * 2) / e.w, l = (e.h + s * 2) / e.h, c = 0, d = 0;
      ["diamond", "pentagon", "round-triangle"].includes(o) ? (u = (e.w + s * 2.4) / e.w, d = -s / 3.6) : ["concave-hexagon", "rhomboid", "right-rhomboid"].includes(o) ? u = (e.w + s * 2.4) / e.w : o === "star" ? (u = (e.w + s * 2.8) / e.w, l = (e.h + s * 2.6) / e.h, d = -s / 3.8) : o === "triangle" ? (u = (e.w + s * 2.8) / e.w, l = (e.h + s * 2.4) / e.h, d = -s / 1.4) : o === "vee" && (u = (e.w + s * 4.4) / e.w, l = (e.h + s * 3.8) / e.h, d = -s * 0.5);
      var f = e.h * l - e.h, h = e.w * u - e.w;
      if (Hs(e, [Math.ceil(f / 2), Math.ceil(h / 2)]), c != 0 || d !== 0) {
        var v = U$(e, c, d);
        yS(e, v);
      }
    }
  }
}, _z = function(e, r) {
  var n = e._private.cy, a = n.styleEnabled(), i = n.headless(), o = br(), s = e._private, u = e.isNode(), l = e.isEdge(), c, d, f, h, v, p, g = s.rstyle, y = u && a ? e.pstyle("bounds-expansion").pfValue : [0], m = function(be) {
    return be.pstyle("display").value !== "none";
  }, b = !a || m(e) && (!l || m(e.source()) && m(e.target()));
  if (b) {
    var w = 0, x = 0;
    a && r.includeOverlays && (w = e.pstyle("overlay-opacity").value, w !== 0 && (x = e.pstyle("overlay-padding").value));
    var E = 0, C = 0;
    a && r.includeUnderlays && (E = e.pstyle("underlay-opacity").value, E !== 0 && (C = e.pstyle("underlay-padding").value));
    var k = Math.max(x, C), S = 0, _ = 0;
    if (a && (S = e.pstyle("width").pfValue, _ = S / 2), u && r.includeNodes) {
      var T = e.position();
      v = T.x, p = T.y;
      var O = e.outerWidth(), D = O / 2, A = e.outerHeight(), F = A / 2;
      c = v - D, d = v + D, f = p - F, h = p + F, Hr(o, c, f, d, h), a && r.includeOutlines && kz(o, e);
    } else if (l && r.includeEdges)
      if (a && !i) {
        var R = e.pstyle("curve-style").strValue;
        if (c = Math.min(g.srcX, g.midX, g.tgtX), d = Math.max(g.srcX, g.midX, g.tgtX), f = Math.min(g.srcY, g.midY, g.tgtY), h = Math.max(g.srcY, g.midY, g.tgtY), c -= _, d += _, f -= _, h += _, Hr(o, c, f, d, h), R === "haystack") {
          var M = g.haystackPts;
          if (M && M.length === 2) {
            if (c = M[0].x, f = M[0].y, d = M[1].x, h = M[1].y, c > d) {
              var L = c;
              c = d, d = L;
            }
            if (f > h) {
              var V = f;
              f = h, h = V;
            }
            Hr(o, c - _, f - _, d + _, h + _);
          }
        } else if (R === "bezier" || R === "unbundled-bezier" || R.endsWith("segments") || R.endsWith("taxi")) {
          var Y;
          switch (R) {
            case "bezier":
            case "unbundled-bezier":
              Y = g.bezierPts;
              break;
            case "segments":
            case "taxi":
            case "round-segments":
            case "round-taxi":
              Y = g.linePts;
              break;
          }
          if (Y != null)
            for (var H = 0; H < Y.length; H++) {
              var K = Y[H];
              c = K.x - _, d = K.x + _, f = K.y - _, h = K.y + _, Hr(o, c, f, d, h);
            }
        }
      } else {
        var ne = e.source(), B = ne.position(), $ = e.target(), z = $.position();
        if (c = B.x, d = z.x, f = B.y, h = z.y, c > d) {
          var W = c;
          c = d, d = W;
        }
        if (f > h) {
          var Z = f;
          f = h, h = Z;
        }
        c -= _, d += _, f -= _, h += _, Hr(o, c, f, d, h);
      }
    if (a && r.includeEdges && l && (Ps(o, e, "mid-source"), Ps(o, e, "mid-target"), Ps(o, e, "source"), Ps(o, e, "target")), a) {
      var N = e.pstyle("ghost").value === "yes";
      if (N) {
        var X = e.pstyle("ghost-offset-x").pfValue, Q = e.pstyle("ghost-offset-y").pfValue;
        Hr(o, o.x1 + X, o.y1 + Q, o.x2 + X, o.y2 + Q);
      }
    }
    var ge = s.bodyBounds = s.bodyBounds || {};
    Ym(ge, o), Hs(ge, y), Vs(ge, 1), a && (c = o.x1, d = o.x2, f = o.y1, h = o.y2, Hr(o, c - k, f - k, d + k, h + k));
    var we = s.overlayBounds = s.overlayBounds || {};
    Ym(we, o), Hs(we, y), Vs(we, 1);
    var fe = s.labelBounds = s.labelBounds || {};
    fe.all != null ? G$(fe.all) : fe.all = br(), a && r.includeLabels && (r.includeMainLabels && Nu(o, e, null), l && (r.includeSourceLabels && Nu(o, e, "source"), r.includeTargetLabels && Nu(o, e, "target")));
  }
  return o.x1 = Or(o.x1), o.y1 = Or(o.y1), o.x2 = Or(o.x2), o.y2 = Or(o.y2), o.w = Or(o.x2 - o.x1), o.h = Or(o.y2 - o.y1), o.w > 0 && o.h > 0 && b && (Hs(o, y), Vs(o, 1)), o;
}, KS = function(e) {
  var r = 0, n = function(o) {
    return (o ? 1 : 0) << r++;
  }, a = 0;
  return a += n(e.incudeNodes), a += n(e.includeEdges), a += n(e.includeLabels), a += n(e.includeMainLabels), a += n(e.includeSourceLabels), a += n(e.includeTargetLabels), a += n(e.includeOverlays), a += n(e.includeOutlines), a;
}, GS = function(e) {
  if (e.isEdge()) {
    var r = e.source().position(), n = e.target().position(), a = function(o) {
      return Math.round(o);
    };
    return f$([a(r.x), a(r.y), a(n.x), a(n.y)]);
  } else
    return 0;
}, y0 = function(e, r) {
  var n = e._private, a, i = e.isEdge(), o = r == null ? m0 : KS(r), s = o === m0, u = GS(e), l = n.bbCachePosKey === u, c = r.useCache && l, d = function(p) {
    return p._private.bbCache == null || p._private.styleDirty;
  }, f = !c || d(e) || i && d(e.source()) || d(e.target());
  if (f ? (l || e.recalculateRenderedStyle(c), a = _z(e, $o), n.bbCache = a, n.bbCachePosKey = u) : a = n.bbCache, !s) {
    var h = e.isNode();
    a = br(), (r.includeNodes && h || r.includeEdges && !h) && (r.includeOverlays ? ga(a, n.overlayBounds) : ga(a, n.bodyBounds)), r.includeLabels && (r.includeMainLabels && (!i || r.includeSourceLabels && r.includeTargetLabels) ? ga(a, n.labelBounds.all) : (r.includeMainLabels && ga(a, n.labelBounds.mainRot), r.includeSourceLabels && ga(a, n.labelBounds.sourceRot), r.includeTargetLabels && ga(a, n.labelBounds.targetRot))), a.w = a.x2 - a.x1, a.h = a.y2 - a.y1;
  }
  return a;
}, $o = {
  includeNodes: !0,
  includeEdges: !0,
  includeLabels: !0,
  includeMainLabels: !0,
  includeSourceLabels: !0,
  includeTargetLabels: !0,
  includeOverlays: !0,
  includeUnderlays: !0,
  includeOutlines: !0,
  useCache: !0
}, m0 = KS($o), b0 = Zt($o);
la.boundingBox = function(t) {
  var e;
  if (this.length === 1 && this[0]._private.bbCache != null && !this[0]._private.styleDirty && (t === void 0 || t.useCache === void 0 || t.useCache === !0))
    t === void 0 ? t = $o : t = b0(t), e = y0(this[0], t);
  else {
    e = br(), t = t || $o;
    var r = b0(t), n = this, a = n.cy(), i = a.styleEnabled();
    if (i)
      for (var o = 0; o < n.length; o++) {
        var s = n[o], u = s._private, l = GS(s), c = u.bbCachePosKey === l, d = r.useCache && c && !u.styleDirty;
        s.recalculateRenderedStyle(d);
      }
    this.updateCompoundBounds(!t.useCache);
    for (var f = 0; f < n.length; f++) {
      var h = n[f];
      ga(e, y0(h, r));
    }
  }
  return e.x1 = Or(e.x1), e.y1 = Or(e.y1), e.x2 = Or(e.x2), e.y2 = Or(e.y2), e.w = Or(e.x2 - e.x1), e.h = Or(e.y2 - e.y1), e;
};
la.dirtyBoundingBoxCache = function() {
  for (var t = 0; t < this.length; t++) {
    var e = this[t]._private;
    e.bbCache = null, e.bbCachePosKey = null, e.bodyBounds = null, e.overlayBounds = null, e.labelBounds.all = null, e.labelBounds.source = null, e.labelBounds.target = null, e.labelBounds.main = null, e.labelBounds.sourceRot = null, e.labelBounds.targetRot = null, e.labelBounds.mainRot = null, e.arrowBounds.source = null, e.arrowBounds.target = null, e.arrowBounds["mid-source"] = null, e.arrowBounds["mid-target"] = null;
  }
  return this.emitAndNotify("bounds"), this;
};
la.boundingBoxAt = function(t) {
  var e = this.nodes(), r = this.cy(), n = r.hasCompoundNodes(), a = r.collection();
  if (n && (a = e.filter(function(l) {
    return l.isParent();
  }), e = e.not(a)), Xe(t)) {
    var i = t;
    t = function() {
      return i;
    };
  }
  var o = function(c, d) {
    return c._private.bbAtOldPos = t(c, d);
  }, s = function(c) {
    return c._private.bbAtOldPos;
  };
  r.startBatch(), e.forEach(o).silentPositions(t), n && (a.dirtyCompoundBoundsCache(), a.dirtyBoundingBoxCache(), a.updateCompoundBounds(!0));
  var u = K$(this.boundingBox({
    useCache: !1
  }));
  return e.silentPositions(s), n && (a.dirtyCompoundBoundsCache(), a.dirtyBoundingBoxCache(), a.updateCompoundBounds(!0)), r.endBatch(), u;
};
gi.boundingbox = gi.bb = gi.boundingBox;
gi.renderedBoundingbox = gi.renderedBoundingBox;
var Tz = la, fo, is;
fo = is = {};
var US = function(e) {
  e.uppercaseName = Vm(e.name), e.autoName = "auto" + e.uppercaseName, e.labelName = "label" + e.uppercaseName, e.outerName = "outer" + e.uppercaseName, e.uppercaseOuterName = Vm(e.outerName), fo[e.name] = function() {
    var n = this[0], a = n._private, i = a.cy, o = i._private.styleEnabled;
    if (n)
      if (o) {
        if (n.isParent())
          return n.updateCompoundBounds(), a[e.autoName] || 0;
        var s = n.pstyle(e.name);
        switch (s.strValue) {
          case "label":
            return n.recalculateRenderedStyle(), a.rstyle[e.labelName] || 0;
          default:
            return s.pfValue;
        }
      } else
        return 1;
  }, fo["outer" + e.uppercaseName] = function() {
    var n = this[0], a = n._private, i = a.cy, o = i._private.styleEnabled;
    if (n)
      if (o) {
        var s = n[e.name](), u = n.pstyle("border-width").pfValue, l = 2 * n.padding();
        return s + u + l;
      } else
        return 1;
  }, fo["rendered" + e.uppercaseName] = function() {
    var n = this[0];
    if (n) {
      var a = n[e.name]();
      return a * this.cy().zoom();
    }
  }, fo["rendered" + e.uppercaseOuterName] = function() {
    var n = this[0];
    if (n) {
      var a = n[e.outerName]();
      return a * this.cy().zoom();
    }
  };
};
US({
  name: "width"
});
US({
  name: "height"
});
is.padding = function() {
  var t = this[0], e = t._private;
  return t.isParent() ? (t.updateCompoundBounds(), e.autoPadding !== void 0 ? e.autoPadding : t.pstyle("padding").pfValue) : t.pstyle("padding").pfValue;
};
is.paddedHeight = function() {
  var t = this[0];
  return t.height() + 2 * t.padding();
};
is.paddedWidth = function() {
  var t = this[0];
  return t.width() + 2 * t.padding();
};
var Iz = is, Oz = function(e, r) {
  if (e.isEdge())
    return r(e);
}, Az = function(e, r) {
  if (e.isEdge()) {
    var n = e.cy();
    return Nl(r(e), n.zoom(), n.pan());
  }
}, Pz = function(e, r) {
  if (e.isEdge()) {
    var n = e.cy(), a = n.pan(), i = n.zoom();
    return r(e).map(function(o) {
      return Nl(o, i, a);
    });
  }
}, Dz = function(e) {
  return e.renderer().getControlPoints(e);
}, Rz = function(e) {
  return e.renderer().getSegmentPoints(e);
}, Lz = function(e) {
  return e.renderer().getSourceEndpoint(e);
}, Fz = function(e) {
  return e.renderer().getTargetEndpoint(e);
}, Mz = function(e) {
  return e.renderer().getEdgeMidpoint(e);
}, w0 = {
  controlPoints: {
    get: Dz,
    mult: !0
  },
  segmentPoints: {
    get: Rz,
    mult: !0
  },
  sourceEndpoint: {
    get: Lz
  },
  targetEndpoint: {
    get: Fz
  },
  midpoint: {
    get: Mz
  }
}, Nz = function(e) {
  return "rendered" + e[0].toUpperCase() + e.substr(1);
}, Bz = Object.keys(w0).reduce(function(t, e) {
  var r = w0[e], n = Nz(e);
  return t[e] = function() {
    return Oz(this, r.get);
  }, r.mult ? t[n] = function() {
    return Pz(this, r.get);
  } : t[n] = function() {
    return Az(this, r.get);
  }, t;
}, {}), $z = ze({}, Sz, Tz, Iz, Bz);
/*!
Event object based on jQuery events, MIT license

https://jquery.org/license/
https://tldrlegal.com/license/mit-license
https://github.com/jquery/jquery/blob/master/src/event.js
*/
var WS = function(e, r) {
  this.recycle(e, r);
};
function ao() {
  return !1;
}
function Ds() {
  return !0;
}
WS.prototype = {
  instanceString: function() {
    return "event";
  },
  recycle: function(e, r) {
    if (this.isImmediatePropagationStopped = this.isPropagationStopped = this.isDefaultPrevented = ao, e != null && e.preventDefault ? (this.type = e.type, this.isDefaultPrevented = e.defaultPrevented ? Ds : ao) : e != null && e.type ? r = e : this.type = e, r != null && (this.originalEvent = r.originalEvent, this.type = r.type != null ? r.type : this.type, this.cy = r.cy, this.target = r.target, this.position = r.position, this.renderedPosition = r.renderedPosition, this.namespace = r.namespace, this.layout = r.layout), this.cy != null && this.position != null && this.renderedPosition == null) {
      var n = this.position, a = this.cy.zoom(), i = this.cy.pan();
      this.renderedPosition = {
        x: n.x * a + i.x,
        y: n.y * a + i.y
      };
    }
    this.timeStamp = e && e.timeStamp || Date.now();
  },
  preventDefault: function() {
    this.isDefaultPrevented = Ds;
    var e = this.originalEvent;
    e && e.preventDefault && e.preventDefault();
  },
  stopPropagation: function() {
    this.isPropagationStopped = Ds;
    var e = this.originalEvent;
    e && e.stopPropagation && e.stopPropagation();
  },
  stopImmediatePropagation: function() {
    this.isImmediatePropagationStopped = Ds, this.stopPropagation();
  },
  isDefaultPrevented: ao,
  isPropagationStopped: ao,
  isImmediatePropagationStopped: ao
};
var jS = /^([^.]+)(\.(?:[^.]+))?$/, qz = ".*", YS = {
  qualifierCompare: function(e, r) {
    return e === r;
  },
  eventMatches: function() {
    return !0;
  },
  addEventFields: function() {
  },
  callbackContext: function(e) {
    return e;
  },
  beforeEmit: function() {
  },
  afterEmit: function() {
  },
  bubble: function() {
    return !1;
  },
  parent: function() {
    return null;
  },
  context: null
}, C0 = Object.keys(YS), zz = {};
function Hl() {
  for (var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : zz, e = arguments.length > 1 ? arguments[1] : void 0, r = 0; r < C0.length; r++) {
    var n = C0[r];
    this[n] = t[n] || YS[n];
  }
  this.context = e || this.context, this.listeners = [], this.emitting = 0;
}
var aa = Hl.prototype, ZS = function(e, r, n, a, i, o, s) {
  yt(a) && (i = a, a = null), s && (o == null ? o = s : o = ze({}, o, s));
  for (var u = lt(n) ? n : n.split(/\s+/), l = 0; l < u.length; l++) {
    var c = u[l];
    if (!ea(c)) {
      var d = c.match(jS);
      if (d) {
        var f = d[1], h = d[2] ? d[2] : null, v = r(e, c, f, h, a, i, o);
        if (v === !1)
          break;
      }
    }
  }
}, x0 = function(e, r) {
  return e.addEventFields(e.context, r), new WS(r.type, r);
}, Vz = function(e, r, n) {
  if (lB(n)) {
    r(e, n);
    return;
  } else if (Xe(n)) {
    r(e, x0(e, n));
    return;
  }
  for (var a = lt(n) ? n : n.split(/\s+/), i = 0; i < a.length; i++) {
    var o = a[i];
    if (!ea(o)) {
      var s = o.match(jS);
      if (s) {
        var u = s[1], l = s[2] ? s[2] : null, c = x0(e, {
          type: u,
          namespace: l,
          target: e.context
        });
        r(e, c);
      }
    }
  }
};
aa.on = aa.addListener = function(t, e, r, n, a) {
  return ZS(this, function(i, o, s, u, l, c, d) {
    yt(c) && i.listeners.push({
      event: o,
      // full event string
      callback: c,
      // callback to run
      type: s,
      // the event type (e.g. 'click')
      namespace: u,
      // the event namespace (e.g. ".foo")
      qualifier: l,
      // a restriction on whether to match this emitter
      conf: d
      // additional configuration
    });
  }, t, e, r, n, a), this;
};
aa.one = function(t, e, r, n) {
  return this.on(t, e, r, n, {
    one: !0
  });
};
aa.removeListener = aa.off = function(t, e, r, n) {
  var a = this;
  this.emitting !== 0 && (this.listeners = y$(this.listeners));
  for (var i = this.listeners, o = function(l) {
    var c = i[l];
    ZS(a, function(d, f, h, v, p, g) {
      if ((c.type === h || t === "*") && (!v && c.namespace !== ".*" || c.namespace === v) && (!p || d.qualifierCompare(c.qualifier, p)) && (!g || c.callback === g))
        return i.splice(l, 1), !1;
    }, t, e, r, n);
  }, s = i.length - 1; s >= 0; s--)
    o(s);
  return this;
};
aa.removeAllListeners = function() {
  return this.removeListener("*");
};
aa.emit = aa.trigger = function(t, e, r) {
  var n = this.listeners, a = n.length;
  return this.emitting++, lt(e) || (e = [e]), Vz(this, function(i, o) {
    r != null && (n = [{
      event: o.event,
      type: o.type,
      namespace: o.namespace,
      callback: r
    }], a = n.length);
    for (var s = function(c) {
      var d = n[c];
      if (d.type === o.type && (!d.namespace || d.namespace === o.namespace || d.namespace === qz) && i.eventMatches(i.context, d, o)) {
        var f = [o];
        e != null && b$(f, e), i.beforeEmit(i.context, d, o), d.conf && d.conf.one && (i.listeners = i.listeners.filter(function(p) {
          return p !== d;
        }));
        var h = i.callbackContext(i.context, d, o), v = d.callback.apply(h, f);
        i.afterEmit(i.context, d, o), v === !1 && (o.stopPropagation(), o.preventDefault());
      }
    }, u = 0; u < a; u++)
      s(u);
    i.bubble(i.context) && !o.isPropagationStopped() && i.parent(i.context).emit(o, e);
  }, t), this.emitting--, this;
};
var Hz = {
  qualifierCompare: function(e, r) {
    return e == null || r == null ? e == null && r == null : e.sameText(r);
  },
  eventMatches: function(e, r, n) {
    var a = r.qualifier;
    return a != null ? e !== n.target && rs(n.target) && a.matches(n.target) : !0;
  },
  addEventFields: function(e, r) {
    r.cy = e.cy(), r.target = e;
  },
  callbackContext: function(e, r, n) {
    return r.qualifier != null ? n.target : e;
  },
  beforeEmit: function(e, r) {
    r.conf && r.conf.once && r.conf.onceCollection.removeListener(r.event, r.qualifier, r.callback);
  },
  bubble: function() {
    return !0;
  },
  parent: function(e) {
    return e.isChild() ? e.parent() : e.cy();
  }
}, Rs = function(e) {
  return Me(e) ? new ra(e) : e;
}, XS = {
  createEmitter: function() {
    for (var e = 0; e < this.length; e++) {
      var r = this[e], n = r._private;
      n.emitter || (n.emitter = new Hl(Hz, r));
    }
    return this;
  },
  emitter: function() {
    return this._private.emitter;
  },
  on: function(e, r, n) {
    for (var a = Rs(r), i = 0; i < this.length; i++) {
      var o = this[i];
      o.emitter().on(e, a, n);
    }
    return this;
  },
  removeListener: function(e, r, n) {
    for (var a = Rs(r), i = 0; i < this.length; i++) {
      var o = this[i];
      o.emitter().removeListener(e, a, n);
    }
    return this;
  },
  removeAllListeners: function() {
    for (var e = 0; e < this.length; e++) {
      var r = this[e];
      r.emitter().removeAllListeners();
    }
    return this;
  },
  one: function(e, r, n) {
    for (var a = Rs(r), i = 0; i < this.length; i++) {
      var o = this[i];
      o.emitter().one(e, a, n);
    }
    return this;
  },
  once: function(e, r, n) {
    for (var a = Rs(r), i = 0; i < this.length; i++) {
      var o = this[i];
      o.emitter().on(e, a, n, {
        once: !0,
        onceCollection: this
      });
    }
  },
  emit: function(e, r) {
    for (var n = 0; n < this.length; n++) {
      var a = this[n];
      a.emitter().emit(e, r);
    }
    return this;
  },
  emitAndNotify: function(e, r) {
    if (this.length !== 0)
      return this.cy().notify(e, this), this.emit(e, r), this;
  }
};
et.eventAliasesOn(XS);
var JS = {
  nodes: function(e) {
    return this.filter(function(r) {
      return r.isNode();
    }).filter(e);
  },
  edges: function(e) {
    return this.filter(function(r) {
      return r.isEdge();
    }).filter(e);
  },
  // internal helper to get nodes and edges as separate collections with single iteration over elements
  byGroup: function() {
    for (var e = this.spawn(), r = this.spawn(), n = 0; n < this.length; n++) {
      var a = this[n];
      a.isNode() ? e.push(a) : r.push(a);
    }
    return {
      nodes: e,
      edges: r
    };
  },
  filter: function(e, r) {
    if (e === void 0)
      return this;
    if (Me(e) || xr(e))
      return new ra(e).filter(this);
    if (yt(e)) {
      for (var n = this.spawn(), a = this, i = 0; i < a.length; i++) {
        var o = a[i], s = r ? e.apply(r, [o, i, a]) : e(o, i, a);
        s && n.push(o);
      }
      return n;
    }
    return this.spawn();
  },
  not: function(e) {
    if (e) {
      Me(e) && (e = this.filter(e));
      for (var r = this.spawn(), n = 0; n < this.length; n++) {
        var a = this[n], i = e.has(a);
        i || r.push(a);
      }
      return r;
    } else
      return this;
  },
  absoluteComplement: function() {
    var e = this.cy();
    return e.mutableElements().not(this);
  },
  intersect: function(e) {
    if (Me(e)) {
      var r = e;
      return this.filter(r);
    }
    for (var n = this.spawn(), a = this, i = e, o = this.length < e.length, s = o ? a : i, u = o ? i : a, l = 0; l < s.length; l++) {
      var c = s[l];
      u.has(c) && n.push(c);
    }
    return n;
  },
  xor: function(e) {
    var r = this._private.cy;
    Me(e) && (e = r.$(e));
    var n = this.spawn(), a = this, i = e, o = function(u, l) {
      for (var c = 0; c < u.length; c++) {
        var d = u[c], f = d._private.data.id, h = l.hasElementWithId(f);
        h || n.push(d);
      }
    };
    return o(a, i), o(i, a), n;
  },
  diff: function(e) {
    var r = this._private.cy;
    Me(e) && (e = r.$(e));
    var n = this.spawn(), a = this.spawn(), i = this.spawn(), o = this, s = e, u = function(c, d, f) {
      for (var h = 0; h < c.length; h++) {
        var v = c[h], p = v._private.data.id, g = d.hasElementWithId(p);
        g ? i.merge(v) : f.push(v);
      }
    };
    return u(o, s, n), u(s, o, a), {
      left: n,
      right: a,
      both: i
    };
  },
  add: function(e) {
    var r = this._private.cy;
    if (!e)
      return this;
    if (Me(e)) {
      var n = e;
      e = r.mutableElements().filter(n);
    }
    for (var a = this.spawnSelf(), i = 0; i < e.length; i++) {
      var o = e[i], s = !this.has(o);
      s && a.push(o);
    }
    return a;
  },
  // in place merge on calling collection
  merge: function(e) {
    var r = this._private, n = r.cy;
    if (!e)
      return this;
    if (e && Me(e)) {
      var a = e;
      e = n.mutableElements().filter(a);
    }
    for (var i = r.map, o = 0; o < e.length; o++) {
      var s = e[o], u = s._private.data.id, l = !i.has(u);
      if (l) {
        var c = this.length++;
        this[c] = s, i.set(u, {
          ele: s,
          index: c
        });
      }
    }
    return this;
  },
  unmergeAt: function(e) {
    var r = this[e], n = r.id(), a = this._private, i = a.map;
    this[e] = void 0, i.delete(n);
    var o = e === this.length - 1;
    if (this.length > 1 && !o) {
      var s = this.length - 1, u = this[s], l = u._private.data.id;
      this[s] = void 0, this[e] = u, i.set(l, {
        ele: u,
        index: e
      });
    }
    return this.length--, this;
  },
  // remove single ele in place in calling collection
  unmergeOne: function(e) {
    e = e[0];
    var r = this._private, n = e._private.data.id, a = r.map, i = a.get(n);
    if (!i)
      return this;
    var o = i.index;
    return this.unmergeAt(o), this;
  },
  // remove eles in place on calling collection
  unmerge: function(e) {
    var r = this._private.cy;
    if (!e)
      return this;
    if (e && Me(e)) {
      var n = e;
      e = r.mutableElements().filter(n);
    }
    for (var a = 0; a < e.length; a++)
      this.unmergeOne(e[a]);
    return this;
  },
  unmergeBy: function(e) {
    for (var r = this.length - 1; r >= 0; r--) {
      var n = this[r];
      e(n) && this.unmergeAt(r);
    }
    return this;
  },
  map: function(e, r) {
    for (var n = [], a = this, i = 0; i < a.length; i++) {
      var o = a[i], s = r ? e.apply(r, [o, i, a]) : e(o, i, a);
      n.push(s);
    }
    return n;
  },
  reduce: function(e, r) {
    for (var n = r, a = this, i = 0; i < a.length; i++)
      n = e(n, a[i], i, a);
    return n;
  },
  max: function(e, r) {
    for (var n = -1 / 0, a, i = this, o = 0; o < i.length; o++) {
      var s = i[o], u = r ? e.apply(r, [s, o, i]) : e(s, o, i);
      u > n && (n = u, a = s);
    }
    return {
      value: n,
      ele: a
    };
  },
  min: function(e, r) {
    for (var n = 1 / 0, a, i = this, o = 0; o < i.length; o++) {
      var s = i[o], u = r ? e.apply(r, [s, o, i]) : e(s, o, i);
      u < n && (n = u, a = s);
    }
    return {
      value: n,
      ele: a
    };
  }
}, Qe = JS;
Qe.u = Qe["|"] = Qe["+"] = Qe.union = Qe.or = Qe.add;
Qe["\\"] = Qe["!"] = Qe["-"] = Qe.difference = Qe.relativeComplement = Qe.subtract = Qe.not;
Qe.n = Qe["&"] = Qe["."] = Qe.and = Qe.intersection = Qe.intersect;
Qe["^"] = Qe["(+)"] = Qe["(-)"] = Qe.symmetricDifference = Qe.symdiff = Qe.xor;
Qe.fnFilter = Qe.filterFn = Qe.stdFilter = Qe.filter;
Qe.complement = Qe.abscomp = Qe.absoluteComplement;
var Kz = {
  isNode: function() {
    return this.group() === "nodes";
  },
  isEdge: function() {
    return this.group() === "edges";
  },
  isLoop: function() {
    return this.isEdge() && this.source()[0] === this.target()[0];
  },
  isSimple: function() {
    return this.isEdge() && this.source()[0] !== this.target()[0];
  },
  group: function() {
    var e = this[0];
    if (e)
      return e._private.group;
  }
}, QS = function(e, r) {
  var n = e.cy(), a = n.hasCompoundNodes();
  function i(c) {
    var d = c.pstyle("z-compound-depth");
    return d.value === "auto" ? a ? c.zDepth() : 0 : d.value === "bottom" ? -1 : d.value === "top" ? Og : 0;
  }
  var o = i(e) - i(r);
  if (o !== 0)
    return o;
  function s(c) {
    var d = c.pstyle("z-index-compare");
    return d.value === "auto" && c.isNode() ? 1 : 0;
  }
  var u = s(e) - s(r);
  if (u !== 0)
    return u;
  var l = e.pstyle("z-index").value - r.pstyle("z-index").value;
  return l !== 0 ? l : e.poolIndex() - r.poolIndex();
}, vl = {
  forEach: function(e, r) {
    if (yt(e))
      for (var n = this.length, a = 0; a < n; a++) {
        var i = this[a], o = r ? e.apply(r, [i, a, this]) : e(i, a, this);
        if (o === !1)
          break;
      }
    return this;
  },
  toArray: function() {
    for (var e = [], r = 0; r < this.length; r++)
      e.push(this[r]);
    return e;
  },
  slice: function(e, r) {
    var n = [], a = this.length;
    r == null && (r = a), e == null && (e = 0), e < 0 && (e = a + e), r < 0 && (r = a + r);
    for (var i = e; i >= 0 && i < r && i < a; i++)
      n.push(this[i]);
    return this.spawn(n);
  },
  size: function() {
    return this.length;
  },
  eq: function(e) {
    return this[e] || this.spawn();
  },
  first: function() {
    return this[0] || this.spawn();
  },
  last: function() {
    return this[this.length - 1] || this.spawn();
  },
  empty: function() {
    return this.length === 0;
  },
  nonempty: function() {
    return !this.empty();
  },
  sort: function(e) {
    if (!yt(e))
      return this;
    var r = this.toArray().sort(e);
    return this.spawn(r);
  },
  sortByZIndex: function() {
    return this.sort(QS);
  },
  zDepth: function() {
    var e = this[0];
    if (e) {
      var r = e._private, n = r.group;
      if (n === "nodes") {
        var a = r.data.parent ? e.parents().size() : 0;
        return e.isParent() ? a : Og - 1;
      } else {
        var i = r.source, o = r.target, s = i.zDepth(), u = o.zDepth();
        return Math.max(s, u, 0);
      }
    }
  }
};
vl.each = vl.forEach;
var Gz = function() {
  var e = "undefined", r = (typeof Symbol > "u" ? "undefined" : Nt(Symbol)) != e && Nt(Symbol.iterator) != e;
  r && (vl[Symbol.iterator] = function() {
    var n = this, a = {
      value: void 0,
      done: !1
    }, i = 0, o = this.length;
    return Y2({
      next: function() {
        return i < o ? a.value = n[i++] : (a.value = void 0, a.done = !0), a;
      }
    }, Symbol.iterator, function() {
      return this;
    });
  });
};
Gz();
var Uz = Zt({
  nodeDimensionsIncludeLabels: !1
}), Gs = {
  // Calculates and returns node dimensions { x, y } based on options given
  layoutDimensions: function(e) {
    e = Uz(e);
    var r;
    if (!this.takesUpSpace())
      r = {
        w: 0,
        h: 0
      };
    else if (e.nodeDimensionsIncludeLabels) {
      var n = this.boundingBox();
      r = {
        w: n.w,
        h: n.h
      };
    } else
      r = {
        w: this.outerWidth(),
        h: this.outerHeight()
      };
    return (r.w === 0 || r.h === 0) && (r.w = r.h = 1), r;
  },
  // using standard layout options, apply position function (w/ or w/o animation)
  layoutPositions: function(e, r, n) {
    var a = this.nodes().filter(function(x) {
      return !x.isParent();
    }), i = this.cy(), o = r.eles, s = function(E) {
      return E.id();
    }, u = Po(n, s);
    e.emit({
      type: "layoutstart",
      layout: e
    }), e.animations = [];
    var l = function(E, C, k) {
      var S = {
        x: C.x1 + C.w / 2,
        y: C.y1 + C.h / 2
      }, _ = {
        // scale from center of bounding box (not necessarily 0,0)
        x: (k.x - S.x) * E,
        y: (k.y - S.y) * E
      };
      return {
        x: S.x + _.x,
        y: S.y + _.y
      };
    }, c = r.spacingFactor && r.spacingFactor !== 1, d = function() {
      if (!c)
        return null;
      for (var E = br(), C = 0; C < a.length; C++) {
        var k = a[C], S = u(k, C);
        W$(E, S.x, S.y);
      }
      return E;
    }, f = d(), h = Po(function(x, E) {
      var C = u(x, E);
      if (c) {
        var k = Math.abs(r.spacingFactor);
        C = l(k, f, C);
      }
      return r.transform != null && (C = r.transform(x, C)), C;
    }, s);
    if (r.animate) {
      for (var v = 0; v < a.length; v++) {
        var p = a[v], g = h(p, v), y = r.animateFilter == null || r.animateFilter(p, v);
        if (y) {
          var m = p.animation({
            position: g,
            duration: r.animationDuration,
            easing: r.animationEasing
          });
          e.animations.push(m);
        } else
          p.position(g);
      }
      if (r.fit) {
        var b = i.animation({
          fit: {
            boundingBox: o.boundingBoxAt(h),
            padding: r.padding
          },
          duration: r.animationDuration,
          easing: r.animationEasing
        });
        e.animations.push(b);
      } else if (r.zoom !== void 0 && r.pan !== void 0) {
        var w = i.animation({
          zoom: r.zoom,
          pan: r.pan,
          duration: r.animationDuration,
          easing: r.animationEasing
        });
        e.animations.push(w);
      }
      e.animations.forEach(function(x) {
        return x.play();
      }), e.one("layoutready", r.ready), e.emit({
        type: "layoutready",
        layout: e
      }), Mi.all(e.animations.map(function(x) {
        return x.promise();
      })).then(function() {
        e.one("layoutstop", r.stop), e.emit({
          type: "layoutstop",
          layout: e
        });
      });
    } else
      a.positions(h), r.fit && i.fit(r.eles, r.padding), r.zoom != null && i.zoom(r.zoom), r.pan && i.pan(r.pan), e.one("layoutready", r.ready), e.emit({
        type: "layoutready",
        layout: e
      }), e.one("layoutstop", r.stop), e.emit({
        type: "layoutstop",
        layout: e
      });
    return this;
  },
  layout: function(e) {
    var r = this.cy();
    return r.makeLayout(ze({}, e, {
      eles: this
    }));
  }
};
Gs.createLayout = Gs.makeLayout = Gs.layout;
function ek(t, e, r) {
  var n = r._private, a = n.styleCache = n.styleCache || [], i;
  return (i = a[t]) != null || (i = a[t] = e(r)), i;
}
function Kl(t, e) {
  return t = Pa(t), function(n) {
    return ek(t, e, n);
  };
}
function Gl(t, e) {
  t = Pa(t);
  var r = function(a) {
    return e.call(a);
  };
  return function() {
    var a = this[0];
    if (a)
      return ek(t, r, a);
  };
}
var jt = {
  recalculateRenderedStyle: function(e) {
    var r = this.cy(), n = r.renderer(), a = r.styleEnabled();
    return n && a && n.recalculateRenderedStyle(this, e), this;
  },
  dirtyStyleCache: function() {
    var e = this.cy(), r = function(i) {
      return i._private.styleCache = null;
    };
    if (e.hasCompoundNodes()) {
      var n;
      n = this.spawnSelf().merge(this.descendants()).merge(this.parents()), n.merge(n.connectedEdges()), n.forEach(r);
    } else
      this.forEach(function(a) {
        r(a), a.connectedEdges().forEach(r);
      });
    return this;
  },
  // fully updates (recalculates) the style for the elements
  updateStyle: function(e) {
    var r = this._private.cy;
    if (!r.styleEnabled())
      return this;
    if (r.batching()) {
      var n = r._private.batchStyleEles;
      return n.merge(this), this;
    }
    var a = r.hasCompoundNodes(), i = this;
    e = !!(e || e === void 0), a && (i = this.spawnSelf().merge(this.descendants()).merge(this.parents()));
    var o = i;
    return e ? o.emitAndNotify("style") : o.emit("style"), i.forEach(function(s) {
      return s._private.styleDirty = !0;
    }), this;
  },
  // private: clears dirty flag and recalculates style
  cleanStyle: function() {
    var e = this.cy();
    if (e.styleEnabled())
      for (var r = 0; r < this.length; r++) {
        var n = this[r];
        n._private.styleDirty && (n._private.styleDirty = !1, e.style().apply(n));
      }
  },
  // get the internal parsed style object for the specified property
  parsedStyle: function(e) {
    var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, n = this[0], a = n.cy();
    if (a.styleEnabled() && n) {
      this.cleanStyle();
      var i = n._private.style[e];
      return i ?? (r ? a.style().getDefaultProperty(e) : null);
    }
  },
  numericStyle: function(e) {
    var r = this[0];
    if (r.cy().styleEnabled() && r) {
      var n = r.pstyle(e);
      return n.pfValue !== void 0 ? n.pfValue : n.value;
    }
  },
  numericStyleUnits: function(e) {
    var r = this[0];
    if (r.cy().styleEnabled() && r)
      return r.pstyle(e).units;
  },
  // get the specified css property as a rendered value (i.e. on-screen value)
  // or get the whole rendered style if no property specified (NB doesn't allow setting)
  renderedStyle: function(e) {
    var r = this.cy();
    if (!r.styleEnabled())
      return this;
    var n = this[0];
    if (n)
      return r.style().getRenderedStyle(n, e);
  },
  // read the calculated css style of the element or override the style (via a bypass)
  style: function(e, r) {
    var n = this.cy();
    if (!n.styleEnabled())
      return this;
    var a = !1, i = n.style();
    if (Xe(e)) {
      var o = e;
      i.applyBypass(this, o, a), this.emitAndNotify("style");
    } else if (Me(e))
      if (r === void 0) {
        var s = this[0];
        return s ? i.getStylePropertyValue(s, e) : void 0;
      } else
        i.applyBypass(this, e, r, a), this.emitAndNotify("style");
    else if (e === void 0) {
      var u = this[0];
      return u ? i.getRawStyle(u) : void 0;
    }
    return this;
  },
  removeStyle: function(e) {
    var r = this.cy();
    if (!r.styleEnabled())
      return this;
    var n = !1, a = r.style(), i = this;
    if (e === void 0)
      for (var o = 0; o < i.length; o++) {
        var s = i[o];
        a.removeAllBypasses(s, n);
      }
    else {
      e = e.split(/\s+/);
      for (var u = 0; u < i.length; u++) {
        var l = i[u];
        a.removeBypasses(l, e, n);
      }
    }
    return this.emitAndNotify("style"), this;
  },
  show: function() {
    return this.css("display", "element"), this;
  },
  hide: function() {
    return this.css("display", "none"), this;
  },
  effectiveOpacity: function() {
    var e = this.cy();
    if (!e.styleEnabled())
      return 1;
    var r = e.hasCompoundNodes(), n = this[0];
    if (n) {
      var a = n._private, i = n.pstyle("opacity").value;
      if (!r)
        return i;
      var o = a.data.parent ? n.parents() : null;
      if (o)
        for (var s = 0; s < o.length; s++) {
          var u = o[s], l = u.pstyle("opacity").value;
          i = l * i;
        }
      return i;
    }
  },
  transparent: function() {
    var e = this.cy();
    if (!e.styleEnabled())
      return !1;
    var r = this[0], n = r.cy().hasCompoundNodes();
    if (r)
      return n ? r.effectiveOpacity() === 0 : r.pstyle("opacity").value === 0;
  },
  backgrounding: function() {
    var e = this.cy();
    if (!e.styleEnabled())
      return !1;
    var r = this[0];
    return !!r._private.backgrounding;
  }
};
function Bu(t, e) {
  var r = t._private, n = r.data.parent ? t.parents() : null;
  if (n)
    for (var a = 0; a < n.length; a++) {
      var i = n[a];
      if (!e(i))
        return !1;
    }
  return !0;
}
function zg(t) {
  var e = t.ok, r = t.edgeOkViaNode || t.ok, n = t.parentOk || t.ok;
  return function() {
    var a = this.cy();
    if (!a.styleEnabled())
      return !0;
    var i = this[0], o = a.hasCompoundNodes();
    if (i) {
      var s = i._private;
      if (!e(i))
        return !1;
      if (i.isNode())
        return !o || Bu(i, n);
      var u = s.source, l = s.target;
      return r(u) && (!o || Bu(u, r)) && (u === l || r(l) && (!o || Bu(l, r)));
    }
  };
}
var qi = Kl("eleTakesUpSpace", function(t) {
  return t.pstyle("display").value === "element" && t.width() !== 0 && (t.isNode() ? t.height() !== 0 : !0);
});
jt.takesUpSpace = Gl("takesUpSpace", zg({
  ok: qi
}));
var Wz = Kl("eleInteractive", function(t) {
  return t.pstyle("events").value === "yes" && t.pstyle("visibility").value === "visible" && qi(t);
}), jz = Kl("parentInteractive", function(t) {
  return t.pstyle("visibility").value === "visible" && qi(t);
});
jt.interactive = Gl("interactive", zg({
  ok: Wz,
  parentOk: jz,
  edgeOkViaNode: qi
}));
jt.noninteractive = function() {
  var t = this[0];
  if (t)
    return !t.interactive();
};
var Yz = Kl("eleVisible", function(t) {
  return t.pstyle("visibility").value === "visible" && t.pstyle("opacity").pfValue !== 0 && qi(t);
}), Zz = qi;
jt.visible = Gl("visible", zg({
  ok: Yz,
  edgeOkViaNode: Zz
}));
jt.hidden = function() {
  var t = this[0];
  if (t)
    return !t.visible();
};
jt.isBundledBezier = Gl("isBundledBezier", function() {
  return this.cy().styleEnabled() ? !this.removed() && this.pstyle("curve-style").value === "bezier" && this.takesUpSpace() : !1;
});
jt.bypass = jt.css = jt.style;
jt.renderedCss = jt.renderedStyle;
jt.removeBypass = jt.removeCss = jt.removeStyle;
jt.pstyle = jt.parsedStyle;
var Xn = {};
function E0(t) {
  return function() {
    var e = arguments, r = [];
    if (e.length === 2) {
      var n = e[0], a = e[1];
      this.on(t.event, n, a);
    } else if (e.length === 1 && yt(e[0])) {
      var i = e[0];
      this.on(t.event, i);
    } else if (e.length === 0 || e.length === 1 && lt(e[0])) {
      for (var o = e.length === 1 ? e[0] : null, s = 0; s < this.length; s++) {
        var u = this[s], l = !t.ableField || u._private[t.ableField], c = u._private[t.field] != t.value;
        if (t.overrideAble) {
          var d = t.overrideAble(u);
          if (d !== void 0 && (l = d, !d))
            return this;
        }
        l && (u._private[t.field] = t.value, c && r.push(u));
      }
      var f = this.spawn(r);
      f.updateStyle(), f.emit(t.event), o && f.emit(o);
    }
    return this;
  };
}
function zi(t) {
  Xn[t.field] = function() {
    var e = this[0];
    if (e) {
      if (t.overrideField) {
        var r = t.overrideField(e);
        if (r !== void 0)
          return r;
      }
      return e._private[t.field];
    }
  }, Xn[t.on] = E0({
    event: t.on,
    field: t.field,
    ableField: t.ableField,
    overrideAble: t.overrideAble,
    value: !0
  }), Xn[t.off] = E0({
    event: t.off,
    field: t.field,
    ableField: t.ableField,
    overrideAble: t.overrideAble,
    value: !1
  });
}
zi({
  field: "locked",
  overrideField: function(e) {
    return e.cy().autolock() ? !0 : void 0;
  },
  on: "lock",
  off: "unlock"
});
zi({
  field: "grabbable",
  overrideField: function(e) {
    return e.cy().autoungrabify() || e.pannable() ? !1 : void 0;
  },
  on: "grabify",
  off: "ungrabify"
});
zi({
  field: "selected",
  ableField: "selectable",
  overrideAble: function(e) {
    return e.cy().autounselectify() ? !1 : void 0;
  },
  on: "select",
  off: "unselect"
});
zi({
  field: "selectable",
  overrideField: function(e) {
    return e.cy().autounselectify() ? !1 : void 0;
  },
  on: "selectify",
  off: "unselectify"
});
Xn.deselect = Xn.unselect;
Xn.grabbed = function() {
  var t = this[0];
  if (t)
    return t._private.grabbed;
};
zi({
  field: "active",
  on: "activate",
  off: "unactivate"
});
zi({
  field: "pannable",
  on: "panify",
  off: "unpanify"
});
Xn.inactive = function() {
  var t = this[0];
  if (t)
    return !t._private.active;
};
var ir = {}, S0 = function(e) {
  return function(n) {
    for (var a = this, i = [], o = 0; o < a.length; o++) {
      var s = a[o];
      if (s.isNode()) {
        for (var u = !1, l = s.connectedEdges(), c = 0; c < l.length; c++) {
          var d = l[c], f = d.source(), h = d.target();
          if (e.noIncomingEdges && h === s && f !== s || e.noOutgoingEdges && f === s && h !== s) {
            u = !0;
            break;
          }
        }
        u || i.push(s);
      }
    }
    return this.spawn(i, !0).filter(n);
  };
}, k0 = function(e) {
  return function(r) {
    for (var n = this, a = [], i = 0; i < n.length; i++) {
      var o = n[i];
      if (o.isNode())
        for (var s = o.connectedEdges(), u = 0; u < s.length; u++) {
          var l = s[u], c = l.source(), d = l.target();
          e.outgoing && c === o ? (a.push(l), a.push(d)) : e.incoming && d === o && (a.push(l), a.push(c));
        }
    }
    return this.spawn(a, !0).filter(r);
  };
}, _0 = function(e) {
  return function(r) {
    for (var n = this, a = [], i = {}; ; ) {
      var o = e.outgoing ? n.outgoers() : n.incomers();
      if (o.length === 0)
        break;
      for (var s = !1, u = 0; u < o.length; u++) {
        var l = o[u], c = l.id();
        i[c] || (i[c] = !0, a.push(l), s = !0);
      }
      if (!s)
        break;
      n = o;
    }
    return this.spawn(a, !0).filter(r);
  };
};
ir.clearTraversalCache = function() {
  for (var t = 0; t < this.length; t++)
    this[t]._private.traversalCache = null;
};
ze(ir, {
  // get the root nodes in the DAG
  roots: S0({
    noIncomingEdges: !0
  }),
  // get the leaf nodes in the DAG
  leaves: S0({
    noOutgoingEdges: !0
  }),
  // normally called children in graph theory
  // these nodes =edges=> outgoing nodes
  outgoers: Pr(k0({
    outgoing: !0
  }), "outgoers"),
  // aka DAG descendants
  successors: _0({
    outgoing: !0
  }),
  // normally called parents in graph theory
  // these nodes <=edges= incoming nodes
  incomers: Pr(k0({
    incoming: !0
  }), "incomers"),
  // aka DAG ancestors
  predecessors: _0({
    incoming: !0
  })
});
ze(ir, {
  neighborhood: Pr(function(t) {
    for (var e = [], r = this.nodes(), n = 0; n < r.length; n++)
      for (var a = r[n], i = a.connectedEdges(), o = 0; o < i.length; o++) {
        var s = i[o], u = s.source(), l = s.target(), c = a === u ? l : u;
        c.length > 0 && e.push(c[0]), e.push(s[0]);
      }
    return this.spawn(e, !0).filter(t);
  }, "neighborhood"),
  closedNeighborhood: function(e) {
    return this.neighborhood().add(this).filter(e);
  },
  openNeighborhood: function(e) {
    return this.neighborhood(e);
  }
});
ir.neighbourhood = ir.neighborhood;
ir.closedNeighbourhood = ir.closedNeighborhood;
ir.openNeighbourhood = ir.openNeighborhood;
ze(ir, {
  source: Pr(function(e) {
    var r = this[0], n;
    return r && (n = r._private.source || r.cy().collection()), n && e ? n.filter(e) : n;
  }, "source"),
  target: Pr(function(e) {
    var r = this[0], n;
    return r && (n = r._private.target || r.cy().collection()), n && e ? n.filter(e) : n;
  }, "target"),
  sources: T0({
    attr: "source"
  }),
  targets: T0({
    attr: "target"
  })
});
function T0(t) {
  return function(r) {
    for (var n = [], a = 0; a < this.length; a++) {
      var i = this[a], o = i._private[t.attr];
      o && n.push(o);
    }
    return this.spawn(n, !0).filter(r);
  };
}
ze(ir, {
  edgesWith: Pr(I0(), "edgesWith"),
  edgesTo: Pr(I0({
    thisIsSrc: !0
  }), "edgesTo")
});
function I0(t) {
  return function(r) {
    var n = [], a = this._private.cy, i = t || {};
    Me(r) && (r = a.$(r));
    for (var o = 0; o < r.length; o++)
      for (var s = r[o]._private.edges, u = 0; u < s.length; u++) {
        var l = s[u], c = l._private.data, d = this.hasElementWithId(c.source) && r.hasElementWithId(c.target), f = r.hasElementWithId(c.source) && this.hasElementWithId(c.target), h = d || f;
        h && ((i.thisIsSrc || i.thisIsTgt) && (i.thisIsSrc && !d || i.thisIsTgt && !f) || n.push(l));
      }
    return this.spawn(n, !0);
  };
}
ze(ir, {
  connectedEdges: Pr(function(t) {
    for (var e = [], r = this, n = 0; n < r.length; n++) {
      var a = r[n];
      if (a.isNode())
        for (var i = a._private.edges, o = 0; o < i.length; o++) {
          var s = i[o];
          e.push(s);
        }
    }
    return this.spawn(e, !0).filter(t);
  }, "connectedEdges"),
  connectedNodes: Pr(function(t) {
    for (var e = [], r = this, n = 0; n < r.length; n++) {
      var a = r[n];
      a.isEdge() && (e.push(a.source()[0]), e.push(a.target()[0]));
    }
    return this.spawn(e, !0).filter(t);
  }, "connectedNodes"),
  parallelEdges: Pr(O0(), "parallelEdges"),
  codirectedEdges: Pr(O0({
    codirected: !0
  }), "codirectedEdges")
});
function O0(t) {
  var e = {
    codirected: !1
  };
  return t = ze({}, e, t), function(n) {
    for (var a = [], i = this.edges(), o = t, s = 0; s < i.length; s++)
      for (var u = i[s], l = u._private, c = l.source, d = c._private.data.id, f = l.data.target, h = c._private.edges, v = 0; v < h.length; v++) {
        var p = h[v], g = p._private.data, y = g.target, m = g.source, b = y === f && m === d, w = d === y && f === m;
        (o.codirected && b || !o.codirected && (b || w)) && a.push(p);
      }
    return this.spawn(a, !0).filter(n);
  };
}
ze(ir, {
  components: function(e) {
    var r = this, n = r.cy(), a = n.collection(), i = e == null ? r.nodes() : e.nodes(), o = [];
    e != null && i.empty() && (i = e.sources());
    var s = function(c, d) {
      a.merge(c), i.unmerge(c), d.merge(c);
    };
    if (i.empty())
      return r.spawn();
    var u = function() {
      var c = n.collection();
      o.push(c);
      var d = i[0];
      s(d, c), r.bfs({
        directed: !1,
        roots: d,
        visit: function(h) {
          return s(h, c);
        }
      }), c.forEach(function(f) {
        f.connectedEdges().forEach(function(h) {
          r.has(h) && c.has(h.source()) && c.has(h.target()) && c.merge(h);
        });
      });
    };
    do
      u();
    while (i.length > 0);
    return o;
  },
  component: function() {
    var e = this[0];
    return e.cy().mutableElements().components(e)[0];
  }
});
ir.componentsOf = ir.components;
var Yt = function(e, r) {
  var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
  if (e === void 0) {
    bt("A collection must have a reference to the core");
    return;
  }
  var i = new nn(), o = !1;
  if (!r)
    r = [];
  else if (r.length > 0 && Xe(r[0]) && !rs(r[0])) {
    o = !0;
    for (var s = [], u = new Fi(), l = 0, c = r.length; l < c; l++) {
      var d = r[l];
      d.data == null && (d.data = {});
      var f = d.data;
      if (f.id == null)
        f.id = vS();
      else if (e.hasElementWithId(f.id) || u.has(f.id))
        continue;
      var h = new Ml(e, d, !1);
      s.push(h), u.add(f.id);
    }
    r = s;
  }
  this.length = 0;
  for (var v = 0, p = r.length; v < p; v++) {
    var g = r[v][0];
    if (g != null) {
      var y = g._private.data.id;
      (!n || !i.has(y)) && (n && i.set(y, {
        index: this.length,
        ele: g
      }), this[this.length] = g, this.length++);
    }
  }
  this._private = {
    eles: this,
    cy: e,
    get map() {
      return this.lazyMap == null && this.rebuildMap(), this.lazyMap;
    },
    set map(m) {
      this.lazyMap = m;
    },
    rebuildMap: function() {
      for (var b = this.lazyMap = new nn(), w = this.eles, x = 0; x < w.length; x++) {
        var E = w[x];
        b.set(E.id(), {
          index: x,
          ele: E
        });
      }
    }
  }, n && (this._private.map = i), o && !a && this.restore();
}, ft = Ml.prototype = Yt.prototype = Object.create(Array.prototype);
ft.instanceString = function() {
  return "collection";
};
ft.spawn = function(t, e) {
  return new Yt(this.cy(), t, e);
};
ft.spawnSelf = function() {
  return this.spawn(this);
};
ft.cy = function() {
  return this._private.cy;
};
ft.renderer = function() {
  return this._private.cy.renderer();
};
ft.element = function() {
  return this[0];
};
ft.collection = function() {
  return Q2(this) ? this : new Yt(this._private.cy, [this]);
};
ft.unique = function() {
  return new Yt(this._private.cy, this, !0);
};
ft.hasElementWithId = function(t) {
  return t = "" + t, this._private.map.has(t);
};
ft.getElementById = function(t) {
  t = "" + t;
  var e = this._private.cy, r = this._private.map.get(t);
  return r ? r.ele : new Yt(e);
};
ft.$id = ft.getElementById;
ft.poolIndex = function() {
  var t = this._private.cy, e = t._private.elements, r = this[0]._private.data.id;
  return e._private.map.get(r).index;
};
ft.indexOf = function(t) {
  var e = t[0]._private.data.id;
  return this._private.map.get(e).index;
};
ft.indexOfId = function(t) {
  return t = "" + t, this._private.map.get(t).index;
};
ft.json = function(t) {
  var e = this.element(), r = this.cy();
  if (e == null && t)
    return this;
  if (e != null) {
    var n = e._private;
    if (Xe(t)) {
      if (r.startBatch(), t.data) {
        e.data(t.data);
        var a = n.data;
        if (e.isEdge()) {
          var i = !1, o = {}, s = t.data.source, u = t.data.target;
          s != null && s != a.source && (o.source = "" + s, i = !0), u != null && u != a.target && (o.target = "" + u, i = !0), i && (e = e.move(o));
        } else {
          var l = "parent" in t.data, c = t.data.parent;
          l && (c != null || a.parent != null) && c != a.parent && (c === void 0 && (c = null), c != null && (c = "" + c), e = e.move({
            parent: c
          }));
        }
      }
      t.position && e.position(t.position);
      var d = function(p, g, y) {
        var m = t[p];
        m != null && m !== n[p] && (m ? e[g]() : e[y]());
      };
      return d("removed", "remove", "restore"), d("selected", "select", "unselect"), d("selectable", "selectify", "unselectify"), d("locked", "lock", "unlock"), d("grabbable", "grabify", "ungrabify"), d("pannable", "panify", "unpanify"), t.classes != null && e.classes(t.classes), r.endBatch(), this;
    } else if (t === void 0) {
      var f = {
        data: rn(n.data),
        position: rn(n.position),
        group: n.group,
        removed: n.removed,
        selected: n.selected,
        selectable: n.selectable,
        locked: n.locked,
        grabbable: n.grabbable,
        pannable: n.pannable,
        classes: null
      };
      f.classes = "";
      var h = 0;
      return n.classes.forEach(function(v) {
        return f.classes += h++ === 0 ? v : " " + v;
      }), f;
    }
  }
};
ft.jsons = function() {
  for (var t = [], e = 0; e < this.length; e++) {
    var r = this[e], n = r.json();
    t.push(n);
  }
  return t;
};
ft.clone = function() {
  for (var t = this.cy(), e = [], r = 0; r < this.length; r++) {
    var n = this[r], a = n.json(), i = new Ml(t, a, !1);
    e.push(i);
  }
  return new Yt(t, e);
};
ft.copy = ft.clone;
ft.restore = function() {
  for (var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, r = this, n = r.cy(), a = n._private, i = [], o = [], s, u = 0, l = r.length; u < l; u++) {
    var c = r[u];
    e && !c.removed() || (c.isNode() ? i.push(c) : o.push(c));
  }
  s = i.concat(o);
  var d, f = function() {
    s.splice(d, 1), d--;
  };
  for (d = 0; d < s.length; d++) {
    var h = s[d], v = h._private, p = v.data;
    if (h.clearTraversalCache(), !(!e && !v.removed)) {
      if (p.id === void 0)
        p.id = vS();
      else if (Ce(p.id))
        p.id = "" + p.id;
      else if (ea(p.id) || !Me(p.id)) {
        bt("Can not create element with invalid string ID `" + p.id + "`"), f();
        continue;
      } else if (n.hasElementWithId(p.id)) {
        bt("Can not create second element with ID `" + p.id + "`"), f();
        continue;
      }
    }
    var g = p.id;
    if (h.isNode()) {
      var y = v.position;
      y.x == null && (y.x = 0), y.y == null && (y.y = 0);
    }
    if (h.isEdge()) {
      for (var m = h, b = ["source", "target"], w = b.length, x = !1, E = 0; E < w; E++) {
        var C = b[E], k = p[C];
        Ce(k) && (k = p[C] = "" + p[C]), k == null || k === "" ? (bt("Can not create edge `" + g + "` with unspecified " + C), x = !0) : n.hasElementWithId(k) || (bt("Can not create edge `" + g + "` with nonexistant " + C + " `" + k + "`"), x = !0);
      }
      if (x) {
        f();
        continue;
      }
      var S = n.getElementById(p.source), _ = n.getElementById(p.target);
      S.same(_) ? S._private.edges.push(m) : (S._private.edges.push(m), _._private.edges.push(m)), m._private.source = S, m._private.target = _;
    }
    v.map = new nn(), v.map.set(g, {
      ele: h,
      index: 0
    }), v.removed = !1, e && n.addToPool(h);
  }
  for (var T = 0; T < i.length; T++) {
    var O = i[T], D = O._private.data;
    Ce(D.parent) && (D.parent = "" + D.parent);
    var A = D.parent, F = A != null;
    if (F || O._private.parent) {
      var R = O._private.parent ? n.collection().merge(O._private.parent) : n.getElementById(A);
      if (R.empty())
        D.parent = void 0;
      else if (R[0].removed())
        tt("Node added with missing parent, reference to parent removed"), D.parent = void 0, O._private.parent = null;
      else {
        for (var M = !1, L = R; !L.empty(); ) {
          if (O.same(L)) {
            M = !0, D.parent = void 0;
            break;
          }
          L = L.parent();
        }
        M || (R[0]._private.children.push(O), O._private.parent = R[0], a.hasCompoundNodes = !0);
      }
    }
  }
  if (s.length > 0) {
    for (var V = s.length === r.length ? r : new Yt(n, s), Y = 0; Y < V.length; Y++) {
      var H = V[Y];
      H.isNode() || (H.parallelEdges().clearTraversalCache(), H.source().clearTraversalCache(), H.target().clearTraversalCache());
    }
    var K;
    a.hasCompoundNodes ? K = n.collection().merge(V).merge(V.connectedNodes()).merge(V.parent()) : K = V, K.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t), t ? V.emitAndNotify("add") : e && V.emit("add");
  }
  return r;
};
ft.removed = function() {
  var t = this[0];
  return t && t._private.removed;
};
ft.inside = function() {
  var t = this[0];
  return t && !t._private.removed;
};
ft.remove = function() {
  var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, r = this, n = [], a = {}, i = r._private.cy;
  function o(A) {
    for (var F = A._private.edges, R = 0; R < F.length; R++)
      u(F[R]);
  }
  function s(A) {
    for (var F = A._private.children, R = 0; R < F.length; R++)
      u(F[R]);
  }
  function u(A) {
    var F = a[A.id()];
    e && A.removed() || F || (a[A.id()] = !0, A.isNode() ? (n.push(A), o(A), s(A)) : n.unshift(A));
  }
  for (var l = 0, c = r.length; l < c; l++) {
    var d = r[l];
    u(d);
  }
  function f(A, F) {
    var R = A._private.edges;
    ta(R, F), A.clearTraversalCache();
  }
  function h(A) {
    A.clearTraversalCache();
  }
  var v = [];
  v.ids = {};
  function p(A, F) {
    F = F[0], A = A[0];
    var R = A._private.children, M = A.id();
    ta(R, F), F._private.parent = null, v.ids[M] || (v.ids[M] = !0, v.push(A));
  }
  r.dirtyCompoundBoundsCache(), e && i.removeFromPool(n);
  for (var g = 0; g < n.length; g++) {
    var y = n[g];
    if (y.isEdge()) {
      var m = y.source()[0], b = y.target()[0];
      f(m, y), f(b, y);
      for (var w = y.parallelEdges(), x = 0; x < w.length; x++) {
        var E = w[x];
        h(E), E.isBundledBezier() && E.dirtyBoundingBoxCache();
      }
    } else {
      var C = y.parent();
      C.length !== 0 && p(C, y);
    }
    e && (y._private.removed = !0);
  }
  var k = i._private.elements;
  i._private.hasCompoundNodes = !1;
  for (var S = 0; S < k.length; S++) {
    var _ = k[S];
    if (_.isParent()) {
      i._private.hasCompoundNodes = !0;
      break;
    }
  }
  var T = new Yt(this.cy(), n);
  T.size() > 0 && (t ? T.emitAndNotify("remove") : e && T.emit("remove"));
  for (var O = 0; O < v.length; O++) {
    var D = v[O];
    (!e || !D.removed()) && D.updateStyle();
  }
  return T;
};
ft.move = function(t) {
  var e = this._private.cy, r = this, n = !1, a = !1, i = function(v) {
    return v == null ? v : "" + v;
  };
  if (t.source !== void 0 || t.target !== void 0) {
    var o = i(t.source), s = i(t.target), u = o != null && e.hasElementWithId(o), l = s != null && e.hasElementWithId(s);
    (u || l) && (e.batch(function() {
      r.remove(n, a), r.emitAndNotify("moveout");
      for (var h = 0; h < r.length; h++) {
        var v = r[h], p = v._private.data;
        v.isEdge() && (u && (p.source = o), l && (p.target = s));
      }
      r.restore(n, a);
    }), r.emitAndNotify("move"));
  } else if (t.parent !== void 0) {
    var c = i(t.parent), d = c === null || e.hasElementWithId(c);
    if (d) {
      var f = c === null ? void 0 : c;
      e.batch(function() {
        var h = r.remove(n, a);
        h.emitAndNotify("moveout");
        for (var v = 0; v < r.length; v++) {
          var p = r[v], g = p._private.data;
          p.isNode() && (g.parent = f);
        }
        h.restore(n, a);
      }), r.emitAndNotify("move");
    }
  }
  return this;
};
[_S, sz, Ks, Zn, Oi, Ez, Vl, $z, XS, JS, Kz, vl, Gs, jt, Xn, ir].forEach(function(t) {
  ze(ft, t);
});
var Xz = {
  add: function(e) {
    var r, n = this;
    if (xr(e)) {
      var a = e;
      if (a._private.cy === n)
        r = a.restore();
      else {
        for (var i = [], o = 0; o < a.length; o++) {
          var s = a[o];
          i.push(s.json());
        }
        r = new Yt(n, i);
      }
    } else if (lt(e)) {
      var u = e;
      r = new Yt(n, u);
    } else if (Xe(e) && (lt(e.nodes) || lt(e.edges))) {
      for (var l = e, c = [], d = ["nodes", "edges"], f = 0, h = d.length; f < h; f++) {
        var v = d[f], p = l[v];
        if (lt(p))
          for (var g = 0, y = p.length; g < y; g++) {
            var m = ze({
              group: v
            }, p[g]);
            c.push(m);
          }
      }
      r = new Yt(n, c);
    } else {
      var b = e;
      r = new Ml(n, b).collection();
    }
    return r;
  },
  remove: function(e) {
    if (!xr(e)) {
      if (Me(e)) {
        var r = e;
        e = this.$(r);
      }
    }
    return e.remove();
  }
};
/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */
function Jz(t, e, r, n) {
  var a = 4, i = 1e-3, o = 1e-7, s = 10, u = 11, l = 1 / (u - 1), c = typeof Float32Array < "u";
  if (arguments.length !== 4)
    return !1;
  for (var d = 0; d < 4; ++d)
    if (typeof arguments[d] != "number" || isNaN(arguments[d]) || !isFinite(arguments[d]))
      return !1;
  t = Math.min(t, 1), r = Math.min(r, 1), t = Math.max(t, 0), r = Math.max(r, 0);
  var f = c ? new Float32Array(u) : new Array(u);
  function h(_, T) {
    return 1 - 3 * T + 3 * _;
  }
  function v(_, T) {
    return 3 * T - 6 * _;
  }
  function p(_) {
    return 3 * _;
  }
  function g(_, T, O) {
    return ((h(T, O) * _ + v(T, O)) * _ + p(T)) * _;
  }
  function y(_, T, O) {
    return 3 * h(T, O) * _ * _ + 2 * v(T, O) * _ + p(T);
  }
  function m(_, T) {
    for (var O = 0; O < a; ++O) {
      var D = y(T, t, r);
      if (D === 0)
        return T;
      var A = g(T, t, r) - _;
      T -= A / D;
    }
    return T;
  }
  function b() {
    for (var _ = 0; _ < u; ++_)
      f[_] = g(_ * l, t, r);
  }
  function w(_, T, O) {
    var D, A, F = 0;
    do
      A = T + (O - T) / 2, D = g(A, t, r) - _, D > 0 ? O = A : T = A;
    while (Math.abs(D) > o && ++F < s);
    return A;
  }
  function x(_) {
    for (var T = 0, O = 1, D = u - 1; O !== D && f[O] <= _; ++O)
      T += l;
    --O;
    var A = (_ - f[O]) / (f[O + 1] - f[O]), F = T + A * l, R = y(F, t, r);
    return R >= i ? m(_, F) : R === 0 ? F : w(_, T, T + l);
  }
  var E = !1;
  function C() {
    E = !0, (t !== e || r !== n) && b();
  }
  var k = function(T) {
    return E || C(), t === e && r === n ? T : T === 0 ? 0 : T === 1 ? 1 : g(x(T), e, n);
  };
  k.getControlPoints = function() {
    return [{
      x: t,
      y: e
    }, {
      x: r,
      y: n
    }];
  };
  var S = "generateBezier(" + [t, e, r, n] + ")";
  return k.toString = function() {
    return S;
  }, k;
}
/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */
var Qz = /* @__PURE__ */ function() {
  function t(n) {
    return -n.tension * n.x - n.friction * n.v;
  }
  function e(n, a, i) {
    var o = {
      x: n.x + i.dx * a,
      v: n.v + i.dv * a,
      tension: n.tension,
      friction: n.friction
    };
    return {
      dx: o.v,
      dv: t(o)
    };
  }
  function r(n, a) {
    var i = {
      dx: n.v,
      dv: t(n)
    }, o = e(n, a * 0.5, i), s = e(n, a * 0.5, o), u = e(n, a, s), l = 1 / 6 * (i.dx + 2 * (o.dx + s.dx) + u.dx), c = 1 / 6 * (i.dv + 2 * (o.dv + s.dv) + u.dv);
    return n.x = n.x + l * a, n.v = n.v + c * a, n;
  }
  return function n(a, i, o) {
    var s = {
      x: -1,
      v: 0,
      tension: null,
      friction: null
    }, u = [0], l = 0, c = 1 / 1e4, d = 16 / 1e3, f, h, v;
    for (a = parseFloat(a) || 500, i = parseFloat(i) || 20, o = o || null, s.tension = a, s.friction = i, f = o !== null, f ? (l = n(a, i), h = l / o * d) : h = d; v = r(v || s, h), u.push(1 + v.x), l += 16, Math.abs(v.x) > c && Math.abs(v.v) > c; )
      ;
    return f ? function(p) {
      return u[p * (u.length - 1) | 0];
    } : l;
  };
}(), ct = function(e, r, n, a) {
  var i = Jz(e, r, n, a);
  return function(o, s, u) {
    return o + (s - o) * i(u);
  };
}, Us = {
  linear: function(e, r, n) {
    return e + (r - e) * n;
  },
  // default easings
  ease: ct(0.25, 0.1, 0.25, 1),
  "ease-in": ct(0.42, 0, 1, 1),
  "ease-out": ct(0, 0, 0.58, 1),
  "ease-in-out": ct(0.42, 0, 0.58, 1),
  // sine
  "ease-in-sine": ct(0.47, 0, 0.745, 0.715),
  "ease-out-sine": ct(0.39, 0.575, 0.565, 1),
  "ease-in-out-sine": ct(0.445, 0.05, 0.55, 0.95),
  // quad
  "ease-in-quad": ct(0.55, 0.085, 0.68, 0.53),
  "ease-out-quad": ct(0.25, 0.46, 0.45, 0.94),
  "ease-in-out-quad": ct(0.455, 0.03, 0.515, 0.955),
  // cubic
  "ease-in-cubic": ct(0.55, 0.055, 0.675, 0.19),
  "ease-out-cubic": ct(0.215, 0.61, 0.355, 1),
  "ease-in-out-cubic": ct(0.645, 0.045, 0.355, 1),
  // quart
  "ease-in-quart": ct(0.895, 0.03, 0.685, 0.22),
  "ease-out-quart": ct(0.165, 0.84, 0.44, 1),
  "ease-in-out-quart": ct(0.77, 0, 0.175, 1),
  // quint
  "ease-in-quint": ct(0.755, 0.05, 0.855, 0.06),
  "ease-out-quint": ct(0.23, 1, 0.32, 1),
  "ease-in-out-quint": ct(0.86, 0, 0.07, 1),
  // expo
  "ease-in-expo": ct(0.95, 0.05, 0.795, 0.035),
  "ease-out-expo": ct(0.19, 1, 0.22, 1),
  "ease-in-out-expo": ct(1, 0, 0, 1),
  // circ
  "ease-in-circ": ct(0.6, 0.04, 0.98, 0.335),
  "ease-out-circ": ct(0.075, 0.82, 0.165, 1),
  "ease-in-out-circ": ct(0.785, 0.135, 0.15, 0.86),
  // user param easings...
  spring: function(e, r, n) {
    if (n === 0)
      return Us.linear;
    var a = Qz(e, r, n);
    return function(i, o, s) {
      return i + (o - i) * a(s);
    };
  },
  "cubic-bezier": ct
};
function A0(t, e, r, n, a) {
  if (n === 1 || e === r)
    return r;
  var i = a(e, r, n);
  return t == null || ((t.roundValue || t.color) && (i = Math.round(i)), t.min !== void 0 && (i = Math.max(i, t.min)), t.max !== void 0 && (i = Math.min(i, t.max))), i;
}
function P0(t, e) {
  return t.pfValue != null || t.value != null ? t.pfValue != null && (e == null || e.type.units !== "%") ? t.pfValue : t.value : t;
}
function ri(t, e, r, n, a) {
  var i = a != null ? a.type : null;
  r < 0 ? r = 0 : r > 1 && (r = 1);
  var o = P0(t, a), s = P0(e, a);
  if (Ce(o) && Ce(s))
    return A0(i, o, s, r, n);
  if (lt(o) && lt(s)) {
    for (var u = [], l = 0; l < s.length; l++) {
      var c = o[l], d = s[l];
      if (c != null && d != null) {
        var f = A0(i, c, d, r, n);
        u.push(f);
      } else
        u.push(d);
    }
    return u;
  }
}
function e8(t, e, r, n) {
  var a = !n, i = t._private, o = e._private, s = o.easing, u = o.startTime, l = n ? t : t.cy(), c = l.style();
  if (!o.easingImpl)
    if (s == null)
      o.easingImpl = Us.linear;
    else {
      var d;
      if (Me(s)) {
        var f = c.parse("transition-timing-function", s);
        d = f.value;
      } else
        d = s;
      var h, v;
      Me(d) ? (h = d, v = []) : (h = d[1], v = d.slice(2).map(function(V) {
        return +V;
      })), v.length > 0 ? (h === "spring" && v.push(o.duration), o.easingImpl = Us[h].apply(null, v)) : o.easingImpl = Us[h];
    }
  var p = o.easingImpl, g;
  if (o.duration === 0 ? g = 1 : g = (r - u) / o.duration, o.applying && (g = o.progress), g < 0 ? g = 0 : g > 1 && (g = 1), o.delay == null) {
    var y = o.startPosition, m = o.position;
    if (m && a && !t.locked()) {
      var b = {};
      io(y.x, m.x) && (b.x = ri(y.x, m.x, g, p)), io(y.y, m.y) && (b.y = ri(y.y, m.y, g, p)), t.position(b);
    }
    var w = o.startPan, x = o.pan, E = i.pan, C = x != null && n;
    C && (io(w.x, x.x) && (E.x = ri(w.x, x.x, g, p)), io(w.y, x.y) && (E.y = ri(w.y, x.y, g, p)), t.emit("pan"));
    var k = o.startZoom, S = o.zoom, _ = S != null && n;
    _ && (io(k, S) && (i.zoom = Fo(i.minZoom, ri(k, S, g, p), i.maxZoom)), t.emit("zoom")), (C || _) && t.emit("viewport");
    var T = o.style;
    if (T && T.length > 0 && a) {
      for (var O = 0; O < T.length; O++) {
        var D = T[O], A = D.name, F = D, R = o.startStyle[A], M = c.properties[R.name], L = ri(R, F, g, p, M);
        c.overrideBypass(t, A, L);
      }
      t.emit("style");
    }
  }
  return o.progress = g, g;
}
function io(t, e) {
  return t == null || e == null ? !1 : Ce(t) && Ce(e) ? !0 : !!(t && e);
}
function t8(t, e, r, n) {
  var a = e._private;
  a.started = !0, a.startTime = r - a.progress * a.duration;
}
function D0(t, e) {
  var r = e._private.aniEles, n = [];
  function a(c, d) {
    var f = c._private, h = f.animation.current, v = f.animation.queue, p = !1;
    if (h.length === 0) {
      var g = v.shift();
      g && h.push(g);
    }
    for (var y = function(E) {
      for (var C = E.length - 1; C >= 0; C--) {
        var k = E[C];
        k();
      }
      E.splice(0, E.length);
    }, m = h.length - 1; m >= 0; m--) {
      var b = h[m], w = b._private;
      if (w.stopped) {
        h.splice(m, 1), w.hooked = !1, w.playing = !1, w.started = !1, y(w.frames);
        continue;
      }
      !w.playing && !w.applying || (w.playing && w.applying && (w.applying = !1), w.started || t8(c, b, t), e8(c, b, t, d), w.applying && (w.applying = !1), y(w.frames), w.step != null && w.step(t), b.completed() && (h.splice(m, 1), w.hooked = !1, w.playing = !1, w.started = !1, y(w.completes)), p = !0);
    }
    return !d && h.length === 0 && v.length === 0 && n.push(c), p;
  }
  for (var i = !1, o = 0; o < r.length; o++) {
    var s = r[o], u = a(s);
    i = i || u;
  }
  var l = a(e, !0);
  (i || l) && (r.length > 0 ? e.notify("draw", r) : e.notify("draw")), r.unmerge(n), e.emit("step");
}
var r8 = {
  // pull in animation functions
  animate: et.animate(),
  animation: et.animation(),
  animated: et.animated(),
  clearQueue: et.clearQueue(),
  delay: et.delay(),
  delayAnimation: et.delayAnimation(),
  stop: et.stop(),
  addToAnimationPool: function(e) {
    var r = this;
    r.styleEnabled() && r._private.aniEles.merge(e);
  },
  stopAnimationLoop: function() {
    this._private.animationsRunning = !1;
  },
  startAnimationLoop: function() {
    var e = this;
    if (e._private.animationsRunning = !0, !e.styleEnabled())
      return;
    function r() {
      e._private.animationsRunning && ll(function(i) {
        D0(i, e), r();
      });
    }
    var n = e.renderer();
    n && n.beforeRender ? n.beforeRender(function(i, o) {
      D0(o, e);
    }, n.beforeRenderPriorities.animations) : r();
  }
}, n8 = {
  qualifierCompare: function(e, r) {
    return e == null || r == null ? e == null && r == null : e.sameText(r);
  },
  eventMatches: function(e, r, n) {
    var a = r.qualifier;
    return a != null ? e !== n.target && rs(n.target) && a.matches(n.target) : !0;
  },
  addEventFields: function(e, r) {
    r.cy = e, r.target = e;
  },
  callbackContext: function(e, r, n) {
    return r.qualifier != null ? n.target : e;
  }
}, Ls = function(e) {
  return Me(e) ? new ra(e) : e;
}, tk = {
  createEmitter: function() {
    var e = this._private;
    return e.emitter || (e.emitter = new Hl(n8, this)), this;
  },
  emitter: function() {
    return this._private.emitter;
  },
  on: function(e, r, n) {
    return this.emitter().on(e, Ls(r), n), this;
  },
  removeListener: function(e, r, n) {
    return this.emitter().removeListener(e, Ls(r), n), this;
  },
  removeAllListeners: function() {
    return this.emitter().removeAllListeners(), this;
  },
  one: function(e, r, n) {
    return this.emitter().one(e, Ls(r), n), this;
  },
  once: function(e, r, n) {
    return this.emitter().one(e, Ls(r), n), this;
  },
  emit: function(e, r) {
    return this.emitter().emit(e, r), this;
  },
  emitAndNotify: function(e, r) {
    return this.emit(e), this.notify(e, r), this;
  }
};
et.eventAliasesOn(tk);
var Pp = {
  png: function(e) {
    var r = this._private.renderer;
    return e = e || {}, r.png(e);
  },
  jpg: function(e) {
    var r = this._private.renderer;
    return e = e || {}, e.bg = e.bg || "#fff", r.jpg(e);
  }
};
Pp.jpeg = Pp.jpg;
var Ws = {
  layout: function(e) {
    var r = this;
    if (e == null) {
      bt("Layout options must be specified to make a layout");
      return;
    }
    if (e.name == null) {
      bt("A `name` must be specified to make a layout");
      return;
    }
    var n = e.name, a = r.extension("layout", n);
    if (a == null) {
      bt("No such layout `" + n + "` found.  Did you forget to import it and `cytoscape.use()` it?");
      return;
    }
    var i;
    Me(e.eles) ? i = r.$(e.eles) : i = e.eles != null ? e.eles : r.$();
    var o = new a(ze({}, e, {
      cy: r,
      eles: i
    }));
    return o;
  }
};
Ws.createLayout = Ws.makeLayout = Ws.layout;
var a8 = {
  notify: function(e, r) {
    var n = this._private;
    if (this.batching()) {
      n.batchNotifications = n.batchNotifications || {};
      var a = n.batchNotifications[e] = n.batchNotifications[e] || this.collection();
      r != null && a.merge(r);
      return;
    }
    if (n.notificationsEnabled) {
      var i = this.renderer();
      this.destroyed() || !i || i.notify(e, r);
    }
  },
  notifications: function(e) {
    var r = this._private;
    return e === void 0 ? r.notificationsEnabled : (r.notificationsEnabled = !!e, this);
  },
  noNotifications: function(e) {
    this.notifications(!1), e(), this.notifications(!0);
  },
  batching: function() {
    return this._private.batchCount > 0;
  },
  startBatch: function() {
    var e = this._private;
    return e.batchCount == null && (e.batchCount = 0), e.batchCount === 0 && (e.batchStyleEles = this.collection(), e.batchNotifications = {}), e.batchCount++, this;
  },
  endBatch: function() {
    var e = this._private;
    if (e.batchCount === 0)
      return this;
    if (e.batchCount--, e.batchCount === 0) {
      e.batchStyleEles.updateStyle();
      var r = this.renderer();
      Object.keys(e.batchNotifications).forEach(function(n) {
        var a = e.batchNotifications[n];
        a.empty() ? r.notify(n) : r.notify(n, a);
      });
    }
    return this;
  },
  batch: function(e) {
    return this.startBatch(), e(), this.endBatch(), this;
  },
  // for backwards compatibility
  batchData: function(e) {
    var r = this;
    return this.batch(function() {
      for (var n = Object.keys(e), a = 0; a < n.length; a++) {
        var i = n[a], o = e[i], s = r.getElementById(i);
        s.data(o);
      }
    });
  }
}, i8 = Zt({
  hideEdgesOnViewport: !1,
  textureOnViewport: !1,
  motionBlur: !1,
  motionBlurOpacity: 0.05,
  pixelRatio: void 0,
  desktopTapThreshold: 4,
  touchTapThreshold: 8,
  wheelSensitivity: 1,
  debug: !1,
  showFps: !1
}), Dp = {
  renderTo: function(e, r, n, a) {
    var i = this._private.renderer;
    return i.renderTo(e, r, n, a), this;
  },
  renderer: function() {
    return this._private.renderer;
  },
  forceRender: function() {
    return this.notify("draw"), this;
  },
  resize: function() {
    return this.invalidateSize(), this.emitAndNotify("resize"), this;
  },
  initRenderer: function(e) {
    var r = this, n = r.extension("renderer", e.name);
    if (n == null) {
      bt("Can not initialise: No such renderer `".concat(e.name, "` found. Did you forget to import it and `cytoscape.use()` it?"));
      return;
    }
    e.wheelSensitivity !== void 0 && tt("You have set a custom wheel sensitivity.  This will make your app zoom unnaturally when using mainstream mice.  You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");
    var a = i8(e);
    a.cy = r, r._private.renderer = new n(a), this.notify("init");
  },
  destroyRenderer: function() {
    var e = this;
    e.notify("destroy");
    var r = e.container();
    if (r)
      for (r._cyreg = null; r.childNodes.length > 0; )
        r.removeChild(r.childNodes[0]);
    e._private.renderer = null, e.mutableElements().forEach(function(n) {
      var a = n._private;
      a.rscratch = {}, a.rstyle = {}, a.animation.current = [], a.animation.queue = [];
    });
  },
  onRender: function(e) {
    return this.on("render", e);
  },
  offRender: function(e) {
    return this.off("render", e);
  }
};
Dp.invalidateDimensions = Dp.resize;
var js = {
  // get a collection
  // - empty collection on no args
  // - collection of elements in the graph on selector arg
  // - guarantee a returned collection when elements or collection specified
  collection: function(e, r) {
    return Me(e) ? this.$(e) : xr(e) ? e.collection() : lt(e) ? (r || (r = {}), new Yt(this, e, r.unique, r.removed)) : new Yt(this);
  },
  nodes: function(e) {
    var r = this.$(function(n) {
      return n.isNode();
    });
    return e ? r.filter(e) : r;
  },
  edges: function(e) {
    var r = this.$(function(n) {
      return n.isEdge();
    });
    return e ? r.filter(e) : r;
  },
  // search the graph like jQuery
  $: function(e) {
    var r = this._private.elements;
    return e ? r.filter(e) : r.spawnSelf();
  },
  mutableElements: function() {
    return this._private.elements;
  }
};
js.elements = js.filter = js.$;
var sr = {}, Co = "t", o8 = "f";
sr.apply = function(t) {
  for (var e = this, r = e._private, n = r.cy, a = n.collection(), i = 0; i < t.length; i++) {
    var o = t[i], s = e.getContextMeta(o);
    if (!s.empty) {
      var u = e.getContextStyle(s), l = e.applyContextStyle(s, u, o);
      o._private.appliedInitStyle ? e.updateTransitions(o, l.diffProps) : o._private.appliedInitStyle = !0;
      var c = e.updateStyleHints(o);
      c && a.push(o);
    }
  }
  return a;
};
sr.getPropertiesDiff = function(t, e) {
  var r = this, n = r._private.propDiffs = r._private.propDiffs || {}, a = t + "-" + e, i = n[a];
  if (i)
    return i;
  for (var o = [], s = {}, u = 0; u < r.length; u++) {
    var l = r[u], c = t[u] === Co, d = e[u] === Co, f = c !== d, h = l.mappedProperties.length > 0;
    if (f || d && h) {
      var v = void 0;
      f && h || f ? v = l.properties : h && (v = l.mappedProperties);
      for (var p = 0; p < v.length; p++) {
        for (var g = v[p], y = g.name, m = !1, b = u + 1; b < r.length; b++) {
          var w = r[b], x = e[b] === Co;
          if (x && (m = w.properties[g.name] != null, m))
            break;
        }
        !s[y] && !m && (s[y] = !0, o.push(y));
      }
    }
  }
  return n[a] = o, o;
};
sr.getContextMeta = function(t) {
  for (var e = this, r = "", n, a = t._private.styleCxtKey || "", i = 0; i < e.length; i++) {
    var o = e[i], s = o.selector && o.selector.matches(t);
    s ? r += Co : r += o8;
  }
  return n = e.getPropertiesDiff(a, r), t._private.styleCxtKey = r, {
    key: r,
    diffPropNames: n,
    empty: n.length === 0
  };
};
sr.getContextStyle = function(t) {
  var e = t.key, r = this, n = this._private.contextStyles = this._private.contextStyles || {};
  if (n[e])
    return n[e];
  for (var a = {
    _private: {
      key: e
    }
  }, i = 0; i < r.length; i++) {
    var o = r[i], s = e[i] === Co;
    if (s)
      for (var u = 0; u < o.properties.length; u++) {
        var l = o.properties[u];
        a[l.name] = l;
      }
  }
  return n[e] = a, a;
};
sr.applyContextStyle = function(t, e, r) {
  for (var n = this, a = t.diffPropNames, i = {}, o = n.types, s = 0; s < a.length; s++) {
    var u = a[s], l = e[u], c = r.pstyle(u);
    if (!l)
      if (c)
        c.bypass ? l = {
          name: u,
          deleteBypassed: !0
        } : l = {
          name: u,
          delete: !0
        };
      else continue;
    if (c !== l) {
      if (l.mapped === o.fn && c != null && c.mapping != null && c.mapping.value === l.value) {
        var d = c.mapping, f = d.fnValue = l.value(r);
        if (f === d.prevFnValue)
          continue;
      }
      var h = i[u] = {
        prev: c
      };
      n.applyParsedProperty(r, l), h.next = r.pstyle(u), h.next && h.next.bypass && (h.next = h.next.bypassed);
    }
  }
  return {
    diffProps: i
  };
};
sr.updateStyleHints = function(t) {
  var e = t._private, r = this, n = r.propertyGroupNames, a = r.propertyGroupKeys, i = function(Q, ge, we) {
    return r.getPropertiesHash(Q, ge, we);
  }, o = e.styleKey;
  if (t.removed())
    return !1;
  var s = e.group === "nodes", u = t._private.style;
  n = Object.keys(u);
  for (var l = 0; l < a.length; l++) {
    var c = a[l];
    e.styleKeys[c] = [li, uo];
  }
  for (var d = function(Q, ge) {
    return e.styleKeys[ge][0] = Do(Q, e.styleKeys[ge][0]);
  }, f = function(Q, ge) {
    return e.styleKeys[ge][1] = Ro(Q, e.styleKeys[ge][1]);
  }, h = function(Q, ge) {
    d(Q, ge), f(Q, ge);
  }, v = function(Q, ge) {
    for (var we = 0; we < Q.length; we++) {
      var fe = Q.charCodeAt(we);
      d(fe, ge), f(fe, ge);
    }
  }, p = 2e9, g = function(Q) {
    return -128 < Q && Q < 128 && Math.floor(Q) !== Q ? p - (Q * 1024 | 0) : Q;
  }, y = 0; y < n.length; y++) {
    var m = n[y], b = u[m];
    if (b != null) {
      var w = this.properties[m], x = w.type, E = w.groupKey, C = void 0;
      w.hashOverride != null ? C = w.hashOverride(t, b) : b.pfValue != null && (C = b.pfValue);
      var k = w.enums == null ? b.value : null, S = C != null, _ = k != null, T = S || _, O = b.units;
      if (x.number && T && !x.multiple) {
        var D = S ? C : k;
        h(g(D), E), !S && O != null && v(O, E);
      } else
        v(b.strValue, E);
    }
  }
  for (var A = [li, uo], F = 0; F < a.length; F++) {
    var R = a[F], M = e.styleKeys[R];
    A[0] = Do(M[0], A[0]), A[1] = Ro(M[1], A[1]);
  }
  e.styleKey = d$(A[0], A[1]);
  var L = e.styleKeys;
  e.labelDimsKey = $n(L.labelDimensions);
  var V = i(t, ["label"], L.labelDimensions);
  if (e.labelKey = $n(V), e.labelStyleKey = $n(ks(L.commonLabel, V)), !s) {
    var Y = i(t, ["source-label"], L.labelDimensions);
    e.sourceLabelKey = $n(Y), e.sourceLabelStyleKey = $n(ks(L.commonLabel, Y));
    var H = i(t, ["target-label"], L.labelDimensions);
    e.targetLabelKey = $n(H), e.targetLabelStyleKey = $n(ks(L.commonLabel, H));
  }
  if (s) {
    var K = e.styleKeys, ne = K.nodeBody, B = K.nodeBorder, $ = K.nodeOutline, z = K.backgroundImage, W = K.compound, Z = K.pie, N = [ne, B, $, z, W, Z].filter(function(X) {
      return X != null;
    }).reduce(ks, [li, uo]);
    e.nodeKey = $n(N), e.hasPie = Z != null && Z[0] !== li && Z[1] !== uo;
  }
  return o !== e.styleKey;
};
sr.clearStyleHints = function(t) {
  var e = t._private;
  e.styleCxtKey = "", e.styleKeys = {}, e.styleKey = null, e.labelKey = null, e.labelStyleKey = null, e.sourceLabelKey = null, e.sourceLabelStyleKey = null, e.targetLabelKey = null, e.targetLabelStyleKey = null, e.nodeKey = null, e.hasPie = null;
};
sr.applyParsedProperty = function(t, e) {
  var r = this, n = e, a = t._private.style, i, o = r.types, s = r.properties[n.name].type, u = n.bypass, l = a[n.name], c = l && l.bypass, d = t._private, f = "mapping", h = function(ne) {
    return ne == null ? null : ne.pfValue != null ? ne.pfValue : ne.value;
  }, v = function() {
    var ne = h(l), B = h(n);
    r.checkTriggers(t, n.name, ne, B);
  };
  if (e.name === "curve-style" && t.isEdge() && // loops must be bundled beziers
  (e.value !== "bezier" && t.isLoop() || // edges connected to compound nodes can not be haystacks
  e.value === "haystack" && (t.source().isParent() || t.target().isParent())) && (n = e = this.parse(e.name, "bezier", u)), n.delete)
    return a[n.name] = void 0, v(), !0;
  if (n.deleteBypassed)
    return l ? l.bypass ? (l.bypassed = void 0, v(), !0) : !1 : (v(), !0);
  if (n.deleteBypass)
    return l ? l.bypass ? (a[n.name] = l.bypassed, v(), !0) : !1 : (v(), !0);
  var p = function() {
    tt("Do not assign mappings to elements without corresponding data (i.e. ele `" + t.id() + "` has no mapping for property `" + n.name + "` with data field `" + n.field + "`); try a `[" + n.field + "]` selector to limit scope to elements with `" + n.field + "` defined");
  };
  switch (n.mapped) {
    case o.mapData: {
      for (var g = n.field.split("."), y = d.data, m = 0; m < g.length && y; m++) {
        var b = g[m];
        y = y[b];
      }
      if (y == null)
        return p(), !1;
      var w;
      if (Ce(y)) {
        var x = n.fieldMax - n.fieldMin;
        x === 0 ? w = 0 : w = (y - n.fieldMin) / x;
      } else
        return tt("Do not use continuous mappers without specifying numeric data (i.e. `" + n.field + ": " + y + "` for `" + t.id() + "` is non-numeric)"), !1;
      if (w < 0 ? w = 0 : w > 1 && (w = 1), s.color) {
        var E = n.valueMin[0], C = n.valueMax[0], k = n.valueMin[1], S = n.valueMax[1], _ = n.valueMin[2], T = n.valueMax[2], O = n.valueMin[3] == null ? 1 : n.valueMin[3], D = n.valueMax[3] == null ? 1 : n.valueMax[3], A = [Math.round(E + (C - E) * w), Math.round(k + (S - k) * w), Math.round(_ + (T - _) * w), Math.round(O + (D - O) * w)];
        i = {
          // colours are simple, so just create the flat property instead of expensive string parsing
          bypass: n.bypass,
          // we're a bypass if the mapping property is a bypass
          name: n.name,
          value: A,
          strValue: "rgb(" + A[0] + ", " + A[1] + ", " + A[2] + ")"
        };
      } else if (s.number) {
        var F = n.valueMin + (n.valueMax - n.valueMin) * w;
        i = this.parse(n.name, F, n.bypass, f);
      } else
        return !1;
      if (!i)
        return p(), !1;
      i.mapping = n, n = i;
      break;
    }
    case o.data: {
      for (var R = n.field.split("."), M = d.data, L = 0; L < R.length && M; L++) {
        var V = R[L];
        M = M[V];
      }
      if (M != null && (i = this.parse(n.name, M, n.bypass, f)), !i)
        return p(), !1;
      i.mapping = n, n = i;
      break;
    }
    case o.fn: {
      var Y = n.value, H = n.fnValue != null ? n.fnValue : Y(t);
      if (n.prevFnValue = H, H == null)
        return tt("Custom function mappers may not return null (i.e. `" + n.name + "` for ele `" + t.id() + "` is null)"), !1;
      if (i = this.parse(n.name, H, n.bypass, f), !i)
        return tt("Custom function mappers may not return invalid values for the property type (i.e. `" + n.name + "` for ele `" + t.id() + "` is invalid)"), !1;
      i.mapping = rn(n), n = i;
      break;
    }
    case void 0:
      break;
    default:
      return !1;
  }
  return u ? (c ? n.bypassed = l.bypassed : n.bypassed = l, a[n.name] = n) : c ? l.bypassed = n : a[n.name] = n, v(), !0;
};
sr.cleanElements = function(t, e) {
  for (var r = 0; r < t.length; r++) {
    var n = t[r];
    if (this.clearStyleHints(n), n.dirtyCompoundBoundsCache(), n.dirtyBoundingBoxCache(), !e)
      n._private.style = {};
    else
      for (var a = n._private.style, i = Object.keys(a), o = 0; o < i.length; o++) {
        var s = i[o], u = a[s];
        u != null && (u.bypass ? u.bypassed = null : a[s] = null);
      }
  }
};
sr.update = function() {
  var t = this._private.cy, e = t.mutableElements();
  e.updateStyle();
};
sr.updateTransitions = function(t, e) {
  var r = this, n = t._private, a = t.pstyle("transition-property").value, i = t.pstyle("transition-duration").pfValue, o = t.pstyle("transition-delay").pfValue;
  if (a.length > 0 && i > 0) {
    for (var s = {}, u = !1, l = 0; l < a.length; l++) {
      var c = a[l], d = t.pstyle(c), f = e[c];
      if (f) {
        var h = f.prev, v = h, p = f.next != null ? f.next : d, g = !1, y = void 0, m = 1e-6;
        v && (Ce(v.pfValue) && Ce(p.pfValue) ? (g = p.pfValue - v.pfValue, y = v.pfValue + m * g) : Ce(v.value) && Ce(p.value) ? (g = p.value - v.value, y = v.value + m * g) : lt(v.value) && lt(p.value) && (g = v.value[0] !== p.value[0] || v.value[1] !== p.value[1] || v.value[2] !== p.value[2], y = v.strValue), g && (s[c] = p.strValue, this.applyBypass(t, c, y), u = !0));
      }
    }
    if (!u)
      return;
    n.transitioning = !0, new Mi(function(b) {
      o > 0 ? t.delayAnimation(o).play().promise().then(b) : b();
    }).then(function() {
      return t.animation({
        style: s,
        duration: i,
        easing: t.pstyle("transition-timing-function").value,
        queue: !1
      }).play().promise();
    }).then(function() {
      r.removeBypasses(t, a), t.emitAndNotify("style"), n.transitioning = !1;
    });
  } else n.transitioning && (this.removeBypasses(t, a), t.emitAndNotify("style"), n.transitioning = !1);
};
sr.checkTrigger = function(t, e, r, n, a, i) {
  var o = this.properties[e], s = a(o);
  s != null && s(r, n) && i(o);
};
sr.checkZOrderTrigger = function(t, e, r, n) {
  var a = this;
  this.checkTrigger(t, e, r, n, function(i) {
    return i.triggersZOrder;
  }, function() {
    a._private.cy.notify("zorder", t);
  });
};
sr.checkBoundsTrigger = function(t, e, r, n) {
  this.checkTrigger(t, e, r, n, function(a) {
    return a.triggersBounds;
  }, function(a) {
    t.dirtyCompoundBoundsCache(), t.dirtyBoundingBoxCache(), // only for beziers -- so performance of other edges isn't affected
    a.triggersBoundsOfParallelBeziers && e === "curve-style" && (r === "bezier" || n === "bezier") && t.parallelEdges().forEach(function(i) {
      i.isBundledBezier() && i.dirtyBoundingBoxCache();
    }), a.triggersBoundsOfConnectedEdges && e === "display" && (r === "none" || n === "none") && t.connectedEdges().forEach(function(i) {
      i.dirtyBoundingBoxCache();
    });
  });
};
sr.checkTriggers = function(t, e, r, n) {
  t.dirtyStyleCache(), this.checkZOrderTrigger(t, e, r, n), this.checkBoundsTrigger(t, e, r, n);
};
var os = {};
os.applyBypass = function(t, e, r, n) {
  var a = this, i = [], o = !0;
  if (e === "*" || e === "**") {
    if (r !== void 0)
      for (var s = 0; s < a.properties.length; s++) {
        var u = a.properties[s], l = u.name, c = this.parse(l, r, !0);
        c && i.push(c);
      }
  } else if (Me(e)) {
    var d = this.parse(e, r, !0);
    d && i.push(d);
  } else if (Xe(e)) {
    var f = e;
    n = r;
    for (var h = Object.keys(f), v = 0; v < h.length; v++) {
      var p = h[v], g = f[p];
      if (g === void 0 && (g = f[Rl(p)]), g !== void 0) {
        var y = this.parse(p, g, !0);
        y && i.push(y);
      }
    }
  } else
    return !1;
  if (i.length === 0)
    return !1;
  for (var m = !1, b = 0; b < t.length; b++) {
    for (var w = t[b], x = {}, E = void 0, C = 0; C < i.length; C++) {
      var k = i[C];
      if (n) {
        var S = w.pstyle(k.name);
        E = x[k.name] = {
          prev: S
        };
      }
      m = this.applyParsedProperty(w, rn(k)) || m, n && (E.next = w.pstyle(k.name));
    }
    m && this.updateStyleHints(w), n && this.updateTransitions(w, x, o);
  }
  return m;
};
os.overrideBypass = function(t, e, r) {
  e = Ig(e);
  for (var n = 0; n < t.length; n++) {
    var a = t[n], i = a._private.style[e], o = this.properties[e].type, s = o.color, u = o.mutiple, l = i ? i.pfValue != null ? i.pfValue : i.value : null;
    !i || !i.bypass ? this.applyBypass(a, e, r) : (i.value = r, i.pfValue != null && (i.pfValue = r), s ? i.strValue = "rgb(" + r.join(",") + ")" : u ? i.strValue = r.join(" ") : i.strValue = "" + r, this.updateStyleHints(a)), this.checkTriggers(a, e, l, r);
  }
};
os.removeAllBypasses = function(t, e) {
  return this.removeBypasses(t, this.propertyNames, e);
};
os.removeBypasses = function(t, e, r) {
  for (var n = !0, a = 0; a < t.length; a++) {
    for (var i = t[a], o = {}, s = 0; s < e.length; s++) {
      var u = e[s], l = this.properties[u], c = i.pstyle(l.name);
      if (!(!c || !c.bypass)) {
        var d = "", f = this.parse(u, d, !0), h = o[l.name] = {
          prev: c
        };
        this.applyParsedProperty(i, f), h.next = i.pstyle(l.name);
      }
    }
    this.updateStyleHints(i), r && this.updateTransitions(i, o, n);
  }
};
var Vg = {};
Vg.getEmSizeInPixels = function() {
  var t = this.containerCss("font-size");
  return t != null ? parseFloat(t) : 1;
};
Vg.containerCss = function(t) {
  var e = this._private.cy, r = e.container(), n = e.window();
  if (n && r && n.getComputedStyle)
    return n.getComputedStyle(r).getPropertyValue(t);
};
var un = {};
un.getRenderedStyle = function(t, e) {
  return e ? this.getStylePropertyValue(t, e, !0) : this.getRawStyle(t, !0);
};
un.getRawStyle = function(t, e) {
  var r = this;
  if (t = t[0], t) {
    for (var n = {}, a = 0; a < r.properties.length; a++) {
      var i = r.properties[a], o = r.getStylePropertyValue(t, i.name, e);
      o != null && (n[i.name] = o, n[Rl(i.name)] = o);
    }
    return n;
  }
};
un.getIndexedStyle = function(t, e, r, n) {
  var a = t.pstyle(e)[r][n];
  return a ?? t.cy().style().getDefaultProperty(e)[r][0];
};
un.getStylePropertyValue = function(t, e, r) {
  var n = this;
  if (t = t[0], t) {
    var a = n.properties[e];
    a.alias && (a = a.pointsTo);
    var i = a.type, o = t.pstyle(a.name);
    if (o) {
      var s = o.value, u = o.units, l = o.strValue;
      if (r && i.number && s != null && Ce(s)) {
        var c = t.cy().zoom(), d = function(g) {
          return g * c;
        }, f = function(g, y) {
          return d(g) + y;
        }, h = lt(s), v = h ? u.every(function(p) {
          return p != null;
        }) : u != null;
        return v ? h ? s.map(function(p, g) {
          return f(p, u[g]);
        }).join(" ") : f(s, u) : h ? s.map(function(p) {
          return Me(p) ? p : "" + d(p);
        }).join(" ") : "" + d(s);
      } else if (l != null)
        return l;
    }
    return null;
  }
};
un.getAnimationStartStyle = function(t, e) {
  for (var r = {}, n = 0; n < e.length; n++) {
    var a = e[n], i = a.name, o = t.pstyle(i);
    o !== void 0 && (Xe(o) ? o = this.parse(i, o.strValue) : o = this.parse(i, o)), o && (r[i] = o);
  }
  return r;
};
un.getPropsList = function(t) {
  var e = this, r = [], n = t, a = e.properties;
  if (n)
    for (var i = Object.keys(n), o = 0; o < i.length; o++) {
      var s = i[o], u = n[s], l = a[s] || a[Ig(s)], c = this.parse(l.name, u);
      c && r.push(c);
    }
  return r;
};
un.getNonDefaultPropertiesHash = function(t, e, r) {
  var n = r.slice(), a, i, o, s, u, l;
  for (u = 0; u < e.length; u++)
    if (a = e[u], i = t.pstyle(a, !1), i != null)
      if (i.pfValue != null)
        n[0] = Do(s, n[0]), n[1] = Ro(s, n[1]);
      else
        for (o = i.strValue, l = 0; l < o.length; l++)
          s = o.charCodeAt(l), n[0] = Do(s, n[0]), n[1] = Ro(s, n[1]);
  return n;
};
un.getPropertiesHash = un.getNonDefaultPropertiesHash;
var Ul = {};
Ul.appendFromJson = function(t) {
  for (var e = this, r = 0; r < t.length; r++) {
    var n = t[r], a = n.selector, i = n.style || n.css, o = Object.keys(i);
    e.selector(a);
    for (var s = 0; s < o.length; s++) {
      var u = o[s], l = i[u];
      e.css(u, l);
    }
  }
  return e;
};
Ul.fromJson = function(t) {
  var e = this;
  return e.resetToDefault(), e.appendFromJson(t), e;
};
Ul.json = function() {
  for (var t = [], e = this.defaultLength; e < this.length; e++) {
    for (var r = this[e], n = r.selector, a = r.properties, i = {}, o = 0; o < a.length; o++) {
      var s = a[o];
      i[s.name] = s.strValue;
    }
    t.push({
      selector: n ? n.toString() : "core",
      style: i
    });
  }
  return t;
};
var Hg = {};
Hg.appendFromString = function(t) {
  var e = this, r = this, n = "" + t, a, i, o;
  n = n.replace(/[/][*](\s|.)+?[*][/]/g, "");
  function s() {
    n.length > a.length ? n = n.substr(a.length) : n = "";
  }
  function u() {
    i.length > o.length ? i = i.substr(o.length) : i = "";
  }
  for (; ; ) {
    var l = n.match(/^\s*$/);
    if (l)
      break;
    var c = n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);
    if (!c) {
      tt("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: " + n);
      break;
    }
    a = c[0];
    var d = c[1];
    if (d !== "core") {
      var f = new ra(d);
      if (f.invalid) {
        tt("Skipping parsing of block: Invalid selector found in string stylesheet: " + d), s();
        continue;
      }
    }
    var h = c[2], v = !1;
    i = h;
    for (var p = []; ; ) {
      var g = i.match(/^\s*$/);
      if (g)
        break;
      var y = i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);
      if (!y) {
        tt("Skipping parsing of block: Invalid formatting of style property and value definitions found in:" + h), v = !0;
        break;
      }
      o = y[0];
      var m = y[1], b = y[2], w = e.properties[m];
      if (!w) {
        tt("Skipping property: Invalid property name in: " + o), u();
        continue;
      }
      var x = r.parse(m, b);
      if (!x) {
        tt("Skipping property: Invalid property definition in: " + o), u();
        continue;
      }
      p.push({
        name: m,
        val: b
      }), u();
    }
    if (v) {
      s();
      break;
    }
    r.selector(d);
    for (var E = 0; E < p.length; E++) {
      var C = p[E];
      r.css(C.name, C.val);
    }
    s();
  }
  return r;
};
Hg.fromString = function(t) {
  var e = this;
  return e.resetToDefault(), e.appendFromString(t), e;
};
var Ht = {};
(function() {
  var t = Mt, e = hB, r = gB, n = yB, a = mB, i = function(N) {
    return "^" + N + "\\s*\\(\\s*([\\w\\.]+)\\s*\\)$";
  }, o = function(N) {
    var X = t + "|\\w+|" + e + "|" + r + "|" + n + "|" + a;
    return "^" + N + "\\s*\\(([\\w\\.]+)\\s*\\,\\s*(" + t + ")\\s*\\,\\s*(" + t + ")\\s*,\\s*(" + X + ")\\s*\\,\\s*(" + X + ")\\)$";
  }, s = [`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`, "^(none)$", "^(.+)$"];
  Ht.types = {
    time: {
      number: !0,
      min: 0,
      units: "s|ms",
      implicitUnits: "ms"
    },
    percent: {
      number: !0,
      min: 0,
      max: 100,
      units: "%",
      implicitUnits: "%"
    },
    percentages: {
      number: !0,
      min: 0,
      max: 100,
      units: "%",
      implicitUnits: "%",
      multiple: !0
    },
    zeroOneNumber: {
      number: !0,
      min: 0,
      max: 1,
      unitless: !0
    },
    zeroOneNumbers: {
      number: !0,
      min: 0,
      max: 1,
      unitless: !0,
      multiple: !0
    },
    nOneOneNumber: {
      number: !0,
      min: -1,
      max: 1,
      unitless: !0
    },
    nonNegativeInt: {
      number: !0,
      min: 0,
      integer: !0,
      unitless: !0
    },
    nonNegativeNumber: {
      number: !0,
      min: 0,
      unitless: !0
    },
    position: {
      enums: ["parent", "origin"]
    },
    nodeSize: {
      number: !0,
      min: 0,
      enums: ["label"]
    },
    number: {
      number: !0,
      unitless: !0
    },
    numbers: {
      number: !0,
      unitless: !0,
      multiple: !0
    },
    positiveNumber: {
      number: !0,
      unitless: !0,
      min: 0,
      strictMin: !0
    },
    size: {
      number: !0,
      min: 0
    },
    bidirectionalSize: {
      number: !0
    },
    // allows negative
    bidirectionalSizeMaybePercent: {
      number: !0,
      allowPercent: !0
    },
    // allows negative
    bidirectionalSizes: {
      number: !0,
      multiple: !0
    },
    // allows negative
    sizeMaybePercent: {
      number: !0,
      min: 0,
      allowPercent: !0
    },
    axisDirection: {
      enums: ["horizontal", "leftward", "rightward", "vertical", "upward", "downward", "auto"]
    },
    paddingRelativeTo: {
      enums: ["width", "height", "average", "min", "max"]
    },
    bgWH: {
      number: !0,
      min: 0,
      allowPercent: !0,
      enums: ["auto"],
      multiple: !0
    },
    bgPos: {
      number: !0,
      allowPercent: !0,
      multiple: !0
    },
    bgRelativeTo: {
      enums: ["inner", "include-padding"],
      multiple: !0
    },
    bgRepeat: {
      enums: ["repeat", "repeat-x", "repeat-y", "no-repeat"],
      multiple: !0
    },
    bgFit: {
      enums: ["none", "contain", "cover"],
      multiple: !0
    },
    bgCrossOrigin: {
      enums: ["anonymous", "use-credentials", "null"],
      multiple: !0
    },
    bgClip: {
      enums: ["none", "node"],
      multiple: !0
    },
    bgContainment: {
      enums: ["inside", "over"],
      multiple: !0
    },
    color: {
      color: !0
    },
    colors: {
      color: !0,
      multiple: !0
    },
    fill: {
      enums: ["solid", "linear-gradient", "radial-gradient"]
    },
    bool: {
      enums: ["yes", "no"]
    },
    bools: {
      enums: ["yes", "no"],
      multiple: !0
    },
    lineStyle: {
      enums: ["solid", "dotted", "dashed"]
    },
    lineCap: {
      enums: ["butt", "round", "square"]
    },
    linePosition: {
      enums: ["center", "inside", "outside"]
    },
    lineJoin: {
      enums: ["round", "bevel", "miter"]
    },
    borderStyle: {
      enums: ["solid", "dotted", "dashed", "double"]
    },
    curveStyle: {
      enums: ["bezier", "unbundled-bezier", "haystack", "segments", "straight", "straight-triangle", "taxi", "round-segments", "round-taxi"]
    },
    radiusType: {
      enums: ["arc-radius", "influence-radius"],
      multiple: !0
    },
    fontFamily: {
      regex: '^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'
    },
    fontStyle: {
      enums: ["italic", "normal", "oblique"]
    },
    fontWeight: {
      enums: ["normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "800", "900", 100, 200, 300, 400, 500, 600, 700, 800, 900]
    },
    textDecoration: {
      enums: ["none", "underline", "overline", "line-through"]
    },
    textTransform: {
      enums: ["none", "uppercase", "lowercase"]
    },
    textWrap: {
      enums: ["none", "wrap", "ellipsis"]
    },
    textOverflowWrap: {
      enums: ["whitespace", "anywhere"]
    },
    textBackgroundShape: {
      enums: ["rectangle", "roundrectangle", "round-rectangle"]
    },
    nodeShape: {
      enums: ["rectangle", "roundrectangle", "round-rectangle", "cutrectangle", "cut-rectangle", "bottomroundrectangle", "bottom-round-rectangle", "barrel", "ellipse", "triangle", "round-triangle", "square", "pentagon", "round-pentagon", "hexagon", "round-hexagon", "concavehexagon", "concave-hexagon", "heptagon", "round-heptagon", "octagon", "round-octagon", "tag", "round-tag", "star", "diamond", "round-diamond", "vee", "rhomboid", "right-rhomboid", "polygon"]
    },
    overlayShape: {
      enums: ["roundrectangle", "round-rectangle", "ellipse"]
    },
    cornerRadius: {
      number: !0,
      min: 0,
      units: "px|em",
      implicitUnits: "px",
      enums: ["auto"]
    },
    compoundIncludeLabels: {
      enums: ["include", "exclude"]
    },
    arrowShape: {
      enums: ["tee", "triangle", "triangle-tee", "circle-triangle", "triangle-cross", "triangle-backcurve", "vee", "square", "circle", "diamond", "chevron", "none"]
    },
    arrowFill: {
      enums: ["filled", "hollow"]
    },
    arrowWidth: {
      number: !0,
      units: "%|px|em",
      implicitUnits: "px",
      enums: ["match-line"]
    },
    display: {
      enums: ["element", "none"]
    },
    visibility: {
      enums: ["hidden", "visible"]
    },
    zCompoundDepth: {
      enums: ["bottom", "orphan", "auto", "top"]
    },
    zIndexCompare: {
      enums: ["auto", "manual"]
    },
    valign: {
      enums: ["top", "center", "bottom"]
    },
    halign: {
      enums: ["left", "center", "right"]
    },
    justification: {
      enums: ["left", "center", "right", "auto"]
    },
    text: {
      string: !0
    },
    data: {
      mapping: !0,
      regex: i("data")
    },
    layoutData: {
      mapping: !0,
      regex: i("layoutData")
    },
    scratch: {
      mapping: !0,
      regex: i("scratch")
    },
    mapData: {
      mapping: !0,
      regex: o("mapData")
    },
    mapLayoutData: {
      mapping: !0,
      regex: o("mapLayoutData")
    },
    mapScratch: {
      mapping: !0,
      regex: o("mapScratch")
    },
    fn: {
      mapping: !0,
      fn: !0
    },
    url: {
      regexes: s,
      singleRegexMatchValue: !0
    },
    urls: {
      regexes: s,
      singleRegexMatchValue: !0,
      multiple: !0
    },
    propList: {
      propList: !0
    },
    angle: {
      number: !0,
      units: "deg|rad",
      implicitUnits: "rad"
    },
    textRotation: {
      number: !0,
      units: "deg|rad",
      implicitUnits: "rad",
      enums: ["none", "autorotate"]
    },
    polygonPointList: {
      number: !0,
      multiple: !0,
      evenMultiple: !0,
      min: -1,
      max: 1,
      unitless: !0
    },
    edgeDistances: {
      enums: ["intersection", "node-position", "endpoints"]
    },
    edgeEndpoint: {
      number: !0,
      multiple: !0,
      units: "%|px|em|deg|rad",
      implicitUnits: "px",
      enums: ["inside-to-node", "outside-to-node", "outside-to-node-or-label", "outside-to-line", "outside-to-line-or-label"],
      singleEnum: !0,
      validate: function(N, X) {
        switch (N.length) {
          case 2:
            return X[0] !== "deg" && X[0] !== "rad" && X[1] !== "deg" && X[1] !== "rad";
          case 1:
            return Me(N[0]) || X[0] === "deg" || X[0] === "rad";
          default:
            return !1;
        }
      }
    },
    easing: {
      regexes: ["^(spring)\\s*\\(\\s*(" + t + ")\\s*,\\s*(" + t + ")\\s*\\)$", "^(cubic-bezier)\\s*\\(\\s*(" + t + ")\\s*,\\s*(" + t + ")\\s*,\\s*(" + t + ")\\s*,\\s*(" + t + ")\\s*\\)$"],
      enums: ["linear", "ease", "ease-in", "ease-out", "ease-in-out", "ease-in-sine", "ease-out-sine", "ease-in-out-sine", "ease-in-quad", "ease-out-quad", "ease-in-out-quad", "ease-in-cubic", "ease-out-cubic", "ease-in-out-cubic", "ease-in-quart", "ease-out-quart", "ease-in-out-quart", "ease-in-quint", "ease-out-quint", "ease-in-out-quint", "ease-in-expo", "ease-out-expo", "ease-in-out-expo", "ease-in-circ", "ease-out-circ", "ease-in-out-circ"]
    },
    gradientDirection: {
      enums: [
        "to-bottom",
        "to-top",
        "to-left",
        "to-right",
        "to-bottom-right",
        "to-bottom-left",
        "to-top-right",
        "to-top-left",
        "to-right-bottom",
        "to-left-bottom",
        "to-right-top",
        "to-left-top"
        // different order
      ]
    },
    boundsExpansion: {
      number: !0,
      multiple: !0,
      min: 0,
      validate: function(N) {
        var X = N.length;
        return X === 1 || X === 2 || X === 4;
      }
    }
  };
  var u = {
    zeroNonZero: function(N, X) {
      return (N == null || X == null) && N !== X || N == 0 && X != 0 ? !0 : N != 0 && X == 0;
    },
    any: function(N, X) {
      return N != X;
    },
    emptyNonEmpty: function(N, X) {
      var Q = ea(N), ge = ea(X);
      return Q && !ge || !Q && ge;
    }
  }, l = Ht.types, c = [{
    name: "label",
    type: l.text,
    triggersBounds: u.any,
    triggersZOrder: u.emptyNonEmpty
  }, {
    name: "text-rotation",
    type: l.textRotation,
    triggersBounds: u.any
  }, {
    name: "text-margin-x",
    type: l.bidirectionalSize,
    triggersBounds: u.any
  }, {
    name: "text-margin-y",
    type: l.bidirectionalSize,
    triggersBounds: u.any
  }], d = [{
    name: "source-label",
    type: l.text,
    triggersBounds: u.any
  }, {
    name: "source-text-rotation",
    type: l.textRotation,
    triggersBounds: u.any
  }, {
    name: "source-text-margin-x",
    type: l.bidirectionalSize,
    triggersBounds: u.any
  }, {
    name: "source-text-margin-y",
    type: l.bidirectionalSize,
    triggersBounds: u.any
  }, {
    name: "source-text-offset",
    type: l.size,
    triggersBounds: u.any
  }], f = [{
    name: "target-label",
    type: l.text,
    triggersBounds: u.any
  }, {
    name: "target-text-rotation",
    type: l.textRotation,
    triggersBounds: u.any
  }, {
    name: "target-text-margin-x",
    type: l.bidirectionalSize,
    triggersBounds: u.any
  }, {
    name: "target-text-margin-y",
    type: l.bidirectionalSize,
    triggersBounds: u.any
  }, {
    name: "target-text-offset",
    type: l.size,
    triggersBounds: u.any
  }], h = [{
    name: "font-family",
    type: l.fontFamily,
    triggersBounds: u.any
  }, {
    name: "font-style",
    type: l.fontStyle,
    triggersBounds: u.any
  }, {
    name: "font-weight",
    type: l.fontWeight,
    triggersBounds: u.any
  }, {
    name: "font-size",
    type: l.size,
    triggersBounds: u.any
  }, {
    name: "text-transform",
    type: l.textTransform,
    triggersBounds: u.any
  }, {
    name: "text-wrap",
    type: l.textWrap,
    triggersBounds: u.any
  }, {
    name: "text-overflow-wrap",
    type: l.textOverflowWrap,
    triggersBounds: u.any
  }, {
    name: "text-max-width",
    type: l.size,
    triggersBounds: u.any
  }, {
    name: "text-outline-width",
    type: l.size,
    triggersBounds: u.any
  }, {
    name: "line-height",
    type: l.positiveNumber,
    triggersBounds: u.any
  }], v = [{
    name: "text-valign",
    type: l.valign,
    triggersBounds: u.any
  }, {
    name: "text-halign",
    type: l.halign,
    triggersBounds: u.any
  }, {
    name: "color",
    type: l.color
  }, {
    name: "text-outline-color",
    type: l.color
  }, {
    name: "text-outline-opacity",
    type: l.zeroOneNumber
  }, {
    name: "text-background-color",
    type: l.color
  }, {
    name: "text-background-opacity",
    type: l.zeroOneNumber
  }, {
    name: "text-background-padding",
    type: l.size,
    triggersBounds: u.any
  }, {
    name: "text-border-opacity",
    type: l.zeroOneNumber
  }, {
    name: "text-border-color",
    type: l.color
  }, {
    name: "text-border-width",
    type: l.size,
    triggersBounds: u.any
  }, {
    name: "text-border-style",
    type: l.borderStyle,
    triggersBounds: u.any
  }, {
    name: "text-background-shape",
    type: l.textBackgroundShape,
    triggersBounds: u.any
  }, {
    name: "text-justification",
    type: l.justification
  }], p = [{
    name: "events",
    type: l.bool,
    triggersZOrder: u.any
  }, {
    name: "text-events",
    type: l.bool,
    triggersZOrder: u.any
  }], g = [{
    name: "display",
    type: l.display,
    triggersZOrder: u.any,
    triggersBounds: u.any,
    triggersBoundsOfConnectedEdges: !0
  }, {
    name: "visibility",
    type: l.visibility,
    triggersZOrder: u.any
  }, {
    name: "opacity",
    type: l.zeroOneNumber,
    triggersZOrder: u.zeroNonZero
  }, {
    name: "text-opacity",
    type: l.zeroOneNumber
  }, {
    name: "min-zoomed-font-size",
    type: l.size
  }, {
    name: "z-compound-depth",
    type: l.zCompoundDepth,
    triggersZOrder: u.any
  }, {
    name: "z-index-compare",
    type: l.zIndexCompare,
    triggersZOrder: u.any
  }, {
    name: "z-index",
    type: l.number,
    triggersZOrder: u.any
  }], y = [{
    name: "overlay-padding",
    type: l.size,
    triggersBounds: u.any
  }, {
    name: "overlay-color",
    type: l.color
  }, {
    name: "overlay-opacity",
    type: l.zeroOneNumber,
    triggersBounds: u.zeroNonZero
  }, {
    name: "overlay-shape",
    type: l.overlayShape,
    triggersBounds: u.any
  }, {
    name: "overlay-corner-radius",
    type: l.cornerRadius
  }], m = [{
    name: "underlay-padding",
    type: l.size,
    triggersBounds: u.any
  }, {
    name: "underlay-color",
    type: l.color
  }, {
    name: "underlay-opacity",
    type: l.zeroOneNumber,
    triggersBounds: u.zeroNonZero
  }, {
    name: "underlay-shape",
    type: l.overlayShape,
    triggersBounds: u.any
  }, {
    name: "underlay-corner-radius",
    type: l.cornerRadius
  }], b = [{
    name: "transition-property",
    type: l.propList
  }, {
    name: "transition-duration",
    type: l.time
  }, {
    name: "transition-delay",
    type: l.time
  }, {
    name: "transition-timing-function",
    type: l.easing
  }], w = function(N, X) {
    return X.value === "label" ? -N.poolIndex() : X.pfValue;
  }, x = [{
    name: "height",
    type: l.nodeSize,
    triggersBounds: u.any,
    hashOverride: w
  }, {
    name: "width",
    type: l.nodeSize,
    triggersBounds: u.any,
    hashOverride: w
  }, {
    name: "shape",
    type: l.nodeShape,
    triggersBounds: u.any
  }, {
    name: "shape-polygon-points",
    type: l.polygonPointList,
    triggersBounds: u.any
  }, {
    name: "corner-radius",
    type: l.cornerRadius
  }, {
    name: "background-color",
    type: l.color
  }, {
    name: "background-fill",
    type: l.fill
  }, {
    name: "background-opacity",
    type: l.zeroOneNumber
  }, {
    name: "background-blacken",
    type: l.nOneOneNumber
  }, {
    name: "background-gradient-stop-colors",
    type: l.colors
  }, {
    name: "background-gradient-stop-positions",
    type: l.percentages
  }, {
    name: "background-gradient-direction",
    type: l.gradientDirection
  }, {
    name: "padding",
    type: l.sizeMaybePercent,
    triggersBounds: u.any
  }, {
    name: "padding-relative-to",
    type: l.paddingRelativeTo,
    triggersBounds: u.any
  }, {
    name: "bounds-expansion",
    type: l.boundsExpansion,
    triggersBounds: u.any
  }], E = [{
    name: "border-color",
    type: l.color
  }, {
    name: "border-opacity",
    type: l.zeroOneNumber
  }, {
    name: "border-width",
    type: l.size,
    triggersBounds: u.any
  }, {
    name: "border-style",
    type: l.borderStyle
  }, {
    name: "border-cap",
    type: l.lineCap
  }, {
    name: "border-join",
    type: l.lineJoin
  }, {
    name: "border-dash-pattern",
    type: l.numbers
  }, {
    name: "border-dash-offset",
    type: l.number
  }, {
    name: "border-position",
    type: l.linePosition
  }], C = [{
    name: "outline-color",
    type: l.color
  }, {
    name: "outline-opacity",
    type: l.zeroOneNumber
  }, {
    name: "outline-width",
    type: l.size,
    triggersBounds: u.any
  }, {
    name: "outline-style",
    type: l.borderStyle
  }, {
    name: "outline-offset",
    type: l.size,
    triggersBounds: u.any
  }], k = [{
    name: "background-image",
    type: l.urls
  }, {
    name: "background-image-crossorigin",
    type: l.bgCrossOrigin
  }, {
    name: "background-image-opacity",
    type: l.zeroOneNumbers
  }, {
    name: "background-image-containment",
    type: l.bgContainment
  }, {
    name: "background-image-smoothing",
    type: l.bools
  }, {
    name: "background-position-x",
    type: l.bgPos
  }, {
    name: "background-position-y",
    type: l.bgPos
  }, {
    name: "background-width-relative-to",
    type: l.bgRelativeTo
  }, {
    name: "background-height-relative-to",
    type: l.bgRelativeTo
  }, {
    name: "background-repeat",
    type: l.bgRepeat
  }, {
    name: "background-fit",
    type: l.bgFit
  }, {
    name: "background-clip",
    type: l.bgClip
  }, {
    name: "background-width",
    type: l.bgWH
  }, {
    name: "background-height",
    type: l.bgWH
  }, {
    name: "background-offset-x",
    type: l.bgPos
  }, {
    name: "background-offset-y",
    type: l.bgPos
  }], S = [{
    name: "position",
    type: l.position,
    triggersBounds: u.any
  }, {
    name: "compound-sizing-wrt-labels",
    type: l.compoundIncludeLabels,
    triggersBounds: u.any
  }, {
    name: "min-width",
    type: l.size,
    triggersBounds: u.any
  }, {
    name: "min-width-bias-left",
    type: l.sizeMaybePercent,
    triggersBounds: u.any
  }, {
    name: "min-width-bias-right",
    type: l.sizeMaybePercent,
    triggersBounds: u.any
  }, {
    name: "min-height",
    type: l.size,
    triggersBounds: u.any
  }, {
    name: "min-height-bias-top",
    type: l.sizeMaybePercent,
    triggersBounds: u.any
  }, {
    name: "min-height-bias-bottom",
    type: l.sizeMaybePercent,
    triggersBounds: u.any
  }], _ = [{
    name: "line-style",
    type: l.lineStyle
  }, {
    name: "line-color",
    type: l.color
  }, {
    name: "line-fill",
    type: l.fill
  }, {
    name: "line-cap",
    type: l.lineCap
  }, {
    name: "line-opacity",
    type: l.zeroOneNumber
  }, {
    name: "line-dash-pattern",
    type: l.numbers
  }, {
    name: "line-dash-offset",
    type: l.number
  }, {
    name: "line-outline-width",
    type: l.size
  }, {
    name: "line-outline-color",
    type: l.color
  }, {
    name: "line-gradient-stop-colors",
    type: l.colors
  }, {
    name: "line-gradient-stop-positions",
    type: l.percentages
  }, {
    name: "curve-style",
    type: l.curveStyle,
    triggersBounds: u.any,
    triggersBoundsOfParallelBeziers: !0
  }, {
    name: "haystack-radius",
    type: l.zeroOneNumber,
    triggersBounds: u.any
  }, {
    name: "source-endpoint",
    type: l.edgeEndpoint,
    triggersBounds: u.any
  }, {
    name: "target-endpoint",
    type: l.edgeEndpoint,
    triggersBounds: u.any
  }, {
    name: "control-point-step-size",
    type: l.size,
    triggersBounds: u.any
  }, {
    name: "control-point-distances",
    type: l.bidirectionalSizes,
    triggersBounds: u.any
  }, {
    name: "control-point-weights",
    type: l.numbers,
    triggersBounds: u.any
  }, {
    name: "segment-distances",
    type: l.bidirectionalSizes,
    triggersBounds: u.any
  }, {
    name: "segment-weights",
    type: l.numbers,
    triggersBounds: u.any
  }, {
    name: "segment-radii",
    type: l.numbers,
    triggersBounds: u.any
  }, {
    name: "radius-type",
    type: l.radiusType,
    triggersBounds: u.any
  }, {
    name: "taxi-turn",
    type: l.bidirectionalSizeMaybePercent,
    triggersBounds: u.any
  }, {
    name: "taxi-turn-min-distance",
    type: l.size,
    triggersBounds: u.any
  }, {
    name: "taxi-direction",
    type: l.axisDirection,
    triggersBounds: u.any
  }, {
    name: "taxi-radius",
    type: l.number,
    triggersBounds: u.any
  }, {
    name: "edge-distances",
    type: l.edgeDistances,
    triggersBounds: u.any
  }, {
    name: "arrow-scale",
    type: l.positiveNumber,
    triggersBounds: u.any
  }, {
    name: "loop-direction",
    type: l.angle,
    triggersBounds: u.any
  }, {
    name: "loop-sweep",
    type: l.angle,
    triggersBounds: u.any
  }, {
    name: "source-distance-from-node",
    type: l.size,
    triggersBounds: u.any
  }, {
    name: "target-distance-from-node",
    type: l.size,
    triggersBounds: u.any
  }], T = [{
    name: "ghost",
    type: l.bool,
    triggersBounds: u.any
  }, {
    name: "ghost-offset-x",
    type: l.bidirectionalSize,
    triggersBounds: u.any
  }, {
    name: "ghost-offset-y",
    type: l.bidirectionalSize,
    triggersBounds: u.any
  }, {
    name: "ghost-opacity",
    type: l.zeroOneNumber
  }], O = [{
    name: "selection-box-color",
    type: l.color
  }, {
    name: "selection-box-opacity",
    type: l.zeroOneNumber
  }, {
    name: "selection-box-border-color",
    type: l.color
  }, {
    name: "selection-box-border-width",
    type: l.size
  }, {
    name: "active-bg-color",
    type: l.color
  }, {
    name: "active-bg-opacity",
    type: l.zeroOneNumber
  }, {
    name: "active-bg-size",
    type: l.size
  }, {
    name: "outside-texture-bg-color",
    type: l.color
  }, {
    name: "outside-texture-bg-opacity",
    type: l.zeroOneNumber
  }], D = [];
  Ht.pieBackgroundN = 16, D.push({
    name: "pie-size",
    type: l.sizeMaybePercent
  });
  for (var A = 1; A <= Ht.pieBackgroundN; A++)
    D.push({
      name: "pie-" + A + "-background-color",
      type: l.color
    }), D.push({
      name: "pie-" + A + "-background-size",
      type: l.percent
    }), D.push({
      name: "pie-" + A + "-background-opacity",
      type: l.zeroOneNumber
    });
  var F = [], R = Ht.arrowPrefixes = ["source", "mid-source", "target", "mid-target"];
  [{
    name: "arrow-shape",
    type: l.arrowShape,
    triggersBounds: u.any
  }, {
    name: "arrow-color",
    type: l.color
  }, {
    name: "arrow-fill",
    type: l.arrowFill
  }, {
    name: "arrow-width",
    type: l.arrowWidth
  }].forEach(function(Z) {
    R.forEach(function(N) {
      var X = N + "-" + Z.name, Q = Z.type, ge = Z.triggersBounds;
      F.push({
        name: X,
        type: Q,
        triggersBounds: ge
      });
    });
  }, {});
  var M = Ht.properties = [].concat(p, b, g, y, m, T, v, h, c, d, f, x, E, C, k, D, S, _, F, O), L = Ht.propertyGroups = {
    // common to all eles
    behavior: p,
    transition: b,
    visibility: g,
    overlay: y,
    underlay: m,
    ghost: T,
    // labels
    commonLabel: v,
    labelDimensions: h,
    mainLabel: c,
    sourceLabel: d,
    targetLabel: f,
    // node props
    nodeBody: x,
    nodeBorder: E,
    nodeOutline: C,
    backgroundImage: k,
    pie: D,
    compound: S,
    // edge props
    edgeLine: _,
    edgeArrow: F,
    core: O
  }, V = Ht.propertyGroupNames = {}, Y = Ht.propertyGroupKeys = Object.keys(L);
  Y.forEach(function(Z) {
    V[Z] = L[Z].map(function(N) {
      return N.name;
    }), L[Z].forEach(function(N) {
      return N.groupKey = Z;
    });
  });
  var H = Ht.aliases = [{
    name: "content",
    pointsTo: "label"
  }, {
    name: "control-point-distance",
    pointsTo: "control-point-distances"
  }, {
    name: "control-point-weight",
    pointsTo: "control-point-weights"
  }, {
    name: "segment-distance",
    pointsTo: "segment-distances"
  }, {
    name: "segment-weight",
    pointsTo: "segment-weights"
  }, {
    name: "segment-radius",
    pointsTo: "segment-radii"
  }, {
    name: "edge-text-rotation",
    pointsTo: "text-rotation"
  }, {
    name: "padding-left",
    pointsTo: "padding"
  }, {
    name: "padding-right",
    pointsTo: "padding"
  }, {
    name: "padding-top",
    pointsTo: "padding"
  }, {
    name: "padding-bottom",
    pointsTo: "padding"
  }];
  Ht.propertyNames = M.map(function(Z) {
    return Z.name;
  });
  for (var K = 0; K < M.length; K++) {
    var ne = M[K];
    M[ne.name] = ne;
  }
  for (var B = 0; B < H.length; B++) {
    var $ = H[B], z = M[$.pointsTo], W = {
      name: $.name,
      alias: !0,
      pointsTo: z
    };
    M.push(W), M[$.name] = W;
  }
})();
Ht.getDefaultProperty = function(t) {
  return this.getDefaultProperties()[t];
};
Ht.getDefaultProperties = function() {
  var t = this._private;
  if (t.defaultProperties != null)
    return t.defaultProperties;
  for (var e = ze({
    // core props
    "selection-box-color": "#ddd",
    "selection-box-opacity": 0.65,
    "selection-box-border-color": "#aaa",
    "selection-box-border-width": 1,
    "active-bg-color": "black",
    "active-bg-opacity": 0.15,
    "active-bg-size": 30,
    "outside-texture-bg-color": "#000",
    "outside-texture-bg-opacity": 0.125,
    // common node/edge props
    events: "yes",
    "text-events": "no",
    "text-valign": "top",
    "text-halign": "center",
    "text-justification": "auto",
    "line-height": 1,
    color: "#000",
    "text-outline-color": "#000",
    "text-outline-width": 0,
    "text-outline-opacity": 1,
    "text-opacity": 1,
    "text-decoration": "none",
    "text-transform": "none",
    "text-wrap": "none",
    "text-overflow-wrap": "whitespace",
    "text-max-width": 9999,
    "text-background-color": "#000",
    "text-background-opacity": 0,
    "text-background-shape": "rectangle",
    "text-background-padding": 0,
    "text-border-opacity": 0,
    "text-border-width": 0,
    "text-border-style": "solid",
    "text-border-color": "#000",
    "font-family": "Helvetica Neue, Helvetica, sans-serif",
    "font-style": "normal",
    "font-weight": "normal",
    "font-size": 16,
    "min-zoomed-font-size": 0,
    "text-rotation": "none",
    "source-text-rotation": "none",
    "target-text-rotation": "none",
    visibility: "visible",
    display: "element",
    opacity: 1,
    "z-compound-depth": "auto",
    "z-index-compare": "auto",
    "z-index": 0,
    label: "",
    "text-margin-x": 0,
    "text-margin-y": 0,
    "source-label": "",
    "source-text-offset": 0,
    "source-text-margin-x": 0,
    "source-text-margin-y": 0,
    "target-label": "",
    "target-text-offset": 0,
    "target-text-margin-x": 0,
    "target-text-margin-y": 0,
    "overlay-opacity": 0,
    "overlay-color": "#000",
    "overlay-padding": 10,
    "overlay-shape": "round-rectangle",
    "overlay-corner-radius": "auto",
    "underlay-opacity": 0,
    "underlay-color": "#000",
    "underlay-padding": 10,
    "underlay-shape": "round-rectangle",
    "underlay-corner-radius": "auto",
    "transition-property": "none",
    "transition-duration": 0,
    "transition-delay": 0,
    "transition-timing-function": "linear",
    // node props
    "background-blacken": 0,
    "background-color": "#999",
    "background-fill": "solid",
    "background-opacity": 1,
    "background-image": "none",
    "background-image-crossorigin": "anonymous",
    "background-image-opacity": 1,
    "background-image-containment": "inside",
    "background-image-smoothing": "yes",
    "background-position-x": "50%",
    "background-position-y": "50%",
    "background-offset-x": 0,
    "background-offset-y": 0,
    "background-width-relative-to": "include-padding",
    "background-height-relative-to": "include-padding",
    "background-repeat": "no-repeat",
    "background-fit": "none",
    "background-clip": "node",
    "background-width": "auto",
    "background-height": "auto",
    "border-color": "#000",
    "border-opacity": 1,
    "border-width": 0,
    "border-style": "solid",
    "border-dash-pattern": [4, 2],
    "border-dash-offset": 0,
    "border-cap": "butt",
    "border-join": "miter",
    "border-position": "center",
    "outline-color": "#999",
    "outline-opacity": 1,
    "outline-width": 0,
    "outline-offset": 0,
    "outline-style": "solid",
    height: 30,
    width: 30,
    shape: "ellipse",
    "shape-polygon-points": "-1, -1,   1, -1,   1, 1,   -1, 1",
    "corner-radius": "auto",
    "bounds-expansion": 0,
    // node gradient
    "background-gradient-direction": "to-bottom",
    "background-gradient-stop-colors": "#999",
    "background-gradient-stop-positions": "0%",
    // ghost props
    ghost: "no",
    "ghost-offset-y": 0,
    "ghost-offset-x": 0,
    "ghost-opacity": 0,
    // compound props
    padding: 0,
    "padding-relative-to": "width",
    position: "origin",
    "compound-sizing-wrt-labels": "include",
    "min-width": 0,
    "min-width-bias-left": 0,
    "min-width-bias-right": 0,
    "min-height": 0,
    "min-height-bias-top": 0,
    "min-height-bias-bottom": 0
  }, {
    // node pie bg
    "pie-size": "100%"
  }, [{
    name: "pie-{{i}}-background-color",
    value: "black"
  }, {
    name: "pie-{{i}}-background-size",
    value: "0%"
  }, {
    name: "pie-{{i}}-background-opacity",
    value: 1
  }].reduce(function(u, l) {
    for (var c = 1; c <= Ht.pieBackgroundN; c++) {
      var d = l.name.replace("{{i}}", c), f = l.value;
      u[d] = f;
    }
    return u;
  }, {}), {
    // edge props
    "line-style": "solid",
    "line-color": "#999",
    "line-fill": "solid",
    "line-cap": "butt",
    "line-opacity": 1,
    "line-outline-width": 0,
    "line-outline-color": "#000",
    "line-gradient-stop-colors": "#999",
    "line-gradient-stop-positions": "0%",
    "control-point-step-size": 40,
    "control-point-weights": 0.5,
    "segment-weights": 0.5,
    "segment-distances": 20,
    "segment-radii": 15,
    "radius-type": "arc-radius",
    "taxi-turn": "50%",
    "taxi-radius": 15,
    "taxi-turn-min-distance": 10,
    "taxi-direction": "auto",
    "edge-distances": "intersection",
    "curve-style": "haystack",
    "haystack-radius": 0,
    "arrow-scale": 1,
    "loop-direction": "-45deg",
    "loop-sweep": "-90deg",
    "source-distance-from-node": 0,
    "target-distance-from-node": 0,
    "source-endpoint": "outside-to-node",
    "target-endpoint": "outside-to-node",
    "line-dash-pattern": [6, 3],
    "line-dash-offset": 0
  }, [{
    name: "arrow-shape",
    value: "none"
  }, {
    name: "arrow-color",
    value: "#999"
  }, {
    name: "arrow-fill",
    value: "filled"
  }, {
    name: "arrow-width",
    value: 1
  }].reduce(function(u, l) {
    return Ht.arrowPrefixes.forEach(function(c) {
      var d = c + "-" + l.name, f = l.value;
      u[d] = f;
    }), u;
  }, {})), r = {}, n = 0; n < this.properties.length; n++) {
    var a = this.properties[n];
    if (!a.pointsTo) {
      var i = a.name, o = e[i], s = this.parse(i, o);
      r[i] = s;
    }
  }
  return t.defaultProperties = r, t.defaultProperties;
};
Ht.addDefaultStylesheet = function() {
  this.selector(":parent").css({
    shape: "rectangle",
    padding: 10,
    "background-color": "#eee",
    "border-color": "#ccc",
    "border-width": 1
  }).selector("edge").css({
    width: 3
  }).selector(":loop").css({
    "curve-style": "bezier"
  }).selector("edge:compound").css({
    "curve-style": "bezier",
    "source-endpoint": "outside-to-line",
    "target-endpoint": "outside-to-line"
  }).selector(":selected").css({
    "background-color": "#0169D9",
    "line-color": "#0169D9",
    "source-arrow-color": "#0169D9",
    "target-arrow-color": "#0169D9",
    "mid-source-arrow-color": "#0169D9",
    "mid-target-arrow-color": "#0169D9"
  }).selector(":parent:selected").css({
    "background-color": "#CCE1F9",
    "border-color": "#aec8e5"
  }).selector(":active").css({
    "overlay-color": "black",
    "overlay-padding": 10,
    "overlay-opacity": 0.25
  }), this.defaultLength = this.length;
};
var Wl = {};
Wl.parse = function(t, e, r, n) {
  var a = this;
  if (yt(e))
    return a.parseImplWarn(t, e, r, n);
  var i = n === "mapping" || n === !0 || n === !1 || n == null ? "dontcare" : n, o = r ? "t" : "f", s = "" + e, u = cS(t, s, o, i), l = a.propCache = a.propCache || [], c;
  return (c = l[u]) || (c = l[u] = a.parseImplWarn(t, e, r, n)), (r || n === "mapping") && (c = rn(c), c && (c.value = rn(c.value))), c;
};
Wl.parseImplWarn = function(t, e, r, n) {
  var a = this.parseImpl(t, e, r, n);
  return !a && e != null && tt("The style property `".concat(t, ": ").concat(e, "` is invalid")), a && (a.name === "width" || a.name === "height") && e === "label" && tt("The style value of `label` is deprecated for `" + a.name + "`"), a;
};
Wl.parseImpl = function(t, e, r, n) {
  var a = this;
  t = Ig(t);
  var i = a.properties[t], o = e, s = a.types;
  if (!i || e === void 0)
    return null;
  i.alias && (i = i.pointsTo, t = i.name);
  var u = Me(e);
  u && (e = e.trim());
  var l = i.type;
  if (!l)
    return null;
  if (r && (e === "" || e === null))
    return {
      name: t,
      value: e,
      bypass: !0,
      deleteBypass: !0
    };
  if (yt(e))
    return {
      name: t,
      value: e,
      strValue: "fn",
      mapped: s.fn,
      bypass: r
    };
  var c, d;
  if (!(!u || n || e.length < 7 || e[1] !== "a")) {
    if (e.length >= 7 && e[0] === "d" && (c = new RegExp(s.data.regex).exec(e))) {
      if (r)
        return !1;
      var f = s.data;
      return {
        name: t,
        value: c,
        strValue: "" + e,
        mapped: f,
        field: c[1],
        bypass: r
      };
    } else if (e.length >= 10 && e[0] === "m" && (d = new RegExp(s.mapData.regex).exec(e))) {
      if (r || l.multiple)
        return !1;
      var h = s.mapData;
      if (!(l.color || l.number))
        return !1;
      var v = this.parse(t, d[4]);
      if (!v || v.mapped)
        return !1;
      var p = this.parse(t, d[5]);
      if (!p || p.mapped)
        return !1;
      if (v.pfValue === p.pfValue || v.strValue === p.strValue)
        return tt("`" + t + ": " + e + "` is not a valid mapper because the output range is zero; converting to `" + t + ": " + v.strValue + "`"), this.parse(t, v.strValue);
      if (l.color) {
        var g = v.value, y = p.value, m = g[0] === y[0] && g[1] === y[1] && g[2] === y[2] && // optional alpha
        (g[3] === y[3] || (g[3] == null || g[3] === 1) && (y[3] == null || y[3] === 1));
        if (m)
          return !1;
      }
      return {
        name: t,
        value: d,
        strValue: "" + e,
        mapped: h,
        field: d[1],
        fieldMin: parseFloat(d[2]),
        // min & max are numeric
        fieldMax: parseFloat(d[3]),
        valueMin: v.value,
        valueMax: p.value,
        bypass: r
      };
    }
  }
  if (l.multiple && n !== "multiple") {
    var b;
    if (u ? b = e.split(/\s+/) : lt(e) ? b = e : b = [e], l.evenMultiple && b.length % 2 !== 0)
      return null;
    for (var w = [], x = [], E = [], C = "", k = !1, S = 0; S < b.length; S++) {
      var _ = a.parse(t, b[S], r, "multiple");
      k = k || Me(_.value), w.push(_.value), E.push(_.pfValue != null ? _.pfValue : _.value), x.push(_.units), C += (S > 0 ? " " : "") + _.strValue;
    }
    return l.validate && !l.validate(w, x) ? null : l.singleEnum && k ? w.length === 1 && Me(w[0]) ? {
      name: t,
      value: w[0],
      strValue: w[0],
      bypass: r
    } : null : {
      name: t,
      value: w,
      pfValue: E,
      strValue: C,
      bypass: r,
      units: x
    };
  }
  var T = function() {
    for (var N = 0; N < l.enums.length; N++) {
      var X = l.enums[N];
      if (X === e)
        return {
          name: t,
          value: e,
          strValue: "" + e,
          bypass: r
        };
    }
    return null;
  };
  if (l.number) {
    var O, D = "px";
    if (l.units && (O = l.units), l.implicitUnits && (D = l.implicitUnits), !l.unitless)
      if (u) {
        var A = "px|em" + (l.allowPercent ? "|\\%" : "");
        O && (A = O);
        var F = e.match("^(" + Mt + ")(" + A + ")?$");
        F && (e = F[1], O = F[2] || D);
      } else (!O || l.implicitUnits) && (O = D);
    if (e = parseFloat(e), isNaN(e) && l.enums === void 0)
      return null;
    if (isNaN(e) && l.enums !== void 0)
      return e = o, T();
    if (l.integer && !sB(e) || l.min !== void 0 && (e < l.min || l.strictMin && e === l.min) || l.max !== void 0 && (e > l.max || l.strictMax && e === l.max))
      return null;
    var R = {
      name: t,
      value: e,
      strValue: "" + e + (O || ""),
      units: O,
      bypass: r
    };
    return l.unitless || O !== "px" && O !== "em" ? R.pfValue = e : R.pfValue = O === "px" || !O ? e : this.getEmSizeInPixels() * e, (O === "ms" || O === "s") && (R.pfValue = O === "ms" ? e : 1e3 * e), (O === "deg" || O === "rad") && (R.pfValue = O === "rad" ? e : z$(e)), O === "%" && (R.pfValue = e / 100), R;
  } else if (l.propList) {
    var M = [], L = "" + e;
    if (L !== "none") {
      for (var V = L.split(/\s*,\s*|\s+/), Y = 0; Y < V.length; Y++) {
        var H = V[Y].trim();
        a.properties[H] ? M.push(H) : tt("`" + H + "` is not a valid property name");
      }
      if (M.length === 0)
        return null;
    }
    return {
      name: t,
      value: M,
      strValue: M.length === 0 ? "none" : M.join(" "),
      bypass: r
    };
  } else if (l.color) {
    var K = SB(e);
    return K ? {
      name: t,
      value: K,
      pfValue: K,
      strValue: "rgb(" + K[0] + "," + K[1] + "," + K[2] + ")",
      // n.b. no spaces b/c of multiple support
      bypass: r
    } : null;
  } else if (l.regex || l.regexes) {
    if (l.enums) {
      var ne = T();
      if (ne)
        return ne;
    }
    for (var B = l.regexes ? l.regexes : [l.regex], $ = 0; $ < B.length; $++) {
      var z = new RegExp(B[$]), W = z.exec(e);
      if (W)
        return {
          name: t,
          value: l.singleRegexMatchValue ? W[1] : W,
          strValue: "" + e,
          bypass: r
        };
    }
    return null;
  } else return l.string ? {
    name: t,
    value: "" + e,
    strValue: "" + e,
    bypass: r
  } : l.enums ? T() : null;
};
var ar = function t(e) {
  if (!(this instanceof t))
    return new t(e);
  if (!Tg(e)) {
    bt("A style must have a core reference");
    return;
  }
  this._private = {
    cy: e,
    coreStyle: {}
  }, this.length = 0, this.resetToDefault();
}, or = ar.prototype;
or.instanceString = function() {
  return "style";
};
or.clear = function() {
  for (var t = this._private, e = t.cy, r = e.elements(), n = 0; n < this.length; n++)
    this[n] = void 0;
  return this.length = 0, t.contextStyles = {}, t.propDiffs = {}, this.cleanElements(r, !0), r.forEach(function(a) {
    var i = a[0]._private;
    i.styleDirty = !0, i.appliedInitStyle = !1;
  }), this;
};
or.resetToDefault = function() {
  return this.clear(), this.addDefaultStylesheet(), this;
};
or.core = function(t) {
  return this._private.coreStyle[t] || this.getDefaultProperty(t);
};
or.selector = function(t) {
  var e = t === "core" ? null : new ra(t), r = this.length++;
  return this[r] = {
    selector: e,
    properties: [],
    mappedProperties: [],
    index: r
  }, this;
};
or.css = function() {
  var t = this, e = arguments;
  if (e.length === 1)
    for (var r = e[0], n = 0; n < t.properties.length; n++) {
      var a = t.properties[n], i = r[a.name];
      i === void 0 && (i = r[Rl(a.name)]), i !== void 0 && this.cssRule(a.name, i);
    }
  else e.length === 2 && this.cssRule(e[0], e[1]);
  return this;
};
or.style = or.css;
or.cssRule = function(t, e) {
  var r = this.parse(t, e);
  if (r) {
    var n = this.length - 1;
    this[n].properties.push(r), this[n].properties[r.name] = r, r.name.match(/pie-(\d+)-background-size/) && r.value && (this._private.hasPie = !0), r.mapped && this[n].mappedProperties.push(r);
    var a = !this[n].selector;
    a && (this._private.coreStyle[r.name] = r);
  }
  return this;
};
or.append = function(t) {
  return eS(t) ? t.appendToStyle(this) : lt(t) ? this.appendFromJson(t) : Me(t) && this.appendFromString(t), this;
};
ar.fromJson = function(t, e) {
  var r = new ar(t);
  return r.fromJson(e), r;
};
ar.fromString = function(t, e) {
  return new ar(t).fromString(e);
};
[sr, os, Vg, un, Ul, Hg, Ht, Wl].forEach(function(t) {
  ze(or, t);
});
ar.types = or.types;
ar.properties = or.properties;
ar.propertyGroups = or.propertyGroups;
ar.propertyGroupNames = or.propertyGroupNames;
ar.propertyGroupKeys = or.propertyGroupKeys;
var s8 = {
  style: function(e) {
    if (e) {
      var r = this.setStyle(e);
      r.update();
    }
    return this._private.style;
  },
  setStyle: function(e) {
    var r = this._private;
    return eS(e) ? r.style = e.generateStyle(this) : lt(e) ? r.style = ar.fromJson(this, e) : Me(e) ? r.style = ar.fromString(this, e) : r.style = ar(this), r.style;
  },
  // e.g. cy.data() changed => recalc ele mappers
  updateStyle: function() {
    this.mutableElements().updateStyle();
  }
}, l8 = "single", Fa = {
  autolock: function(e) {
    if (e !== void 0)
      this._private.autolock = !!e;
    else
      return this._private.autolock;
    return this;
  },
  autoungrabify: function(e) {
    if (e !== void 0)
      this._private.autoungrabify = !!e;
    else
      return this._private.autoungrabify;
    return this;
  },
  autounselectify: function(e) {
    if (e !== void 0)
      this._private.autounselectify = !!e;
    else
      return this._private.autounselectify;
    return this;
  },
  selectionType: function(e) {
    var r = this._private;
    if (r.selectionType == null && (r.selectionType = l8), e !== void 0)
      (e === "additive" || e === "single") && (r.selectionType = e);
    else
      return r.selectionType;
    return this;
  },
  panningEnabled: function(e) {
    if (e !== void 0)
      this._private.panningEnabled = !!e;
    else
      return this._private.panningEnabled;
    return this;
  },
  userPanningEnabled: function(e) {
    if (e !== void 0)
      this._private.userPanningEnabled = !!e;
    else
      return this._private.userPanningEnabled;
    return this;
  },
  zoomingEnabled: function(e) {
    if (e !== void 0)
      this._private.zoomingEnabled = !!e;
    else
      return this._private.zoomingEnabled;
    return this;
  },
  userZoomingEnabled: function(e) {
    if (e !== void 0)
      this._private.userZoomingEnabled = !!e;
    else
      return this._private.userZoomingEnabled;
    return this;
  },
  boxSelectionEnabled: function(e) {
    if (e !== void 0)
      this._private.boxSelectionEnabled = !!e;
    else
      return this._private.boxSelectionEnabled;
    return this;
  },
  pan: function() {
    var e = arguments, r = this._private.pan, n, a, i, o, s;
    switch (e.length) {
      case 0:
        return r;
      case 1:
        if (Me(e[0]))
          return n = e[0], r[n];
        if (Xe(e[0])) {
          if (!this._private.panningEnabled)
            return this;
          i = e[0], o = i.x, s = i.y, Ce(o) && (r.x = o), Ce(s) && (r.y = s), this.emit("pan viewport");
        }
        break;
      case 2:
        if (!this._private.panningEnabled)
          return this;
        n = e[0], a = e[1], (n === "x" || n === "y") && Ce(a) && (r[n] = a), this.emit("pan viewport");
        break;
    }
    return this.notify("viewport"), this;
  },
  panBy: function(e, r) {
    var n = arguments, a = this._private.pan, i, o, s, u, l;
    if (!this._private.panningEnabled)
      return this;
    switch (n.length) {
      case 1:
        Xe(e) && (s = n[0], u = s.x, l = s.y, Ce(u) && (a.x += u), Ce(l) && (a.y += l), this.emit("pan viewport"));
        break;
      case 2:
        i = e, o = r, (i === "x" || i === "y") && Ce(o) && (a[i] += o), this.emit("pan viewport");
        break;
    }
    return this.notify("viewport"), this;
  },
  fit: function(e, r) {
    var n = this.getFitViewport(e, r);
    if (n) {
      var a = this._private;
      a.zoom = n.zoom, a.pan = n.pan, this.emit("pan zoom viewport"), this.notify("viewport");
    }
    return this;
  },
  getFitViewport: function(e, r) {
    if (Ce(e) && r === void 0 && (r = e, e = void 0), !(!this._private.panningEnabled || !this._private.zoomingEnabled)) {
      var n;
      if (Me(e)) {
        var a = e;
        e = this.$(a);
      } else if (cB(e)) {
        var i = e;
        n = {
          x1: i.x1,
          y1: i.y1,
          x2: i.x2,
          y2: i.y2
        }, n.w = n.x2 - n.x1, n.h = n.y2 - n.y1;
      } else xr(e) || (e = this.mutableElements());
      if (!(xr(e) && e.empty())) {
        n = n || e.boundingBox();
        var o = this.width(), s = this.height(), u;
        if (r = Ce(r) ? r : 0, !isNaN(o) && !isNaN(s) && o > 0 && s > 0 && !isNaN(n.w) && !isNaN(n.h) && n.w > 0 && n.h > 0) {
          u = Math.min((o - 2 * r) / n.w, (s - 2 * r) / n.h), u = u > this._private.maxZoom ? this._private.maxZoom : u, u = u < this._private.minZoom ? this._private.minZoom : u;
          var l = {
            // now pan to middle
            x: (o - u * (n.x1 + n.x2)) / 2,
            y: (s - u * (n.y1 + n.y2)) / 2
          };
          return {
            zoom: u,
            pan: l
          };
        }
      }
    }
  },
  zoomRange: function(e, r) {
    var n = this._private;
    if (r == null) {
      var a = e;
      e = a.min, r = a.max;
    }
    return Ce(e) && Ce(r) && e <= r ? (n.minZoom = e, n.maxZoom = r) : Ce(e) && r === void 0 && e <= n.maxZoom ? n.minZoom = e : Ce(r) && e === void 0 && r >= n.minZoom && (n.maxZoom = r), this;
  },
  minZoom: function(e) {
    return e === void 0 ? this._private.minZoom : this.zoomRange({
      min: e
    });
  },
  maxZoom: function(e) {
    return e === void 0 ? this._private.maxZoom : this.zoomRange({
      max: e
    });
  },
  getZoomedViewport: function(e) {
    var r = this._private, n = r.pan, a = r.zoom, i, o, s = !1;
    if (r.zoomingEnabled || (s = !0), Ce(e) ? o = e : Xe(e) && (o = e.level, e.position != null ? i = Nl(e.position, a, n) : e.renderedPosition != null && (i = e.renderedPosition), i != null && !r.panningEnabled && (s = !0)), o = o > r.maxZoom ? r.maxZoom : o, o = o < r.minZoom ? r.minZoom : o, s || !Ce(o) || o === a || i != null && (!Ce(i.x) || !Ce(i.y)))
      return null;
    if (i != null) {
      var u = n, l = a, c = o, d = {
        x: -c / l * (i.x - u.x) + i.x,
        y: -c / l * (i.y - u.y) + i.y
      };
      return {
        zoomed: !0,
        panned: !0,
        zoom: c,
        pan: d
      };
    } else
      return {
        zoomed: !0,
        panned: !1,
        zoom: o,
        pan: n
      };
  },
  zoom: function(e) {
    if (e === void 0)
      return this._private.zoom;
    var r = this.getZoomedViewport(e), n = this._private;
    return r == null || !r.zoomed ? this : (n.zoom = r.zoom, r.panned && (n.pan.x = r.pan.x, n.pan.y = r.pan.y), this.emit("zoom" + (r.panned ? " pan" : "") + " viewport"), this.notify("viewport"), this);
  },
  viewport: function(e) {
    var r = this._private, n = !0, a = !0, i = [], o = !1, s = !1;
    if (!e)
      return this;
    if (Ce(e.zoom) || (n = !1), Xe(e.pan) || (a = !1), !n && !a)
      return this;
    if (n) {
      var u = e.zoom;
      u < r.minZoom || u > r.maxZoom || !r.zoomingEnabled ? o = !0 : (r.zoom = u, i.push("zoom"));
    }
    if (a && (!o || !e.cancelOnFailedZoom) && r.panningEnabled) {
      var l = e.pan;
      Ce(l.x) && (r.pan.x = l.x, s = !1), Ce(l.y) && (r.pan.y = l.y, s = !1), s || i.push("pan");
    }
    return i.length > 0 && (i.push("viewport"), this.emit(i.join(" ")), this.notify("viewport")), this;
  },
  center: function(e) {
    var r = this.getCenterPan(e);
    return r && (this._private.pan = r, this.emit("pan viewport"), this.notify("viewport")), this;
  },
  getCenterPan: function(e, r) {
    if (this._private.panningEnabled) {
      if (Me(e)) {
        var n = e;
        e = this.mutableElements().filter(n);
      } else xr(e) || (e = this.mutableElements());
      if (e.length !== 0) {
        var a = e.boundingBox(), i = this.width(), o = this.height();
        r = r === void 0 ? this._private.zoom : r;
        var s = {
          // middle
          x: (i - r * (a.x1 + a.x2)) / 2,
          y: (o - r * (a.y1 + a.y2)) / 2
        };
        return s;
      }
    }
  },
  reset: function() {
    return !this._private.panningEnabled || !this._private.zoomingEnabled ? this : (this.viewport({
      pan: {
        x: 0,
        y: 0
      },
      zoom: 1
    }), this);
  },
  invalidateSize: function() {
    this._private.sizeCache = null;
  },
  size: function() {
    var e = this._private, r = e.container, n = this;
    return e.sizeCache = e.sizeCache || (r ? function() {
      var a = n.window().getComputedStyle(r), i = function(s) {
        return parseFloat(a.getPropertyValue(s));
      };
      return {
        width: r.clientWidth - i("padding-left") - i("padding-right"),
        height: r.clientHeight - i("padding-top") - i("padding-bottom")
      };
    }() : {
      // fallback if no container (not 0 b/c can be used for dividing etc)
      width: 1,
      height: 1
    });
  },
  width: function() {
    return this.size().width;
  },
  height: function() {
    return this.size().height;
  },
  extent: function() {
    var e = this._private.pan, r = this._private.zoom, n = this.renderedExtent(), a = {
      x1: (n.x1 - e.x) / r,
      x2: (n.x2 - e.x) / r,
      y1: (n.y1 - e.y) / r,
      y2: (n.y2 - e.y) / r
    };
    return a.w = a.x2 - a.x1, a.h = a.y2 - a.y1, a;
  },
  renderedExtent: function() {
    var e = this.width(), r = this.height();
    return {
      x1: 0,
      y1: 0,
      x2: e,
      y2: r,
      w: e,
      h: r
    };
  },
  multiClickDebounceTime: function(e) {
    if (e) this._private.multiClickDebounceTime = e;
    else return this._private.multiClickDebounceTime;
    return this;
  }
};
Fa.centre = Fa.center;
Fa.autolockNodes = Fa.autolock;
Fa.autoungrabifyNodes = Fa.autoungrabify;
var qo = {
  data: et.data({
    field: "data",
    bindingEvent: "data",
    allowBinding: !0,
    allowSetting: !0,
    settingEvent: "data",
    settingTriggersEvent: !0,
    triggerFnName: "trigger",
    allowGetting: !0,
    updateStyle: !0
  }),
  removeData: et.removeData({
    field: "data",
    event: "data",
    triggerFnName: "trigger",
    triggerEvent: !0,
    updateStyle: !0
  }),
  scratch: et.data({
    field: "scratch",
    bindingEvent: "scratch",
    allowBinding: !0,
    allowSetting: !0,
    settingEvent: "scratch",
    settingTriggersEvent: !0,
    triggerFnName: "trigger",
    allowGetting: !0,
    updateStyle: !0
  }),
  removeScratch: et.removeData({
    field: "scratch",
    event: "scratch",
    triggerFnName: "trigger",
    triggerEvent: !0,
    updateStyle: !0
  })
};
qo.attr = qo.data;
qo.removeAttr = qo.removeData;
var zo = function(e) {
  var r = this;
  e = ze({}, e);
  var n = e.container;
  n && !sl(n) && sl(n[0]) && (n = n[0]);
  var a = n ? n._cyreg : null;
  a = a || {}, a && a.cy && (a.cy.destroy(), a = {});
  var i = a.readies = a.readies || [];
  n && (n._cyreg = a), a.cy = r;
  var o = Dt !== void 0 && n !== void 0 && !e.headless, s = e;
  s.layout = ze({
    name: o ? "grid" : "null"
  }, s.layout), s.renderer = ze({
    name: o ? "canvas" : "null"
  }, s.renderer);
  var u = function(v, p, g) {
    return p !== void 0 ? p : g !== void 0 ? g : v;
  }, l = this._private = {
    container: n,
    // html dom ele container
    ready: !1,
    // whether ready has been triggered
    options: s,
    // cached options
    elements: new Yt(this),
    // elements in the graph
    listeners: [],
    // list of listeners
    aniEles: new Yt(this),
    // elements being animated
    data: s.data || {},
    // data for the core
    scratch: {},
    // scratch object for core
    layout: null,
    renderer: null,
    destroyed: !1,
    // whether destroy was called
    notificationsEnabled: !0,
    // whether notifications are sent to the renderer
    minZoom: 1e-50,
    maxZoom: 1e50,
    zoomingEnabled: u(!0, s.zoomingEnabled),
    userZoomingEnabled: u(!0, s.userZoomingEnabled),
    panningEnabled: u(!0, s.panningEnabled),
    userPanningEnabled: u(!0, s.userPanningEnabled),
    boxSelectionEnabled: u(!0, s.boxSelectionEnabled),
    autolock: u(!1, s.autolock, s.autolockNodes),
    autoungrabify: u(!1, s.autoungrabify, s.autoungrabifyNodes),
    autounselectify: u(!1, s.autounselectify),
    styleEnabled: s.styleEnabled === void 0 ? o : s.styleEnabled,
    zoom: Ce(s.zoom) ? s.zoom : 1,
    pan: {
      x: Xe(s.pan) && Ce(s.pan.x) ? s.pan.x : 0,
      y: Xe(s.pan) && Ce(s.pan.y) ? s.pan.y : 0
    },
    animation: {
      // object for currently-running animations
      current: [],
      queue: []
    },
    hasCompoundNodes: !1,
    multiClickDebounceTime: u(250, s.multiClickDebounceTime)
  };
  this.createEmitter(), this.selectionType(s.selectionType), this.zoomRange({
    min: s.minZoom,
    max: s.maxZoom
  });
  var c = function(v, p) {
    var g = v.some(dB);
    if (g)
      return Mi.all(v).then(p);
    p(v);
  };
  l.styleEnabled && r.setStyle([]);
  var d = ze({}, s, s.renderer);
  r.initRenderer(d);
  var f = function(v, p, g) {
    r.notifications(!1);
    var y = r.mutableElements();
    y.length > 0 && y.remove(), v != null && (Xe(v) || lt(v)) && r.add(v), r.one("layoutready", function(b) {
      r.notifications(!0), r.emit(b), r.one("load", p), r.emitAndNotify("load");
    }).one("layoutstop", function() {
      r.one("done", g), r.emit("done");
    });
    var m = ze({}, r._private.options.layout);
    m.eles = r.elements(), r.layout(m).run();
  };
  c([s.style, s.elements], function(h) {
    var v = h[0], p = h[1];
    l.styleEnabled && r.style().append(v), f(p, function() {
      r.startAnimationLoop(), l.ready = !0, yt(s.ready) && r.on("ready", s.ready);
      for (var g = 0; g < i.length; g++) {
        var y = i[g];
        r.on("ready", y);
      }
      a && (a.readies = []), r.emit("ready");
    }, s.done);
  });
}, hl = zo.prototype;
ze(hl, {
  instanceString: function() {
    return "core";
  },
  isReady: function() {
    return this._private.ready;
  },
  destroyed: function() {
    return this._private.destroyed;
  },
  ready: function(e) {
    return this.isReady() ? this.emitter().emit("ready", [], e) : this.on("ready", e), this;
  },
  destroy: function() {
    var e = this;
    if (!e.destroyed())
      return e.stopAnimationLoop(), e.destroyRenderer(), this.emit("destroy"), e._private.destroyed = !0, e;
  },
  hasElementWithId: function(e) {
    return this._private.elements.hasElementWithId(e);
  },
  getElementById: function(e) {
    return this._private.elements.getElementById(e);
  },
  hasCompoundNodes: function() {
    return this._private.hasCompoundNodes;
  },
  headless: function() {
    return this._private.renderer.isHeadless();
  },
  styleEnabled: function() {
    return this._private.styleEnabled;
  },
  addToPool: function(e) {
    return this._private.elements.merge(e), this;
  },
  removeFromPool: function(e) {
    return this._private.elements.unmerge(e), this;
  },
  container: function() {
    return this._private.container || null;
  },
  window: function() {
    var e = this._private.container;
    if (e == null) return Dt;
    var r = this._private.container.ownerDocument;
    return r === void 0 || r == null ? Dt : r.defaultView || Dt;
  },
  mount: function(e) {
    if (e != null) {
      var r = this, n = r._private, a = n.options;
      return !sl(e) && sl(e[0]) && (e = e[0]), r.stopAnimationLoop(), r.destroyRenderer(), n.container = e, n.styleEnabled = !0, r.invalidateSize(), r.initRenderer(ze({}, a, a.renderer, {
        // allow custom renderer name to be re-used, otherwise use canvas
        name: a.renderer.name === "null" ? "canvas" : a.renderer.name
      })), r.startAnimationLoop(), r.style(a.style), r.emit("mount"), r;
    }
  },
  unmount: function() {
    var e = this;
    return e.stopAnimationLoop(), e.destroyRenderer(), e.initRenderer({
      name: "null"
    }), e.emit("unmount"), e;
  },
  options: function() {
    return rn(this._private.options);
  },
  json: function(e) {
    var r = this, n = r._private, a = r.mutableElements(), i = function(w) {
      return r.getElementById(w.id());
    };
    if (Xe(e)) {
      if (r.startBatch(), e.elements) {
        var o = {}, s = function(w, x) {
          for (var E = [], C = [], k = 0; k < w.length; k++) {
            var S = w[k];
            if (!S.data.id) {
              tt("cy.json() cannot handle elements without an ID attribute");
              continue;
            }
            var _ = "" + S.data.id, T = r.getElementById(_);
            o[_] = !0, T.length !== 0 ? C.push({
              ele: T,
              json: S
            }) : (x && (S.group = x), E.push(S));
          }
          r.add(E);
          for (var O = 0; O < C.length; O++) {
            var D = C[O], A = D.ele, F = D.json;
            A.json(F);
          }
        };
        if (lt(e.elements))
          s(e.elements);
        else
          for (var u = ["nodes", "edges"], l = 0; l < u.length; l++) {
            var c = u[l], d = e.elements[c];
            lt(d) && s(d, c);
          }
        var f = r.collection();
        a.filter(function(b) {
          return !o[b.id()];
        }).forEach(function(b) {
          b.isParent() ? f.merge(b) : b.remove();
        }), f.forEach(function(b) {
          return b.children().move({
            parent: null
          });
        }), f.forEach(function(b) {
          return i(b).remove();
        });
      }
      e.style && r.style(e.style), e.zoom != null && e.zoom !== n.zoom && r.zoom(e.zoom), e.pan && (e.pan.x !== n.pan.x || e.pan.y !== n.pan.y) && r.pan(e.pan), e.data && r.data(e.data);
      for (var h = ["minZoom", "maxZoom", "zoomingEnabled", "userZoomingEnabled", "panningEnabled", "userPanningEnabled", "boxSelectionEnabled", "autolock", "autoungrabify", "autounselectify", "multiClickDebounceTime"], v = 0; v < h.length; v++) {
        var p = h[v];
        e[p] != null && r[p](e[p]);
      }
      return r.endBatch(), this;
    } else {
      var g = !!e, y = {};
      g ? y.elements = this.elements().map(function(b) {
        return b.json();
      }) : (y.elements = {}, a.forEach(function(b) {
        var w = b.group();
        y.elements[w] || (y.elements[w] = []), y.elements[w].push(b.json());
      })), this._private.styleEnabled && (y.style = r.style().json()), y.data = rn(r.data());
      var m = n.options;
      return y.zoomingEnabled = n.zoomingEnabled, y.userZoomingEnabled = n.userZoomingEnabled, y.zoom = n.zoom, y.minZoom = n.minZoom, y.maxZoom = n.maxZoom, y.panningEnabled = n.panningEnabled, y.userPanningEnabled = n.userPanningEnabled, y.pan = rn(n.pan), y.boxSelectionEnabled = n.boxSelectionEnabled, y.renderer = rn(m.renderer), y.hideEdgesOnViewport = m.hideEdgesOnViewport, y.textureOnViewport = m.textureOnViewport, y.wheelSensitivity = m.wheelSensitivity, y.motionBlur = m.motionBlur, y.multiClickDebounceTime = m.multiClickDebounceTime, y;
    }
  }
});
hl.$id = hl.getElementById;
[Xz, r8, tk, Pp, Ws, a8, Dp, js, s8, Fa, qo].forEach(function(t) {
  ze(hl, t);
});
var u8 = {
  fit: !0,
  // whether to fit the viewport to the graph
  directed: !1,
  // whether the tree is directed downwards (or edges can point in any direction if false)
  padding: 30,
  // padding on fit
  circle: !1,
  // put depths in concentric circles if true, put depths top down if false
  grid: !1,
  // whether to create an even grid into which the DAG is placed (circle:false only)
  spacingFactor: 1.75,
  // positive spacing factor, larger => more space between nodes (N.B. n/a if causes overlap)
  boundingBox: void 0,
  // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }
  avoidOverlap: !0,
  // prevents node overlap, may overflow boundingBox if not enough space
  nodeDimensionsIncludeLabels: !1,
  // Excludes the label when calculating node bounding boxes for the layout algorithm
  roots: void 0,
  // the roots of the trees
  depthSort: void 0,
  // a sorting function to order nodes at equal depth. e.g. function(a, b){ return a.data('weight') - b.data('weight') }
  animate: !1,
  // whether to transition the node positions
  animationDuration: 500,
  // duration of animation in ms if enabled
  animationEasing: void 0,
  // easing of animation if enabled,
  animateFilter: function(e, r) {
    return !0;
  },
  // a function that determines whether the node should be animated.  All nodes animated by default on animate enabled.  Non-animated nodes are positioned immediately when the layout starts
  ready: void 0,
  // callback on layoutready
  stop: void 0,
  // callback on layoutstop
  transform: function(e, r) {
    return r;
  }
  // transform a given node position. Useful for changing flow direction in discrete layouts
}, c8 = {
  maximal: !1,
  // whether to shift nodes down their natural BFS depths in order to avoid upwards edges (DAGS only); setting acyclic to true sets maximal to true also
  acyclic: !1
  // whether the tree is acyclic and thus a node could be shifted (due to the maximal option) multiple times without causing an infinite loop; setting to true sets maximal to true also; if you are uncertain whether a tree is acyclic, set to false to avoid potential infinite loops
}, ni = function(e) {
  return e.scratch("breadthfirst");
}, R0 = function(e, r) {
  return e.scratch("breadthfirst", r);
};
function rk(t) {
  this.options = ze({}, u8, c8, t);
}
rk.prototype.run = function() {
  var t = this.options, e = t, r = t.cy, n = e.eles, a = n.nodes().filter(function(fe) {
    return !fe.isParent();
  }), i = n, o = e.directed, s = e.acyclic || e.maximal || e.maximalAdjustments > 0, u = br(e.boundingBox ? e.boundingBox : {
    x1: 0,
    y1: 0,
    w: r.width(),
    h: r.height()
  }), l;
  if (xr(e.roots))
    l = e.roots;
  else if (lt(e.roots)) {
    for (var c = [], d = 0; d < e.roots.length; d++) {
      var f = e.roots[d], h = r.getElementById(f);
      c.push(h);
    }
    l = r.collection(c);
  } else if (Me(e.roots))
    l = r.$(e.roots);
  else if (o)
    l = a.roots();
  else {
    var v = n.components();
    l = r.collection();
    for (var p = function(ce) {
      var be = v[ce], ve = be.maxDegree(!1), xe = be.filter(function(_e) {
        return _e.degree(!1) === ve;
      });
      l = l.add(xe);
    }, g = 0; g < v.length; g++)
      p(g);
  }
  var y = [], m = {}, b = function(ce, be) {
    y[be] == null && (y[be] = []);
    var ve = y[be].length;
    y[be].push(ce), R0(ce, {
      index: ve,
      depth: be
    });
  }, w = function(ce, be) {
    var ve = ni(ce), xe = ve.depth, _e = ve.index;
    y[xe][_e] = null, b(ce, be);
  };
  i.bfs({
    roots: l,
    directed: e.directed,
    visit: function(ce, be, ve, xe, _e) {
      var He = ce[0], Ve = He.id();
      b(He, _e), m[Ve] = !0;
    }
  });
  for (var x = [], E = 0; E < a.length; E++) {
    var C = a[E];
    m[C.id()] || x.push(C);
  }
  var k = function(ce) {
    for (var be = y[ce], ve = 0; ve < be.length; ve++) {
      var xe = be[ve];
      if (xe == null) {
        be.splice(ve, 1), ve--;
        continue;
      }
      R0(xe, {
        depth: ce,
        index: ve
      });
    }
  }, S = function() {
    for (var ce = 0; ce < y.length; ce++)
      k(ce);
  }, _ = function(ce, be) {
    for (var ve = ni(ce), xe = ce.incomers().filter(function(I) {
      return I.isNode() && n.has(I);
    }), _e = -1, He = ce.id(), Ve = 0; Ve < xe.length; Ve++) {
      var De = xe[Ve], Ne = ni(De);
      _e = Math.max(_e, Ne.depth);
    }
    if (ve.depth <= _e) {
      if (!e.acyclic && be[He])
        return null;
      var ue = _e + 1;
      return w(ce, ue), be[He] = ue, !0;
    }
    return !1;
  };
  if (o && s) {
    var T = [], O = {}, D = function(ce) {
      return T.push(ce);
    }, A = function() {
      return T.shift();
    };
    for (a.forEach(function(fe) {
      return T.push(fe);
    }); T.length > 0; ) {
      var F = A(), R = _(F, O);
      if (R)
        F.outgoers().filter(function(fe) {
          return fe.isNode() && n.has(fe);
        }).forEach(D);
      else if (R === null) {
        tt("Detected double maximal shift for node `" + F.id() + "`.  Bailing maximal adjustment due to cycle.  Use `options.maximal: true` only on DAGs.");
        break;
      }
    }
  }
  S();
  var M = 0;
  if (e.avoidOverlap)
    for (var L = 0; L < a.length; L++) {
      var V = a[L], Y = V.layoutDimensions(e), H = Y.w, K = Y.h;
      M = Math.max(M, H, K);
    }
  var ne = {}, B = function(ce) {
    if (ne[ce.id()])
      return ne[ce.id()];
    for (var be = ni(ce).depth, ve = ce.neighborhood(), xe = 0, _e = 0, He = 0; He < ve.length; He++) {
      var Ve = ve[He];
      if (!(Ve.isEdge() || Ve.isParent() || !a.has(Ve))) {
        var De = ni(Ve);
        if (De != null) {
          var Ne = De.index, ue = De.depth;
          if (!(Ne == null || ue == null)) {
            var I = y[ue].length;
            ue < be && (xe += Ne / I, _e++);
          }
        }
      }
    }
    return _e = Math.max(1, _e), xe = xe / _e, _e === 0 && (xe = 0), ne[ce.id()] = xe, xe;
  }, $ = function(ce, be) {
    var ve = B(ce), xe = B(be), _e = ve - xe;
    return _e === 0 ? rS(ce.id(), be.id()) : _e;
  };
  e.depthSort !== void 0 && ($ = e.depthSort);
  for (var z = 0; z < y.length; z++)
    y[z].sort($), k(z);
  for (var W = [], Z = 0; Z < x.length; Z++)
    W.push(x[Z]);
  y.unshift(W), S();
  for (var N = 0, X = 0; X < y.length; X++)
    N = Math.max(y[X].length, N);
  var Q = {
    x: u.x1 + u.w / 2,
    y: u.x1 + u.h / 2
  }, ge = y.reduce(function(fe, ce) {
    return Math.max(fe, ce.length);
  }, 0), we = function(ce) {
    var be = ni(ce), ve = be.depth, xe = be.index, _e = y[ve].length, He = Math.max(u.w / ((e.grid ? ge : _e) + 1), M), Ve = Math.max(u.h / (y.length + 1), M), De = Math.min(u.w / 2 / y.length, u.h / 2 / y.length);
    if (De = Math.max(De, M), e.circle) {
      var ue = De * ve + De - (y.length > 0 && y[0].length <= 3 ? De / 2 : 0), I = 2 * Math.PI / y[ve].length * xe;
      return ve === 0 && y[0].length === 1 && (ue = 1), {
        x: Q.x + ue * Math.cos(I),
        y: Q.y + ue * Math.sin(I)
      };
    } else {
      var Ne = {
        x: Q.x + (xe + 1 - (_e + 1) / 2) * He,
        y: (ve + 1) * Ve
      };
      return Ne;
    }
  };
  return n.nodes().layoutPositions(this, e, we), this;
};
var d8 = {
  fit: !0,
  // whether to fit the viewport to the graph
  padding: 30,
  // the padding on fit
  boundingBox: void 0,
  // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }
  avoidOverlap: !0,
  // prevents node overlap, may overflow boundingBox and radius if not enough space
  nodeDimensionsIncludeLabels: !1,
  // Excludes the label when calculating node bounding boxes for the layout algorithm
  spacingFactor: void 0,
  // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up
  radius: void 0,
  // the radius of the circle
  startAngle: 3 / 2 * Math.PI,
  // where nodes start in radians
  sweep: void 0,
  // how many radians should be between the first and last node (defaults to full circle)
  clockwise: !0,
  // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false)
  sort: void 0,
  // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') }
  animate: !1,
  // whether to transition the node positions
  animationDuration: 500,
  // duration of animation in ms if enabled
  animationEasing: void 0,
  // easing of animation if enabled
  animateFilter: function(e, r) {
    return !0;
  },
  // a function that determines whether the node should be animated.  All nodes animated by default on animate enabled.  Non-animated nodes are positioned immediately when the layout starts
  ready: void 0,
  // callback on layoutready
  stop: void 0,
  // callback on layoutstop
  transform: function(e, r) {
    return r;
  }
  // transform a given node position. Useful for changing flow direction in discrete layouts 
};
function nk(t) {
  this.options = ze({}, d8, t);
}
nk.prototype.run = function() {
  var t = this.options, e = t, r = t.cy, n = e.eles, a = e.counterclockwise !== void 0 ? !e.counterclockwise : e.clockwise, i = n.nodes().not(":parent");
  e.sort && (i = i.sort(e.sort));
  for (var o = br(e.boundingBox ? e.boundingBox : {
    x1: 0,
    y1: 0,
    w: r.width(),
    h: r.height()
  }), s = {
    x: o.x1 + o.w / 2,
    y: o.y1 + o.h / 2
  }, u = e.sweep === void 0 ? 2 * Math.PI - 2 * Math.PI / i.length : e.sweep, l = u / Math.max(1, i.length - 1), c, d = 0, f = 0; f < i.length; f++) {
    var h = i[f], v = h.layoutDimensions(e), p = v.w, g = v.h;
    d = Math.max(d, p, g);
  }
  if (Ce(e.radius) ? c = e.radius : i.length <= 1 ? c = 0 : c = Math.min(o.h, o.w) / 2 - d, i.length > 1 && e.avoidOverlap) {
    d *= 1.75;
    var y = Math.cos(l) - Math.cos(0), m = Math.sin(l) - Math.sin(0), b = Math.sqrt(d * d / (y * y + m * m));
    c = Math.max(b, c);
  }
  var w = function(E, C) {
    var k = e.startAngle + C * l * (a ? 1 : -1), S = c * Math.cos(k), _ = c * Math.sin(k), T = {
      x: s.x + S,
      y: s.y + _
    };
    return T;
  };
  return n.nodes().layoutPositions(this, e, w), this;
};
var f8 = {
  fit: !0,
  // whether to fit the viewport to the graph
  padding: 30,
  // the padding on fit
  startAngle: 3 / 2 * Math.PI,
  // where nodes start in radians
  sweep: void 0,
  // how many radians should be between the first and last node (defaults to full circle)
  clockwise: !0,
  // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false)
  equidistant: !1,
  // whether levels have an equal radial distance betwen them, may cause bounding box overflow
  minNodeSpacing: 10,
  // min spacing between outside of nodes (used for radius adjustment)
  boundingBox: void 0,
  // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }
  avoidOverlap: !0,
  // prevents node overlap, may overflow boundingBox if not enough space
  nodeDimensionsIncludeLabels: !1,
  // Excludes the label when calculating node bounding boxes for the layout algorithm
  height: void 0,
  // height of layout area (overrides container height)
  width: void 0,
  // width of layout area (overrides container width)
  spacingFactor: void 0,
  // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up
  concentric: function(e) {
    return e.degree();
  },
  levelWidth: function(e) {
    return e.maxDegree() / 4;
  },
  animate: !1,
  // whether to transition the node positions
  animationDuration: 500,
  // duration of animation in ms if enabled
  animationEasing: void 0,
  // easing of animation if enabled
  animateFilter: function(e, r) {
    return !0;
  },
  // a function that determines whether the node should be animated.  All nodes animated by default on animate enabled.  Non-animated nodes are positioned immediately when the layout starts
  ready: void 0,
  // callback on layoutready
  stop: void 0,
  // callback on layoutstop
  transform: function(e, r) {
    return r;
  }
  // transform a given node position. Useful for changing flow direction in discrete layouts
};
function ak(t) {
  this.options = ze({}, f8, t);
}
ak.prototype.run = function() {
  for (var t = this.options, e = t, r = e.counterclockwise !== void 0 ? !e.counterclockwise : e.clockwise, n = t.cy, a = e.eles, i = a.nodes().not(":parent"), o = br(e.boundingBox ? e.boundingBox : {
    x1: 0,
    y1: 0,
    w: n.width(),
    h: n.height()
  }), s = {
    x: o.x1 + o.w / 2,
    y: o.y1 + o.h / 2
  }, u = [], l = 0, c = 0; c < i.length; c++) {
    var d = i[c], f = void 0;
    f = e.concentric(d), u.push({
      value: f,
      node: d
    }), d._private.scratch.concentric = f;
  }
  i.updateStyle();
  for (var h = 0; h < i.length; h++) {
    var v = i[h], p = v.layoutDimensions(e);
    l = Math.max(l, p.w, p.h);
  }
  u.sort(function(fe, ce) {
    return ce.value - fe.value;
  });
  for (var g = e.levelWidth(i), y = [[]], m = y[0], b = 0; b < u.length; b++) {
    var w = u[b];
    if (m.length > 0) {
      var x = Math.abs(m[0].value - w.value);
      x >= g && (m = [], y.push(m));
    }
    m.push(w);
  }
  var E = l + e.minNodeSpacing;
  if (!e.avoidOverlap) {
    var C = y.length > 0 && y[0].length > 1, k = Math.min(o.w, o.h) / 2 - E, S = k / (y.length + C ? 1 : 0);
    E = Math.min(E, S);
  }
  for (var _ = 0, T = 0; T < y.length; T++) {
    var O = y[T], D = e.sweep === void 0 ? 2 * Math.PI - 2 * Math.PI / O.length : e.sweep, A = O.dTheta = D / Math.max(1, O.length - 1);
    if (O.length > 1 && e.avoidOverlap) {
      var F = Math.cos(A) - Math.cos(0), R = Math.sin(A) - Math.sin(0), M = Math.sqrt(E * E / (F * F + R * R));
      _ = Math.max(M, _);
    }
    O.r = _, _ += E;
  }
  if (e.equidistant) {
    for (var L = 0, V = 0, Y = 0; Y < y.length; Y++) {
      var H = y[Y], K = H.r - V;
      L = Math.max(L, K);
    }
    V = 0;
    for (var ne = 0; ne < y.length; ne++) {
      var B = y[ne];
      ne === 0 && (V = B.r), B.r = V, V += L;
    }
  }
  for (var $ = {}, z = 0; z < y.length; z++)
    for (var W = y[z], Z = W.dTheta, N = W.r, X = 0; X < W.length; X++) {
      var Q = W[X], ge = e.startAngle + (r ? 1 : -1) * Z * X, we = {
        x: s.x + N * Math.cos(ge),
        y: s.y + N * Math.sin(ge)
      };
      $[Q.node.id()] = we;
    }
  return a.nodes().layoutPositions(this, e, function(fe) {
    var ce = fe.id();
    return $[ce];
  }), this;
};
var $u, v8 = {
  // Called on `layoutready`
  ready: function() {
  },
  // Called on `layoutstop`
  stop: function() {
  },
  // Whether to animate while running the layout
  // true : Animate continuously as the layout is running
  // false : Just show the end result
  // 'end' : Animate with the end result, from the initial positions to the end positions
  animate: !0,
  // Easing of the animation for animate:'end'
  animationEasing: void 0,
  // The duration of the animation for animate:'end'
  animationDuration: void 0,
  // A function that determines whether the node should be animated
  // All nodes animated by default on animate enabled
  // Non-animated nodes are positioned immediately when the layout starts
  animateFilter: function(e, r) {
    return !0;
  },
  // The layout animates only after this many milliseconds for animate:true
  // (prevents flashing on fast runs)
  animationThreshold: 250,
  // Number of iterations between consecutive screen positions update
  refresh: 20,
  // Whether to fit the network view after when done
  fit: !0,
  // Padding on fit
  padding: 30,
  // Constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }
  boundingBox: void 0,
  // Excludes the label when calculating node bounding boxes for the layout algorithm
  nodeDimensionsIncludeLabels: !1,
  // Randomize the initial positions of the nodes (true) or use existing positions (false)
  randomize: !1,
  // Extra spacing between components in non-compound graphs
  componentSpacing: 40,
  // Node repulsion (non overlapping) multiplier
  nodeRepulsion: function(e) {
    return 2048;
  },
  // Node repulsion (overlapping) multiplier
  nodeOverlap: 4,
  // Ideal edge (non nested) length
  idealEdgeLength: function(e) {
    return 32;
  },
  // Divisor to compute edge forces
  edgeElasticity: function(e) {
    return 32;
  },
  // Nesting factor (multiplier) to compute ideal edge length for nested edges
  nestingFactor: 1.2,
  // Gravity force (constant)
  gravity: 1,
  // Maximum number of iterations to perform
  numIter: 1e3,
  // Initial temperature (maximum node displacement)
  initialTemp: 1e3,
  // Cooling factor (how the temperature is reduced between consecutive iterations
  coolingFactor: 0.99,
  // Lower temperature threshold (below this point the layout will end)
  minTemp: 1
};
function jl(t) {
  this.options = ze({}, v8, t), this.options.layout = this;
  var e = this.options.eles.nodes(), r = this.options.eles.edges(), n = r.filter(function(a) {
    var i = a.source().data("id"), o = a.target().data("id"), s = e.some(function(l) {
      return l.data("id") === i;
    }), u = e.some(function(l) {
      return l.data("id") === o;
    });
    return !s || !u;
  });
  this.options.eles = this.options.eles.not(n);
}
jl.prototype.run = function() {
  var t = this.options, e = t.cy, r = this;
  r.stopped = !1, (t.animate === !0 || t.animate === !1) && r.emit({
    type: "layoutstart",
    layout: r
  }), t.debug === !0 ? $u = !0 : $u = !1;
  var n = h8(e, r, t);
  $u && y8(n), t.randomize && m8(n);
  var a = kn(), i = function() {
    b8(n, e, t), t.fit === !0 && e.fit(t.padding);
  }, o = function(f) {
    return !(r.stopped || f >= t.numIter || (w8(n, t), n.temperature = n.temperature * t.coolingFactor, n.temperature < t.minTemp));
  }, s = function() {
    if (t.animate === !0 || t.animate === !1)
      i(), r.one("layoutstop", t.stop), r.emit({
        type: "layoutstop",
        layout: r
      });
    else {
      var f = t.eles.nodes(), h = ik(n, t, f);
      f.layoutPositions(r, t, h);
    }
  }, u = 0, l = !0;
  if (t.animate === !0) {
    var c = function d() {
      for (var f = 0; l && f < t.refresh; )
        l = o(u), u++, f++;
      if (!l)
        F0(n, t), s();
      else {
        var h = kn();
        h - a >= t.animationThreshold && i(), ll(d);
      }
    };
    c();
  } else {
    for (; l; )
      l = o(u), u++;
    F0(n, t), s();
  }
  return this;
};
jl.prototype.stop = function() {
  return this.stopped = !0, this.thread && this.thread.stop(), this.emit("layoutstop"), this;
};
jl.prototype.destroy = function() {
  return this.thread && this.thread.stop(), this;
};
var h8 = function(e, r, n) {
  for (var a = n.eles.edges(), i = n.eles.nodes(), o = br(n.boundingBox ? n.boundingBox : {
    x1: 0,
    y1: 0,
    w: e.width(),
    h: e.height()
  }), s = {
    isCompound: e.hasCompoundNodes(),
    layoutNodes: [],
    idToIndex: {},
    nodeSize: i.size(),
    graphSet: [],
    indexToGraph: [],
    layoutEdges: [],
    edgeSize: a.size(),
    temperature: n.initialTemp,
    clientWidth: o.w,
    clientHeight: o.h,
    boundingBox: o
  }, u = n.eles.components(), l = {}, c = 0; c < u.length; c++)
    for (var d = u[c], f = 0; f < d.length; f++) {
      var h = d[f];
      l[h.id()] = c;
    }
  for (var c = 0; c < s.nodeSize; c++) {
    var v = i[c], p = v.layoutDimensions(n), g = {};
    g.isLocked = v.locked(), g.id = v.data("id"), g.parentId = v.data("parent"), g.cmptId = l[v.id()], g.children = [], g.positionX = v.position("x"), g.positionY = v.position("y"), g.offsetX = 0, g.offsetY = 0, g.height = p.w, g.width = p.h, g.maxX = g.positionX + g.width / 2, g.minX = g.positionX - g.width / 2, g.maxY = g.positionY + g.height / 2, g.minY = g.positionY - g.height / 2, g.padLeft = parseFloat(v.style("padding")), g.padRight = parseFloat(v.style("padding")), g.padTop = parseFloat(v.style("padding")), g.padBottom = parseFloat(v.style("padding")), g.nodeRepulsion = yt(n.nodeRepulsion) ? n.nodeRepulsion(v) : n.nodeRepulsion, s.layoutNodes.push(g), s.idToIndex[g.id] = c;
  }
  for (var y = [], m = 0, b = -1, w = [], c = 0; c < s.nodeSize; c++) {
    var v = s.layoutNodes[c], x = v.parentId;
    x != null ? s.layoutNodes[s.idToIndex[x]].children.push(v.id) : (y[++b] = v.id, w.push(v.id));
  }
  for (s.graphSet.push(w); m <= b; ) {
    var E = y[m++], C = s.idToIndex[E], h = s.layoutNodes[C], k = h.children;
    if (k.length > 0) {
      s.graphSet.push(k);
      for (var c = 0; c < k.length; c++)
        y[++b] = k[c];
    }
  }
  for (var c = 0; c < s.graphSet.length; c++)
    for (var S = s.graphSet[c], f = 0; f < S.length; f++) {
      var _ = s.idToIndex[S[f]];
      s.indexToGraph[_] = c;
    }
  for (var c = 0; c < s.edgeSize; c++) {
    var T = a[c], O = {};
    O.id = T.data("id"), O.sourceId = T.data("source"), O.targetId = T.data("target");
    var D = yt(n.idealEdgeLength) ? n.idealEdgeLength(T) : n.idealEdgeLength, A = yt(n.edgeElasticity) ? n.edgeElasticity(T) : n.edgeElasticity, F = s.idToIndex[O.sourceId], R = s.idToIndex[O.targetId], M = s.indexToGraph[F], L = s.indexToGraph[R];
    if (M != L) {
      for (var V = p8(O.sourceId, O.targetId, s), Y = s.graphSet[V], H = 0, g = s.layoutNodes[F]; Y.indexOf(g.id) === -1; )
        g = s.layoutNodes[s.idToIndex[g.parentId]], H++;
      for (g = s.layoutNodes[R]; Y.indexOf(g.id) === -1; )
        g = s.layoutNodes[s.idToIndex[g.parentId]], H++;
      D *= H * n.nestingFactor;
    }
    O.idealLength = D, O.elasticity = A, s.layoutEdges.push(O);
  }
  return s;
}, p8 = function(e, r, n) {
  var a = g8(e, r, 0, n);
  return 2 > a.count ? 0 : a.graph;
}, g8 = function t(e, r, n, a) {
  var i = a.graphSet[n];
  if (-1 < i.indexOf(e) && -1 < i.indexOf(r))
    return {
      count: 2,
      graph: n
    };
  for (var o = 0, s = 0; s < i.length; s++) {
    var u = i[s], l = a.idToIndex[u], c = a.layoutNodes[l].children;
    if (c.length !== 0) {
      var d = a.indexToGraph[a.idToIndex[c[0]]], f = t(e, r, d, a);
      if (f.count !== 0)
        if (f.count === 1) {
          if (o++, o === 2)
            break;
        } else
          return f;
    }
  }
  return {
    count: o,
    graph: n
  };
}, y8, m8 = function(e, r) {
  for (var n = e.clientWidth, a = e.clientHeight, i = 0; i < e.nodeSize; i++) {
    var o = e.layoutNodes[i];
    o.children.length === 0 && !o.isLocked && (o.positionX = Math.random() * n, o.positionY = Math.random() * a);
  }
}, ik = function(e, r, n) {
  var a = e.boundingBox, i = {
    x1: 1 / 0,
    x2: -1 / 0,
    y1: 1 / 0,
    y2: -1 / 0
  };
  return r.boundingBox && (n.forEach(function(o) {
    var s = e.layoutNodes[e.idToIndex[o.data("id")]];
    i.x1 = Math.min(i.x1, s.positionX), i.x2 = Math.max(i.x2, s.positionX), i.y1 = Math.min(i.y1, s.positionY), i.y2 = Math.max(i.y2, s.positionY);
  }), i.w = i.x2 - i.x1, i.h = i.y2 - i.y1), function(o, s) {
    var u = e.layoutNodes[e.idToIndex[o.data("id")]];
    if (r.boundingBox) {
      var l = (u.positionX - i.x1) / i.w, c = (u.positionY - i.y1) / i.h;
      return {
        x: a.x1 + l * a.w,
        y: a.y1 + c * a.h
      };
    } else
      return {
        x: u.positionX,
        y: u.positionY
      };
  };
}, b8 = function(e, r, n) {
  var a = n.layout, i = n.eles.nodes(), o = ik(e, n, i);
  i.positions(o), e.ready !== !0 && (e.ready = !0, a.one("layoutready", n.ready), a.emit({
    type: "layoutready",
    layout: this
  }));
}, w8 = function(e, r, n) {
  C8(e, r), S8(e), k8(e, r), _8(e), T8(e);
}, C8 = function(e, r) {
  for (var n = 0; n < e.graphSet.length; n++)
    for (var a = e.graphSet[n], i = a.length, o = 0; o < i; o++)
      for (var s = e.layoutNodes[e.idToIndex[a[o]]], u = o + 1; u < i; u++) {
        var l = e.layoutNodes[e.idToIndex[a[u]]];
        x8(s, l, e, r);
      }
}, L0 = function(e) {
  return -e + 2 * e * Math.random();
}, x8 = function(e, r, n, a) {
  var i = e.cmptId, o = r.cmptId;
  if (!(i !== o && !n.isCompound)) {
    var s = r.positionX - e.positionX, u = r.positionY - e.positionY, l = 1;
    s === 0 && u === 0 && (s = L0(l), u = L0(l));
    var c = E8(e, r, s, u);
    if (c > 0)
      var d = a.nodeOverlap * c, f = Math.sqrt(s * s + u * u), h = d * s / f, v = d * u / f;
    else
      var p = pl(e, s, u), g = pl(r, -1 * s, -1 * u), y = g.x - p.x, m = g.y - p.y, b = y * y + m * m, f = Math.sqrt(b), d = (e.nodeRepulsion + r.nodeRepulsion) / b, h = d * y / f, v = d * m / f;
    e.isLocked || (e.offsetX -= h, e.offsetY -= v), r.isLocked || (r.offsetX += h, r.offsetY += v);
  }
}, E8 = function(e, r, n, a) {
  if (n > 0)
    var i = e.maxX - r.minX;
  else
    var i = r.maxX - e.minX;
  if (a > 0)
    var o = e.maxY - r.minY;
  else
    var o = r.maxY - e.minY;
  return i >= 0 && o >= 0 ? Math.sqrt(i * i + o * o) : 0;
}, pl = function(e, r, n) {
  var a = e.positionX, i = e.positionY, o = e.height || 1, s = e.width || 1, u = n / r, l = o / s, c = {};
  return r === 0 && 0 < n || r === 0 && 0 > n ? (c.x = a, c.y = i + o / 2, c) : 0 < r && -1 * l <= u && u <= l ? (c.x = a + s / 2, c.y = i + s * n / 2 / r, c) : 0 > r && -1 * l <= u && u <= l ? (c.x = a - s / 2, c.y = i - s * n / 2 / r, c) : 0 < n && (u <= -1 * l || u >= l) ? (c.x = a + o * r / 2 / n, c.y = i + o / 2, c) : (0 > n && (u <= -1 * l || u >= l) && (c.x = a - o * r / 2 / n, c.y = i - o / 2), c);
}, S8 = function(e, r) {
  for (var n = 0; n < e.edgeSize; n++) {
    var a = e.layoutEdges[n], i = e.idToIndex[a.sourceId], o = e.layoutNodes[i], s = e.idToIndex[a.targetId], u = e.layoutNodes[s], l = u.positionX - o.positionX, c = u.positionY - o.positionY;
    if (!(l === 0 && c === 0)) {
      var d = pl(o, l, c), f = pl(u, -1 * l, -1 * c), h = f.x - d.x, v = f.y - d.y, p = Math.sqrt(h * h + v * v), g = Math.pow(a.idealLength - p, 2) / a.elasticity;
      if (p !== 0)
        var y = g * h / p, m = g * v / p;
      else
        var y = 0, m = 0;
      o.isLocked || (o.offsetX += y, o.offsetY += m), u.isLocked || (u.offsetX -= y, u.offsetY -= m);
    }
  }
}, k8 = function(e, r) {
  if (r.gravity !== 0)
    for (var n = 1, a = 0; a < e.graphSet.length; a++) {
      var i = e.graphSet[a], o = i.length;
      if (a === 0)
        var s = e.clientHeight / 2, u = e.clientWidth / 2;
      else
        var l = e.layoutNodes[e.idToIndex[i[0]]], c = e.layoutNodes[e.idToIndex[l.parentId]], s = c.positionX, u = c.positionY;
      for (var d = 0; d < o; d++) {
        var f = e.layoutNodes[e.idToIndex[i[d]]];
        if (!f.isLocked) {
          var h = s - f.positionX, v = u - f.positionY, p = Math.sqrt(h * h + v * v);
          if (p > n) {
            var g = r.gravity * h / p, y = r.gravity * v / p;
            f.offsetX += g, f.offsetY += y;
          }
        }
      }
    }
}, _8 = function(e, r) {
  var n = [], a = 0, i = -1;
  for (n.push.apply(n, e.graphSet[0]), i += e.graphSet[0].length; a <= i; ) {
    var o = n[a++], s = e.idToIndex[o], u = e.layoutNodes[s], l = u.children;
    if (0 < l.length && !u.isLocked) {
      for (var c = u.offsetX, d = u.offsetY, f = 0; f < l.length; f++) {
        var h = e.layoutNodes[e.idToIndex[l[f]]];
        h.offsetX += c, h.offsetY += d, n[++i] = l[f];
      }
      u.offsetX = 0, u.offsetY = 0;
    }
  }
}, T8 = function(e, r) {
  for (var n = 0; n < e.nodeSize; n++) {
    var a = e.layoutNodes[n];
    0 < a.children.length && (a.maxX = void 0, a.minX = void 0, a.maxY = void 0, a.minY = void 0);
  }
  for (var n = 0; n < e.nodeSize; n++) {
    var a = e.layoutNodes[n];
    if (!(0 < a.children.length || a.isLocked)) {
      var i = I8(a.offsetX, a.offsetY, e.temperature);
      a.positionX += i.x, a.positionY += i.y, a.offsetX = 0, a.offsetY = 0, a.minX = a.positionX - a.width, a.maxX = a.positionX + a.width, a.minY = a.positionY - a.height, a.maxY = a.positionY + a.height, O8(a, e);
    }
  }
  for (var n = 0; n < e.nodeSize; n++) {
    var a = e.layoutNodes[n];
    0 < a.children.length && !a.isLocked && (a.positionX = (a.maxX + a.minX) / 2, a.positionY = (a.maxY + a.minY) / 2, a.width = a.maxX - a.minX, a.height = a.maxY - a.minY);
  }
}, I8 = function(e, r, n) {
  var a = Math.sqrt(e * e + r * r);
  if (a > n)
    var i = {
      x: n * e / a,
      y: n * r / a
    };
  else
    var i = {
      x: e,
      y: r
    };
  return i;
}, O8 = function t(e, r) {
  var n = e.parentId;
  if (n != null) {
    var a = r.layoutNodes[r.idToIndex[n]], i = !1;
    if ((a.maxX == null || e.maxX + a.padRight > a.maxX) && (a.maxX = e.maxX + a.padRight, i = !0), (a.minX == null || e.minX - a.padLeft < a.minX) && (a.minX = e.minX - a.padLeft, i = !0), (a.maxY == null || e.maxY + a.padBottom > a.maxY) && (a.maxY = e.maxY + a.padBottom, i = !0), (a.minY == null || e.minY - a.padTop < a.minY) && (a.minY = e.minY - a.padTop, i = !0), i)
      return t(a, r);
  }
}, F0 = function(e, r) {
  for (var n = e.layoutNodes, a = [], i = 0; i < n.length; i++) {
    var o = n[i], s = o.cmptId, u = a[s] = a[s] || [];
    u.push(o);
  }
  for (var l = 0, i = 0; i < a.length; i++) {
    var c = a[i];
    if (c) {
      c.x1 = 1 / 0, c.x2 = -1 / 0, c.y1 = 1 / 0, c.y2 = -1 / 0;
      for (var d = 0; d < c.length; d++) {
        var f = c[d];
        c.x1 = Math.min(c.x1, f.positionX - f.width / 2), c.x2 = Math.max(c.x2, f.positionX + f.width / 2), c.y1 = Math.min(c.y1, f.positionY - f.height / 2), c.y2 = Math.max(c.y2, f.positionY + f.height / 2);
      }
      c.w = c.x2 - c.x1, c.h = c.y2 - c.y1, l += c.w * c.h;
    }
  }
  a.sort(function(m, b) {
    return b.w * b.h - m.w * m.h;
  });
  for (var h = 0, v = 0, p = 0, g = 0, y = Math.sqrt(l) * e.clientWidth / e.clientHeight, i = 0; i < a.length; i++) {
    var c = a[i];
    if (c) {
      for (var d = 0; d < c.length; d++) {
        var f = c[d];
        f.isLocked || (f.positionX += h - c.x1, f.positionY += v - c.y1);
      }
      h += c.w + r.componentSpacing, p += c.w + r.componentSpacing, g = Math.max(g, c.h), p > y && (v += g + r.componentSpacing, h = 0, p = 0, g = 0);
    }
  }
}, A8 = {
  fit: !0,
  // whether to fit the viewport to the graph
  padding: 30,
  // padding used on fit
  boundingBox: void 0,
  // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }
  avoidOverlap: !0,
  // prevents node overlap, may overflow boundingBox if not enough space
  avoidOverlapPadding: 10,
  // extra spacing around nodes when avoidOverlap: true
  nodeDimensionsIncludeLabels: !1,
  // Excludes the label when calculating node bounding boxes for the layout algorithm
  spacingFactor: void 0,
  // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up
  condense: !1,
  // uses all available space on false, uses minimal space on true
  rows: void 0,
  // force num of rows in the grid
  cols: void 0,
  // force num of columns in the grid
  position: function(e) {
  },
  // returns { row, col } for element
  sort: void 0,
  // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') }
  animate: !1,
  // whether to transition the node positions
  animationDuration: 500,
  // duration of animation in ms if enabled
  animationEasing: void 0,
  // easing of animation if enabled
  animateFilter: function(e, r) {
    return !0;
  },
  // a function that determines whether the node should be animated.  All nodes animated by default on animate enabled.  Non-animated nodes are positioned immediately when the layout starts
  ready: void 0,
  // callback on layoutready
  stop: void 0,
  // callback on layoutstop
  transform: function(e, r) {
    return r;
  }
  // transform a given node position. Useful for changing flow direction in discrete layouts 
};
function ok(t) {
  this.options = ze({}, A8, t);
}
ok.prototype.run = function() {
  var t = this.options, e = t, r = t.cy, n = e.eles, a = n.nodes().not(":parent");
  e.sort && (a = a.sort(e.sort));
  var i = br(e.boundingBox ? e.boundingBox : {
    x1: 0,
    y1: 0,
    w: r.width(),
    h: r.height()
  });
  if (i.h === 0 || i.w === 0)
    n.nodes().layoutPositions(this, e, function(ne) {
      return {
        x: i.x1,
        y: i.y1
      };
    });
  else {
    var o = a.size(), s = Math.sqrt(o * i.h / i.w), u = Math.round(s), l = Math.round(i.w / i.h * s), c = function(B) {
      if (B == null)
        return Math.min(u, l);
      var $ = Math.min(u, l);
      $ == u ? u = B : l = B;
    }, d = function(B) {
      if (B == null)
        return Math.max(u, l);
      var $ = Math.max(u, l);
      $ == u ? u = B : l = B;
    }, f = e.rows, h = e.cols != null ? e.cols : e.columns;
    if (f != null && h != null)
      u = f, l = h;
    else if (f != null && h == null)
      u = f, l = Math.ceil(o / u);
    else if (f == null && h != null)
      l = h, u = Math.ceil(o / l);
    else if (l * u > o) {
      var v = c(), p = d();
      (v - 1) * p >= o ? c(v - 1) : (p - 1) * v >= o && d(p - 1);
    } else
      for (; l * u < o; ) {
        var g = c(), y = d();
        (y + 1) * g >= o ? d(y + 1) : c(g + 1);
      }
    var m = i.w / l, b = i.h / u;
    if (e.condense && (m = 0, b = 0), e.avoidOverlap)
      for (var w = 0; w < a.length; w++) {
        var x = a[w], E = x._private.position;
        (E.x == null || E.y == null) && (E.x = 0, E.y = 0);
        var C = x.layoutDimensions(e), k = e.avoidOverlapPadding, S = C.w + k, _ = C.h + k;
        m = Math.max(m, S), b = Math.max(b, _);
      }
    for (var T = {}, O = function(B, $) {
      return !!T["c-" + B + "-" + $];
    }, D = function(B, $) {
      T["c-" + B + "-" + $] = !0;
    }, A = 0, F = 0, R = function() {
      F++, F >= l && (F = 0, A++);
    }, M = {}, L = 0; L < a.length; L++) {
      var V = a[L], Y = e.position(V);
      if (Y && (Y.row !== void 0 || Y.col !== void 0)) {
        var H = {
          row: Y.row,
          col: Y.col
        };
        if (H.col === void 0)
          for (H.col = 0; O(H.row, H.col); )
            H.col++;
        else if (H.row === void 0)
          for (H.row = 0; O(H.row, H.col); )
            H.row++;
        M[V.id()] = H, D(H.row, H.col);
      }
    }
    var K = function(B, $) {
      var z, W;
      if (B.locked() || B.isParent())
        return !1;
      var Z = M[B.id()];
      if (Z)
        z = Z.col * m + m / 2 + i.x1, W = Z.row * b + b / 2 + i.y1;
      else {
        for (; O(A, F); )
          R();
        z = F * m + m / 2 + i.x1, W = A * b + b / 2 + i.y1, D(A, F), R();
      }
      return {
        x: z,
        y: W
      };
    };
    a.layoutPositions(this, e, K);
  }
  return this;
};
var P8 = {
  ready: function() {
  },
  // on layoutready
  stop: function() {
  }
  // on layoutstop
};
function Kg(t) {
  this.options = ze({}, P8, t);
}
Kg.prototype.run = function() {
  var t = this.options, e = t.eles, r = this;
  return t.cy, r.emit("layoutstart"), e.nodes().positions(function() {
    return {
      x: 0,
      y: 0
    };
  }), r.one("layoutready", t.ready), r.emit("layoutready"), r.one("layoutstop", t.stop), r.emit("layoutstop"), this;
};
Kg.prototype.stop = function() {
  return this;
};
var D8 = {
  positions: void 0,
  // map of (node id) => (position obj); or function(node){ return somPos; }
  zoom: void 0,
  // the zoom level to set (prob want fit = false if set)
  pan: void 0,
  // the pan level to set (prob want fit = false if set)
  fit: !0,
  // whether to fit to viewport
  padding: 30,
  // padding on fit
  spacingFactor: void 0,
  // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up
  animate: !1,
  // whether to transition the node positions
  animationDuration: 500,
  // duration of animation in ms if enabled
  animationEasing: void 0,
  // easing of animation if enabled
  animateFilter: function(e, r) {
    return !0;
  },
  // a function that determines whether the node should be animated.  All nodes animated by default on animate enabled.  Non-animated nodes are positioned immediately when the layout starts
  ready: void 0,
  // callback on layoutready
  stop: void 0,
  // callback on layoutstop
  transform: function(e, r) {
    return r;
  }
  // transform a given node position. Useful for changing flow direction in discrete layouts
};
function sk(t) {
  this.options = ze({}, D8, t);
}
sk.prototype.run = function() {
  var t = this.options, e = t.eles, r = e.nodes(), n = yt(t.positions);
  function a(i) {
    if (t.positions == null)
      return M$(i.position());
    if (n)
      return t.positions(i);
    var o = t.positions[i._private.data.id];
    return o ?? null;
  }
  return r.layoutPositions(this, t, function(i, o) {
    var s = a(i);
    return i.locked() || s == null ? !1 : s;
  }), this;
};
var R8 = {
  fit: !0,
  // whether to fit to viewport
  padding: 30,
  // fit padding
  boundingBox: void 0,
  // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }
  animate: !1,
  // whether to transition the node positions
  animationDuration: 500,
  // duration of animation in ms if enabled
  animationEasing: void 0,
  // easing of animation if enabled
  animateFilter: function(e, r) {
    return !0;
  },
  // a function that determines whether the node should be animated.  All nodes animated by default on animate enabled.  Non-animated nodes are positioned immediately when the layout starts
  ready: void 0,
  // callback on layoutready
  stop: void 0,
  // callback on layoutstop
  transform: function(e, r) {
    return r;
  }
  // transform a given node position. Useful for changing flow direction in discrete layouts 
};
function lk(t) {
  this.options = ze({}, R8, t);
}
lk.prototype.run = function() {
  var t = this.options, e = t.cy, r = t.eles, n = br(t.boundingBox ? t.boundingBox : {
    x1: 0,
    y1: 0,
    w: e.width(),
    h: e.height()
  }), a = function(o, s) {
    return {
      x: n.x1 + Math.round(Math.random() * n.w),
      y: n.y1 + Math.round(Math.random() * n.h)
    };
  };
  return r.nodes().layoutPositions(this, t, a), this;
};
var L8 = [{
  name: "breadthfirst",
  impl: rk
}, {
  name: "circle",
  impl: nk
}, {
  name: "concentric",
  impl: ak
}, {
  name: "cose",
  impl: jl
}, {
  name: "grid",
  impl: ok
}, {
  name: "null",
  impl: Kg
}, {
  name: "preset",
  impl: sk
}, {
  name: "random",
  impl: lk
}];
function uk(t) {
  this.options = t, this.notifications = 0;
}
var M0 = function() {
}, N0 = function() {
  throw new Error("A headless instance can not render images");
};
uk.prototype = {
  recalculateRenderedStyle: M0,
  notify: function() {
    this.notifications++;
  },
  init: M0,
  isHeadless: function() {
    return !0;
  },
  png: N0,
  jpg: N0
};
var Gg = {};
Gg.arrowShapeWidth = 0.3;
Gg.registerArrowShapes = function() {
  var t = this.arrowShapes = {}, e = this, r = function(l, c, d, f, h, v, p) {
    var g = h.x - d / 2 - p, y = h.x + d / 2 + p, m = h.y - d / 2 - p, b = h.y + d / 2 + p, w = g <= l && l <= y && m <= c && c <= b;
    return w;
  }, n = function(l, c, d, f, h) {
    var v = l * Math.cos(f) - c * Math.sin(f), p = l * Math.sin(f) + c * Math.cos(f), g = v * d, y = p * d, m = g + h.x, b = y + h.y;
    return {
      x: m,
      y: b
    };
  }, a = function(l, c, d, f) {
    for (var h = [], v = 0; v < l.length; v += 2) {
      var p = l[v], g = l[v + 1];
      h.push(n(p, g, c, d, f));
    }
    return h;
  }, i = function(l) {
    for (var c = [], d = 0; d < l.length; d++) {
      var f = l[d];
      c.push(f.x, f.y);
    }
    return c;
  }, o = function(l) {
    return l.pstyle("width").pfValue * l.pstyle("arrow-scale").pfValue * 2;
  }, s = function(l, c) {
    Me(c) && (c = t[c]), t[l] = ze({
      name: l,
      points: [-0.15, -0.3, 0.15, -0.3, 0.15, 0.3, -0.15, 0.3],
      collide: function(f, h, v, p, g, y) {
        var m = i(a(this.points, v + 2 * y, p, g)), b = vr(f, h, m);
        return b;
      },
      roughCollide: r,
      draw: function(f, h, v, p) {
        var g = a(this.points, h, v, p);
        e.arrowShapeImpl("polygon")(f, g);
      },
      spacing: function(f) {
        return 0;
      },
      gap: o
    }, c);
  };
  s("none", {
    collide: ul,
    roughCollide: ul,
    draw: Ag,
    spacing: Wm,
    gap: Wm
  }), s("triangle", {
    points: [-0.15, -0.3, 0, 0, 0.15, -0.3]
  }), s("arrow", "triangle"), s("triangle-backcurve", {
    points: t.triangle.points,
    controlPoint: [0, -0.15],
    roughCollide: r,
    draw: function(l, c, d, f, h) {
      var v = a(this.points, c, d, f), p = this.controlPoint, g = n(p[0], p[1], c, d, f);
      e.arrowShapeImpl(this.name)(l, v, g);
    },
    gap: function(l) {
      return o(l) * 0.8;
    }
  }), s("triangle-tee", {
    points: [0, 0, 0.15, -0.3, -0.15, -0.3, 0, 0],
    pointsTee: [-0.15, -0.4, -0.15, -0.5, 0.15, -0.5, 0.15, -0.4],
    collide: function(l, c, d, f, h, v, p) {
      var g = i(a(this.points, d + 2 * p, f, h)), y = i(a(this.pointsTee, d + 2 * p, f, h)), m = vr(l, c, g) || vr(l, c, y);
      return m;
    },
    draw: function(l, c, d, f, h) {
      var v = a(this.points, c, d, f), p = a(this.pointsTee, c, d, f);
      e.arrowShapeImpl(this.name)(l, v, p);
    }
  }), s("circle-triangle", {
    radius: 0.15,
    pointsTr: [0, -0.15, 0.15, -0.45, -0.15, -0.45, 0, -0.15],
    collide: function(l, c, d, f, h, v, p) {
      var g = h, y = Math.pow(g.x - l, 2) + Math.pow(g.y - c, 2) <= Math.pow((d + 2 * p) * this.radius, 2), m = i(a(this.points, d + 2 * p, f, h));
      return vr(l, c, m) || y;
    },
    draw: function(l, c, d, f, h) {
      var v = a(this.pointsTr, c, d, f);
      e.arrowShapeImpl(this.name)(l, v, f.x, f.y, this.radius * c);
    },
    spacing: function(l) {
      return e.getArrowWidth(l.pstyle("width").pfValue, l.pstyle("arrow-scale").value) * this.radius;
    }
  }), s("triangle-cross", {
    points: [0, 0, 0.15, -0.3, -0.15, -0.3, 0, 0],
    baseCrossLinePts: [
      -0.15,
      -0.4,
      // first half of the rectangle
      -0.15,
      -0.4,
      0.15,
      -0.4,
      // second half of the rectangle
      0.15,
      -0.4
    ],
    crossLinePts: function(l, c) {
      var d = this.baseCrossLinePts.slice(), f = c / l, h = 3, v = 5;
      return d[h] = d[h] - f, d[v] = d[v] - f, d;
    },
    collide: function(l, c, d, f, h, v, p) {
      var g = i(a(this.points, d + 2 * p, f, h)), y = i(a(this.crossLinePts(d, v), d + 2 * p, f, h)), m = vr(l, c, g) || vr(l, c, y);
      return m;
    },
    draw: function(l, c, d, f, h) {
      var v = a(this.points, c, d, f), p = a(this.crossLinePts(c, h), c, d, f);
      e.arrowShapeImpl(this.name)(l, v, p);
    }
  }), s("vee", {
    points: [-0.15, -0.3, 0, 0, 0.15, -0.3, 0, -0.15],
    gap: function(l) {
      return o(l) * 0.525;
    }
  }), s("circle", {
    radius: 0.15,
    collide: function(l, c, d, f, h, v, p) {
      var g = h, y = Math.pow(g.x - l, 2) + Math.pow(g.y - c, 2) <= Math.pow((d + 2 * p) * this.radius, 2);
      return y;
    },
    draw: function(l, c, d, f, h) {
      e.arrowShapeImpl(this.name)(l, f.x, f.y, this.radius * c);
    },
    spacing: function(l) {
      return e.getArrowWidth(l.pstyle("width").pfValue, l.pstyle("arrow-scale").value) * this.radius;
    }
  }), s("tee", {
    points: [-0.15, 0, -0.15, -0.1, 0.15, -0.1, 0.15, 0],
    spacing: function(l) {
      return 1;
    },
    gap: function(l) {
      return 1;
    }
  }), s("square", {
    points: [-0.15, 0, 0.15, 0, 0.15, -0.3, -0.15, -0.3]
  }), s("diamond", {
    points: [-0.15, -0.15, 0, -0.3, 0.15, -0.15, 0, 0],
    gap: function(l) {
      return l.pstyle("width").pfValue * l.pstyle("arrow-scale").value;
    }
  }), s("chevron", {
    points: [0, 0, -0.15, -0.15, -0.1, -0.2, 0, -0.1, 0.1, -0.2, 0.15, -0.15],
    gap: function(l) {
      return 0.95 * l.pstyle("width").pfValue * l.pstyle("arrow-scale").value;
    }
  });
};
var Ka = {};
Ka.projectIntoViewport = function(t, e) {
  var r = this.cy, n = this.findContainerClientCoords(), a = n[0], i = n[1], o = n[4], s = r.pan(), u = r.zoom(), l = ((t - a) / o - s.x) / u, c = ((e - i) / o - s.y) / u;
  return [l, c];
};
Ka.findContainerClientCoords = function() {
  if (this.containerBB)
    return this.containerBB;
  var t = this.container, e = t.getBoundingClientRect(), r = this.cy.window().getComputedStyle(t), n = function(y) {
    return parseFloat(r.getPropertyValue(y));
  }, a = {
    left: n("padding-left"),
    right: n("padding-right"),
    top: n("padding-top"),
    bottom: n("padding-bottom")
  }, i = {
    left: n("border-left-width"),
    right: n("border-right-width"),
    top: n("border-top-width"),
    bottom: n("border-bottom-width")
  }, o = t.clientWidth, s = t.clientHeight, u = a.left + a.right, l = a.top + a.bottom, c = i.left + i.right, d = e.width / (o + c), f = o - u, h = s - l, v = e.left + a.left + i.left, p = e.top + a.top + i.top;
  return this.containerBB = [v, p, f, h, d];
};
Ka.invalidateContainerClientCoordsCache = function() {
  this.containerBB = null;
};
Ka.findNearestElement = function(t, e, r, n) {
  return this.findNearestElements(t, e, r, n)[0];
};
Ka.findNearestElements = function(t, e, r, n) {
  var a = this, i = this, o = i.getCachedZSortedEles(), s = [], u = i.cy.zoom(), l = i.cy.hasCompoundNodes(), c = (n ? 24 : 8) / u, d = (n ? 8 : 2) / u, f = (n ? 8 : 2) / u, h = 1 / 0, v, p;
  r && (o = o.interactive);
  function g(C, k) {
    if (C.isNode()) {
      if (p)
        return;
      p = C, s.push(C);
    }
    if (C.isEdge() && (k == null || k < h))
      if (v) {
        if (v.pstyle("z-compound-depth").value === C.pstyle("z-compound-depth").value && v.pstyle("z-compound-depth").value === C.pstyle("z-compound-depth").value) {
          for (var S = 0; S < s.length; S++)
            if (s[S].isEdge()) {
              s[S] = C, v = C, h = k ?? h;
              break;
            }
        }
      } else
        s.push(C), v = C, h = k ?? h;
  }
  function y(C) {
    var k = C.outerWidth() + 2 * d, S = C.outerHeight() + 2 * d, _ = k / 2, T = S / 2, O = C.position(), D = C.pstyle("corner-radius").value === "auto" ? "auto" : C.pstyle("corner-radius").pfValue, A = C._private.rscratch;
    if (O.x - _ <= t && t <= O.x + _ && O.y - T <= e && e <= O.y + T) {
      var F = i.nodeShapes[a.getNodeShape(C)];
      if (F.checkPoint(t, e, 0, k, S, O.x, O.y, D, A))
        return g(C, 0), !0;
    }
  }
  function m(C) {
    var k = C._private, S = k.rscratch, _ = C.pstyle("width").pfValue, T = C.pstyle("arrow-scale").value, O = _ / 2 + c, D = O * O, A = O * 2, L = k.source, V = k.target, F;
    if (S.edgeType === "segments" || S.edgeType === "straight" || S.edgeType === "haystack") {
      for (var R = S.allpts, M = 0; M + 3 < R.length; M += 2)
        if (Y$(t, e, R[M], R[M + 1], R[M + 2], R[M + 3], A) && D > (F = eq(t, e, R[M], R[M + 1], R[M + 2], R[M + 3])))
          return g(C, F), !0;
    } else if (S.edgeType === "bezier" || S.edgeType === "multibezier" || S.edgeType === "self" || S.edgeType === "compound") {
      for (var R = S.allpts, M = 0; M + 5 < S.allpts.length; M += 4)
        if (Z$(t, e, R[M], R[M + 1], R[M + 2], R[M + 3], R[M + 4], R[M + 5], A) && D > (F = Q$(t, e, R[M], R[M + 1], R[M + 2], R[M + 3], R[M + 4], R[M + 5])))
          return g(C, F), !0;
    }
    for (var L = L || k.source, V = V || k.target, Y = a.getArrowWidth(_, T), H = [{
      name: "source",
      x: S.arrowStartX,
      y: S.arrowStartY,
      angle: S.srcArrowAngle
    }, {
      name: "target",
      x: S.arrowEndX,
      y: S.arrowEndY,
      angle: S.tgtArrowAngle
    }, {
      name: "mid-source",
      x: S.midX,
      y: S.midY,
      angle: S.midsrcArrowAngle
    }, {
      name: "mid-target",
      x: S.midX,
      y: S.midY,
      angle: S.midtgtArrowAngle
    }], M = 0; M < H.length; M++) {
      var K = H[M], ne = i.arrowShapes[C.pstyle(K.name + "-arrow-shape").value], B = C.pstyle("width").pfValue;
      if (ne.roughCollide(t, e, Y, K.angle, {
        x: K.x,
        y: K.y
      }, B, c) && ne.collide(t, e, Y, K.angle, {
        x: K.x,
        y: K.y
      }, B, c))
        return g(C), !0;
    }
    l && s.length > 0 && (y(L), y(V));
  }
  function b(C, k, S) {
    return Kr(C, k, S);
  }
  function w(C, k) {
    var S = C._private, _ = f, T;
    k ? T = k + "-" : T = "", C.boundingBox();
    var O = S.labelBounds[k || "main"], D = C.pstyle(T + "label").value, A = C.pstyle("text-events").strValue === "yes";
    if (!(!A || !D)) {
      var F = b(S.rscratch, "labelX", k), R = b(S.rscratch, "labelY", k), M = b(S.rscratch, "labelAngle", k), L = C.pstyle(T + "text-margin-x").pfValue, V = C.pstyle(T + "text-margin-y").pfValue, Y = O.x1 - _ - L, H = O.x2 + _ - L, K = O.y1 - _ - V, ne = O.y2 + _ - V;
      if (M) {
        var B = Math.cos(M), $ = Math.sin(M), z = function(we, fe) {
          return we = we - F, fe = fe - R, {
            x: we * B - fe * $ + F,
            y: we * $ + fe * B + R
          };
        }, W = z(Y, K), Z = z(Y, ne), N = z(H, K), X = z(H, ne), Q = [
          // with the margin added after the rotation is applied
          W.x + L,
          W.y + V,
          N.x + L,
          N.y + V,
          X.x + L,
          X.y + V,
          Z.x + L,
          Z.y + V
        ];
        if (vr(t, e, Q))
          return g(C), !0;
      } else if (Ti(O, t, e))
        return g(C), !0;
    }
  }
  for (var x = o.length - 1; x >= 0; x--) {
    var E = o[x];
    E.isNode() ? y(E) || w(E) : m(E) || w(E) || w(E, "source") || w(E, "target");
  }
  return s;
};
Ka.getAllInBox = function(t, e, r, n) {
  var a = this.getCachedZSortedEles().interactive, i = [], o = Math.min(t, r), s = Math.max(t, r), u = Math.min(e, n), l = Math.max(e, n);
  t = o, r = s, e = u, n = l;
  for (var c = br({
    x1: t,
    y1: e,
    x2: r,
    y2: n
  }), d = 0; d < a.length; d++) {
    var f = a[d];
    if (f.isNode()) {
      var h = f, v = h.boundingBox({
        includeNodes: !0,
        includeEdges: !1,
        includeLabels: !1
      });
      Rg(c, v) && !mS(v, c) && i.push(h);
    } else {
      var p = f, g = p._private, y = g.rscratch;
      if (y.startX != null && y.startY != null && !Ti(c, y.startX, y.startY) || y.endX != null && y.endY != null && !Ti(c, y.endX, y.endY))
        continue;
      if (y.edgeType === "bezier" || y.edgeType === "multibezier" || y.edgeType === "self" || y.edgeType === "compound" || y.edgeType === "segments" || y.edgeType === "haystack") {
        for (var m = g.rstyle.bezierPts || g.rstyle.linePts || g.rstyle.haystackPts, b = !0, w = 0; w < m.length; w++)
          if (!j$(c, m[w])) {
            b = !1;
            break;
          }
        b && i.push(p);
      } else (y.edgeType === "haystack" || y.edgeType === "straight") && i.push(p);
    }
  }
  return i;
};
var gl = {};
gl.calculateArrowAngles = function(t) {
  var e = t._private.rscratch, r = e.edgeType === "haystack", n = e.edgeType === "bezier", a = e.edgeType === "multibezier", i = e.edgeType === "segments", o = e.edgeType === "compound", s = e.edgeType === "self", u, l, c, d, f, h, y, m;
  if (r ? (c = e.haystackPts[0], d = e.haystackPts[1], f = e.haystackPts[2], h = e.haystackPts[3]) : (c = e.arrowStartX, d = e.arrowStartY, f = e.arrowEndX, h = e.arrowEndY), y = e.midX, m = e.midY, i)
    u = c - e.segpts[0], l = d - e.segpts[1];
  else if (a || o || s || n) {
    var v = e.allpts, p = zt(v[0], v[2], v[4], 0.1), g = zt(v[1], v[3], v[5], 0.1);
    u = c - p, l = d - g;
  } else
    u = c - y, l = d - m;
  e.srcArrowAngle = _s(u, l);
  var y = e.midX, m = e.midY;
  if (r && (y = (c + f) / 2, m = (d + h) / 2), u = f - c, l = h - d, i) {
    var v = e.allpts;
    if (v.length / 2 % 2 === 0) {
      var b = v.length / 2, w = b - 2;
      u = v[b] - v[w], l = v[b + 1] - v[w + 1];
    } else if (e.isRound)
      u = e.midVector[1], l = -e.midVector[0];
    else {
      var b = v.length / 2 - 1, w = b - 2;
      u = v[b] - v[w], l = v[b + 1] - v[w + 1];
    }
  } else if (a || o || s) {
    var v = e.allpts, x = e.ctrlpts, E, C, k, S;
    if (x.length / 2 % 2 === 0) {
      var _ = v.length / 2 - 1, T = _ + 2, O = T + 2;
      E = zt(v[_], v[T], v[O], 0), C = zt(v[_ + 1], v[T + 1], v[O + 1], 0), k = zt(v[_], v[T], v[O], 1e-4), S = zt(v[_ + 1], v[T + 1], v[O + 1], 1e-4);
    } else {
      var T = v.length / 2 - 1, _ = T - 2, O = T + 2;
      E = zt(v[_], v[T], v[O], 0.4999), C = zt(v[_ + 1], v[T + 1], v[O + 1], 0.4999), k = zt(v[_], v[T], v[O], 0.5), S = zt(v[_ + 1], v[T + 1], v[O + 1], 0.5);
    }
    u = k - E, l = S - C;
  }
  if (e.midtgtArrowAngle = _s(u, l), e.midDispX = u, e.midDispY = l, u *= -1, l *= -1, i) {
    var v = e.allpts;
    if (v.length / 2 % 2 !== 0) {
      if (!e.isRound) {
        var b = v.length / 2 - 1, D = b + 2;
        u = -(v[D] - v[b]), l = -(v[D + 1] - v[b + 1]);
      }
    }
  }
  if (e.midsrcArrowAngle = _s(u, l), i)
    u = f - e.segpts[e.segpts.length - 2], l = h - e.segpts[e.segpts.length - 1];
  else if (a || o || s || n) {
    var v = e.allpts, A = v.length, p = zt(v[A - 6], v[A - 4], v[A - 2], 0.9), g = zt(v[A - 5], v[A - 3], v[A - 1], 0.9);
    u = f - p, l = h - g;
  } else
    u = f - y, l = h - m;
  e.tgtArrowAngle = _s(u, l);
};
gl.getArrowWidth = gl.getArrowHeight = function(t, e) {
  var r = this.arrowWidthCache = this.arrowWidthCache || {}, n = r[t + ", " + e];
  return n || (n = Math.max(Math.pow(t * 13.37, 0.9), 29) * e, r[t + ", " + e] = n, n);
};
var Rp, Lp, tn = {}, Ir = {}, B0, $0, wa, Ys, yn, ha, ya, en, ai, Fs, ck, dk, Fp, Mp, q0, z0 = function(e, r, n) {
  n.x = r.x - e.x, n.y = r.y - e.y, n.len = Math.sqrt(n.x * n.x + n.y * n.y), n.nx = n.x / n.len, n.ny = n.y / n.len, n.ang = Math.atan2(n.ny, n.nx);
}, F8 = function(e, r) {
  r.x = e.x * -1, r.y = e.y * -1, r.nx = e.nx * -1, r.ny = e.ny * -1, r.ang = e.ang > 0 ? -(Math.PI - e.ang) : Math.PI + e.ang;
}, M8 = function(e, r, n, a, i) {
  if (e !== q0 ? z0(r, e, tn) : F8(Ir, tn), z0(r, n, Ir), B0 = tn.nx * Ir.ny - tn.ny * Ir.nx, $0 = tn.nx * Ir.nx - tn.ny * -Ir.ny, yn = Math.asin(Math.max(-1, Math.min(1, B0))), Math.abs(yn) < 1e-6) {
    Rp = r.x, Lp = r.y, ya = ai = 0;
    return;
  }
  wa = 1, Ys = !1, $0 < 0 ? yn < 0 ? yn = Math.PI + yn : (yn = Math.PI - yn, wa = -1, Ys = !0) : yn > 0 && (wa = -1, Ys = !0), r.radius !== void 0 ? ai = r.radius : ai = a, ha = yn / 2, Fs = Math.min(tn.len / 2, Ir.len / 2), i ? (en = Math.abs(Math.cos(ha) * ai / Math.sin(ha)), en > Fs ? (en = Fs, ya = Math.abs(en * Math.sin(ha) / Math.cos(ha))) : ya = ai) : (en = Math.min(Fs, ai), ya = Math.abs(en * Math.sin(ha) / Math.cos(ha))), Fp = r.x + Ir.nx * en, Mp = r.y + Ir.ny * en, Rp = Fp - Ir.ny * ya * wa, Lp = Mp + Ir.nx * ya * wa, ck = r.x + tn.nx * en, dk = r.y + tn.ny * en, q0 = r;
};
function fk(t, e) {
  e.radius === 0 ? t.lineTo(e.cx, e.cy) : t.arc(e.cx, e.cy, e.radius, e.startAngle, e.endAngle, e.counterClockwise);
}
function Ug(t, e, r, n) {
  var a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0;
  return n === 0 || e.radius === 0 ? {
    cx: e.x,
    cy: e.y,
    radius: 0,
    startX: e.x,
    startY: e.y,
    stopX: e.x,
    stopY: e.y,
    startAngle: void 0,
    endAngle: void 0,
    counterClockwise: void 0
  } : (M8(t, e, r, n, a), {
    cx: Rp,
    cy: Lp,
    radius: ya,
    startX: ck,
    startY: dk,
    stopX: Fp,
    stopY: Mp,
    startAngle: tn.ang + Math.PI / 2 * wa,
    endAngle: Ir.ang - Math.PI / 2 * wa,
    counterClockwise: Ys
  });
}
var lr = {};
lr.findMidptPtsEtc = function(t, e) {
  var r = e.posPts, n = e.intersectionPts, a = e.vectorNormInverse, i, o = t.pstyle("source-endpoint"), s = t.pstyle("target-endpoint"), u = o.units != null && s.units != null, l = function(x, E, C, k) {
    var S = k - E, _ = C - x, T = Math.sqrt(_ * _ + S * S);
    return {
      x: -S / T,
      y: _ / T
    };
  }, c = t.pstyle("edge-distances").value;
  switch (c) {
    case "node-position":
      i = r;
      break;
    case "intersection":
      i = n;
      break;
    case "endpoints": {
      if (u) {
        var d = this.manualEndptToPx(t.source()[0], o), f = Vr(d, 2), h = f[0], v = f[1], p = this.manualEndptToPx(t.target()[0], s), g = Vr(p, 2), y = g[0], m = g[1], b = {
          x1: h,
          y1: v,
          x2: y,
          y2: m
        };
        a = l(h, v, y, m), i = b;
      } else
        tt("Edge ".concat(t.id(), " has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint.  Falling back on edge-distances:intersection (default).")), i = n;
      break;
    }
  }
  return {
    midptPts: i,
    vectorNormInverse: a
  };
};
lr.findHaystackPoints = function(t) {
  for (var e = 0; e < t.length; e++) {
    var r = t[e], n = r._private, a = n.rscratch;
    if (!a.haystack) {
      var i = Math.random() * 2 * Math.PI;
      a.source = {
        x: Math.cos(i),
        y: Math.sin(i)
      }, i = Math.random() * 2 * Math.PI, a.target = {
        x: Math.cos(i),
        y: Math.sin(i)
      };
    }
    var o = n.source, s = n.target, u = o.position(), l = s.position(), c = o.width(), d = s.width(), f = o.height(), h = s.height(), v = r.pstyle("haystack-radius").value, p = v / 2;
    a.haystackPts = a.allpts = [a.source.x * c * p + u.x, a.source.y * f * p + u.y, a.target.x * d * p + l.x, a.target.y * h * p + l.y], a.midX = (a.allpts[0] + a.allpts[2]) / 2, a.midY = (a.allpts[1] + a.allpts[3]) / 2, a.edgeType = "haystack", a.haystack = !0, this.storeEdgeProjections(r), this.calculateArrowAngles(r), this.recalculateEdgeLabelProjections(r), this.calculateLabelAngles(r);
  }
};
lr.findSegmentsPoints = function(t, e) {
  var r = t._private.rscratch, n = t.pstyle("segment-weights"), a = t.pstyle("segment-distances"), i = t.pstyle("segment-radii"), o = t.pstyle("radius-type"), s = Math.min(n.pfValue.length, a.pfValue.length), u = i.pfValue[i.pfValue.length - 1], l = o.pfValue[o.pfValue.length - 1];
  r.edgeType = "segments", r.segpts = [], r.radii = [], r.isArcRadius = [];
  for (var c = 0; c < s; c++) {
    var d = n.pfValue[c], f = a.pfValue[c], h = 1 - d, v = d, p = this.findMidptPtsEtc(t, e), g = p.midptPts, y = p.vectorNormInverse, m = {
      x: g.x1 * h + g.x2 * v,
      y: g.y1 * h + g.y2 * v
    };
    r.segpts.push(m.x + y.x * f, m.y + y.y * f), r.radii.push(i.pfValue[c] !== void 0 ? i.pfValue[c] : u), r.isArcRadius.push((o.pfValue[c] !== void 0 ? o.pfValue[c] : l) === "arc-radius");
  }
};
lr.findLoopPoints = function(t, e, r, n) {
  var a = t._private.rscratch, i = e.dirCounts, o = e.srcPos, s = t.pstyle("control-point-distances"), u = s ? s.pfValue[0] : void 0, l = t.pstyle("loop-direction").pfValue, c = t.pstyle("loop-sweep").pfValue, d = t.pstyle("control-point-step-size").pfValue;
  a.edgeType = "self";
  var f = r, h = d;
  n && (f = 0, h = u);
  var v = l - Math.PI / 2, p = v - c / 2, g = v + c / 2, y = l + "_" + c;
  f = i[y] === void 0 ? i[y] = 0 : ++i[y], a.ctrlpts = [o.x + Math.cos(p) * 1.4 * h * (f / 3 + 1), o.y + Math.sin(p) * 1.4 * h * (f / 3 + 1), o.x + Math.cos(g) * 1.4 * h * (f / 3 + 1), o.y + Math.sin(g) * 1.4 * h * (f / 3 + 1)];
};
lr.findCompoundLoopPoints = function(t, e, r, n) {
  var a = t._private.rscratch;
  a.edgeType = "compound";
  var i = e.srcPos, o = e.tgtPos, s = e.srcW, u = e.srcH, l = e.tgtW, c = e.tgtH, d = t.pstyle("control-point-step-size").pfValue, f = t.pstyle("control-point-distances"), h = f ? f.pfValue[0] : void 0, v = r, p = d;
  n && (v = 0, p = h);
  var g = 50, y = {
    x: i.x - s / 2,
    y: i.y - u / 2
  }, m = {
    x: o.x - l / 2,
    y: o.y - c / 2
  }, b = {
    x: Math.min(y.x, m.x),
    y: Math.min(y.y, m.y)
  }, w = 0.5, x = Math.max(w, Math.log(s * 0.01)), E = Math.max(w, Math.log(l * 0.01));
  a.ctrlpts = [b.x, b.y - (1 + Math.pow(g, 1.12) / 100) * p * (v / 3 + 1) * x, b.x - (1 + Math.pow(g, 1.12) / 100) * p * (v / 3 + 1) * E, b.y];
};
lr.findStraightEdgePoints = function(t) {
  t._private.rscratch.edgeType = "straight";
};
lr.findBezierPoints = function(t, e, r, n, a) {
  var i = t._private.rscratch, o = t.pstyle("control-point-step-size").pfValue, s = t.pstyle("control-point-distances"), u = t.pstyle("control-point-weights"), l = s && u ? Math.min(s.value.length, u.value.length) : 1, c = s ? s.pfValue[0] : void 0, d = u.value[0], f = n;
  i.edgeType = f ? "multibezier" : "bezier", i.ctrlpts = [];
  for (var h = 0; h < l; h++) {
    var v = (0.5 - e.eles.length / 2 + r) * o * (a ? -1 : 1), p = void 0, g = gS(v);
    f && (c = s ? s.pfValue[h] : o, d = u.value[h]), n ? p = c : p = c !== void 0 ? g * c : void 0;
    var y = p !== void 0 ? p : v, m = 1 - d, b = d, w = this.findMidptPtsEtc(t, e), x = w.midptPts, E = w.vectorNormInverse, C = {
      x: x.x1 * m + x.x2 * b,
      y: x.y1 * m + x.y2 * b
    };
    i.ctrlpts.push(C.x + E.x * y, C.y + E.y * y);
  }
};
lr.findTaxiPoints = function(t, e) {
  var r = t._private.rscratch;
  r.edgeType = "segments";
  var n = "vertical", a = "horizontal", i = "leftward", o = "rightward", s = "downward", u = "upward", l = "auto", c = e.posPts, d = e.srcW, f = e.srcH, h = e.tgtW, v = e.tgtH, p = t.pstyle("edge-distances").value, g = p !== "node-position", y = t.pstyle("taxi-direction").value, m = y, b = t.pstyle("taxi-turn"), w = b.units === "%", x = b.pfValue, E = x < 0, C = t.pstyle("taxi-turn-min-distance").pfValue, k = g ? (d + h) / 2 : 0, S = g ? (f + v) / 2 : 0, _ = c.x2 - c.x1, T = c.y2 - c.y1, O = function(Oe, Pe) {
    return Oe > 0 ? Math.max(Oe - Pe, 0) : Math.min(Oe + Pe, 0);
  }, D = O(_, k), A = O(T, S), F = !1;
  m === l ? y = Math.abs(D) > Math.abs(A) ? a : n : m === u || m === s ? (y = n, F = !0) : (m === i || m === o) && (y = a, F = !0);
  var R = y === n, M = R ? A : D, L = R ? T : _, V = gS(L), Y = !1;
  !(F && (w || E)) && (m === s && L < 0 || m === u && L > 0 || m === i && L > 0 || m === o && L < 0) && (V *= -1, M = V * Math.abs(M), Y = !0);
  var H;
  if (w) {
    var K = x < 0 ? 1 + x : x;
    H = K * M;
  } else {
    var ne = x < 0 ? M : 0;
    H = ne + x * V;
  }
  var B = function(Oe) {
    return Math.abs(Oe) < C || Math.abs(Oe) >= Math.abs(M);
  }, $ = B(H), z = B(Math.abs(M) - Math.abs(H)), W = $ || z;
  if (W && !Y)
    if (R) {
      var Z = Math.abs(L) <= f / 2, N = Math.abs(_) <= h / 2;
      if (Z) {
        var X = (c.x1 + c.x2) / 2, Q = c.y1, ge = c.y2;
        r.segpts = [X, Q, X, ge];
      } else if (N) {
        var we = (c.y1 + c.y2) / 2, fe = c.x1, ce = c.x2;
        r.segpts = [fe, we, ce, we];
      } else
        r.segpts = [c.x1, c.y2];
    } else {
      var be = Math.abs(L) <= d / 2, ve = Math.abs(T) <= v / 2;
      if (be) {
        var xe = (c.y1 + c.y2) / 2, _e = c.x1, He = c.x2;
        r.segpts = [_e, xe, He, xe];
      } else if (ve) {
        var Ve = (c.x1 + c.x2) / 2, De = c.y1, Ne = c.y2;
        r.segpts = [Ve, De, Ve, Ne];
      } else
        r.segpts = [c.x2, c.y1];
    }
  else if (R) {
    var ue = c.y1 + H + (g ? f / 2 * V : 0), I = c.x1, G = c.x2;
    r.segpts = [I, ue, G, ue];
  } else {
    var se = c.x1 + H + (g ? d / 2 * V : 0), ee = c.y1, te = c.y2;
    r.segpts = [se, ee, se, te];
  }
  if (r.isRound) {
    var ye = t.pstyle("taxi-radius").value, oe = t.pstyle("radius-type").value[0] === "arc-radius";
    r.radii = new Array(r.segpts.length / 2).fill(ye), r.isArcRadius = new Array(r.segpts.length / 2).fill(oe);
  }
};
lr.tryToCorrectInvalidPoints = function(t, e) {
  var r = t._private.rscratch;
  if (r.edgeType === "bezier") {
    var n = e.srcPos, a = e.tgtPos, i = e.srcW, o = e.srcH, s = e.tgtW, u = e.tgtH, l = e.srcShape, c = e.tgtShape, d = e.srcCornerRadius, f = e.tgtCornerRadius, h = e.srcRs, v = e.tgtRs, p = !Ce(r.startX) || !Ce(r.startY), g = !Ce(r.arrowStartX) || !Ce(r.arrowStartY), y = !Ce(r.endX) || !Ce(r.endY), m = !Ce(r.arrowEndX) || !Ce(r.arrowEndY), b = 3, w = this.getArrowWidth(t.pstyle("width").pfValue, t.pstyle("arrow-scale").value) * this.arrowShapeWidth, x = b * w, E = Da({
      x: r.ctrlpts[0],
      y: r.ctrlpts[1]
    }, {
      x: r.startX,
      y: r.startY
    }), C = E < x, k = Da({
      x: r.ctrlpts[0],
      y: r.ctrlpts[1]
    }, {
      x: r.endX,
      y: r.endY
    }), S = k < x, _ = !1;
    if (p || g || C) {
      _ = !0;
      var T = {
        // delta
        x: r.ctrlpts[0] - n.x,
        y: r.ctrlpts[1] - n.y
      }, O = Math.sqrt(T.x * T.x + T.y * T.y), D = {
        // normalised delta
        x: T.x / O,
        y: T.y / O
      }, A = Math.max(i, o), F = {
        // *2 radius guarantees outside shape
        x: r.ctrlpts[0] + D.x * 2 * A,
        y: r.ctrlpts[1] + D.y * 2 * A
      }, R = l.intersectLine(n.x, n.y, i, o, F.x, F.y, 0, d, h);
      C ? (r.ctrlpts[0] = r.ctrlpts[0] + D.x * (x - E), r.ctrlpts[1] = r.ctrlpts[1] + D.y * (x - E)) : (r.ctrlpts[0] = R[0] + D.x * x, r.ctrlpts[1] = R[1] + D.y * x);
    }
    if (y || m || S) {
      _ = !0;
      var M = {
        // delta
        x: r.ctrlpts[0] - a.x,
        y: r.ctrlpts[1] - a.y
      }, L = Math.sqrt(M.x * M.x + M.y * M.y), V = {
        // normalised delta
        x: M.x / L,
        y: M.y / L
      }, Y = Math.max(i, o), H = {
        // *2 radius guarantees outside shape
        x: r.ctrlpts[0] + V.x * 2 * Y,
        y: r.ctrlpts[1] + V.y * 2 * Y
      }, K = c.intersectLine(a.x, a.y, s, u, H.x, H.y, 0, f, v);
      S ? (r.ctrlpts[0] = r.ctrlpts[0] + V.x * (x - k), r.ctrlpts[1] = r.ctrlpts[1] + V.y * (x - k)) : (r.ctrlpts[0] = K[0] + V.x * x, r.ctrlpts[1] = K[1] + V.y * x);
    }
    _ && this.findEndpoints(t);
  }
};
lr.storeAllpts = function(t) {
  var e = t._private.rscratch;
  if (e.edgeType === "multibezier" || e.edgeType === "bezier" || e.edgeType === "self" || e.edgeType === "compound") {
    e.allpts = [], e.allpts.push(e.startX, e.startY);
    for (var r = 0; r + 1 < e.ctrlpts.length; r += 2)
      e.allpts.push(e.ctrlpts[r], e.ctrlpts[r + 1]), r + 3 < e.ctrlpts.length && e.allpts.push((e.ctrlpts[r] + e.ctrlpts[r + 2]) / 2, (e.ctrlpts[r + 1] + e.ctrlpts[r + 3]) / 2);
    e.allpts.push(e.endX, e.endY);
    var n, a;
    e.ctrlpts.length / 2 % 2 === 0 ? (n = e.allpts.length / 2 - 1, e.midX = e.allpts[n], e.midY = e.allpts[n + 1]) : (n = e.allpts.length / 2 - 3, a = 0.5, e.midX = zt(e.allpts[n], e.allpts[n + 2], e.allpts[n + 4], a), e.midY = zt(e.allpts[n + 1], e.allpts[n + 3], e.allpts[n + 5], a));
  } else if (e.edgeType === "straight")
    e.allpts = [e.startX, e.startY, e.endX, e.endY], e.midX = (e.startX + e.endX + e.arrowStartX + e.arrowEndX) / 4, e.midY = (e.startY + e.endY + e.arrowStartY + e.arrowEndY) / 4;
  else if (e.edgeType === "segments") {
    if (e.allpts = [], e.allpts.push(e.startX, e.startY), e.allpts.push.apply(e.allpts, e.segpts), e.allpts.push(e.endX, e.endY), e.isRound) {
      e.roundCorners = [];
      for (var i = 2; i + 3 < e.allpts.length; i += 2) {
        var o = e.radii[i / 2 - 1], s = e.isArcRadius[i / 2 - 1];
        e.roundCorners.push(Ug({
          x: e.allpts[i - 2],
          y: e.allpts[i - 1]
        }, {
          x: e.allpts[i],
          y: e.allpts[i + 1],
          radius: o
        }, {
          x: e.allpts[i + 2],
          y: e.allpts[i + 3]
        }, o, s));
      }
    }
    if (e.segpts.length % 4 === 0) {
      var u = e.segpts.length / 2, l = u - 2;
      e.midX = (e.segpts[l] + e.segpts[u]) / 2, e.midY = (e.segpts[l + 1] + e.segpts[u + 1]) / 2;
    } else {
      var c = e.segpts.length / 2 - 1;
      if (!e.isRound)
        e.midX = e.segpts[c], e.midY = e.segpts[c + 1];
      else {
        var d = {
          x: e.segpts[c],
          y: e.segpts[c + 1]
        }, f = e.roundCorners[c / 2], h = [d.x - f.cx, d.y - f.cy], v = f.radius / Math.sqrt(Math.pow(h[0], 2) + Math.pow(h[1], 2));
        h = h.map(function(p) {
          return p * v;
        }), e.midX = f.cx + h[0], e.midY = f.cy + h[1], e.midVector = h;
      }
    }
  }
};
lr.checkForInvalidEdgeWarning = function(t) {
  var e = t[0]._private.rscratch;
  e.nodesOverlap || Ce(e.startX) && Ce(e.startY) && Ce(e.endX) && Ce(e.endY) ? e.loggedErr = !1 : e.loggedErr || (e.loggedErr = !0, tt("Edge `" + t.id() + "` has invalid endpoints and so it is impossible to draw.  Adjust your edge style (e.g. control points) accordingly or use an alternative edge type.  This is expected behaviour when the source node and the target node overlap."));
};
lr.findEdgeControlPoints = function(t) {
  var e = this;
  if (!(!t || t.length === 0)) {
    for (var r = this, n = r.cy, a = n.hasCompoundNodes(), i = {
      map: new nn(),
      get: function(C) {
        var k = this.map.get(C[0]);
        return k != null ? k.get(C[1]) : null;
      },
      set: function(C, k) {
        var S = this.map.get(C[0]);
        S == null && (S = new nn(), this.map.set(C[0], S)), S.set(C[1], k);
      }
    }, o = [], s = [], u = 0; u < t.length; u++) {
      var l = t[u], c = l._private, d = l.pstyle("curve-style").value;
      if (!(l.removed() || !l.takesUpSpace())) {
        if (d === "haystack") {
          s.push(l);
          continue;
        }
        var f = d === "unbundled-bezier" || d.endsWith("segments") || d === "straight" || d === "straight-triangle" || d.endsWith("taxi"), h = d === "unbundled-bezier" || d === "bezier", v = c.source, p = c.target, g = v.poolIndex(), y = p.poolIndex(), m = [g, y].sort(), b = i.get(m);
        b == null && (b = {
          eles: []
        }, i.set(m, b), o.push(m)), b.eles.push(l), f && (b.hasUnbundled = !0), h && (b.hasBezier = !0);
      }
    }
    for (var w = function(C) {
      var k = o[C], S = i.get(k), _ = void 0;
      if (!S.hasUnbundled) {
        var T = S.eles[0].parallelEdges().filter(function(se) {
          return se.isBundledBezier();
        });
        Pg(S.eles), T.forEach(function(se) {
          return S.eles.push(se);
        }), S.eles.sort(function(se, ee) {
          return se.poolIndex() - ee.poolIndex();
        });
      }
      var O = S.eles[0], D = O.source(), A = O.target();
      if (D.poolIndex() > A.poolIndex()) {
        var F = D;
        D = A, A = F;
      }
      var R = S.srcPos = D.position(), M = S.tgtPos = A.position(), L = S.srcW = D.outerWidth(), V = S.srcH = D.outerHeight(), Y = S.tgtW = A.outerWidth(), H = S.tgtH = A.outerHeight(), K = S.srcShape = r.nodeShapes[e.getNodeShape(D)], ne = S.tgtShape = r.nodeShapes[e.getNodeShape(A)], B = S.srcCornerRadius = D.pstyle("corner-radius").value === "auto" ? "auto" : D.pstyle("corner-radius").pfValue, $ = S.tgtCornerRadius = A.pstyle("corner-radius").value === "auto" ? "auto" : A.pstyle("corner-radius").pfValue, z = S.tgtRs = A._private.rscratch, W = S.srcRs = D._private.rscratch;
      S.dirCounts = {
        north: 0,
        west: 0,
        south: 0,
        east: 0,
        northwest: 0,
        southwest: 0,
        northeast: 0,
        southeast: 0
      };
      for (var Z = 0; Z < S.eles.length; Z++) {
        var N = S.eles[Z], X = N[0]._private.rscratch, Q = N.pstyle("curve-style").value, ge = Q === "unbundled-bezier" || Q.endsWith("segments") || Q.endsWith("taxi"), we = !D.same(N.source());
        if (!S.calculatedIntersection && D !== A && (S.hasBezier || S.hasUnbundled)) {
          S.calculatedIntersection = !0;
          var fe = K.intersectLine(R.x, R.y, L, V, M.x, M.y, 0, B, W), ce = S.srcIntn = fe, be = ne.intersectLine(M.x, M.y, Y, H, R.x, R.y, 0, $, z), ve = S.tgtIntn = be, xe = S.intersectionPts = {
            x1: fe[0],
            x2: be[0],
            y1: fe[1],
            y2: be[1]
          }, _e = S.posPts = {
            x1: R.x,
            x2: M.x,
            y1: R.y,
            y2: M.y
          }, He = be[1] - fe[1], Ve = be[0] - fe[0], De = Math.sqrt(Ve * Ve + He * He), Ne = S.vector = {
            x: Ve,
            y: He
          }, ue = S.vectorNorm = {
            x: Ne.x / De,
            y: Ne.y / De
          }, I = {
            x: -ue.y,
            y: ue.x
          };
          S.nodesOverlap = !Ce(De) || ne.checkPoint(fe[0], fe[1], 0, Y, H, M.x, M.y, $, z) || K.checkPoint(be[0], be[1], 0, L, V, R.x, R.y, B, W), S.vectorNormInverse = I, _ = {
            nodesOverlap: S.nodesOverlap,
            dirCounts: S.dirCounts,
            calculatedIntersection: !0,
            hasBezier: S.hasBezier,
            hasUnbundled: S.hasUnbundled,
            eles: S.eles,
            srcPos: M,
            tgtPos: R,
            srcW: Y,
            srcH: H,
            tgtW: L,
            tgtH: V,
            srcIntn: ve,
            tgtIntn: ce,
            srcShape: ne,
            tgtShape: K,
            posPts: {
              x1: _e.x2,
              y1: _e.y2,
              x2: _e.x1,
              y2: _e.y1
            },
            intersectionPts: {
              x1: xe.x2,
              y1: xe.y2,
              x2: xe.x1,
              y2: xe.y1
            },
            vector: {
              x: -Ne.x,
              y: -Ne.y
            },
            vectorNorm: {
              x: -ue.x,
              y: -ue.y
            },
            vectorNormInverse: {
              x: -I.x,
              y: -I.y
            }
          };
        }
        var G = we ? _ : S;
        X.nodesOverlap = G.nodesOverlap, X.srcIntn = G.srcIntn, X.tgtIntn = G.tgtIntn, X.isRound = Q.startsWith("round"), a && (D.isParent() || D.isChild() || A.isParent() || A.isChild()) && (D.parents().anySame(A) || A.parents().anySame(D) || D.same(A) && D.isParent()) ? e.findCompoundLoopPoints(N, G, Z, ge) : D === A ? e.findLoopPoints(N, G, Z, ge) : Q.endsWith("segments") ? e.findSegmentsPoints(N, G) : Q.endsWith("taxi") ? e.findTaxiPoints(N, G) : Q === "straight" || !ge && S.eles.length % 2 === 1 && Z === Math.floor(S.eles.length / 2) ? e.findStraightEdgePoints(N) : e.findBezierPoints(N, G, Z, ge, we), e.findEndpoints(N), e.tryToCorrectInvalidPoints(N, G), e.checkForInvalidEdgeWarning(N), e.storeAllpts(N), e.storeEdgeProjections(N), e.calculateArrowAngles(N), e.recalculateEdgeLabelProjections(N), e.calculateLabelAngles(N);
      }
    }, x = 0; x < o.length; x++)
      w(x);
    this.findHaystackPoints(s);
  }
};
function vk(t) {
  var e = [];
  if (t != null) {
    for (var r = 0; r < t.length; r += 2) {
      var n = t[r], a = t[r + 1];
      e.push({
        x: n,
        y: a
      });
    }
    return e;
  }
}
lr.getSegmentPoints = function(t) {
  var e = t[0]._private.rscratch, r = e.edgeType;
  if (r === "segments")
    return this.recalculateRenderedStyle(t), vk(e.segpts);
};
lr.getControlPoints = function(t) {
  var e = t[0]._private.rscratch, r = e.edgeType;
  if (r === "bezier" || r === "multibezier" || r === "self" || r === "compound")
    return this.recalculateRenderedStyle(t), vk(e.ctrlpts);
};
lr.getEdgeMidpoint = function(t) {
  var e = t[0]._private.rscratch;
  return this.recalculateRenderedStyle(t), {
    x: e.midX,
    y: e.midY
  };
};
var ss = {};
ss.manualEndptToPx = function(t, e) {
  var r = this, n = t.position(), a = t.outerWidth(), i = t.outerHeight(), o = t._private.rscratch;
  if (e.value.length === 2) {
    var s = [e.pfValue[0], e.pfValue[1]];
    return e.units[0] === "%" && (s[0] = s[0] * a), e.units[1] === "%" && (s[1] = s[1] * i), s[0] += n.x, s[1] += n.y, s;
  } else {
    var u = e.pfValue[0];
    u = -Math.PI / 2 + u;
    var l = 2 * Math.max(a, i), c = [n.x + Math.cos(u) * l, n.y + Math.sin(u) * l];
    return r.nodeShapes[this.getNodeShape(t)].intersectLine(n.x, n.y, a, i, c[0], c[1], 0, t.pstyle("corner-radius").value === "auto" ? "auto" : t.pstyle("corner-radius").pfValue, o);
  }
};
ss.findEndpoints = function(t) {
  var e = this, r, n = t.source()[0], a = t.target()[0], i = n.position(), o = a.position(), s = t.pstyle("target-arrow-shape").value, u = t.pstyle("source-arrow-shape").value, l = t.pstyle("target-distance-from-node").pfValue, c = t.pstyle("source-distance-from-node").pfValue, d = n._private.rscratch, f = a._private.rscratch, h = t.pstyle("curve-style").value, v = t._private.rscratch, p = v.edgeType, g = h === "taxi", y = p === "self" || p === "compound", m = p === "bezier" || p === "multibezier" || y, b = p !== "bezier", w = p === "straight" || p === "segments", x = p === "segments", E = m || b || w, C = y || g, k = t.pstyle("source-endpoint"), S = C ? "outside-to-node" : k.value, _ = n.pstyle("corner-radius").value === "auto" ? "auto" : n.pstyle("corner-radius").pfValue, T = t.pstyle("target-endpoint"), O = C ? "outside-to-node" : T.value, D = a.pstyle("corner-radius").value === "auto" ? "auto" : a.pstyle("corner-radius").pfValue;
  v.srcManEndpt = k, v.tgtManEndpt = T;
  var A, F, R, M;
  if (m) {
    var L = [v.ctrlpts[0], v.ctrlpts[1]], V = b ? [v.ctrlpts[v.ctrlpts.length - 2], v.ctrlpts[v.ctrlpts.length - 1]] : L;
    A = V, F = L;
  } else if (w) {
    var Y = x ? v.segpts.slice(0, 2) : [o.x, o.y], H = x ? v.segpts.slice(v.segpts.length - 2) : [i.x, i.y];
    A = H, F = Y;
  }
  if (O === "inside-to-node")
    r = [o.x, o.y];
  else if (T.units)
    r = this.manualEndptToPx(a, T);
  else if (O === "outside-to-line")
    r = v.tgtIntn;
  else if (O === "outside-to-node" || O === "outside-to-node-or-label" ? R = A : (O === "outside-to-line" || O === "outside-to-line-or-label") && (R = [i.x, i.y]), r = e.nodeShapes[this.getNodeShape(a)].intersectLine(o.x, o.y, a.outerWidth(), a.outerHeight(), R[0], R[1], 0, D, f), O === "outside-to-node-or-label" || O === "outside-to-line-or-label") {
    var K = a._private.rscratch, ne = K.labelWidth, B = K.labelHeight, $ = K.labelX, z = K.labelY, W = ne / 2, Z = B / 2, N = a.pstyle("text-valign").value;
    N === "top" ? z -= Z : N === "bottom" && (z += Z);
    var X = a.pstyle("text-halign").value;
    X === "left" ? $ -= W : X === "right" && ($ += W);
    var Q = Mo(R[0], R[1], [$ - W, z - Z, $ + W, z - Z, $ + W, z + Z, $ - W, z + Z], o.x, o.y);
    if (Q.length > 0) {
      var ge = i, we = pa(ge, ui(r)), fe = pa(ge, ui(Q)), ce = we;
      if (fe < we && (r = Q, ce = fe), Q.length > 2) {
        var be = pa(ge, {
          x: Q[2],
          y: Q[3]
        });
        be < ce && (r = [Q[2], Q[3]]);
      }
    }
  }
  var ve = Ts(r, A, e.arrowShapes[s].spacing(t) + l), xe = Ts(r, A, e.arrowShapes[s].gap(t) + l);
  if (v.endX = xe[0], v.endY = xe[1], v.arrowEndX = ve[0], v.arrowEndY = ve[1], S === "inside-to-node")
    r = [i.x, i.y];
  else if (k.units)
    r = this.manualEndptToPx(n, k);
  else if (S === "outside-to-line")
    r = v.srcIntn;
  else if (S === "outside-to-node" || S === "outside-to-node-or-label" ? M = F : (S === "outside-to-line" || S === "outside-to-line-or-label") && (M = [o.x, o.y]), r = e.nodeShapes[this.getNodeShape(n)].intersectLine(i.x, i.y, n.outerWidth(), n.outerHeight(), M[0], M[1], 0, _, d), S === "outside-to-node-or-label" || S === "outside-to-line-or-label") {
    var _e = n._private.rscratch, He = _e.labelWidth, Ve = _e.labelHeight, De = _e.labelX, Ne = _e.labelY, ue = He / 2, I = Ve / 2, G = n.pstyle("text-valign").value;
    G === "top" ? Ne -= I : G === "bottom" && (Ne += I);
    var se = n.pstyle("text-halign").value;
    se === "left" ? De -= ue : se === "right" && (De += ue);
    var ee = Mo(M[0], M[1], [De - ue, Ne - I, De + ue, Ne - I, De + ue, Ne + I, De - ue, Ne + I], i.x, i.y);
    if (ee.length > 0) {
      var te = o, ye = pa(te, ui(r)), oe = pa(te, ui(ee)), he = ye;
      if (oe < ye && (r = [ee[0], ee[1]], he = oe), ee.length > 2) {
        var Oe = pa(te, {
          x: ee[2],
          y: ee[3]
        });
        Oe < he && (r = [ee[2], ee[3]]);
      }
    }
  }
  var Pe = Ts(r, F, e.arrowShapes[u].spacing(t) + c), Ae = Ts(r, F, e.arrowShapes[u].gap(t) + c);
  v.startX = Ae[0], v.startY = Ae[1], v.arrowStartX = Pe[0], v.arrowStartY = Pe[1], E && (!Ce(v.startX) || !Ce(v.startY) || !Ce(v.endX) || !Ce(v.endY) ? v.badLine = !0 : v.badLine = !1);
};
ss.getSourceEndpoint = function(t) {
  var e = t[0]._private.rscratch;
  switch (this.recalculateRenderedStyle(t), e.edgeType) {
    case "haystack":
      return {
        x: e.haystackPts[0],
        y: e.haystackPts[1]
      };
    default:
      return {
        x: e.arrowStartX,
        y: e.arrowStartY
      };
  }
};
ss.getTargetEndpoint = function(t) {
  var e = t[0]._private.rscratch;
  switch (this.recalculateRenderedStyle(t), e.edgeType) {
    case "haystack":
      return {
        x: e.haystackPts[2],
        y: e.haystackPts[3]
      };
    default:
      return {
        x: e.arrowEndX,
        y: e.arrowEndY
      };
  }
};
var Wg = {};
function N8(t, e, r) {
  for (var n = function(l, c, d, f) {
    return zt(l, c, d, f);
  }, a = e._private, i = a.rstyle.bezierPts, o = 0; o < t.bezierProjPcts.length; o++) {
    var s = t.bezierProjPcts[o];
    i.push({
      x: n(r[0], r[2], r[4], s),
      y: n(r[1], r[3], r[5], s)
    });
  }
}
Wg.storeEdgeProjections = function(t) {
  var e = t._private, r = e.rscratch, n = r.edgeType;
  if (e.rstyle.bezierPts = null, e.rstyle.linePts = null, e.rstyle.haystackPts = null, n === "multibezier" || n === "bezier" || n === "self" || n === "compound") {
    e.rstyle.bezierPts = [];
    for (var a = 0; a + 5 < r.allpts.length; a += 4)
      N8(this, t, r.allpts.slice(a, a + 6));
  } else if (n === "segments")
    for (var i = e.rstyle.linePts = [], a = 0; a + 1 < r.allpts.length; a += 2)
      i.push({
        x: r.allpts[a],
        y: r.allpts[a + 1]
      });
  else if (n === "haystack") {
    var o = r.haystackPts;
    e.rstyle.haystackPts = [{
      x: o[0],
      y: o[1]
    }, {
      x: o[2],
      y: o[3]
    }];
  }
  e.rstyle.arrowWidth = this.getArrowWidth(t.pstyle("width").pfValue, t.pstyle("arrow-scale").value) * this.arrowShapeWidth;
};
Wg.recalculateEdgeProjections = function(t) {
  this.findEdgeControlPoints(t);
};
var fn = {};
fn.recalculateNodeLabelProjection = function(t) {
  var e = t.pstyle("label").strValue;
  if (!ea(e)) {
    var r, n, a = t._private, i = t.width(), o = t.height(), s = t.padding(), u = t.position(), l = t.pstyle("text-halign").strValue, c = t.pstyle("text-valign").strValue, d = a.rscratch, f = a.rstyle;
    switch (l) {
      case "left":
        r = u.x - i / 2 - s;
        break;
      case "right":
        r = u.x + i / 2 + s;
        break;
      default:
        r = u.x;
    }
    switch (c) {
      case "top":
        n = u.y - o / 2 - s;
        break;
      case "bottom":
        n = u.y + o / 2 + s;
        break;
      default:
        n = u.y;
    }
    d.labelX = r, d.labelY = n, f.labelX = r, f.labelY = n, this.calculateLabelAngles(t), this.applyLabelDimensions(t);
  }
};
var hk = function(e, r) {
  var n = Math.atan(r / e);
  return e === 0 && n < 0 && (n = n * -1), n;
}, pk = function(e, r) {
  var n = r.x - e.x, a = r.y - e.y;
  return hk(n, a);
}, B8 = function(e, r, n, a) {
  var i = Fo(0, a - 1e-3, 1), o = Fo(0, a + 1e-3, 1), s = vi(e, r, n, i), u = vi(e, r, n, o);
  return pk(s, u);
};
fn.recalculateEdgeLabelProjections = function(t) {
  var e, r = t._private, n = r.rscratch, a = this, i = {
    mid: t.pstyle("label").strValue,
    source: t.pstyle("source-label").strValue,
    target: t.pstyle("target-label").strValue
  };
  if (i.mid || i.source || i.target) {
    e = {
      x: n.midX,
      y: n.midY
    };
    var o = function(d, f, h) {
      Gn(r.rscratch, d, f, h), Gn(r.rstyle, d, f, h);
    };
    o("labelX", null, e.x), o("labelY", null, e.y);
    var s = hk(n.midDispX, n.midDispY);
    o("labelAutoAngle", null, s);
    var u = function c() {
      if (c.cache)
        return c.cache;
      for (var d = [], f = 0; f + 5 < n.allpts.length; f += 4) {
        var h = {
          x: n.allpts[f],
          y: n.allpts[f + 1]
        }, v = {
          x: n.allpts[f + 2],
          y: n.allpts[f + 3]
        }, p = {
          x: n.allpts[f + 4],
          y: n.allpts[f + 5]
        };
        d.push({
          p0: h,
          p1: v,
          p2: p,
          startDist: 0,
          length: 0,
          segments: []
        });
      }
      var g = r.rstyle.bezierPts, y = a.bezierProjPcts.length;
      function m(C, k, S, _, T) {
        var O = Da(k, S), D = C.segments[C.segments.length - 1], A = {
          p0: k,
          p1: S,
          t0: _,
          t1: T,
          startDist: D ? D.startDist + D.length : 0,
          length: O
        };
        C.segments.push(A), C.length += O;
      }
      for (var b = 0; b < d.length; b++) {
        var w = d[b], x = d[b - 1];
        x && (w.startDist = x.startDist + x.length), m(w, w.p0, g[b * y], 0, a.bezierProjPcts[0]);
        for (var E = 0; E < y - 1; E++)
          m(w, g[b * y + E], g[b * y + E + 1], a.bezierProjPcts[E], a.bezierProjPcts[E + 1]);
        m(w, g[b * y + y - 1], w.p2, a.bezierProjPcts[y - 1], 1);
      }
      return c.cache = d;
    }, l = function(d) {
      var f, h = d === "source";
      if (i[d]) {
        var v = t.pstyle(d + "-text-offset").pfValue;
        switch (n.edgeType) {
          case "self":
          case "compound":
          case "bezier":
          case "multibezier": {
            for (var p = u(), g, y = 0, m = 0, b = 0; b < p.length; b++) {
              for (var w = p[h ? b : p.length - 1 - b], x = 0; x < w.segments.length; x++) {
                var E = w.segments[h ? x : w.segments.length - 1 - x], C = b === p.length - 1 && x === w.segments.length - 1;
                if (y = m, m += E.length, m >= v || C) {
                  g = {
                    cp: w,
                    segment: E
                  };
                  break;
                }
              }
              if (g)
                break;
            }
            var k = g.cp, S = g.segment, _ = (v - y) / S.length, T = S.t1 - S.t0, O = h ? S.t0 + T * _ : S.t1 - T * _;
            O = Fo(0, O, 1), e = vi(k.p0, k.p1, k.p2, O), f = B8(k.p0, k.p1, k.p2, O);
            break;
          }
          case "straight":
          case "segments":
          case "haystack": {
            for (var D = 0, A, F, R, M, L = n.allpts.length, V = 0; V + 3 < L && (h ? (R = {
              x: n.allpts[V],
              y: n.allpts[V + 1]
            }, M = {
              x: n.allpts[V + 2],
              y: n.allpts[V + 3]
            }) : (R = {
              x: n.allpts[L - 2 - V],
              y: n.allpts[L - 1 - V]
            }, M = {
              x: n.allpts[L - 4 - V],
              y: n.allpts[L - 3 - V]
            }), A = Da(R, M), F = D, D += A, !(D >= v)); V += 2)
              ;
            var Y = v - F, H = Y / A;
            H = Fo(0, H, 1), e = H$(R, M, H), f = pk(R, M);
            break;
          }
        }
        o("labelX", d, e.x), o("labelY", d, e.y), o("labelAutoAngle", d, f);
      }
    };
    l("source"), l("target"), this.applyLabelDimensions(t);
  }
};
fn.applyLabelDimensions = function(t) {
  this.applyPrefixedLabelDimensions(t), t.isEdge() && (this.applyPrefixedLabelDimensions(t, "source"), this.applyPrefixedLabelDimensions(t, "target"));
};
fn.applyPrefixedLabelDimensions = function(t, e) {
  var r = t._private, n = this.getLabelText(t, e), a = this.calculateLabelDimensions(t, n), i = t.pstyle("line-height").pfValue, o = t.pstyle("text-wrap").strValue, s = Kr(r.rscratch, "labelWrapCachedLines", e) || [], u = o !== "wrap" ? 1 : Math.max(s.length, 1), l = a.height / u, c = l * i, d = a.width, f = a.height + (u - 1) * (i - 1) * l;
  Gn(r.rstyle, "labelWidth", e, d), Gn(r.rscratch, "labelWidth", e, d), Gn(r.rstyle, "labelHeight", e, f), Gn(r.rscratch, "labelHeight", e, f), Gn(r.rscratch, "labelLineHeight", e, c);
};
fn.getLabelText = function(t, e) {
  var r = t._private, n = e ? e + "-" : "", a = t.pstyle(n + "label").strValue, i = t.pstyle("text-transform").value, o = function(ne, B) {
    return B ? (Gn(r.rscratch, ne, e, B), B) : Kr(r.rscratch, ne, e);
  };
  if (!a)
    return "";
  i == "none" || (i == "uppercase" ? a = a.toUpperCase() : i == "lowercase" && (a = a.toLowerCase()));
  var s = t.pstyle("text-wrap").value;
  if (s === "wrap") {
    var u = o("labelKey");
    if (u != null && o("labelWrapKey") === u)
      return o("labelWrapCachedText");
    for (var l = "​", c = a.split(`
`), d = t.pstyle("text-max-width").pfValue, f = t.pstyle("text-overflow-wrap").value, h = f === "anywhere", v = [], p = /[\s\u200b]+|$/g, g = 0; g < c.length; g++) {
      var y = c[g], m = this.calculateLabelDimensions(t, y), b = m.width;
      if (h) {
        var w = y.split("").join(l);
        y = w;
      }
      if (b > d) {
        var x = y.matchAll(p), E = "", C = 0, k = X2(x), S;
        try {
          for (k.s(); !(S = k.n()).done; ) {
            var _ = S.value, T = _[0], O = y.substring(C, _.index);
            C = _.index + T.length;
            var D = E.length === 0 ? O : E + O + T, A = this.calculateLabelDimensions(t, D), F = A.width;
            F <= d ? E += O + T : (E && v.push(E), E = O + T);
          }
        } catch (K) {
          k.e(K);
        } finally {
          k.f();
        }
        E.match(/^[\s\u200b]+$/) || v.push(E);
      } else
        v.push(y);
    }
    o("labelWrapCachedLines", v), a = o("labelWrapCachedText", v.join(`
`)), o("labelWrapKey", u);
  } else if (s === "ellipsis") {
    var R = t.pstyle("text-max-width").pfValue, M = "", L = "…", V = !1;
    if (this.calculateLabelDimensions(t, a).width < R)
      return a;
    for (var Y = 0; Y < a.length; Y++) {
      var H = this.calculateLabelDimensions(t, M + a[Y] + L).width;
      if (H > R)
        break;
      M += a[Y], Y === a.length - 1 && (V = !0);
    }
    return V || (M += L), M;
  }
  return a;
};
fn.getLabelJustification = function(t) {
  var e = t.pstyle("text-justification").strValue, r = t.pstyle("text-halign").strValue;
  if (e === "auto")
    if (t.isNode())
      switch (r) {
        case "left":
          return "right";
        case "right":
          return "left";
        default:
          return "center";
      }
    else
      return "center";
  else
    return e;
};
fn.calculateLabelDimensions = function(t, e) {
  var r = this, n = r.cy.window(), a = n.document, i = Pa(e, t._private.labelDimsKey), o = r.labelDimCache || (r.labelDimCache = []), s = o[i];
  if (s != null)
    return s;
  var u = 0, l = t.pstyle("font-style").strValue, c = t.pstyle("font-size").pfValue, d = t.pstyle("font-family").strValue, f = t.pstyle("font-weight").strValue, h = this.labelCalcCanvas, v = this.labelCalcCanvasContext;
  if (!h) {
    h = this.labelCalcCanvas = a.createElement("canvas"), v = this.labelCalcCanvasContext = h.getContext("2d");
    var p = h.style;
    p.position = "absolute", p.left = "-9999px", p.top = "-9999px", p.zIndex = "-1", p.visibility = "hidden", p.pointerEvents = "none";
  }
  v.font = "".concat(l, " ").concat(f, " ").concat(c, "px ").concat(d);
  for (var g = 0, y = 0, m = e.split(`
`), b = 0; b < m.length; b++) {
    var w = m[b], x = v.measureText(w), E = Math.ceil(x.width), C = c;
    g = Math.max(E, g), y += C;
  }
  return g += u, y += u, o[i] = {
    width: g,
    height: y
  };
};
fn.calculateLabelAngle = function(t, e) {
  var r = t._private, n = r.rscratch, a = t.isEdge(), i = e ? e + "-" : "", o = t.pstyle(i + "text-rotation"), s = o.strValue;
  return s === "none" ? 0 : a && s === "autorotate" ? n.labelAutoAngle : s === "autorotate" ? 0 : o.pfValue;
};
fn.calculateLabelAngles = function(t) {
  var e = this, r = t.isEdge(), n = t._private, a = n.rscratch;
  a.labelAngle = e.calculateLabelAngle(t), r && (a.sourceLabelAngle = e.calculateLabelAngle(t, "source"), a.targetLabelAngle = e.calculateLabelAngle(t, "target"));
};
var gk = {}, V0 = 28, H0 = !1;
gk.getNodeShape = function(t) {
  var e = this, r = t.pstyle("shape").value;
  if (r === "cutrectangle" && (t.width() < V0 || t.height() < V0))
    return H0 || (tt("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"), H0 = !0), "rectangle";
  if (t.isParent())
    return r === "rectangle" || r === "roundrectangle" || r === "round-rectangle" || r === "cutrectangle" || r === "cut-rectangle" || r === "barrel" ? r : "rectangle";
  if (r === "polygon") {
    var n = t.pstyle("shape-polygon-points").value;
    return e.nodeShapes.makePolygon(n).name;
  }
  return r;
};
var Yl = {};
Yl.registerCalculationListeners = function() {
  var t = this.cy, e = t.collection(), r = this, n = function(o) {
    var s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
    if (e.merge(o), s)
      for (var u = 0; u < o.length; u++) {
        var l = o[u], c = l._private, d = c.rstyle;
        d.clean = !1, d.cleanConnected = !1;
      }
  };
  r.binder(t).on("bounds.* dirty.*", function(o) {
    var s = o.target;
    n(s);
  }).on("style.* background.*", function(o) {
    var s = o.target;
    n(s, !1);
  });
  var a = function(o) {
    if (o) {
      var s = r.onUpdateEleCalcsFns;
      e.cleanStyle();
      for (var u = 0; u < e.length; u++) {
        var l = e[u], c = l._private.rstyle;
        l.isNode() && !c.cleanConnected && (n(l.connectedEdges()), c.cleanConnected = !0);
      }
      if (s)
        for (var d = 0; d < s.length; d++) {
          var f = s[d];
          f(o, e);
        }
      r.recalculateRenderedStyle(e), e = t.collection();
    }
  };
  r.flushRenderedStyleQueue = function() {
    a(!0);
  }, r.beforeRender(a, r.beforeRenderPriorities.eleCalcs);
};
Yl.onUpdateEleCalcs = function(t) {
  var e = this.onUpdateEleCalcsFns = this.onUpdateEleCalcsFns || [];
  e.push(t);
};
Yl.recalculateRenderedStyle = function(t, e) {
  var r = function(w) {
    return w._private.rstyle.cleanConnected;
  }, n = [], a = [];
  if (!this.destroyed) {
    e === void 0 && (e = !0);
    for (var i = 0; i < t.length; i++) {
      var o = t[i], s = o._private, u = s.rstyle;
      o.isEdge() && (!r(o.source()) || !r(o.target())) && (u.clean = !1), !(e && u.clean || o.removed()) && o.pstyle("display").value !== "none" && (s.group === "nodes" ? a.push(o) : n.push(o), u.clean = !0);
    }
    for (var l = 0; l < a.length; l++) {
      var c = a[l], d = c._private, f = d.rstyle, h = c.position();
      this.recalculateNodeLabelProjection(c), f.nodeX = h.x, f.nodeY = h.y, f.nodeW = c.pstyle("width").pfValue, f.nodeH = c.pstyle("height").pfValue;
    }
    this.recalculateEdgeProjections(n);
    for (var v = 0; v < n.length; v++) {
      var p = n[v], g = p._private, y = g.rstyle, m = g.rscratch;
      y.srcX = m.arrowStartX, y.srcY = m.arrowStartY, y.tgtX = m.arrowEndX, y.tgtY = m.arrowEndY, y.midX = m.midX, y.midY = m.midY, y.labelAngle = m.labelAngle, y.sourceLabelAngle = m.sourceLabelAngle, y.targetLabelAngle = m.targetLabelAngle;
    }
  }
};
var Zl = {};
Zl.updateCachedGrabbedEles = function() {
  var t = this.cachedZSortedEles;
  if (t) {
    t.drag = [], t.nondrag = [];
    for (var e = [], r = 0; r < t.length; r++) {
      var n = t[r], a = n._private.rscratch;
      n.grabbed() && !n.isParent() ? e.push(n) : a.inDragLayer ? t.drag.push(n) : t.nondrag.push(n);
    }
    for (var r = 0; r < e.length; r++) {
      var n = e[r];
      t.drag.push(n);
    }
  }
};
Zl.invalidateCachedZSortedEles = function() {
  this.cachedZSortedEles = null;
};
Zl.getCachedZSortedEles = function(t) {
  if (t || !this.cachedZSortedEles) {
    var e = this.cy.mutableElements().toArray();
    e.sort(QS), e.interactive = e.filter(function(r) {
      return r.interactive();
    }), this.cachedZSortedEles = e, this.updateCachedGrabbedEles();
  } else
    e = this.cachedZSortedEles;
  return e;
};
var yk = {};
[Ka, gl, lr, ss, Wg, fn, gk, Yl, Zl].forEach(function(t) {
  ze(yk, t);
});
var mk = {};
mk.getCachedImage = function(t, e, r) {
  var n = this, a = n.imageCache = n.imageCache || {}, i = a[t];
  if (i)
    return i.image.complete || i.image.addEventListener("load", r), i.image;
  i = a[t] = a[t] || {};
  var o = i.image = new Image();
  o.addEventListener("load", r), o.addEventListener("error", function() {
    o.error = !0;
  });
  var s = "data:", u = t.substring(0, s.length).toLowerCase() === s;
  return u || (e = e === "null" ? null : e, o.crossOrigin = e), o.src = t, o;
};
var Vi = {};
Vi.registerBinding = function(t, e, r, n) {
  var a = Array.prototype.slice.apply(arguments, [1]), i = this.binder(t);
  return i.on.apply(i, a);
};
Vi.binder = function(t) {
  var e = this, r = e.cy.window(), n = t === r || t === r.document || t === r.document.body || uB(t);
  if (e.supportsPassiveEvents == null) {
    var a = !1;
    try {
      var i = Object.defineProperty({}, "passive", {
        get: function() {
          return a = !0, !0;
        }
      });
      r.addEventListener("test", null, i);
    } catch {
    }
    e.supportsPassiveEvents = a;
  }
  var o = function(u, l, c) {
    var d = Array.prototype.slice.call(arguments);
    return n && e.supportsPassiveEvents && (d[2] = {
      capture: c ?? !1,
      passive: !1,
      once: !1
    }), e.bindings.push({
      target: t,
      args: d
    }), (t.addEventListener || t.on).apply(t, d), this;
  };
  return {
    on: o,
    addEventListener: o,
    addListener: o,
    bind: o
  };
};
Vi.nodeIsDraggable = function(t) {
  return t && t.isNode() && !t.locked() && t.grabbable();
};
Vi.nodeIsGrabbable = function(t) {
  return this.nodeIsDraggable(t) && t.interactive();
};
Vi.load = function() {
  var t = this, e = t.cy.window(), r = function(I) {
    return I.selected();
  }, n = function(I, G, se, ee) {
    I == null && (I = t.cy);
    for (var te = 0; te < G.length; te++) {
      var ye = G[te];
      I.emit({
        originalEvent: se,
        type: ye,
        position: ee
      });
    }
  }, a = function(I) {
    return I.shiftKey || I.metaKey || I.ctrlKey;
  }, i = function(I, G) {
    var se = !0;
    if (t.cy.hasCompoundNodes() && I && I.pannable())
      for (var ee = 0; G && ee < G.length; ee++) {
        var I = G[ee];
        if (I.isNode() && I.isParent() && !I.pannable()) {
          se = !1;
          break;
        }
      }
    else
      se = !0;
    return se;
  }, o = function(I) {
    I[0]._private.grabbed = !0;
  }, s = function(I) {
    I[0]._private.grabbed = !1;
  }, u = function(I) {
    I[0]._private.rscratch.inDragLayer = !0;
  }, l = function(I) {
    I[0]._private.rscratch.inDragLayer = !1;
  }, c = function(I) {
    I[0]._private.rscratch.isGrabTarget = !0;
  }, d = function(I) {
    I[0]._private.rscratch.isGrabTarget = !1;
  }, f = function(I, G) {
    var se = G.addToList, ee = se.has(I);
    !ee && I.grabbable() && !I.locked() && (se.merge(I), o(I));
  }, h = function(I, G) {
    if (I.cy().hasCompoundNodes() && !(G.inDragLayer == null && G.addToList == null)) {
      var se = I.descendants();
      G.inDragLayer && (se.forEach(u), se.connectedEdges().forEach(u)), G.addToList && f(se, G);
    }
  }, v = function(I, G) {
    G = G || {};
    var se = I.cy().hasCompoundNodes();
    G.inDragLayer && (I.forEach(u), I.neighborhood().stdFilter(function(ee) {
      return !se || ee.isEdge();
    }).forEach(u)), G.addToList && I.forEach(function(ee) {
      f(ee, G);
    }), h(I, G), y(I, {
      inDragLayer: G.inDragLayer
    }), t.updateCachedGrabbedEles();
  }, p = v, g = function(I) {
    I && (t.getCachedZSortedEles().forEach(function(G) {
      s(G), l(G), d(G);
    }), t.updateCachedGrabbedEles());
  }, y = function(I, G) {
    if (!(G.inDragLayer == null && G.addToList == null) && I.cy().hasCompoundNodes()) {
      var se = I.ancestors().orphans();
      if (!se.same(I)) {
        var ee = se.descendants().spawnSelf().merge(se).unmerge(I).unmerge(I.descendants()), te = ee.connectedEdges();
        G.inDragLayer && (te.forEach(u), ee.forEach(u)), G.addToList && ee.forEach(function(ye) {
          f(ye, G);
        });
      }
    }
  }, m = function() {
    document.activeElement != null && document.activeElement.blur != null && document.activeElement.blur();
  }, b = typeof MutationObserver < "u", w = typeof ResizeObserver < "u";
  b ? (t.removeObserver = new MutationObserver(function(ue) {
    for (var I = 0; I < ue.length; I++) {
      var G = ue[I], se = G.removedNodes;
      if (se)
        for (var ee = 0; ee < se.length; ee++) {
          var te = se[ee];
          if (te === t.container) {
            t.destroy();
            break;
          }
        }
    }
  }), t.container.parentNode && t.removeObserver.observe(t.container.parentNode, {
    childList: !0
  })) : t.registerBinding(t.container, "DOMNodeRemoved", function(ue) {
    t.destroy();
  });
  var x = Fl(function() {
    t.cy.resize();
  }, 100);
  b && (t.styleObserver = new MutationObserver(x), t.styleObserver.observe(t.container, {
    attributes: !0
  })), t.registerBinding(e, "resize", x), w && (t.resizeObserver = new ResizeObserver(x), t.resizeObserver.observe(t.container));
  var E = function(I, G) {
    for (; I != null; )
      G(I), I = I.parentNode;
  }, C = function() {
    t.invalidateContainerClientCoordsCache();
  };
  E(t.container, function(ue) {
    t.registerBinding(ue, "transitionend", C), t.registerBinding(ue, "animationend", C), t.registerBinding(ue, "scroll", C);
  }), t.registerBinding(t.container, "contextmenu", function(ue) {
    ue.preventDefault();
  });
  var k = function() {
    return t.selection[4] !== 0;
  }, S = function(I) {
    for (var G = t.findContainerClientCoords(), se = G[0], ee = G[1], te = G[2], ye = G[3], oe = I.touches ? I.touches : [I], he = !1, Oe = 0; Oe < oe.length; Oe++) {
      var Pe = oe[Oe];
      if (se <= Pe.clientX && Pe.clientX <= se + te && ee <= Pe.clientY && Pe.clientY <= ee + ye) {
        he = !0;
        break;
      }
    }
    if (!he)
      return !1;
    for (var Ae = t.container, $e = I.target, Ie = $e.parentNode, Le = !1; Ie; ) {
      if (Ie === Ae) {
        Le = !0;
        break;
      }
      Ie = Ie.parentNode;
    }
    return !!Le;
  };
  t.registerBinding(t.container, "mousedown", function(I) {
    if (S(I) && !(t.hoverData.which === 1 && I.which !== 1)) {
      I.preventDefault(), m(), t.hoverData.capture = !0, t.hoverData.which = I.which;
      var G = t.cy, se = [I.clientX, I.clientY], ee = t.projectIntoViewport(se[0], se[1]), te = t.selection, ye = t.findNearestElements(ee[0], ee[1], !0, !1), oe = ye[0], he = t.dragData.possibleDragElements;
      t.hoverData.mdownPos = ee, t.hoverData.mdownGPos = se;
      var Oe = function() {
        t.hoverData.tapholdCancelled = !1, clearTimeout(t.hoverData.tapholdTimeout), t.hoverData.tapholdTimeout = setTimeout(function() {
          if (!t.hoverData.tapholdCancelled) {
            var ut = t.hoverData.down;
            ut ? ut.emit({
              originalEvent: I,
              type: "taphold",
              position: {
                x: ee[0],
                y: ee[1]
              }
            }) : G.emit({
              originalEvent: I,
              type: "taphold",
              position: {
                x: ee[0],
                y: ee[1]
              }
            });
          }
        }, t.tapholdDuration);
      };
      if (I.which == 3) {
        t.hoverData.cxtStarted = !0;
        var Pe = {
          originalEvent: I,
          type: "cxttapstart",
          position: {
            x: ee[0],
            y: ee[1]
          }
        };
        oe ? (oe.activate(), oe.emit(Pe), t.hoverData.down = oe) : G.emit(Pe), t.hoverData.downTime = (/* @__PURE__ */ new Date()).getTime(), t.hoverData.cxtDragged = !1;
      } else if (I.which == 1) {
        oe && oe.activate();
        {
          if (oe != null && t.nodeIsGrabbable(oe)) {
            var Ae = function(ut) {
              return {
                originalEvent: I,
                type: ut,
                position: {
                  x: ee[0],
                  y: ee[1]
                }
              };
            }, $e = function(ut) {
              ut.emit(Ae("grab"));
            };
            if (c(oe), !oe.selected())
              he = t.dragData.possibleDragElements = G.collection(), p(oe, {
                addToList: he
              }), oe.emit(Ae("grabon")).emit(Ae("grab"));
            else {
              he = t.dragData.possibleDragElements = G.collection();
              var Ie = G.$(function(Le) {
                return Le.isNode() && Le.selected() && t.nodeIsGrabbable(Le);
              });
              v(Ie, {
                addToList: he
              }), oe.emit(Ae("grabon")), Ie.forEach($e);
            }
            t.redrawHint("eles", !0), t.redrawHint("drag", !0);
          }
          t.hoverData.down = oe, t.hoverData.downs = ye, t.hoverData.downTime = (/* @__PURE__ */ new Date()).getTime();
        }
        n(oe, ["mousedown", "tapstart", "vmousedown"], I, {
          x: ee[0],
          y: ee[1]
        }), oe == null ? (te[4] = 1, t.data.bgActivePosistion = {
          x: ee[0],
          y: ee[1]
        }, t.redrawHint("select", !0), t.redraw()) : oe.pannable() && (te[4] = 1), Oe();
      }
      te[0] = te[2] = ee[0], te[1] = te[3] = ee[1];
    }
  }, !1), t.registerBinding(e, "mousemove", function(I) {
    var G = t.hoverData.capture;
    if (!(!G && !S(I))) {
      var se = !1, ee = t.cy, te = ee.zoom(), ye = [I.clientX, I.clientY], oe = t.projectIntoViewport(ye[0], ye[1]), he = t.hoverData.mdownPos, Oe = t.hoverData.mdownGPos, Pe = t.selection, Ae = null;
      !t.hoverData.draggingEles && !t.hoverData.dragging && !t.hoverData.selecting && (Ae = t.findNearestElement(oe[0], oe[1], !0, !1));
      var $e = t.hoverData.last, Ie = t.hoverData.down, Le = [oe[0] - Pe[2], oe[1] - Pe[3]], ut = t.dragData.possibleDragElements, nt;
      if (Oe) {
        var kt = ye[0] - Oe[0], _t = kt * kt, Ct = ye[1] - Oe[1], Jt = Ct * Ct, Pt = _t + Jt;
        t.hoverData.isOverThresholdDrag = nt = Pt >= t.desktopTapThreshold2;
      }
      var $t = a(I);
      nt && (t.hoverData.tapholdCancelled = !0);
      var wr = function() {
        var re = t.hoverData.dragDelta = t.hoverData.dragDelta || [];
        re.length === 0 ? (re.push(Le[0]), re.push(Le[1])) : (re[0] += Le[0], re[1] += Le[1]);
      };
      se = !0, n(Ae, ["mousemove", "vmousemove", "tapdrag"], I, {
        x: oe[0],
        y: oe[1]
      });
      var Qt = function() {
        t.data.bgActivePosistion = void 0, t.hoverData.selecting || ee.emit({
          originalEvent: I,
          type: "boxstart",
          position: {
            x: oe[0],
            y: oe[1]
          }
        }), Pe[4] = 1, t.hoverData.selecting = !0, t.redrawHint("select", !0), t.redraw();
      };
      if (t.hoverData.which === 3) {
        if (nt) {
          var er = {
            originalEvent: I,
            type: "cxtdrag",
            position: {
              x: oe[0],
              y: oe[1]
            }
          };
          Ie ? Ie.emit(er) : ee.emit(er), t.hoverData.cxtDragged = !0, (!t.hoverData.cxtOver || Ae !== t.hoverData.cxtOver) && (t.hoverData.cxtOver && t.hoverData.cxtOver.emit({
            originalEvent: I,
            type: "cxtdragout",
            position: {
              x: oe[0],
              y: oe[1]
            }
          }), t.hoverData.cxtOver = Ae, Ae && Ae.emit({
            originalEvent: I,
            type: "cxtdragover",
            position: {
              x: oe[0],
              y: oe[1]
            }
          }));
        }
      } else if (t.hoverData.dragging) {
        if (se = !0, ee.panningEnabled() && ee.userPanningEnabled()) {
          var kr;
          if (t.hoverData.justStartedPan) {
            var Nr = t.hoverData.mdownPos;
            kr = {
              x: (oe[0] - Nr[0]) * te,
              y: (oe[1] - Nr[1]) * te
            }, t.hoverData.justStartedPan = !1;
          } else
            kr = {
              x: Le[0] * te,
              y: Le[1] * te
            };
          ee.panBy(kr), ee.emit("dragpan"), t.hoverData.dragged = !0;
        }
        oe = t.projectIntoViewport(I.clientX, I.clientY);
      } else if (Pe[4] == 1 && (Ie == null || Ie.pannable())) {
        if (nt) {
          if (!t.hoverData.dragging && ee.boxSelectionEnabled() && ($t || !ee.panningEnabled() || !ee.userPanningEnabled()))
            Qt();
          else if (!t.hoverData.selecting && ee.panningEnabled() && ee.userPanningEnabled()) {
            var dr = i(Ie, t.hoverData.downs);
            dr && (t.hoverData.dragging = !0, t.hoverData.justStartedPan = !0, Pe[4] = 0, t.data.bgActivePosistion = ui(he), t.redrawHint("select", !0), t.redraw());
          }
          Ie && Ie.pannable() && Ie.active() && Ie.unactivate();
        }
      } else {
        if (Ie && Ie.pannable() && Ie.active() && Ie.unactivate(), (!Ie || !Ie.grabbed()) && Ae != $e && ($e && n($e, ["mouseout", "tapdragout"], I, {
          x: oe[0],
          y: oe[1]
        }), Ae && n(Ae, ["mouseover", "tapdragover"], I, {
          x: oe[0],
          y: oe[1]
        }), t.hoverData.last = Ae), Ie)
          if (nt) {
            if (ee.boxSelectionEnabled() && $t)
              Ie && Ie.grabbed() && (g(ut), Ie.emit("freeon"), ut.emit("free"), t.dragData.didDrag && (Ie.emit("dragfreeon"), ut.emit("dragfree"))), Qt();
            else if (Ie && Ie.grabbed() && t.nodeIsDraggable(Ie)) {
              var xt = !t.dragData.didDrag;
              xt && t.redrawHint("eles", !0), t.dragData.didDrag = !0, t.hoverData.draggingEles || v(ut, {
                inDragLayer: !0
              });
              var Tt = {
                x: 0,
                y: 0
              };
              if (Ce(Le[0]) && Ce(Le[1]) && (Tt.x += Le[0], Tt.y += Le[1], xt)) {
                var qt = t.hoverData.dragDelta;
                qt && Ce(qt[0]) && Ce(qt[1]) && (Tt.x += qt[0], Tt.y += qt[1]);
              }
              t.hoverData.draggingEles = !0, ut.silentShift(Tt).emit("position drag"), t.redrawHint("drag", !0), t.redraw();
            }
          } else
            wr();
        se = !0;
      }
      if (Pe[2] = oe[0], Pe[3] = oe[1], se)
        return I.stopPropagation && I.stopPropagation(), I.preventDefault && I.preventDefault(), !1;
    }
  }, !1);
  var _, T, O;
  t.registerBinding(e, "mouseup", function(I) {
    if (!(t.hoverData.which === 1 && I.which !== 1 && t.hoverData.capture)) {
      var G = t.hoverData.capture;
      if (G) {
        t.hoverData.capture = !1;
        var se = t.cy, ee = t.projectIntoViewport(I.clientX, I.clientY), te = t.selection, ye = t.findNearestElement(ee[0], ee[1], !0, !1), oe = t.dragData.possibleDragElements, he = t.hoverData.down, Oe = a(I);
        if (t.data.bgActivePosistion && (t.redrawHint("select", !0), t.redraw()), t.hoverData.tapholdCancelled = !0, t.data.bgActivePosistion = void 0, he && he.unactivate(), t.hoverData.which === 3) {
          var Pe = {
            originalEvent: I,
            type: "cxttapend",
            position: {
              x: ee[0],
              y: ee[1]
            }
          };
          if (he ? he.emit(Pe) : se.emit(Pe), !t.hoverData.cxtDragged) {
            var Ae = {
              originalEvent: I,
              type: "cxttap",
              position: {
                x: ee[0],
                y: ee[1]
              }
            };
            he ? he.emit(Ae) : se.emit(Ae);
          }
          t.hoverData.cxtDragged = !1, t.hoverData.which = null;
        } else if (t.hoverData.which === 1) {
          if (n(ye, ["mouseup", "tapend", "vmouseup"], I, {
            x: ee[0],
            y: ee[1]
          }), !t.dragData.didDrag && // didn't move a node around
          !t.hoverData.dragged && // didn't pan
          !t.hoverData.selecting && // not box selection
          !t.hoverData.isOverThresholdDrag && (n(he, ["click", "tap", "vclick"], I, {
            x: ee[0],
            y: ee[1]
          }), T = !1, I.timeStamp - O <= se.multiClickDebounceTime() ? (_ && clearTimeout(_), T = !0, O = null, n(he, ["dblclick", "dbltap", "vdblclick"], I, {
            x: ee[0],
            y: ee[1]
          })) : (_ = setTimeout(function() {
            T || n(he, ["oneclick", "onetap", "voneclick"], I, {
              x: ee[0],
              y: ee[1]
            });
          }, se.multiClickDebounceTime()), O = I.timeStamp)), he == null && !t.dragData.didDrag && !t.hoverData.selecting && !t.hoverData.dragged && !a(I) && (se.$(r).unselect(["tapunselect"]), oe.length > 0 && t.redrawHint("eles", !0), t.dragData.possibleDragElements = oe = se.collection()), ye == he && !t.dragData.didDrag && !t.hoverData.selecting && ye != null && ye._private.selectable && (t.hoverData.dragging || (se.selectionType() === "additive" || Oe ? ye.selected() ? ye.unselect(["tapunselect"]) : ye.select(["tapselect"]) : Oe || (se.$(r).unmerge(ye).unselect(["tapunselect"]), ye.select(["tapselect"]))), t.redrawHint("eles", !0)), t.hoverData.selecting) {
            var $e = se.collection(t.getAllInBox(te[0], te[1], te[2], te[3]));
            t.redrawHint("select", !0), $e.length > 0 && t.redrawHint("eles", !0), se.emit({
              type: "boxend",
              originalEvent: I,
              position: {
                x: ee[0],
                y: ee[1]
              }
            });
            var Ie = function(nt) {
              return nt.selectable() && !nt.selected();
            };
            se.selectionType() === "additive" || Oe || se.$(r).unmerge($e).unselect(), $e.emit("box").stdFilter(Ie).select().emit("boxselect"), t.redraw();
          }
          if (t.hoverData.dragging && (t.hoverData.dragging = !1, t.redrawHint("select", !0), t.redrawHint("eles", !0), t.redraw()), !te[4]) {
            t.redrawHint("drag", !0), t.redrawHint("eles", !0);
            var Le = he && he.grabbed();
            g(oe), Le && (he.emit("freeon"), oe.emit("free"), t.dragData.didDrag && (he.emit("dragfreeon"), oe.emit("dragfree")));
          }
        }
        te[4] = 0, t.hoverData.down = null, t.hoverData.cxtStarted = !1, t.hoverData.draggingEles = !1, t.hoverData.selecting = !1, t.hoverData.isOverThresholdDrag = !1, t.dragData.didDrag = !1, t.hoverData.dragged = !1, t.hoverData.dragDelta = [], t.hoverData.mdownPos = null, t.hoverData.mdownGPos = null, t.hoverData.which = null;
      }
    }
  }, !1);
  var D = function(I) {
    if (!t.scrollingPage) {
      var G = t.cy, se = G.zoom(), ee = G.pan(), te = t.projectIntoViewport(I.clientX, I.clientY), ye = [te[0] * se + ee.x, te[1] * se + ee.y];
      if (t.hoverData.draggingEles || t.hoverData.dragging || t.hoverData.cxtStarted || k()) {
        I.preventDefault();
        return;
      }
      if (G.panningEnabled() && G.userPanningEnabled() && G.zoomingEnabled() && G.userZoomingEnabled()) {
        I.preventDefault(), t.data.wheelZooming = !0, clearTimeout(t.data.wheelTimeout), t.data.wheelTimeout = setTimeout(function() {
          t.data.wheelZooming = !1, t.redrawHint("eles", !0), t.redraw();
        }, 150);
        var oe;
        I.deltaY != null ? oe = I.deltaY / -250 : I.wheelDeltaY != null ? oe = I.wheelDeltaY / 1e3 : oe = I.wheelDelta / 1e3, oe = oe * t.wheelSensitivity;
        var he = I.deltaMode === 1;
        he && (oe *= 33);
        var Oe = G.zoom() * Math.pow(10, oe);
        I.type === "gesturechange" && (Oe = t.gestureStartZoom * I.scale), G.zoom({
          level: Oe,
          renderedPosition: {
            x: ye[0],
            y: ye[1]
          }
        }), G.emit(I.type === "gesturechange" ? "pinchzoom" : "scrollzoom");
      }
    }
  };
  t.registerBinding(t.container, "wheel", D, !0), t.registerBinding(e, "scroll", function(I) {
    t.scrollingPage = !0, clearTimeout(t.scrollingPageTimeout), t.scrollingPageTimeout = setTimeout(function() {
      t.scrollingPage = !1;
    }, 250);
  }, !0), t.registerBinding(t.container, "gesturestart", function(I) {
    t.gestureStartZoom = t.cy.zoom(), t.hasTouchStarted || I.preventDefault();
  }, !0), t.registerBinding(t.container, "gesturechange", function(ue) {
    t.hasTouchStarted || D(ue);
  }, !0), t.registerBinding(t.container, "mouseout", function(I) {
    var G = t.projectIntoViewport(I.clientX, I.clientY);
    t.cy.emit({
      originalEvent: I,
      type: "mouseout",
      position: {
        x: G[0],
        y: G[1]
      }
    });
  }, !1), t.registerBinding(t.container, "mouseover", function(I) {
    var G = t.projectIntoViewport(I.clientX, I.clientY);
    t.cy.emit({
      originalEvent: I,
      type: "mouseover",
      position: {
        x: G[0],
        y: G[1]
      }
    });
  }, !1);
  var A, F, R, M, L, V, Y, H, K, ne, B, $, z, W = function(I, G, se, ee) {
    return Math.sqrt((se - I) * (se - I) + (ee - G) * (ee - G));
  }, Z = function(I, G, se, ee) {
    return (se - I) * (se - I) + (ee - G) * (ee - G);
  }, N;
  t.registerBinding(t.container, "touchstart", N = function(I) {
    if (t.hasTouchStarted = !0, !!S(I)) {
      m(), t.touchData.capture = !0, t.data.bgActivePosistion = void 0;
      var G = t.cy, se = t.touchData.now, ee = t.touchData.earlier;
      if (I.touches[0]) {
        var te = t.projectIntoViewport(I.touches[0].clientX, I.touches[0].clientY);
        se[0] = te[0], se[1] = te[1];
      }
      if (I.touches[1]) {
        var te = t.projectIntoViewport(I.touches[1].clientX, I.touches[1].clientY);
        se[2] = te[0], se[3] = te[1];
      }
      if (I.touches[2]) {
        var te = t.projectIntoViewport(I.touches[2].clientX, I.touches[2].clientY);
        se[4] = te[0], se[5] = te[1];
      }
      if (I.touches[1]) {
        t.touchData.singleTouchMoved = !0, g(t.dragData.touchDragEles);
        var ye = t.findContainerClientCoords();
        K = ye[0], ne = ye[1], B = ye[2], $ = ye[3], A = I.touches[0].clientX - K, F = I.touches[0].clientY - ne, R = I.touches[1].clientX - K, M = I.touches[1].clientY - ne, z = 0 <= A && A <= B && 0 <= R && R <= B && 0 <= F && F <= $ && 0 <= M && M <= $;
        var oe = G.pan(), he = G.zoom();
        L = W(A, F, R, M), V = Z(A, F, R, M), Y = [(A + R) / 2, (F + M) / 2], H = [(Y[0] - oe.x) / he, (Y[1] - oe.y) / he];
        var Oe = 200, Pe = Oe * Oe;
        if (V < Pe && !I.touches[2]) {
          var Ae = t.findNearestElement(se[0], se[1], !0, !0), $e = t.findNearestElement(se[2], se[3], !0, !0);
          Ae && Ae.isNode() ? (Ae.activate().emit({
            originalEvent: I,
            type: "cxttapstart",
            position: {
              x: se[0],
              y: se[1]
            }
          }), t.touchData.start = Ae) : $e && $e.isNode() ? ($e.activate().emit({
            originalEvent: I,
            type: "cxttapstart",
            position: {
              x: se[0],
              y: se[1]
            }
          }), t.touchData.start = $e) : G.emit({
            originalEvent: I,
            type: "cxttapstart",
            position: {
              x: se[0],
              y: se[1]
            }
          }), t.touchData.start && (t.touchData.start._private.grabbed = !1), t.touchData.cxt = !0, t.touchData.cxtDragged = !1, t.data.bgActivePosistion = void 0, t.redraw();
          return;
        }
      }
      if (I.touches[2])
        G.boxSelectionEnabled() && I.preventDefault();
      else if (!I.touches[1]) {
        if (I.touches[0]) {
          var Ie = t.findNearestElements(se[0], se[1], !0, !0), Le = Ie[0];
          if (Le != null && (Le.activate(), t.touchData.start = Le, t.touchData.starts = Ie, t.nodeIsGrabbable(Le))) {
            var ut = t.dragData.touchDragEles = G.collection(), nt = null;
            t.redrawHint("eles", !0), t.redrawHint("drag", !0), Le.selected() ? (nt = G.$(function(Pt) {
              return Pt.selected() && t.nodeIsGrabbable(Pt);
            }), v(nt, {
              addToList: ut
            })) : p(Le, {
              addToList: ut
            }), c(Le);
            var kt = function($t) {
              return {
                originalEvent: I,
                type: $t,
                position: {
                  x: se[0],
                  y: se[1]
                }
              };
            };
            Le.emit(kt("grabon")), nt ? nt.forEach(function(Pt) {
              Pt.emit(kt("grab"));
            }) : Le.emit(kt("grab"));
          }
          n(Le, ["touchstart", "tapstart", "vmousedown"], I, {
            x: se[0],
            y: se[1]
          }), Le == null && (t.data.bgActivePosistion = {
            x: te[0],
            y: te[1]
          }, t.redrawHint("select", !0), t.redraw()), t.touchData.singleTouchMoved = !1, t.touchData.singleTouchStartTime = +/* @__PURE__ */ new Date(), clearTimeout(t.touchData.tapholdTimeout), t.touchData.tapholdTimeout = setTimeout(function() {
            t.touchData.singleTouchMoved === !1 && !t.pinching && !t.touchData.selecting && n(t.touchData.start, ["taphold"], I, {
              x: se[0],
              y: se[1]
            });
          }, t.tapholdDuration);
        }
      }
      if (I.touches.length >= 1) {
        for (var _t = t.touchData.startPosition = [null, null, null, null, null, null], Ct = 0; Ct < se.length; Ct++)
          _t[Ct] = ee[Ct] = se[Ct];
        var Jt = I.touches[0];
        t.touchData.startGPosition = [Jt.clientX, Jt.clientY];
      }
    }
  }, !1);
  var X;
  t.registerBinding(e, "touchmove", X = function(I) {
    var G = t.touchData.capture;
    if (!(!G && !S(I))) {
      var se = t.selection, ee = t.cy, te = t.touchData.now, ye = t.touchData.earlier, oe = ee.zoom();
      if (I.touches[0]) {
        var he = t.projectIntoViewport(I.touches[0].clientX, I.touches[0].clientY);
        te[0] = he[0], te[1] = he[1];
      }
      if (I.touches[1]) {
        var he = t.projectIntoViewport(I.touches[1].clientX, I.touches[1].clientY);
        te[2] = he[0], te[3] = he[1];
      }
      if (I.touches[2]) {
        var he = t.projectIntoViewport(I.touches[2].clientX, I.touches[2].clientY);
        te[4] = he[0], te[5] = he[1];
      }
      var Oe = t.touchData.startGPosition, Pe;
      if (G && I.touches[0] && Oe) {
        for (var Ae = [], $e = 0; $e < te.length; $e++)
          Ae[$e] = te[$e] - ye[$e];
        var Ie = I.touches[0].clientX - Oe[0], Le = Ie * Ie, ut = I.touches[0].clientY - Oe[1], nt = ut * ut, kt = Le + nt;
        Pe = kt >= t.touchTapThreshold2;
      }
      if (G && t.touchData.cxt) {
        I.preventDefault();
        var _t = I.touches[0].clientX - K, Ct = I.touches[0].clientY - ne, Jt = I.touches[1].clientX - K, Pt = I.touches[1].clientY - ne, $t = Z(_t, Ct, Jt, Pt), wr = $t / V, Qt = 150, er = Qt * Qt, kr = 1.5, Nr = kr * kr;
        if (wr >= Nr || $t >= er) {
          t.touchData.cxt = !1, t.data.bgActivePosistion = void 0, t.redrawHint("select", !0);
          var dr = {
            originalEvent: I,
            type: "cxttapend",
            position: {
              x: te[0],
              y: te[1]
            }
          };
          t.touchData.start ? (t.touchData.start.unactivate().emit(dr), t.touchData.start = null) : ee.emit(dr);
        }
      }
      if (G && t.touchData.cxt) {
        var dr = {
          originalEvent: I,
          type: "cxtdrag",
          position: {
            x: te[0],
            y: te[1]
          }
        };
        t.data.bgActivePosistion = void 0, t.redrawHint("select", !0), t.touchData.start ? t.touchData.start.emit(dr) : ee.emit(dr), t.touchData.start && (t.touchData.start._private.grabbed = !1), t.touchData.cxtDragged = !0;
        var xt = t.findNearestElement(te[0], te[1], !0, !0);
        (!t.touchData.cxtOver || xt !== t.touchData.cxtOver) && (t.touchData.cxtOver && t.touchData.cxtOver.emit({
          originalEvent: I,
          type: "cxtdragout",
          position: {
            x: te[0],
            y: te[1]
          }
        }), t.touchData.cxtOver = xt, xt && xt.emit({
          originalEvent: I,
          type: "cxtdragover",
          position: {
            x: te[0],
            y: te[1]
          }
        }));
      } else if (G && I.touches[2] && ee.boxSelectionEnabled())
        I.preventDefault(), t.data.bgActivePosistion = void 0, this.lastThreeTouch = +/* @__PURE__ */ new Date(), t.touchData.selecting || ee.emit({
          originalEvent: I,
          type: "boxstart",
          position: {
            x: te[0],
            y: te[1]
          }
        }), t.touchData.selecting = !0, t.touchData.didSelect = !0, se[4] = 1, !se || se.length === 0 || se[0] === void 0 ? (se[0] = (te[0] + te[2] + te[4]) / 3, se[1] = (te[1] + te[3] + te[5]) / 3, se[2] = (te[0] + te[2] + te[4]) / 3 + 1, se[3] = (te[1] + te[3] + te[5]) / 3 + 1) : (se[2] = (te[0] + te[2] + te[4]) / 3, se[3] = (te[1] + te[3] + te[5]) / 3), t.redrawHint("select", !0), t.redraw();
      else if (G && I.touches[1] && !t.touchData.didSelect && ee.zoomingEnabled() && ee.panningEnabled() && ee.userZoomingEnabled() && ee.userPanningEnabled()) {
        I.preventDefault(), t.data.bgActivePosistion = void 0, t.redrawHint("select", !0);
        var Tt = t.dragData.touchDragEles;
        if (Tt) {
          t.redrawHint("drag", !0);
          for (var qt = 0; qt < Tt.length; qt++) {
            var Fn = Tt[qt]._private;
            Fn.grabbed = !1, Fn.rscratch.inDragLayer = !1;
          }
        }
        var re = t.touchData.start, _t = I.touches[0].clientX - K, Ct = I.touches[0].clientY - ne, Jt = I.touches[1].clientX - K, Pt = I.touches[1].clientY - ne, Ee = W(_t, Ct, Jt, Pt), We = Ee / L;
        if (z) {
          var at = _t - A, Qr = Ct - F, Mn = Jt - R, Xa = Pt - M, pn = (at + Mn) / 2, _r = (Qr + Xa) / 2, Nn = ee.zoom(), hu = Nn * We, ps = ee.pan(), yy = H[0] * Nn + ps.x, my = H[1] * Nn + ps.y, ET = {
            x: -hu / Nn * (yy - ps.x - pn) + yy,
            y: -hu / Nn * (my - ps.y - _r) + my
          };
          if (re && re.active()) {
            var Tt = t.dragData.touchDragEles;
            g(Tt), t.redrawHint("drag", !0), t.redrawHint("eles", !0), re.unactivate().emit("freeon"), Tt.emit("free"), t.dragData.didDrag && (re.emit("dragfreeon"), Tt.emit("dragfree"));
          }
          ee.viewport({
            zoom: hu,
            pan: ET,
            cancelOnFailedZoom: !0
          }), ee.emit("pinchzoom"), L = Ee, A = _t, F = Ct, R = Jt, M = Pt, t.pinching = !0;
        }
        if (I.touches[0]) {
          var he = t.projectIntoViewport(I.touches[0].clientX, I.touches[0].clientY);
          te[0] = he[0], te[1] = he[1];
        }
        if (I.touches[1]) {
          var he = t.projectIntoViewport(I.touches[1].clientX, I.touches[1].clientY);
          te[2] = he[0], te[3] = he[1];
        }
        if (I.touches[2]) {
          var he = t.projectIntoViewport(I.touches[2].clientX, I.touches[2].clientY);
          te[4] = he[0], te[5] = he[1];
        }
      } else if (I.touches[0] && !t.touchData.didSelect) {
        var Br = t.touchData.start, pu = t.touchData.last, xt;
        if (!t.hoverData.draggingEles && !t.swipePanning && (xt = t.findNearestElement(te[0], te[1], !0, !0)), G && Br != null && I.preventDefault(), G && Br != null && t.nodeIsDraggable(Br))
          if (Pe) {
            var Tt = t.dragData.touchDragEles, by = !t.dragData.didDrag;
            by && v(Tt, {
              inDragLayer: !0
            }), t.dragData.didDrag = !0;
            var Zi = {
              x: 0,
              y: 0
            };
            if (Ce(Ae[0]) && Ce(Ae[1]) && (Zi.x += Ae[0], Zi.y += Ae[1], by)) {
              t.redrawHint("eles", !0);
              var $r = t.touchData.dragDelta;
              $r && Ce($r[0]) && Ce($r[1]) && (Zi.x += $r[0], Zi.y += $r[1]);
            }
            t.hoverData.draggingEles = !0, Tt.silentShift(Zi).emit("position drag"), t.redrawHint("drag", !0), t.touchData.startPosition[0] == ye[0] && t.touchData.startPosition[1] == ye[1] && t.redrawHint("eles", !0), t.redraw();
          } else {
            var $r = t.touchData.dragDelta = t.touchData.dragDelta || [];
            $r.length === 0 ? ($r.push(Ae[0]), $r.push(Ae[1])) : ($r[0] += Ae[0], $r[1] += Ae[1]);
          }
        if (n(Br || xt, ["touchmove", "tapdrag", "vmousemove"], I, {
          x: te[0],
          y: te[1]
        }), (!Br || !Br.grabbed()) && xt != pu && (pu && pu.emit({
          originalEvent: I,
          type: "tapdragout",
          position: {
            x: te[0],
            y: te[1]
          }
        }), xt && xt.emit({
          originalEvent: I,
          type: "tapdragover",
          position: {
            x: te[0],
            y: te[1]
          }
        })), t.touchData.last = xt, G)
          for (var qt = 0; qt < te.length; qt++)
            te[qt] && t.touchData.startPosition[qt] && Pe && (t.touchData.singleTouchMoved = !0);
        if (G && (Br == null || Br.pannable()) && ee.panningEnabled() && ee.userPanningEnabled()) {
          var ST = i(Br, t.touchData.starts);
          ST && (I.preventDefault(), t.data.bgActivePosistion || (t.data.bgActivePosistion = ui(t.touchData.startPosition)), t.swipePanning ? (ee.panBy({
            x: Ae[0] * oe,
            y: Ae[1] * oe
          }), ee.emit("dragpan")) : Pe && (t.swipePanning = !0, ee.panBy({
            x: Ie * oe,
            y: ut * oe
          }), ee.emit("dragpan"), Br && (Br.unactivate(), t.redrawHint("select", !0), t.touchData.start = null)));
          var he = t.projectIntoViewport(I.touches[0].clientX, I.touches[0].clientY);
          te[0] = he[0], te[1] = he[1];
        }
      }
      for (var $e = 0; $e < te.length; $e++)
        ye[$e] = te[$e];
      G && I.touches.length > 0 && !t.hoverData.draggingEles && !t.swipePanning && t.data.bgActivePosistion != null && (t.data.bgActivePosistion = void 0, t.redrawHint("select", !0), t.redraw());
    }
  }, !1);
  var Q;
  t.registerBinding(e, "touchcancel", Q = function(I) {
    var G = t.touchData.start;
    t.touchData.capture = !1, G && G.unactivate();
  });
  var ge, we, fe, ce;
  if (t.registerBinding(e, "touchend", ge = function(I) {
    var G = t.touchData.start, se = t.touchData.capture;
    if (se)
      I.touches.length === 0 && (t.touchData.capture = !1), I.preventDefault();
    else
      return;
    var ee = t.selection;
    t.swipePanning = !1, t.hoverData.draggingEles = !1;
    var te = t.cy, ye = te.zoom(), oe = t.touchData.now, he = t.touchData.earlier;
    if (I.touches[0]) {
      var Oe = t.projectIntoViewport(I.touches[0].clientX, I.touches[0].clientY);
      oe[0] = Oe[0], oe[1] = Oe[1];
    }
    if (I.touches[1]) {
      var Oe = t.projectIntoViewport(I.touches[1].clientX, I.touches[1].clientY);
      oe[2] = Oe[0], oe[3] = Oe[1];
    }
    if (I.touches[2]) {
      var Oe = t.projectIntoViewport(I.touches[2].clientX, I.touches[2].clientY);
      oe[4] = Oe[0], oe[5] = Oe[1];
    }
    G && G.unactivate();
    var Pe;
    if (t.touchData.cxt) {
      if (Pe = {
        originalEvent: I,
        type: "cxttapend",
        position: {
          x: oe[0],
          y: oe[1]
        }
      }, G ? G.emit(Pe) : te.emit(Pe), !t.touchData.cxtDragged) {
        var Ae = {
          originalEvent: I,
          type: "cxttap",
          position: {
            x: oe[0],
            y: oe[1]
          }
        };
        G ? G.emit(Ae) : te.emit(Ae);
      }
      t.touchData.start && (t.touchData.start._private.grabbed = !1), t.touchData.cxt = !1, t.touchData.start = null, t.redraw();
      return;
    }
    if (!I.touches[2] && te.boxSelectionEnabled() && t.touchData.selecting) {
      t.touchData.selecting = !1;
      var $e = te.collection(t.getAllInBox(ee[0], ee[1], ee[2], ee[3]));
      ee[0] = void 0, ee[1] = void 0, ee[2] = void 0, ee[3] = void 0, ee[4] = 0, t.redrawHint("select", !0), te.emit({
        type: "boxend",
        originalEvent: I,
        position: {
          x: oe[0],
          y: oe[1]
        }
      });
      var Ie = function(er) {
        return er.selectable() && !er.selected();
      };
      $e.emit("box").stdFilter(Ie).select().emit("boxselect"), $e.nonempty() && t.redrawHint("eles", !0), t.redraw();
    }
    if (G != null && G.unactivate(), I.touches[2])
      t.data.bgActivePosistion = void 0, t.redrawHint("select", !0);
    else if (!I.touches[1]) {
      if (!I.touches[0]) {
        if (!I.touches[0]) {
          t.data.bgActivePosistion = void 0, t.redrawHint("select", !0);
          var Le = t.dragData.touchDragEles;
          if (G != null) {
            var ut = G._private.grabbed;
            g(Le), t.redrawHint("drag", !0), t.redrawHint("eles", !0), ut && (G.emit("freeon"), Le.emit("free"), t.dragData.didDrag && (G.emit("dragfreeon"), Le.emit("dragfree"))), n(G, ["touchend", "tapend", "vmouseup", "tapdragout"], I, {
              x: oe[0],
              y: oe[1]
            }), G.unactivate(), t.touchData.start = null;
          } else {
            var nt = t.findNearestElement(oe[0], oe[1], !0, !0);
            n(nt, ["touchend", "tapend", "vmouseup", "tapdragout"], I, {
              x: oe[0],
              y: oe[1]
            });
          }
          var kt = t.touchData.startPosition[0] - oe[0], _t = kt * kt, Ct = t.touchData.startPosition[1] - oe[1], Jt = Ct * Ct, Pt = _t + Jt, $t = Pt * ye * ye;
          t.touchData.singleTouchMoved || (G || te.$(":selected").unselect(["tapunselect"]), n(G, ["tap", "vclick"], I, {
            x: oe[0],
            y: oe[1]
          }), we = !1, I.timeStamp - ce <= te.multiClickDebounceTime() ? (fe && clearTimeout(fe), we = !0, ce = null, n(G, ["dbltap", "vdblclick"], I, {
            x: oe[0],
            y: oe[1]
          })) : (fe = setTimeout(function() {
            we || n(G, ["onetap", "voneclick"], I, {
              x: oe[0],
              y: oe[1]
            });
          }, te.multiClickDebounceTime()), ce = I.timeStamp)), G != null && !t.dragData.didDrag && G._private.selectable && $t < t.touchTapThreshold2 && !t.pinching && (te.selectionType() === "single" ? (te.$(r).unmerge(G).unselect(["tapunselect"]), G.select(["tapselect"])) : G.selected() ? G.unselect(["tapunselect"]) : G.select(["tapselect"]), t.redrawHint("eles", !0)), t.touchData.singleTouchMoved = !0;
        }
      }
    }
    for (var wr = 0; wr < oe.length; wr++)
      he[wr] = oe[wr];
    t.dragData.didDrag = !1, I.touches.length === 0 && (t.touchData.dragDelta = [], t.touchData.startPosition = [null, null, null, null, null, null], t.touchData.startGPosition = null, t.touchData.didSelect = !1), I.touches.length < 2 && (I.touches.length === 1 && (t.touchData.startGPosition = [I.touches[0].clientX, I.touches[0].clientY]), t.pinching = !1, t.redrawHint("eles", !0), t.redraw());
  }, !1), typeof TouchEvent > "u") {
    var be = [], ve = function(I) {
      return {
        clientX: I.clientX,
        clientY: I.clientY,
        force: 1,
        identifier: I.pointerId,
        pageX: I.pageX,
        pageY: I.pageY,
        radiusX: I.width / 2,
        radiusY: I.height / 2,
        screenX: I.screenX,
        screenY: I.screenY,
        target: I.target
      };
    }, xe = function(I) {
      return {
        event: I,
        touch: ve(I)
      };
    }, _e = function(I) {
      be.push(xe(I));
    }, He = function(I) {
      for (var G = 0; G < be.length; G++) {
        var se = be[G];
        if (se.event.pointerId === I.pointerId) {
          be.splice(G, 1);
          return;
        }
      }
    }, Ve = function(I) {
      var G = be.filter(function(se) {
        return se.event.pointerId === I.pointerId;
      })[0];
      G.event = I, G.touch = ve(I);
    }, De = function(I) {
      I.touches = be.map(function(G) {
        return G.touch;
      });
    }, Ne = function(I) {
      return I.pointerType === "mouse" || I.pointerType === 4;
    };
    t.registerBinding(t.container, "pointerdown", function(ue) {
      Ne(ue) || (ue.preventDefault(), _e(ue), De(ue), N(ue));
    }), t.registerBinding(t.container, "pointerup", function(ue) {
      Ne(ue) || (He(ue), De(ue), ge(ue));
    }), t.registerBinding(t.container, "pointercancel", function(ue) {
      Ne(ue) || (He(ue), De(ue), Q(ue));
    }), t.registerBinding(t.container, "pointermove", function(ue) {
      Ne(ue) || (ue.preventDefault(), Ve(ue), De(ue), X(ue));
    });
  }
};
var Pn = {};
Pn.generatePolygon = function(t, e) {
  return this.nodeShapes[t] = {
    renderer: this,
    name: t,
    points: e,
    draw: function(n, a, i, o, s, u) {
      this.renderer.nodeShapeImpl("polygon", n, a, i, o, s, this.points);
    },
    intersectLine: function(n, a, i, o, s, u, l, c) {
      return Mo(s, u, this.points, n, a, i / 2, o / 2, l);
    },
    checkPoint: function(n, a, i, o, s, u, l, c) {
      return _n(n, a, this.points, u, l, o, s, [0, -1], i);
    }
  };
};
Pn.generateEllipse = function() {
  return this.nodeShapes.ellipse = {
    renderer: this,
    name: "ellipse",
    draw: function(e, r, n, a, i, o) {
      this.renderer.nodeShapeImpl(this.name, e, r, n, a, i);
    },
    intersectLine: function(e, r, n, a, i, o, s, u) {
      return rq(i, o, e, r, n / 2 + s, a / 2 + s);
    },
    checkPoint: function(e, r, n, a, i, o, s, u) {
      return xa(e, r, a, i, o, s, n);
    }
  };
};
Pn.generateRoundPolygon = function(t, e) {
  return this.nodeShapes[t] = {
    renderer: this,
    name: t,
    points: e,
    getOrCreateCorners: function(n, a, i, o, s, u, l) {
      if (u[l] !== void 0 && u[l + "-cx"] === n && u[l + "-cy"] === a)
        return u[l];
      u[l] = new Array(e.length / 2), u[l + "-cx"] = n, u[l + "-cy"] = a;
      var c = i / 2, d = o / 2;
      s = s === "auto" ? CS(i, o) : s;
      for (var f = new Array(e.length / 2), h = 0; h < e.length / 2; h++)
        f[h] = {
          x: n + c * e[h * 2],
          y: a + d * e[h * 2 + 1]
        };
      var v, p, g, y, m = f.length;
      for (p = f[m - 1], v = 0; v < m; v++)
        g = f[v % m], y = f[(v + 1) % m], u[l][v] = Ug(p, g, y, s), p = g, g = y;
      return u[l];
    },
    draw: function(n, a, i, o, s, u, l) {
      this.renderer.nodeShapeImpl("round-polygon", n, a, i, o, s, this.points, this.getOrCreateCorners(a, i, o, s, u, l, "drawCorners"));
    },
    intersectLine: function(n, a, i, o, s, u, l, c, d) {
      return nq(s, u, this.points, n, a, i, o, l, this.getOrCreateCorners(n, a, i, o, c, d, "corners"));
    },
    checkPoint: function(n, a, i, o, s, u, l, c, d) {
      return tq(n, a, this.points, u, l, o, s, this.getOrCreateCorners(u, l, o, s, c, d, "corners"));
    }
  };
};
Pn.generateRoundRectangle = function() {
  return this.nodeShapes["round-rectangle"] = this.nodeShapes.roundrectangle = {
    renderer: this,
    name: "round-rectangle",
    points: ur(4, 0),
    draw: function(e, r, n, a, i, o) {
      this.renderer.nodeShapeImpl(this.name, e, r, n, a, i, this.points, o);
    },
    intersectLine: function(e, r, n, a, i, o, s, u) {
      return bS(i, o, e, r, n, a, s, u);
    },
    checkPoint: function(e, r, n, a, i, o, s, u) {
      var l = a / 2, c = i / 2;
      u = u === "auto" ? Ra(a, i) : u, u = Math.min(l, c, u);
      var d = u * 2;
      return !!(_n(e, r, this.points, o, s, a, i - d, [0, -1], n) || _n(e, r, this.points, o, s, a - d, i, [0, -1], n) || xa(e, r, d, d, o - l + u, s - c + u, n) || xa(e, r, d, d, o + l - u, s - c + u, n) || xa(e, r, d, d, o + l - u, s + c - u, n) || xa(e, r, d, d, o - l + u, s + c - u, n));
    }
  };
};
Pn.generateCutRectangle = function() {
  return this.nodeShapes["cut-rectangle"] = this.nodeShapes.cutrectangle = {
    renderer: this,
    name: "cut-rectangle",
    cornerLength: Lg(),
    points: ur(4, 0),
    draw: function(e, r, n, a, i, o) {
      this.renderer.nodeShapeImpl(this.name, e, r, n, a, i, null, o);
    },
    generateCutTrianglePts: function(e, r, n, a, i) {
      var o = i === "auto" ? this.cornerLength : i, s = r / 2, u = e / 2, l = n - u, c = n + u, d = a - s, f = a + s;
      return {
        topLeft: [l, d + o, l + o, d, l + o, d + o],
        topRight: [c - o, d, c, d + o, c - o, d + o],
        bottomRight: [c, f - o, c - o, f, c - o, f - o],
        bottomLeft: [l + o, f, l, f - o, l + o, f - o]
      };
    },
    intersectLine: function(e, r, n, a, i, o, s, u) {
      var l = this.generateCutTrianglePts(n + 2 * s, a + 2 * s, e, r, u), c = [].concat.apply([], [l.topLeft.splice(0, 4), l.topRight.splice(0, 4), l.bottomRight.splice(0, 4), l.bottomLeft.splice(0, 4)]);
      return Mo(i, o, c, e, r);
    },
    checkPoint: function(e, r, n, a, i, o, s, u) {
      var l = u === "auto" ? this.cornerLength : u;
      if (_n(e, r, this.points, o, s, a, i - 2 * l, [0, -1], n) || _n(e, r, this.points, o, s, a - 2 * l, i, [0, -1], n))
        return !0;
      var c = this.generateCutTrianglePts(a, i, o, s);
      return vr(e, r, c.topLeft) || vr(e, r, c.topRight) || vr(e, r, c.bottomRight) || vr(e, r, c.bottomLeft);
    }
  };
};
Pn.generateBarrel = function() {
  return this.nodeShapes.barrel = {
    renderer: this,
    name: "barrel",
    points: ur(4, 0),
    draw: function(e, r, n, a, i, o) {
      this.renderer.nodeShapeImpl(this.name, e, r, n, a, i);
    },
    intersectLine: function(e, r, n, a, i, o, s, u) {
      var l = 0.15, c = 0.5, d = 0.85, f = this.generateBarrelBezierPts(n + 2 * s, a + 2 * s, e, r), h = function(g) {
        var y = vi({
          x: g[0],
          y: g[1]
        }, {
          x: g[2],
          y: g[3]
        }, {
          x: g[4],
          y: g[5]
        }, l), m = vi({
          x: g[0],
          y: g[1]
        }, {
          x: g[2],
          y: g[3]
        }, {
          x: g[4],
          y: g[5]
        }, c), b = vi({
          x: g[0],
          y: g[1]
        }, {
          x: g[2],
          y: g[3]
        }, {
          x: g[4],
          y: g[5]
        }, d);
        return [g[0], g[1], y.x, y.y, m.x, m.y, b.x, b.y, g[4], g[5]];
      }, v = [].concat(h(f.topLeft), h(f.topRight), h(f.bottomRight), h(f.bottomLeft));
      return Mo(i, o, v, e, r);
    },
    generateBarrelBezierPts: function(e, r, n, a) {
      var i = r / 2, o = e / 2, s = n - o, u = n + o, l = a - i, c = a + i, d = _p(e, r), f = d.heightOffset, h = d.widthOffset, v = d.ctrlPtOffsetPct * e, p = {
        topLeft: [s, l + f, s + v, l, s + h, l],
        topRight: [u - h, l, u - v, l, u, l + f],
        bottomRight: [u, c - f, u - v, c, u - h, c],
        bottomLeft: [s + h, c, s + v, c, s, c - f]
      };
      return p.topLeft.isTop = !0, p.topRight.isTop = !0, p.bottomLeft.isBottom = !0, p.bottomRight.isBottom = !0, p;
    },
    checkPoint: function(e, r, n, a, i, o, s, u) {
      var l = _p(a, i), c = l.heightOffset, d = l.widthOffset;
      if (_n(e, r, this.points, o, s, a, i - 2 * c, [0, -1], n) || _n(e, r, this.points, o, s, a - 2 * d, i, [0, -1], n))
        return !0;
      for (var f = this.generateBarrelBezierPts(a, i, o, s), h = function(k, S, _) {
        var T = _[4], O = _[2], D = _[0], A = _[5], F = _[1], R = Math.min(T, D), M = Math.max(T, D), L = Math.min(A, F), V = Math.max(A, F);
        if (R <= k && k <= M && L <= S && S <= V) {
          var Y = aq(T, O, D), H = X$(Y[0], Y[1], Y[2], k), K = H.filter(function(ne) {
            return 0 <= ne && ne <= 1;
          });
          if (K.length > 0)
            return K[0];
        }
        return null;
      }, v = Object.keys(f), p = 0; p < v.length; p++) {
        var g = v[p], y = f[g], m = h(e, r, y);
        if (m != null) {
          var b = y[5], w = y[3], x = y[1], E = zt(b, w, x, m);
          if (y.isTop && E <= r || y.isBottom && r <= E)
            return !0;
        }
      }
      return !1;
    }
  };
};
Pn.generateBottomRoundrectangle = function() {
  return this.nodeShapes["bottom-round-rectangle"] = this.nodeShapes.bottomroundrectangle = {
    renderer: this,
    name: "bottom-round-rectangle",
    points: ur(4, 0),
    draw: function(e, r, n, a, i, o) {
      this.renderer.nodeShapeImpl(this.name, e, r, n, a, i, this.points, o);
    },
    intersectLine: function(e, r, n, a, i, o, s, u) {
      var l = e - (n / 2 + s), c = r - (a / 2 + s), d = c, f = e + (n / 2 + s), h = jn(i, o, e, r, l, c, f, d, !1);
      return h.length > 0 ? h : bS(i, o, e, r, n, a, s, u);
    },
    checkPoint: function(e, r, n, a, i, o, s, u) {
      u = u === "auto" ? Ra(a, i) : u;
      var l = 2 * u;
      if (_n(e, r, this.points, o, s, a, i - l, [0, -1], n) || _n(e, r, this.points, o, s, a - l, i, [0, -1], n))
        return !0;
      var c = a / 2 + 2 * n, d = i / 2 + 2 * n, f = [o - c, s - d, o - c, s, o + c, s, o + c, s - d];
      return !!(vr(e, r, f) || xa(e, r, l, l, o + a / 2 - u, s + i / 2 - u, n) || xa(e, r, l, l, o - a / 2 + u, s + i / 2 - u, n));
    }
  };
};
Pn.registerNodeShapes = function() {
  var t = this.nodeShapes = {}, e = this;
  this.generateEllipse(), this.generatePolygon("triangle", ur(3, 0)), this.generateRoundPolygon("round-triangle", ur(3, 0)), this.generatePolygon("rectangle", ur(4, 0)), t.square = t.rectangle, this.generateRoundRectangle(), this.generateCutRectangle(), this.generateBarrel(), this.generateBottomRoundrectangle();
  {
    var r = [0, 1, 1, 0, 0, -1, -1, 0];
    this.generatePolygon("diamond", r), this.generateRoundPolygon("round-diamond", r);
  }
  this.generatePolygon("pentagon", ur(5, 0)), this.generateRoundPolygon("round-pentagon", ur(5, 0)), this.generatePolygon("hexagon", ur(6, 0)), this.generateRoundPolygon("round-hexagon", ur(6, 0)), this.generatePolygon("heptagon", ur(7, 0)), this.generateRoundPolygon("round-heptagon", ur(7, 0)), this.generatePolygon("octagon", ur(8, 0)), this.generateRoundPolygon("round-octagon", ur(8, 0));
  var n = new Array(20);
  {
    var a = kp(5, 0), i = kp(5, Math.PI / 5), o = 0.5 * (3 - Math.sqrt(5));
    o *= 1.57;
    for (var s = 0; s < i.length / 2; s++)
      i[s * 2] *= o, i[s * 2 + 1] *= o;
    for (var s = 0; s < 20 / 4; s++)
      n[s * 4] = a[s * 2], n[s * 4 + 1] = a[s * 2 + 1], n[s * 4 + 2] = i[s * 2], n[s * 4 + 3] = i[s * 2 + 1];
  }
  n = wS(n), this.generatePolygon("star", n), this.generatePolygon("vee", [-1, -1, 0, -0.333, 1, -1, 0, 1]), this.generatePolygon("rhomboid", [-1, -1, 0.333, -1, 1, 1, -0.333, 1]), this.generatePolygon("right-rhomboid", [-0.333, -1, 1, -1, 0.333, 1, -1, 1]), this.nodeShapes.concavehexagon = this.generatePolygon("concave-hexagon", [-1, -0.95, -0.75, 0, -1, 0.95, 1, 0.95, 0.75, 0, 1, -0.95]);
  {
    var u = [-1, -1, 0.25, -1, 1, 0, 0.25, 1, -1, 1];
    this.generatePolygon("tag", u), this.generateRoundPolygon("round-tag", u);
  }
  t.makePolygon = function(l) {
    var c = l.join("$"), d = "polygon-" + c, f;
    return (f = this[d]) ? f : e.generatePolygon(d, l);
  };
};
var ls = {};
ls.timeToRender = function() {
  return this.redrawTotalTime / this.redrawCount;
};
ls.redraw = function(t) {
  t = t || hS();
  var e = this;
  e.averageRedrawTime === void 0 && (e.averageRedrawTime = 0), e.lastRedrawTime === void 0 && (e.lastRedrawTime = 0), e.lastDrawTime === void 0 && (e.lastDrawTime = 0), e.requestedFrame = !0, e.renderOptions = t;
};
ls.beforeRender = function(t, e) {
  if (!this.destroyed) {
    e == null && bt("Priority is not optional for beforeRender");
    var r = this.beforeRenderCallbacks;
    r.push({
      fn: t,
      priority: e
    }), r.sort(function(n, a) {
      return a.priority - n.priority;
    });
  }
};
var K0 = function(e, r, n) {
  for (var a = e.beforeRenderCallbacks, i = 0; i < a.length; i++)
    a[i].fn(r, n);
};
ls.startRenderLoop = function() {
  var t = this, e = t.cy;
  if (!t.renderLoopStarted) {
    t.renderLoopStarted = !0;
    var r = function n(a) {
      if (!t.destroyed) {
        if (!e.batching()) if (t.requestedFrame && !t.skipFrame) {
          K0(t, !0, a);
          var i = kn();
          t.render(t.renderOptions);
          var o = t.lastDrawTime = kn();
          t.averageRedrawTime === void 0 && (t.averageRedrawTime = o - i), t.redrawCount === void 0 && (t.redrawCount = 0), t.redrawCount++, t.redrawTotalTime === void 0 && (t.redrawTotalTime = 0);
          var s = o - i;
          t.redrawTotalTime += s, t.lastRedrawTime = s, t.averageRedrawTime = t.averageRedrawTime / 2 + s / 2, t.requestedFrame = !1;
        } else
          K0(t, !1, a);
        t.skipFrame = !1, ll(n);
      }
    };
    ll(r);
  }
};
var $8 = function(e) {
  this.init(e);
}, bk = $8, Hi = bk.prototype;
Hi.clientFunctions = ["redrawHint", "render", "renderTo", "matchCanvasSize", "nodeShapeImpl", "arrowShapeImpl"];
Hi.init = function(t) {
  var e = this;
  e.options = t, e.cy = t.cy;
  var r = e.container = t.cy.container(), n = e.cy.window();
  if (n) {
    var a = n.document, i = a.head, o = "__________cytoscape_stylesheet", s = "__________cytoscape_container", u = a.getElementById(o) != null;
    if (r.className.indexOf(s) < 0 && (r.className = (r.className || "") + " " + s), !u) {
      var l = a.createElement("style");
      l.id = o, l.textContent = "." + s + " { position: relative; }", i.insertBefore(l, i.children[0]);
    }
    var c = n.getComputedStyle(r), d = c.getPropertyValue("position");
    d === "static" && tt("A Cytoscape container has style position:static and so can not use UI extensions properly");
  }
  e.selection = [void 0, void 0, void 0, void 0, 0], e.bezierProjPcts = [0.05, 0.225, 0.4, 0.5, 0.6, 0.775, 0.95], e.hoverData = {
    down: null,
    last: null,
    downTime: null,
    triggerMode: null,
    dragging: !1,
    initialPan: [null, null],
    capture: !1
  }, e.dragData = {
    possibleDragElements: []
  }, e.touchData = {
    start: null,
    capture: !1,
    // These 3 fields related to tap, taphold events
    startPosition: [null, null, null, null, null, null],
    singleTouchStartTime: null,
    singleTouchMoved: !0,
    now: [null, null, null, null, null, null],
    earlier: [null, null, null, null, null, null]
  }, e.redraws = 0, e.showFps = t.showFps, e.debug = t.debug, e.hideEdgesOnViewport = t.hideEdgesOnViewport, e.textureOnViewport = t.textureOnViewport, e.wheelSensitivity = t.wheelSensitivity, e.motionBlurEnabled = t.motionBlur, e.forcedPixelRatio = Ce(t.pixelRatio) ? t.pixelRatio : null, e.motionBlur = t.motionBlur, e.motionBlurOpacity = t.motionBlurOpacity, e.motionBlurTransparency = 1 - e.motionBlurOpacity, e.motionBlurPxRatio = 1, e.mbPxRBlurry = 1, e.minMbLowQualFrames = 4, e.fullQualityMb = !1, e.clearedForMotionBlur = [], e.desktopTapThreshold = t.desktopTapThreshold, e.desktopTapThreshold2 = t.desktopTapThreshold * t.desktopTapThreshold, e.touchTapThreshold = t.touchTapThreshold, e.touchTapThreshold2 = t.touchTapThreshold * t.touchTapThreshold, e.tapholdDuration = 500, e.bindings = [], e.beforeRenderCallbacks = [], e.beforeRenderPriorities = {
    // higher priority execs before lower one
    animations: 400,
    eleCalcs: 300,
    eleTxrDeq: 200,
    lyrTxrDeq: 150,
    lyrTxrSkip: 100
  }, e.registerNodeShapes(), e.registerArrowShapes(), e.registerCalculationListeners();
};
Hi.notify = function(t, e) {
  var r = this, n = r.cy;
  if (!this.destroyed) {
    if (t === "init") {
      r.load();
      return;
    }
    if (t === "destroy") {
      r.destroy();
      return;
    }
    (t === "add" || t === "remove" || t === "move" && n.hasCompoundNodes() || t === "load" || t === "zorder" || t === "mount") && r.invalidateCachedZSortedEles(), t === "viewport" && r.redrawHint("select", !0), (t === "load" || t === "resize" || t === "mount") && (r.invalidateContainerClientCoordsCache(), r.matchCanvasSize(r.container)), r.redrawHint("eles", !0), r.redrawHint("drag", !0), this.startRenderLoop(), this.redraw();
  }
};
Hi.destroy = function() {
  var t = this;
  t.destroyed = !0, t.cy.stopAnimationLoop();
  for (var e = 0; e < t.bindings.length; e++) {
    var r = t.bindings[e], n = r, a = n.target;
    (a.off || a.removeEventListener).apply(a, n.args);
  }
  if (t.bindings = [], t.beforeRenderCallbacks = [], t.onUpdateEleCalcsFns = [], t.removeObserver && t.removeObserver.disconnect(), t.styleObserver && t.styleObserver.disconnect(), t.resizeObserver && t.resizeObserver.disconnect(), t.labelCalcDiv)
    try {
      document.body.removeChild(t.labelCalcDiv);
    } catch {
    }
};
Hi.isHeadless = function() {
  return !1;
};
[Gg, yk, mk, Vi, Pn, ls].forEach(function(t) {
  ze(Hi, t);
});
var qu = 1e3 / 60, wk = {
  setupDequeueing: function(e) {
    return function() {
      var n = this, a = this.renderer;
      if (!n.dequeueingSetup) {
        n.dequeueingSetup = !0;
        var i = Fl(function() {
          a.redrawHint("eles", !0), a.redrawHint("drag", !0), a.redraw();
        }, e.deqRedrawThreshold), o = function(l, c) {
          var d = kn(), f = a.averageRedrawTime, h = a.lastRedrawTime, v = [], p = a.cy.extent(), g = a.getPixelRatio();
          for (l || a.flushRenderedStyleQueue(); ; ) {
            var y = kn(), m = y - d, b = y - c;
            if (h < qu) {
              var w = qu - (l ? f : 0);
              if (b >= e.deqFastCost * w)
                break;
            } else if (l) {
              if (m >= e.deqCost * h || m >= e.deqAvgCost * f)
                break;
            } else if (b >= e.deqNoDrawCost * qu)
              break;
            var x = e.deq(n, g, p);
            if (x.length > 0)
              for (var E = 0; E < x.length; E++)
                v.push(x[E]);
            else
              break;
          }
          v.length > 0 && (e.onDeqd(n, v), !l && e.shouldRedraw(n, v, g, p) && i());
        }, s = e.priority || Ag;
        a.beforeRender(o, s(n));
      }
    };
  }
}, q8 = /* @__PURE__ */ function() {
  function t(e) {
    var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ul;
    kg(this, t), this.idsByKey = new nn(), this.keyForId = new nn(), this.cachesByLvl = new nn(), this.lvls = [], this.getKey = e, this.doesEleInvalidateKey = r;
  }
  return _g(t, [{
    key: "getIdsFor",
    value: function(r) {
      r == null && bt("Can not get id list for null key");
      var n = this.idsByKey, a = this.idsByKey.get(r);
      return a || (a = new Fi(), n.set(r, a)), a;
    }
  }, {
    key: "addIdForKey",
    value: function(r, n) {
      r != null && this.getIdsFor(r).add(n);
    }
  }, {
    key: "deleteIdForKey",
    value: function(r, n) {
      r != null && this.getIdsFor(r).delete(n);
    }
  }, {
    key: "getNumberOfIdsForKey",
    value: function(r) {
      return r == null ? 0 : this.getIdsFor(r).size;
    }
  }, {
    key: "updateKeyMappingFor",
    value: function(r) {
      var n = r.id(), a = this.keyForId.get(n), i = this.getKey(r);
      this.deleteIdForKey(a, n), this.addIdForKey(i, n), this.keyForId.set(n, i);
    }
  }, {
    key: "deleteKeyMappingFor",
    value: function(r) {
      var n = r.id(), a = this.keyForId.get(n);
      this.deleteIdForKey(a, n), this.keyForId.delete(n);
    }
  }, {
    key: "keyHasChangedFor",
    value: function(r) {
      var n = r.id(), a = this.keyForId.get(n), i = this.getKey(r);
      return a !== i;
    }
  }, {
    key: "isInvalid",
    value: function(r) {
      return this.keyHasChangedFor(r) || this.doesEleInvalidateKey(r);
    }
  }, {
    key: "getCachesAt",
    value: function(r) {
      var n = this.cachesByLvl, a = this.lvls, i = n.get(r);
      return i || (i = new nn(), n.set(r, i), a.push(r)), i;
    }
  }, {
    key: "getCache",
    value: function(r, n) {
      return this.getCachesAt(n).get(r);
    }
  }, {
    key: "get",
    value: function(r, n) {
      var a = this.getKey(r), i = this.getCache(a, n);
      return i != null && this.updateKeyMappingFor(r), i;
    }
  }, {
    key: "getForCachedKey",
    value: function(r, n) {
      var a = this.keyForId.get(r.id()), i = this.getCache(a, n);
      return i;
    }
  }, {
    key: "hasCache",
    value: function(r, n) {
      return this.getCachesAt(n).has(r);
    }
  }, {
    key: "has",
    value: function(r, n) {
      var a = this.getKey(r);
      return this.hasCache(a, n);
    }
  }, {
    key: "setCache",
    value: function(r, n, a) {
      a.key = r, this.getCachesAt(n).set(r, a);
    }
  }, {
    key: "set",
    value: function(r, n, a) {
      var i = this.getKey(r);
      this.setCache(i, n, a), this.updateKeyMappingFor(r);
    }
  }, {
    key: "deleteCache",
    value: function(r, n) {
      this.getCachesAt(n).delete(r);
    }
  }, {
    key: "delete",
    value: function(r, n) {
      var a = this.getKey(r);
      this.deleteCache(a, n);
    }
  }, {
    key: "invalidateKey",
    value: function(r) {
      var n = this;
      this.lvls.forEach(function(a) {
        return n.deleteCache(r, a);
      });
    }
    // returns true if no other eles reference the invalidated cache (n.b. other eles may need the cache with the same key)
  }, {
    key: "invalidate",
    value: function(r) {
      var n = r.id(), a = this.keyForId.get(n);
      this.deleteKeyMappingFor(r);
      var i = this.doesEleInvalidateKey(r);
      return i && this.invalidateKey(a), i || this.getNumberOfIdsForKey(a) === 0;
    }
  }]), t;
}(), G0 = 25, Ms = 50, Zs = -4, Np = 3, z8 = 7.99, V8 = 8, H8 = 1024, K8 = 1024, G8 = 1024, U8 = 0.2, W8 = 0.8, j8 = 10, Y8 = 0.15, Z8 = 0.1, X8 = 0.9, J8 = 0.9, Q8 = 100, eV = 1, ci = {
  dequeue: "dequeue",
  downscale: "downscale",
  highQuality: "highQuality"
}, tV = Zt({
  getKey: null,
  doesEleInvalidateKey: ul,
  drawElement: null,
  getBoundingBox: null,
  getRotationPoint: null,
  getRotationOffset: null,
  isVisible: dS,
  allowEdgeTxrCaching: !0,
  allowParentTxrCaching: !0
}), vo = function(e, r) {
  var n = this;
  n.renderer = e, n.onDequeues = [];
  var a = tV(r);
  ze(n, a), n.lookup = new q8(a.getKey, a.doesEleInvalidateKey), n.setupDequeueing();
}, Bt = vo.prototype;
Bt.reasons = ci;
Bt.getTextureQueue = function(t) {
  var e = this;
  return e.eleImgCaches = e.eleImgCaches || {}, e.eleImgCaches[t] = e.eleImgCaches[t] || [];
};
Bt.getRetiredTextureQueue = function(t) {
  var e = this, r = e.eleImgCaches.retired = e.eleImgCaches.retired || {}, n = r[t] = r[t] || [];
  return n;
};
Bt.getElementQueue = function() {
  var t = this, e = t.eleCacheQueue = t.eleCacheQueue || new as(function(r, n) {
    return n.reqs - r.reqs;
  });
  return e;
};
Bt.getElementKeyToQueue = function() {
  var t = this, e = t.eleKeyToCacheQueue = t.eleKeyToCacheQueue || {};
  return e;
};
Bt.getElement = function(t, e, r, n, a) {
  var i = this, o = this.renderer, s = o.cy.zoom(), u = this.lookup;
  if (!e || e.w === 0 || e.h === 0 || isNaN(e.w) || isNaN(e.h) || !t.visible() || t.removed() || !i.allowEdgeTxrCaching && t.isEdge() || !i.allowParentTxrCaching && t.isParent())
    return null;
  if (n == null && (n = Math.ceil(Dg(s * r))), n < Zs)
    n = Zs;
  else if (s >= z8 || n > Np)
    return null;
  var l = Math.pow(2, n), c = e.h * l, d = e.w * l, f = o.eleTextBiggerThanMin(t, l);
  if (!this.isVisible(t, f))
    return null;
  var h = u.get(t, n);
  if (h && h.invalidated && (h.invalidated = !1, h.texture.invalidatedWidth -= h.width), h)
    return h;
  var v;
  if (c <= G0 ? v = G0 : c <= Ms ? v = Ms : v = Math.ceil(c / Ms) * Ms, c > G8 || d > K8)
    return null;
  var p = i.getTextureQueue(v), g = p[p.length - 2], y = function() {
    return i.recycleTexture(v, d) || i.addTexture(v, d);
  };
  g || (g = p[p.length - 1]), g || (g = y()), g.width - g.usedWidth < d && (g = y());
  for (var m = function(R) {
    return R && R.scaledLabelShown === f;
  }, b = a && a === ci.dequeue, w = a && a === ci.highQuality, x = a && a === ci.downscale, E, C = n + 1; C <= Np; C++) {
    var k = u.get(t, C);
    if (k) {
      E = k;
      break;
    }
  }
  var S = E && E.level === n + 1 ? E : null, _ = function() {
    g.context.drawImage(S.texture.canvas, S.x, 0, S.width, S.height, g.usedWidth, 0, d, c);
  };
  if (g.context.setTransform(1, 0, 0, 1, 0, 0), g.context.clearRect(g.usedWidth, 0, d, v), m(S))
    _();
  else if (m(E))
    if (w) {
      for (var T = E.level; T > n; T--)
        S = i.getElement(t, e, r, T, ci.downscale);
      _();
    } else
      return i.queueElement(t, E.level - 1), E;
  else {
    var O;
    if (!b && !w && !x)
      for (var D = n - 1; D >= Zs; D--) {
        var A = u.get(t, D);
        if (A) {
          O = A;
          break;
        }
      }
    if (m(O))
      return i.queueElement(t, n), O;
    g.context.translate(g.usedWidth, 0), g.context.scale(l, l), this.drawElement(g.context, t, e, f, !1), g.context.scale(1 / l, 1 / l), g.context.translate(-g.usedWidth, 0);
  }
  return h = {
    x: g.usedWidth,
    texture: g,
    level: n,
    scale: l,
    width: d,
    height: c,
    scaledLabelShown: f
  }, g.usedWidth += Math.ceil(d + V8), g.eleCaches.push(h), u.set(t, n, h), i.checkTextureFullness(g), h;
};
Bt.invalidateElements = function(t) {
  for (var e = 0; e < t.length; e++)
    this.invalidateElement(t[e]);
};
Bt.invalidateElement = function(t) {
  var e = this, r = e.lookup, n = [], a = r.isInvalid(t);
  if (a) {
    for (var i = Zs; i <= Np; i++) {
      var o = r.getForCachedKey(t, i);
      o && n.push(o);
    }
    var s = r.invalidate(t);
    if (s)
      for (var u = 0; u < n.length; u++) {
        var l = n[u], c = l.texture;
        c.invalidatedWidth += l.width, l.invalidated = !0, e.checkTextureUtility(c);
      }
    e.removeFromQueue(t);
  }
};
Bt.checkTextureUtility = function(t) {
  t.invalidatedWidth >= U8 * t.width && this.retireTexture(t);
};
Bt.checkTextureFullness = function(t) {
  var e = this, r = e.getTextureQueue(t.height);
  t.usedWidth / t.width > W8 && t.fullnessChecks >= j8 ? ta(r, t) : t.fullnessChecks++;
};
Bt.retireTexture = function(t) {
  var e = this, r = t.height, n = e.getTextureQueue(r), a = this.lookup;
  ta(n, t), t.retired = !0;
  for (var i = t.eleCaches, o = 0; o < i.length; o++) {
    var s = i[o];
    a.deleteCache(s.key, s.level);
  }
  Pg(i);
  var u = e.getRetiredTextureQueue(r);
  u.push(t);
};
Bt.addTexture = function(t, e) {
  var r = this, n = r.getTextureQueue(t), a = {};
  return n.push(a), a.eleCaches = [], a.height = t, a.width = Math.max(H8, e), a.usedWidth = 0, a.invalidatedWidth = 0, a.fullnessChecks = 0, a.canvas = r.renderer.makeOffscreenCanvas(a.width, a.height), a.context = a.canvas.getContext("2d"), a;
};
Bt.recycleTexture = function(t, e) {
  for (var r = this, n = r.getTextureQueue(t), a = r.getRetiredTextureQueue(t), i = 0; i < a.length; i++) {
    var o = a[i];
    if (o.width >= e)
      return o.retired = !1, o.usedWidth = 0, o.invalidatedWidth = 0, o.fullnessChecks = 0, Pg(o.eleCaches), o.context.setTransform(1, 0, 0, 1, 0, 0), o.context.clearRect(0, 0, o.width, o.height), ta(a, o), n.push(o), o;
  }
};
Bt.queueElement = function(t, e) {
  var r = this, n = r.getElementQueue(), a = r.getElementKeyToQueue(), i = this.getKey(t), o = a[i];
  if (o)
    o.level = Math.max(o.level, e), o.eles.merge(t), o.reqs++, n.updateItem(o);
  else {
    var s = {
      eles: t.spawn().merge(t),
      level: e,
      reqs: 1,
      key: i
    };
    n.push(s), a[i] = s;
  }
};
Bt.dequeue = function(t) {
  for (var e = this, r = e.getElementQueue(), n = e.getElementKeyToQueue(), a = [], i = e.lookup, o = 0; o < eV && r.size() > 0; o++) {
    var s = r.pop(), u = s.key, l = s.eles[0], c = i.hasCache(l, s.level);
    if (n[u] = null, c)
      continue;
    a.push(s);
    var d = e.getBoundingBox(l);
    e.getElement(l, d, t, s.level, ci.dequeue);
  }
  return a;
};
Bt.removeFromQueue = function(t) {
  var e = this, r = e.getElementQueue(), n = e.getElementKeyToQueue(), a = this.getKey(t), i = n[a];
  i != null && (i.eles.length === 1 ? (i.reqs = Og, r.updateItem(i), r.pop(), n[a] = null) : i.eles.unmerge(t));
};
Bt.onDequeue = function(t) {
  this.onDequeues.push(t);
};
Bt.offDequeue = function(t) {
  ta(this.onDequeues, t);
};
Bt.setupDequeueing = wk.setupDequeueing({
  deqRedrawThreshold: Q8,
  deqCost: Y8,
  deqAvgCost: Z8,
  deqNoDrawCost: X8,
  deqFastCost: J8,
  deq: function(e, r, n) {
    return e.dequeue(r, n);
  },
  onDeqd: function(e, r) {
    for (var n = 0; n < e.onDequeues.length; n++) {
      var a = e.onDequeues[n];
      a(r);
    }
  },
  shouldRedraw: function(e, r, n, a) {
    for (var i = 0; i < r.length; i++)
      for (var o = r[i].eles, s = 0; s < o.length; s++) {
        var u = o[s].boundingBox();
        if (Rg(u, a))
          return !0;
      }
    return !1;
  },
  priority: function(e) {
    return e.renderer.beforeRenderPriorities.eleTxrDeq;
  }
});
var rV = 1, xo = -4, yl = 2, nV = 3.99, aV = 50, iV = 50, oV = 0.15, sV = 0.1, lV = 0.9, uV = 0.9, cV = 1, U0 = 250, dV = 4e3 * 4e3, fV = !0, Ck = function(e) {
  var r = this, n = r.renderer = e, a = n.cy;
  r.layersByLevel = {}, r.firstGet = !0, r.lastInvalidationTime = kn() - 2 * U0, r.skipping = !1, r.eleTxrDeqs = a.collection(), r.scheduleElementRefinement = Fl(function() {
    r.refineElementTextures(r.eleTxrDeqs), r.eleTxrDeqs.unmerge(r.eleTxrDeqs);
  }, iV), n.beforeRender(function(o, s) {
    s - r.lastInvalidationTime <= U0 ? r.skipping = !0 : r.skipping = !1;
  }, n.beforeRenderPriorities.lyrTxrSkip);
  var i = function(s, u) {
    return u.reqs - s.reqs;
  };
  r.layersQueue = new as(i), r.setupDequeueing();
}, Xt = Ck.prototype, W0 = 0, vV = Math.pow(2, 53) - 1;
Xt.makeLayer = function(t, e) {
  var r = Math.pow(2, e), n = Math.ceil(t.w * r), a = Math.ceil(t.h * r), i = this.renderer.makeOffscreenCanvas(n, a), o = {
    id: W0 = ++W0 % vV,
    bb: t,
    level: e,
    width: n,
    height: a,
    canvas: i,
    context: i.getContext("2d"),
    eles: [],
    elesQueue: [],
    reqs: 0
  }, s = o.context, u = -o.bb.x1, l = -o.bb.y1;
  return s.scale(r, r), s.translate(u, l), o;
};
Xt.getLayers = function(t, e, r) {
  var n = this, a = n.renderer, i = a.cy, o = i.zoom(), s = n.firstGet;
  if (n.firstGet = !1, r == null) {
    if (r = Math.ceil(Dg(o * e)), r < xo)
      r = xo;
    else if (o >= nV || r > yl)
      return null;
  }
  n.validateLayersElesOrdering(r, t);
  var u = n.layersByLevel, l = Math.pow(2, r), c = u[r] = u[r] || [], d, f = n.levelIsComplete(r, t), h, v = function() {
    var _ = function(F) {
      if (n.validateLayersElesOrdering(F, t), n.levelIsComplete(F, t))
        return h = u[F], !0;
    }, T = function(F) {
      if (!h)
        for (var R = r + F; xo <= R && R <= yl && !_(R); R += F)
          ;
    };
    T(1), T(-1);
    for (var O = c.length - 1; O >= 0; O--) {
      var D = c[O];
      D.invalid && ta(c, D);
    }
  };
  if (!f)
    v();
  else
    return c;
  var p = function() {
    if (!d) {
      d = br();
      for (var _ = 0; _ < t.length; _++)
        yS(d, t[_].boundingBox());
    }
    return d;
  }, g = function(_) {
    _ = _ || {};
    var T = _.after;
    p();
    var O = d.w * l * (d.h * l);
    if (O > dV)
      return null;
    var D = n.makeLayer(d, r);
    if (T != null) {
      var A = c.indexOf(T) + 1;
      c.splice(A, 0, D);
    } else (_.insert === void 0 || _.insert) && c.unshift(D);
    return D;
  };
  if (n.skipping && !s)
    return null;
  for (var y = null, m = t.length / rV, b = !s, w = 0; w < t.length; w++) {
    var x = t[w], E = x._private.rscratch, C = E.imgLayerCaches = E.imgLayerCaches || {}, k = C[r];
    if (k) {
      y = k;
      continue;
    }
    if ((!y || y.eles.length >= m || !mS(y.bb, x.boundingBox())) && (y = g({
      insert: !0,
      after: y
    }), !y))
      return null;
    h || b ? n.queueLayer(y, x) : n.drawEleInLayer(y, x, r, e), y.eles.push(x), C[r] = y;
  }
  return h || (b ? null : c);
};
Xt.getEleLevelForLayerLevel = function(t, e) {
  return t;
};
Xt.drawEleInLayer = function(t, e, r, n) {
  var a = this, i = this.renderer, o = t.context, s = e.boundingBox();
  s.w === 0 || s.h === 0 || !e.visible() || (r = a.getEleLevelForLayerLevel(r, n), i.setImgSmoothing(o, !1), i.drawCachedElement(o, e, null, null, r, fV), i.setImgSmoothing(o, !0));
};
Xt.levelIsComplete = function(t, e) {
  var r = this, n = r.layersByLevel[t];
  if (!n || n.length === 0)
    return !1;
  for (var a = 0, i = 0; i < n.length; i++) {
    var o = n[i];
    if (o.reqs > 0 || o.invalid)
      return !1;
    a += o.eles.length;
  }
  return a === e.length;
};
Xt.validateLayersElesOrdering = function(t, e) {
  var r = this.layersByLevel[t];
  if (r)
    for (var n = 0; n < r.length; n++) {
      for (var a = r[n], i = -1, o = 0; o < e.length; o++)
        if (a.eles[0] === e[o]) {
          i = o;
          break;
        }
      if (i < 0) {
        this.invalidateLayer(a);
        continue;
      }
      for (var s = i, o = 0; o < a.eles.length; o++)
        if (a.eles[o] !== e[s + o]) {
          this.invalidateLayer(a);
          break;
        }
    }
};
Xt.updateElementsInLayers = function(t, e) {
  for (var r = this, n = rs(t[0]), a = 0; a < t.length; a++)
    for (var i = n ? null : t[a], o = n ? t[a] : t[a].ele, s = o._private.rscratch, u = s.imgLayerCaches = s.imgLayerCaches || {}, l = xo; l <= yl; l++) {
      var c = u[l];
      c && (i && r.getEleLevelForLayerLevel(c.level) !== i.level || e(c, o, i));
    }
};
Xt.haveLayers = function() {
  for (var t = this, e = !1, r = xo; r <= yl; r++) {
    var n = t.layersByLevel[r];
    if (n && n.length > 0) {
      e = !0;
      break;
    }
  }
  return e;
};
Xt.invalidateElements = function(t) {
  var e = this;
  t.length !== 0 && (e.lastInvalidationTime = kn(), !(t.length === 0 || !e.haveLayers()) && e.updateElementsInLayers(t, function(n, a, i) {
    e.invalidateLayer(n);
  }));
};
Xt.invalidateLayer = function(t) {
  if (this.lastInvalidationTime = kn(), !t.invalid) {
    var e = t.level, r = t.eles, n = this.layersByLevel[e];
    ta(n, t), t.elesQueue = [], t.invalid = !0, t.replacement && (t.replacement.invalid = !0);
    for (var a = 0; a < r.length; a++) {
      var i = r[a]._private.rscratch.imgLayerCaches;
      i && (i[e] = null);
    }
  }
};
Xt.refineElementTextures = function(t) {
  var e = this;
  e.updateElementsInLayers(t, function(n, a, i) {
    var o = n.replacement;
    if (o || (o = n.replacement = e.makeLayer(n.bb, n.level), o.replaces = n, o.eles = n.eles), !o.reqs)
      for (var s = 0; s < o.eles.length; s++)
        e.queueLayer(o, o.eles[s]);
  });
};
Xt.enqueueElementRefinement = function(t) {
  this.eleTxrDeqs.merge(t), this.scheduleElementRefinement();
};
Xt.queueLayer = function(t, e) {
  var r = this, n = r.layersQueue, a = t.elesQueue, i = a.hasId = a.hasId || {};
  if (!t.replacement) {
    if (e) {
      if (i[e.id()])
        return;
      a.push(e), i[e.id()] = !0;
    }
    t.reqs ? (t.reqs++, n.updateItem(t)) : (t.reqs = 1, n.push(t));
  }
};
Xt.dequeue = function(t) {
  for (var e = this, r = e.layersQueue, n = [], a = 0; a < cV && r.size() !== 0; ) {
    var i = r.peek();
    if (i.replacement) {
      r.pop();
      continue;
    }
    if (i.replaces && i !== i.replaces.replacement) {
      r.pop();
      continue;
    }
    if (i.invalid) {
      r.pop();
      continue;
    }
    var o = i.elesQueue.shift();
    o && (e.drawEleInLayer(i, o, i.level, t), a++), n.length === 0 && n.push(!0), i.elesQueue.length === 0 && (r.pop(), i.reqs = 0, i.replaces && e.applyLayerReplacement(i), e.requestRedraw());
  }
  return n;
};
Xt.applyLayerReplacement = function(t) {
  var e = this, r = e.layersByLevel[t.level], n = t.replaces, a = r.indexOf(n);
  if (!(a < 0 || n.invalid)) {
    r[a] = t;
    for (var i = 0; i < t.eles.length; i++) {
      var o = t.eles[i]._private, s = o.imgLayerCaches = o.imgLayerCaches || {};
      s && (s[t.level] = t);
    }
    e.requestRedraw();
  }
};
Xt.requestRedraw = Fl(function() {
  var t = this.renderer;
  t.redrawHint("eles", !0), t.redrawHint("drag", !0), t.redraw();
}, 100);
Xt.setupDequeueing = wk.setupDequeueing({
  deqRedrawThreshold: aV,
  deqCost: oV,
  deqAvgCost: sV,
  deqNoDrawCost: lV,
  deqFastCost: uV,
  deq: function(e, r) {
    return e.dequeue(r);
  },
  onDeqd: Ag,
  shouldRedraw: dS,
  priority: function(e) {
    return e.renderer.beforeRenderPriorities.lyrTxrDeq;
  }
});
var xk = {}, j0;
function hV(t, e) {
  for (var r = 0; r < e.length; r++) {
    var n = e[r];
    t.lineTo(n.x, n.y);
  }
}
function pV(t, e, r) {
  for (var n, a = 0; a < e.length; a++) {
    var i = e[a];
    a === 0 && (n = i), t.lineTo(i.x, i.y);
  }
  t.quadraticCurveTo(r.x, r.y, n.x, n.y);
}
function Y0(t, e, r) {
  t.beginPath && t.beginPath();
  for (var n = e, a = 0; a < n.length; a++) {
    var i = n[a];
    t.lineTo(i.x, i.y);
  }
  var o = r, s = r[0];
  t.moveTo(s.x, s.y);
  for (var a = 1; a < o.length; a++) {
    var i = o[a];
    t.lineTo(i.x, i.y);
  }
  t.closePath && t.closePath();
}
function gV(t, e, r, n, a) {
  t.beginPath && t.beginPath(), t.arc(r, n, a, 0, Math.PI * 2, !1);
  var i = e, o = i[0];
  t.moveTo(o.x, o.y);
  for (var s = 0; s < i.length; s++) {
    var u = i[s];
    t.lineTo(u.x, u.y);
  }
  t.closePath && t.closePath();
}
function yV(t, e, r, n) {
  t.arc(e, r, n, 0, Math.PI * 2, !1);
}
xk.arrowShapeImpl = function(t) {
  return (j0 || (j0 = {
    polygon: hV,
    "triangle-backcurve": pV,
    "triangle-tee": Y0,
    "circle-triangle": gV,
    "triangle-cross": Y0,
    circle: yV
  }))[t];
};
var vn = {};
vn.drawElement = function(t, e, r, n, a, i) {
  var o = this;
  e.isNode() ? o.drawNode(t, e, r, n, a, i) : o.drawEdge(t, e, r, n, a, i);
};
vn.drawElementOverlay = function(t, e) {
  var r = this;
  e.isNode() ? r.drawNodeOverlay(t, e) : r.drawEdgeOverlay(t, e);
};
vn.drawElementUnderlay = function(t, e) {
  var r = this;
  e.isNode() ? r.drawNodeUnderlay(t, e) : r.drawEdgeUnderlay(t, e);
};
vn.drawCachedElementPortion = function(t, e, r, n, a, i, o, s) {
  var u = this, l = r.getBoundingBox(e);
  if (!(l.w === 0 || l.h === 0)) {
    var c = r.getElement(e, l, n, a, i);
    if (c != null) {
      var d = s(u, e);
      if (d === 0)
        return;
      var f = o(u, e), h = l.x1, v = l.y1, p = l.w, g = l.h, y, m, b, w, x;
      if (f !== 0) {
        var E = r.getRotationPoint(e);
        b = E.x, w = E.y, t.translate(b, w), t.rotate(f), x = u.getImgSmoothing(t), x || u.setImgSmoothing(t, !0);
        var C = r.getRotationOffset(e);
        y = C.x, m = C.y;
      } else
        y = h, m = v;
      var k;
      d !== 1 && (k = t.globalAlpha, t.globalAlpha = k * d), t.drawImage(c.texture.canvas, c.x, 0, c.width, c.height, y, m, p, g), d !== 1 && (t.globalAlpha = k), f !== 0 && (t.rotate(-f), t.translate(-b, -w), x || u.setImgSmoothing(t, !1));
    } else
      r.drawElement(t, e);
  }
};
var mV = function() {
  return 0;
}, bV = function(e, r) {
  return e.getTextAngle(r, null);
}, wV = function(e, r) {
  return e.getTextAngle(r, "source");
}, CV = function(e, r) {
  return e.getTextAngle(r, "target");
}, xV = function(e, r) {
  return r.effectiveOpacity();
}, zu = function(e, r) {
  return r.pstyle("text-opacity").pfValue * r.effectiveOpacity();
};
vn.drawCachedElement = function(t, e, r, n, a, i) {
  var o = this, s = o.data, u = s.eleTxrCache, l = s.lblTxrCache, c = s.slbTxrCache, d = s.tlbTxrCache, f = e.boundingBox(), h = i === !0 ? u.reasons.highQuality : null;
  if (!(f.w === 0 || f.h === 0 || !e.visible()) && (!n || Rg(f, n))) {
    var v = e.isEdge(), p = e.element()._private.rscratch.badLine;
    o.drawElementUnderlay(t, e), o.drawCachedElementPortion(t, e, u, r, a, h, mV, xV), (!v || !p) && o.drawCachedElementPortion(t, e, l, r, a, h, bV, zu), v && !p && (o.drawCachedElementPortion(t, e, c, r, a, h, wV, zu), o.drawCachedElementPortion(t, e, d, r, a, h, CV, zu)), o.drawElementOverlay(t, e);
  }
};
vn.drawElements = function(t, e) {
  for (var r = this, n = 0; n < e.length; n++) {
    var a = e[n];
    r.drawElement(t, a);
  }
};
vn.drawCachedElements = function(t, e, r, n) {
  for (var a = this, i = 0; i < e.length; i++) {
    var o = e[i];
    a.drawCachedElement(t, o, r, n);
  }
};
vn.drawCachedNodes = function(t, e, r, n) {
  for (var a = this, i = 0; i < e.length; i++) {
    var o = e[i];
    o.isNode() && a.drawCachedElement(t, o, r, n);
  }
};
vn.drawLayeredElements = function(t, e, r, n) {
  var a = this, i = a.data.lyrTxrCache.getLayers(e, r);
  if (i)
    for (var o = 0; o < i.length; o++) {
      var s = i[o], u = s.bb;
      u.w === 0 || u.h === 0 || t.drawImage(s.canvas, u.x1, u.y1, u.w, u.h);
    }
  else
    a.drawCachedElements(t, e, r, n);
};
var Dn = {};
Dn.drawEdge = function(t, e, r) {
  var n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !0, a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, i = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : !0, o = this, s = e._private.rscratch;
  if (!(i && !e.visible()) && !(s.badLine || s.allpts == null || isNaN(s.allpts[0]))) {
    var u;
    r && (u = r, t.translate(-u.x1, -u.y1));
    var l = i ? e.pstyle("opacity").value : 1, c = i ? e.pstyle("line-opacity").value : 1, d = e.pstyle("curve-style").value, f = e.pstyle("line-style").value, h = e.pstyle("width").pfValue, v = e.pstyle("line-cap").value, p = e.pstyle("line-outline-width").value, g = e.pstyle("line-outline-color").value, y = l * c, m = l * c, b = function() {
      var F = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : y;
      d === "straight-triangle" ? (o.eleStrokeStyle(t, e, F), o.drawEdgeTrianglePath(e, t, s.allpts)) : (t.lineWidth = h, t.lineCap = v, o.eleStrokeStyle(t, e, F), o.drawEdgePath(e, t, s.allpts, f), t.lineCap = "butt");
    }, w = function() {
      var F = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : y;
      if (t.lineWidth = h + p, t.lineCap = v, p > 0)
        o.colorStrokeStyle(t, g[0], g[1], g[2], F);
      else {
        t.lineCap = "butt";
        return;
      }
      d === "straight-triangle" ? o.drawEdgeTrianglePath(e, t, s.allpts) : (o.drawEdgePath(e, t, s.allpts, f), t.lineCap = "butt");
    }, x = function() {
      a && o.drawEdgeOverlay(t, e);
    }, E = function() {
      a && o.drawEdgeUnderlay(t, e);
    }, C = function() {
      var F = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : m;
      o.drawArrowheads(t, e, F);
    }, k = function() {
      o.drawElementText(t, e, null, n);
    };
    t.lineJoin = "round";
    var S = e.pstyle("ghost").value === "yes";
    if (S) {
      var _ = e.pstyle("ghost-offset-x").pfValue, T = e.pstyle("ghost-offset-y").pfValue, O = e.pstyle("ghost-opacity").value, D = y * O;
      t.translate(_, T), b(D), C(D), t.translate(-_, -T);
    } else
      w();
    E(), b(), C(), x(), k(), r && t.translate(u.x1, u.y1);
  }
};
var Ek = function(e) {
  if (!["overlay", "underlay"].includes(e))
    throw new Error("Invalid state");
  return function(r, n) {
    if (n.visible()) {
      var a = n.pstyle("".concat(e, "-opacity")).value;
      if (a !== 0) {
        var i = this, o = i.usePaths(), s = n._private.rscratch, u = n.pstyle("".concat(e, "-padding")).pfValue, l = 2 * u, c = n.pstyle("".concat(e, "-color")).value;
        r.lineWidth = l, s.edgeType === "self" && !o ? r.lineCap = "butt" : r.lineCap = "round", i.colorStrokeStyle(r, c[0], c[1], c[2], a), i.drawEdgePath(n, r, s.allpts, "solid");
      }
    }
  };
};
Dn.drawEdgeOverlay = Ek("overlay");
Dn.drawEdgeUnderlay = Ek("underlay");
Dn.drawEdgePath = function(t, e, r, n) {
  var a = t._private.rscratch, i = e, o, s = !1, u = this.usePaths(), l = t.pstyle("line-dash-pattern").pfValue, c = t.pstyle("line-dash-offset").pfValue;
  if (u) {
    var d = r.join("$"), f = a.pathCacheKey && a.pathCacheKey === d;
    f ? (o = e = a.pathCache, s = !0) : (o = e = new Path2D(), a.pathCacheKey = d, a.pathCache = o);
  }
  if (i.setLineDash)
    switch (n) {
      case "dotted":
        i.setLineDash([1, 1]);
        break;
      case "dashed":
        i.setLineDash(l), i.lineDashOffset = c;
        break;
      case "solid":
        i.setLineDash([]);
        break;
    }
  if (!s && !a.badLine)
    switch (e.beginPath && e.beginPath(), e.moveTo(r[0], r[1]), a.edgeType) {
      case "bezier":
      case "self":
      case "compound":
      case "multibezier":
        for (var h = 2; h + 3 < r.length; h += 4)
          e.quadraticCurveTo(r[h], r[h + 1], r[h + 2], r[h + 3]);
        break;
      case "straight":
      case "haystack":
        for (var v = 2; v + 1 < r.length; v += 2)
          e.lineTo(r[v], r[v + 1]);
        break;
      case "segments":
        if (a.isRound) {
          var p = X2(a.roundCorners), g;
          try {
            for (p.s(); !(g = p.n()).done; ) {
              var y = g.value;
              fk(e, y);
            }
          } catch (b) {
            p.e(b);
          } finally {
            p.f();
          }
          e.lineTo(r[r.length - 2], r[r.length - 1]);
        } else
          for (var m = 2; m + 1 < r.length; m += 2)
            e.lineTo(r[m], r[m + 1]);
        break;
    }
  e = i, u ? e.stroke(o) : e.stroke(), e.setLineDash && e.setLineDash([]);
};
Dn.drawEdgeTrianglePath = function(t, e, r) {
  e.fillStyle = e.strokeStyle;
  for (var n = t.pstyle("width").pfValue, a = 0; a + 1 < r.length; a += 2) {
    var i = [r[a + 2] - r[a], r[a + 3] - r[a + 1]], o = Math.sqrt(i[0] * i[0] + i[1] * i[1]), s = [i[1] / o, -i[0] / o], u = [s[0] * n / 2, s[1] * n / 2];
    e.beginPath(), e.moveTo(r[a] - u[0], r[a + 1] - u[1]), e.lineTo(r[a] + u[0], r[a + 1] + u[1]), e.lineTo(r[a + 2], r[a + 3]), e.closePath(), e.fill();
  }
};
Dn.drawArrowheads = function(t, e, r) {
  var n = e._private.rscratch, a = n.edgeType === "haystack";
  a || this.drawArrowhead(t, e, "source", n.arrowStartX, n.arrowStartY, n.srcArrowAngle, r), this.drawArrowhead(t, e, "mid-target", n.midX, n.midY, n.midtgtArrowAngle, r), this.drawArrowhead(t, e, "mid-source", n.midX, n.midY, n.midsrcArrowAngle, r), a || this.drawArrowhead(t, e, "target", n.arrowEndX, n.arrowEndY, n.tgtArrowAngle, r);
};
Dn.drawArrowhead = function(t, e, r, n, a, i, o) {
  if (!(isNaN(n) || n == null || isNaN(a) || a == null || isNaN(i) || i == null)) {
    var s = this, u = e.pstyle(r + "-arrow-shape").value;
    if (u !== "none") {
      var l = e.pstyle(r + "-arrow-fill").value === "hollow" ? "both" : "filled", c = e.pstyle(r + "-arrow-fill").value, d = e.pstyle("width").pfValue, f = e.pstyle(r + "-arrow-width"), h = f.value === "match-line" ? d : f.pfValue;
      f.units === "%" && (h *= d);
      var v = e.pstyle("opacity").value;
      o === void 0 && (o = v);
      var p = t.globalCompositeOperation;
      (o !== 1 || c === "hollow") && (t.globalCompositeOperation = "destination-out", s.colorFillStyle(t, 255, 255, 255, 1), s.colorStrokeStyle(t, 255, 255, 255, 1), s.drawArrowShape(e, t, l, d, u, h, n, a, i), t.globalCompositeOperation = p);
      var g = e.pstyle(r + "-arrow-color").value;
      s.colorFillStyle(t, g[0], g[1], g[2], o), s.colorStrokeStyle(t, g[0], g[1], g[2], o), s.drawArrowShape(e, t, c, d, u, h, n, a, i);
    }
  }
};
Dn.drawArrowShape = function(t, e, r, n, a, i, o, s, u) {
  var l = this, c = this.usePaths() && a !== "triangle-cross", d = !1, f, h = e, v = {
    x: o,
    y: s
  }, p = t.pstyle("arrow-scale").value, g = this.getArrowWidth(n, p), y = l.arrowShapes[a];
  if (c) {
    var m = l.arrowPathCache = l.arrowPathCache || [], b = Pa(a), w = m[b];
    w != null ? (f = e = w, d = !0) : (f = e = new Path2D(), m[b] = f);
  }
  d || (e.beginPath && e.beginPath(), c ? y.draw(e, 1, 0, {
    x: 0,
    y: 0
  }, 1) : y.draw(e, g, u, v, n), e.closePath && e.closePath()), e = h, c && (e.translate(o, s), e.rotate(u), e.scale(g, g)), (r === "filled" || r === "both") && (c ? e.fill(f) : e.fill()), (r === "hollow" || r === "both") && (e.lineWidth = i / (c ? g : 1), e.lineJoin = "miter", c ? e.stroke(f) : e.stroke()), c && (e.scale(1 / g, 1 / g), e.rotate(-u), e.translate(-o, -s));
};
var jg = {};
jg.safeDrawImage = function(t, e, r, n, a, i, o, s, u, l) {
  if (!(a <= 0 || i <= 0 || u <= 0 || l <= 0))
    try {
      t.drawImage(e, r, n, a, i, o, s, u, l);
    } catch (c) {
      tt(c);
    }
};
jg.drawInscribedImage = function(t, e, r, n, a) {
  var i = this, o = r.position(), s = o.x, u = o.y, l = r.cy().style(), c = l.getIndexedStyle.bind(l), d = c(r, "background-fit", "value", n), f = c(r, "background-repeat", "value", n), h = r.width(), v = r.height(), p = r.padding() * 2, g = h + (c(r, "background-width-relative-to", "value", n) === "inner" ? 0 : p), y = v + (c(r, "background-height-relative-to", "value", n) === "inner" ? 0 : p), m = r._private.rscratch, b = c(r, "background-clip", "value", n), w = b === "node", x = c(r, "background-image-opacity", "value", n) * a, E = c(r, "background-image-smoothing", "value", n), C = r.pstyle("corner-radius").value;
  C !== "auto" && (C = r.pstyle("corner-radius").pfValue);
  var k = e.width || e.cachedW, S = e.height || e.cachedH;
  (k == null || S == null) && (document.body.appendChild(e), k = e.cachedW = e.width || e.offsetWidth, S = e.cachedH = e.height || e.offsetHeight, document.body.removeChild(e));
  var _ = k, T = S;
  if (c(r, "background-width", "value", n) !== "auto" && (c(r, "background-width", "units", n) === "%" ? _ = c(r, "background-width", "pfValue", n) * g : _ = c(r, "background-width", "pfValue", n)), c(r, "background-height", "value", n) !== "auto" && (c(r, "background-height", "units", n) === "%" ? T = c(r, "background-height", "pfValue", n) * y : T = c(r, "background-height", "pfValue", n)), !(_ === 0 || T === 0)) {
    if (d === "contain") {
      var O = Math.min(g / _, y / T);
      _ *= O, T *= O;
    } else if (d === "cover") {
      var O = Math.max(g / _, y / T);
      _ *= O, T *= O;
    }
    var D = s - g / 2, A = c(r, "background-position-x", "units", n), F = c(r, "background-position-x", "pfValue", n);
    A === "%" ? D += (g - _) * F : D += F;
    var R = c(r, "background-offset-x", "units", n), M = c(r, "background-offset-x", "pfValue", n);
    R === "%" ? D += (g - _) * M : D += M;
    var L = u - y / 2, V = c(r, "background-position-y", "units", n), Y = c(r, "background-position-y", "pfValue", n);
    V === "%" ? L += (y - T) * Y : L += Y;
    var H = c(r, "background-offset-y", "units", n), K = c(r, "background-offset-y", "pfValue", n);
    H === "%" ? L += (y - T) * K : L += K, m.pathCache && (D -= s, L -= u, s = 0, u = 0);
    var ne = t.globalAlpha;
    t.globalAlpha = x;
    var B = i.getImgSmoothing(t), $ = !1;
    if (E === "no" && B ? (i.setImgSmoothing(t, !1), $ = !0) : E === "yes" && !B && (i.setImgSmoothing(t, !0), $ = !0), f === "no-repeat")
      w && (t.save(), m.pathCache ? t.clip(m.pathCache) : (i.nodeShapes[i.getNodeShape(r)].draw(t, s, u, g, y, C, m), t.clip())), i.safeDrawImage(t, e, 0, 0, k, S, D, L, _, T), w && t.restore();
    else {
      var z = t.createPattern(e, f);
      t.fillStyle = z, i.nodeShapes[i.getNodeShape(r)].draw(t, s, u, g, y, C, m), t.translate(D, L), t.fill(), t.translate(-D, -L);
    }
    t.globalAlpha = ne, $ && i.setImgSmoothing(t, B);
  }
};
var Ga = {};
Ga.eleTextBiggerThanMin = function(t, e) {
  if (!e) {
    var r = t.cy().zoom(), n = this.getPixelRatio(), a = Math.ceil(Dg(r * n));
    e = Math.pow(2, a);
  }
  var i = t.pstyle("font-size").pfValue * e, o = t.pstyle("min-zoomed-font-size").pfValue;
  return !(i < o);
};
Ga.drawElementText = function(t, e, r, n, a) {
  var i = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : !0, o = this;
  if (n == null) {
    if (i && !o.eleTextBiggerThanMin(e))
      return;
  } else if (n === !1)
    return;
  if (e.isNode()) {
    var s = e.pstyle("label");
    if (!s || !s.value)
      return;
    var u = o.getLabelJustification(e);
    t.textAlign = u, t.textBaseline = "bottom";
  } else {
    var l = e.element()._private.rscratch.badLine, c = e.pstyle("label"), d = e.pstyle("source-label"), f = e.pstyle("target-label");
    if (l || (!c || !c.value) && (!d || !d.value) && (!f || !f.value))
      return;
    t.textAlign = "center", t.textBaseline = "bottom";
  }
  var h = !r, v;
  r && (v = r, t.translate(-v.x1, -v.y1)), a == null ? (o.drawText(t, e, null, h, i), e.isEdge() && (o.drawText(t, e, "source", h, i), o.drawText(t, e, "target", h, i))) : o.drawText(t, e, a, h, i), r && t.translate(v.x1, v.y1);
};
Ga.getFontCache = function(t) {
  var e;
  this.fontCaches = this.fontCaches || [];
  for (var r = 0; r < this.fontCaches.length; r++)
    if (e = this.fontCaches[r], e.context === t)
      return e;
  return e = {
    context: t
  }, this.fontCaches.push(e), e;
};
Ga.setupTextStyle = function(t, e) {
  var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0, n = e.pstyle("font-style").strValue, a = e.pstyle("font-size").pfValue + "px", i = e.pstyle("font-family").strValue, o = e.pstyle("font-weight").strValue, s = r ? e.effectiveOpacity() * e.pstyle("text-opacity").value : 1, u = e.pstyle("text-outline-opacity").value * s, l = e.pstyle("color").value, c = e.pstyle("text-outline-color").value;
  t.font = n + " " + o + " " + a + " " + i, t.lineJoin = "round", this.colorFillStyle(t, l[0], l[1], l[2], s), this.colorStrokeStyle(t, c[0], c[1], c[2], u);
};
function Vu(t, e, r, n, a) {
  var i = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : 5, o = arguments.length > 6 ? arguments[6] : void 0;
  t.beginPath(), t.moveTo(e + i, r), t.lineTo(e + n - i, r), t.quadraticCurveTo(e + n, r, e + n, r + i), t.lineTo(e + n, r + a - i), t.quadraticCurveTo(e + n, r + a, e + n - i, r + a), t.lineTo(e + i, r + a), t.quadraticCurveTo(e, r + a, e, r + a - i), t.lineTo(e, r + i), t.quadraticCurveTo(e, r, e + i, r), t.closePath(), o ? t.stroke() : t.fill();
}
Ga.getTextAngle = function(t, e) {
  var r, n = t._private, a = n.rscratch, i = e ? e + "-" : "", o = t.pstyle(i + "text-rotation"), s = Kr(a, "labelAngle", e);
  return o.strValue === "autorotate" ? r = t.isEdge() ? s : 0 : o.strValue === "none" ? r = 0 : r = o.pfValue, r;
};
Ga.drawText = function(t, e, r) {
  var n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !0, a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, i = e._private, o = i.rscratch, s = a ? e.effectiveOpacity() : 1;
  if (!(a && (s === 0 || e.pstyle("text-opacity").value === 0))) {
    r === "main" && (r = null);
    var u = Kr(o, "labelX", r), l = Kr(o, "labelY", r), c, d, f = this.getLabelText(e, r);
    if (f != null && f !== "" && !isNaN(u) && !isNaN(l)) {
      this.setupTextStyle(t, e, a);
      var h = r ? r + "-" : "", v = Kr(o, "labelWidth", r), p = Kr(o, "labelHeight", r), g = e.pstyle(h + "text-margin-x").pfValue, y = e.pstyle(h + "text-margin-y").pfValue, m = e.isEdge(), b = e.pstyle("text-halign").value, w = e.pstyle("text-valign").value;
      m && (b = "center", w = "center"), u += g, l += y;
      var x;
      switch (n ? x = this.getTextAngle(e, r) : x = 0, x !== 0 && (c = u, d = l, t.translate(c, d), t.rotate(x), u = 0, l = 0), w) {
        case "top":
          break;
        case "center":
          l += p / 2;
          break;
        case "bottom":
          l += p;
          break;
      }
      var E = e.pstyle("text-background-opacity").value, C = e.pstyle("text-border-opacity").value, k = e.pstyle("text-border-width").pfValue, S = e.pstyle("text-background-padding").pfValue, _ = e.pstyle("text-background-shape").strValue, T = _.indexOf("round") === 0, O = 2;
      if (E > 0 || k > 0 && C > 0) {
        var D = u - S;
        switch (b) {
          case "left":
            D -= v;
            break;
          case "center":
            D -= v / 2;
            break;
        }
        var A = l - p - S, F = v + 2 * S, R = p + 2 * S;
        if (E > 0) {
          var M = t.fillStyle, L = e.pstyle("text-background-color").value;
          t.fillStyle = "rgba(" + L[0] + "," + L[1] + "," + L[2] + "," + E * s + ")", T ? Vu(t, D, A, F, R, O) : t.fillRect(D, A, F, R), t.fillStyle = M;
        }
        if (k > 0 && C > 0) {
          var V = t.strokeStyle, Y = t.lineWidth, H = e.pstyle("text-border-color").value, K = e.pstyle("text-border-style").value;
          if (t.strokeStyle = "rgba(" + H[0] + "," + H[1] + "," + H[2] + "," + C * s + ")", t.lineWidth = k, t.setLineDash)
            switch (K) {
              case "dotted":
                t.setLineDash([1, 1]);
                break;
              case "dashed":
                t.setLineDash([4, 2]);
                break;
              case "double":
                t.lineWidth = k / 4, t.setLineDash([]);
                break;
              case "solid":
                t.setLineDash([]);
                break;
            }
          if (T ? Vu(t, D, A, F, R, O, "stroke") : t.strokeRect(D, A, F, R), K === "double") {
            var ne = k / 2;
            T ? Vu(t, D + ne, A + ne, F - ne * 2, R - ne * 2, O, "stroke") : t.strokeRect(D + ne, A + ne, F - ne * 2, R - ne * 2);
          }
          t.setLineDash && t.setLineDash([]), t.lineWidth = Y, t.strokeStyle = V;
        }
      }
      var B = 2 * e.pstyle("text-outline-width").pfValue;
      if (B > 0 && (t.lineWidth = B), e.pstyle("text-wrap").value === "wrap") {
        var $ = Kr(o, "labelWrapCachedLines", r), z = Kr(o, "labelLineHeight", r), W = v / 2, Z = this.getLabelJustification(e);
        switch (Z === "auto" || (b === "left" ? Z === "left" ? u += -v : Z === "center" && (u += -W) : b === "center" ? Z === "left" ? u += -W : Z === "right" && (u += W) : b === "right" && (Z === "center" ? u += W : Z === "right" && (u += v))), w) {
          case "top":
            l -= ($.length - 1) * z;
            break;
          case "center":
          case "bottom":
            l -= ($.length - 1) * z;
            break;
        }
        for (var N = 0; N < $.length; N++)
          B > 0 && t.strokeText($[N], u, l), t.fillText($[N], u, l), l += z;
      } else
        B > 0 && t.strokeText(f, u, l), t.fillText(f, u, l);
      x !== 0 && (t.rotate(-x), t.translate(-c, -d));
    }
  }
};
var Ki = {};
Ki.drawNode = function(t, e, r) {
  var n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !0, a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, i = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : !0, o = this, s, u, l = e._private, c = l.rscratch, d = e.position();
  if (!(!Ce(d.x) || !Ce(d.y)) && !(i && !e.visible())) {
    var f = i ? e.effectiveOpacity() : 1, h = o.usePaths(), v, p = !1, g = e.padding();
    s = e.width() + 2 * g, u = e.height() + 2 * g;
    var y;
    r && (y = r, t.translate(-y.x1, -y.y1));
    for (var m = e.pstyle("background-image"), b = m.value, w = new Array(b.length), x = new Array(b.length), E = 0, C = 0; C < b.length; C++) {
      var k = b[C], S = w[C] = k != null && k !== "none";
      if (S) {
        var _ = e.cy().style().getIndexedStyle(e, "background-image-crossorigin", "value", C);
        E++, x[C] = o.getCachedImage(k, _, function() {
          l.backgroundTimestamp = Date.now(), e.emitAndNotify("background");
        });
      }
    }
    var T = e.pstyle("background-blacken").value, O = e.pstyle("border-width").pfValue, D = e.pstyle("background-opacity").value * f, A = e.pstyle("border-color").value, F = e.pstyle("border-style").value, R = e.pstyle("border-join").value, M = e.pstyle("border-cap").value, L = e.pstyle("border-position").value, V = e.pstyle("border-dash-pattern").pfValue, Y = e.pstyle("border-dash-offset").pfValue, H = e.pstyle("border-opacity").value * f, K = e.pstyle("outline-width").pfValue, ne = e.pstyle("outline-color").value, B = e.pstyle("outline-style").value, $ = e.pstyle("outline-opacity").value * f, z = e.pstyle("outline-offset").value, W = e.pstyle("corner-radius").value;
    W !== "auto" && (W = e.pstyle("corner-radius").pfValue);
    var Z = function() {
      var ye = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : D;
      o.eleFillStyle(t, e, ye);
    }, N = function() {
      var ye = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : H;
      o.colorStrokeStyle(t, A[0], A[1], A[2], ye);
    }, X = function() {
      var ye = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : $;
      o.colorStrokeStyle(t, ne[0], ne[1], ne[2], ye);
    }, Q = function(ye, oe, he, Oe) {
      var Pe = o.nodePathCache = o.nodePathCache || [], Ae = cS(he === "polygon" ? he + "," + Oe.join(",") : he, "" + oe, "" + ye, "" + W), $e = Pe[Ae], Ie, Le = !1;
      return $e != null ? (Ie = $e, Le = !0, c.pathCache = Ie) : (Ie = new Path2D(), Pe[Ae] = c.pathCache = Ie), {
        path: Ie,
        cacheHit: Le
      };
    }, ge = e.pstyle("shape").strValue, we = e.pstyle("shape-polygon-points").pfValue;
    if (h) {
      t.translate(d.x, d.y);
      var fe = Q(s, u, ge, we);
      v = fe.path, p = fe.cacheHit;
    }
    var ce = function() {
      if (!p) {
        var ye = d;
        h && (ye = {
          x: 0,
          y: 0
        }), o.nodeShapes[o.getNodeShape(e)].draw(v || t, ye.x, ye.y, s, u, W, c);
      }
      h ? t.fill(v) : t.fill();
    }, be = function() {
      for (var ye = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : f, oe = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, he = l.backgrounding, Oe = 0, Pe = 0; Pe < x.length; Pe++) {
        var Ae = e.cy().style().getIndexedStyle(e, "background-image-containment", "value", Pe);
        if (oe && Ae === "over" || !oe && Ae === "inside") {
          Oe++;
          continue;
        }
        w[Pe] && x[Pe].complete && !x[Pe].error && (Oe++, o.drawInscribedImage(t, x[Pe], e, Pe, ye));
      }
      l.backgrounding = Oe !== E, he !== l.backgrounding && e.updateStyle(!1);
    }, ve = function() {
      var ye = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, oe = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : f;
      o.hasPie(e) && (o.drawPie(t, e, oe), ye && (h || o.nodeShapes[o.getNodeShape(e)].draw(t, d.x, d.y, s, u, W, c)));
    }, xe = function() {
      var ye = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : f, oe = (T > 0 ? T : -T) * ye, he = T > 0 ? 0 : 255;
      T !== 0 && (o.colorFillStyle(t, he, he, he, oe), h ? t.fill(v) : t.fill());
    }, _e = function() {
      if (O > 0) {
        if (t.lineWidth = O, t.lineCap = M, t.lineJoin = R, t.setLineDash)
          switch (F) {
            case "dotted":
              t.setLineDash([1, 1]);
              break;
            case "dashed":
              t.setLineDash(V), t.lineDashOffset = Y;
              break;
            case "solid":
            case "double":
              t.setLineDash([]);
              break;
          }
        if (L !== "center") {
          if (t.save(), t.lineWidth *= 2, L === "inside")
            h ? t.clip(v) : t.clip();
          else {
            var ye = new Path2D();
            ye.rect(-s / 2 - O, -u / 2 - O, s + 2 * O, u + 2 * O), ye.addPath(v), t.clip(ye, "evenodd");
          }
          h ? t.stroke(v) : t.stroke(), t.restore();
        } else
          h ? t.stroke(v) : t.stroke();
        if (F === "double") {
          t.lineWidth = O / 3;
          var oe = t.globalCompositeOperation;
          t.globalCompositeOperation = "destination-out", h ? t.stroke(v) : t.stroke(), t.globalCompositeOperation = oe;
        }
        t.setLineDash && t.setLineDash([]);
      }
    }, He = function() {
      if (K > 0) {
        if (t.lineWidth = K, t.lineCap = "butt", t.setLineDash)
          switch (B) {
            case "dotted":
              t.setLineDash([1, 1]);
              break;
            case "dashed":
              t.setLineDash([4, 2]);
              break;
            case "solid":
            case "double":
              t.setLineDash([]);
              break;
          }
        var ye = d;
        h && (ye = {
          x: 0,
          y: 0
        });
        var oe = o.getNodeShape(e), he = O;
        L === "inside" && (he = 0), L === "outside" && (he *= 2);
        var Oe = (s + he + (K + z)) / s, Pe = (u + he + (K + z)) / u, Ae = s * Oe, $e = u * Pe, Ie = o.nodeShapes[oe].points, Le;
        if (h) {
          var ut = Q(Ae, $e, oe, Ie);
          Le = ut.path;
        }
        if (oe === "ellipse")
          o.drawEllipsePath(Le || t, ye.x, ye.y, Ae, $e);
        else if (["round-diamond", "round-heptagon", "round-hexagon", "round-octagon", "round-pentagon", "round-polygon", "round-triangle", "round-tag"].includes(oe)) {
          var nt = 0, kt = 0, _t = 0;
          oe === "round-diamond" ? nt = (he + z + K) * 1.4 : oe === "round-heptagon" ? (nt = (he + z + K) * 1.075, _t = -(he / 2 + z + K) / 35) : oe === "round-hexagon" ? nt = (he + z + K) * 1.12 : oe === "round-pentagon" ? (nt = (he + z + K) * 1.13, _t = -(he / 2 + z + K) / 15) : oe === "round-tag" ? (nt = (he + z + K) * 1.12, kt = (he / 2 + K + z) * 0.07) : oe === "round-triangle" && (nt = (he + z + K) * (Math.PI / 2), _t = -(he + z / 2 + K) / Math.PI), nt !== 0 && (Oe = (s + nt) / s, Ae = s * Oe, ["round-hexagon", "round-tag"].includes(oe) || (Pe = (u + nt) / u, $e = u * Pe)), W = W === "auto" ? CS(Ae, $e) : W;
          for (var Ct = Ae / 2, Jt = $e / 2, Pt = W + (he + K + z) / 2, $t = new Array(Ie.length / 2), wr = new Array(Ie.length / 2), Qt = 0; Qt < Ie.length / 2; Qt++)
            $t[Qt] = {
              x: ye.x + kt + Ct * Ie[Qt * 2],
              y: ye.y + _t + Jt * Ie[Qt * 2 + 1]
            };
          var er, kr, Nr, dr, xt = $t.length;
          for (kr = $t[xt - 1], er = 0; er < xt; er++)
            Nr = $t[er % xt], dr = $t[(er + 1) % xt], wr[er] = Ug(kr, Nr, dr, Pt), kr = Nr, Nr = dr;
          o.drawRoundPolygonPath(Le || t, ye.x + kt, ye.y + _t, s * Oe, u * Pe, Ie, wr);
        } else if (["roundrectangle", "round-rectangle"].includes(oe))
          W = W === "auto" ? Ra(Ae, $e) : W, o.drawRoundRectanglePath(Le || t, ye.x, ye.y, Ae, $e, W + (he + K + z) / 2);
        else if (["cutrectangle", "cut-rectangle"].includes(oe))
          W = W === "auto" ? Lg() : W, o.drawCutRectanglePath(Le || t, ye.x, ye.y, Ae, $e, null, W + (he + K + z) / 4);
        else if (["bottomroundrectangle", "bottom-round-rectangle"].includes(oe))
          W = W === "auto" ? Ra(Ae, $e) : W, o.drawBottomRoundRectanglePath(Le || t, ye.x, ye.y, Ae, $e, W + (he + K + z) / 2);
        else if (oe === "barrel")
          o.drawBarrelPath(Le || t, ye.x, ye.y, Ae, $e);
        else if (oe.startsWith("polygon") || ["rhomboid", "right-rhomboid", "round-tag", "tag", "vee"].includes(oe)) {
          var Tt = (he + K + z) / s;
          Ie = cl(dl(Ie, Tt)), o.drawPolygonPath(Le || t, ye.x, ye.y, s, u, Ie);
        } else {
          var qt = (he + K + z) / s;
          Ie = cl(dl(Ie, -qt)), o.drawPolygonPath(Le || t, ye.x, ye.y, s, u, Ie);
        }
        if (h ? t.stroke(Le) : t.stroke(), B === "double") {
          t.lineWidth = he / 3;
          var Fn = t.globalCompositeOperation;
          t.globalCompositeOperation = "destination-out", h ? t.stroke(Le) : t.stroke(), t.globalCompositeOperation = Fn;
        }
        t.setLineDash && t.setLineDash([]);
      }
    }, Ve = function() {
      a && o.drawNodeOverlay(t, e, d, s, u);
    }, De = function() {
      a && o.drawNodeUnderlay(t, e, d, s, u);
    }, Ne = function() {
      o.drawElementText(t, e, null, n);
    }, ue = e.pstyle("ghost").value === "yes";
    if (ue) {
      var I = e.pstyle("ghost-offset-x").pfValue, G = e.pstyle("ghost-offset-y").pfValue, se = e.pstyle("ghost-opacity").value, ee = se * f;
      t.translate(I, G), X(), He(), Z(se * D), ce(), be(ee, !0), N(se * H), _e(), ve(T !== 0 || O !== 0), be(ee, !1), xe(ee), t.translate(-I, -G);
    }
    h && t.translate(-d.x, -d.y), De(), h && t.translate(d.x, d.y), X(), He(), Z(), ce(), be(f, !0), N(), _e(), ve(T !== 0 || O !== 0), be(f, !1), xe(), h && t.translate(-d.x, -d.y), Ne(), Ve(), r && t.translate(y.x1, y.y1);
  }
};
var Sk = function(e) {
  if (!["overlay", "underlay"].includes(e))
    throw new Error("Invalid state");
  return function(r, n, a, i, o) {
    var s = this;
    if (n.visible()) {
      var u = n.pstyle("".concat(e, "-padding")).pfValue, l = n.pstyle("".concat(e, "-opacity")).value, c = n.pstyle("".concat(e, "-color")).value, d = n.pstyle("".concat(e, "-shape")).value, f = n.pstyle("".concat(e, "-corner-radius")).value;
      if (l > 0) {
        if (a = a || n.position(), i == null || o == null) {
          var h = n.padding();
          i = n.width() + 2 * h, o = n.height() + 2 * h;
        }
        s.colorFillStyle(r, c[0], c[1], c[2], l), s.nodeShapes[d].draw(r, a.x, a.y, i + u * 2, o + u * 2, f), r.fill();
      }
    }
  };
};
Ki.drawNodeOverlay = Sk("overlay");
Ki.drawNodeUnderlay = Sk("underlay");
Ki.hasPie = function(t) {
  return t = t[0], t._private.hasPie;
};
Ki.drawPie = function(t, e, r, n) {
  e = e[0], n = n || e.position();
  var a = e.cy().style(), i = e.pstyle("pie-size"), o = n.x, s = n.y, u = e.width(), l = e.height(), c = Math.min(u, l) / 2, d = 0, f = this.usePaths();
  f && (o = 0, s = 0), i.units === "%" ? c = c * i.pfValue : i.pfValue !== void 0 && (c = i.pfValue / 2);
  for (var h = 1; h <= a.pieBackgroundN; h++) {
    var v = e.pstyle("pie-" + h + "-background-size").value, p = e.pstyle("pie-" + h + "-background-color").value, g = e.pstyle("pie-" + h + "-background-opacity").value * r, y = v / 100;
    y + d > 1 && (y = 1 - d);
    var m = 1.5 * Math.PI + 2 * Math.PI * d, b = 2 * Math.PI * y, w = m + b;
    v === 0 || d >= 1 || d + y > 1 || (t.beginPath(), t.moveTo(o, s), t.arc(o, s, c, m, w), t.closePath(), this.colorFillStyle(t, p[0], p[1], p[2], g), t.fill(), d += y);
  }
};
var Sr = {}, EV = 100;
Sr.getPixelRatio = function() {
  var t = this.data.contexts[0];
  if (this.forcedPixelRatio != null)
    return this.forcedPixelRatio;
  var e = this.cy.window(), r = t.backingStorePixelRatio || t.webkitBackingStorePixelRatio || t.mozBackingStorePixelRatio || t.msBackingStorePixelRatio || t.oBackingStorePixelRatio || t.backingStorePixelRatio || 1;
  return (e.devicePixelRatio || 1) / r;
};
Sr.paintCache = function(t) {
  for (var e = this.paintCaches = this.paintCaches || [], r = !0, n, a = 0; a < e.length; a++)
    if (n = e[a], n.context === t) {
      r = !1;
      break;
    }
  return r && (n = {
    context: t
  }, e.push(n)), n;
};
Sr.createGradientStyleFor = function(t, e, r, n, a) {
  var i, o = this.usePaths(), s = r.pstyle(e + "-gradient-stop-colors").value, u = r.pstyle(e + "-gradient-stop-positions").pfValue;
  if (n === "radial-gradient")
    if (r.isEdge()) {
      var l = r.sourceEndpoint(), c = r.targetEndpoint(), d = r.midpoint(), f = Da(l, d), h = Da(c, d);
      i = t.createRadialGradient(d.x, d.y, 0, d.x, d.y, Math.max(f, h));
    } else {
      var v = o ? {
        x: 0,
        y: 0
      } : r.position(), p = r.paddedWidth(), g = r.paddedHeight();
      i = t.createRadialGradient(v.x, v.y, 0, v.x, v.y, Math.max(p, g));
    }
  else if (r.isEdge()) {
    var y = r.sourceEndpoint(), m = r.targetEndpoint();
    i = t.createLinearGradient(y.x, y.y, m.x, m.y);
  } else {
    var b = o ? {
      x: 0,
      y: 0
    } : r.position(), w = r.paddedWidth(), x = r.paddedHeight(), E = w / 2, C = x / 2, k = r.pstyle("background-gradient-direction").value;
    switch (k) {
      case "to-bottom":
        i = t.createLinearGradient(b.x, b.y - C, b.x, b.y + C);
        break;
      case "to-top":
        i = t.createLinearGradient(b.x, b.y + C, b.x, b.y - C);
        break;
      case "to-left":
        i = t.createLinearGradient(b.x + E, b.y, b.x - E, b.y);
        break;
      case "to-right":
        i = t.createLinearGradient(b.x - E, b.y, b.x + E, b.y);
        break;
      case "to-bottom-right":
      case "to-right-bottom":
        i = t.createLinearGradient(b.x - E, b.y - C, b.x + E, b.y + C);
        break;
      case "to-top-right":
      case "to-right-top":
        i = t.createLinearGradient(b.x - E, b.y + C, b.x + E, b.y - C);
        break;
      case "to-bottom-left":
      case "to-left-bottom":
        i = t.createLinearGradient(b.x + E, b.y - C, b.x - E, b.y + C);
        break;
      case "to-top-left":
      case "to-left-top":
        i = t.createLinearGradient(b.x + E, b.y + C, b.x - E, b.y - C);
        break;
    }
  }
  if (!i) return null;
  for (var S = u.length === s.length, _ = s.length, T = 0; T < _; T++)
    i.addColorStop(S ? u[T] : T / (_ - 1), "rgba(" + s[T][0] + "," + s[T][1] + "," + s[T][2] + "," + a + ")");
  return i;
};
Sr.gradientFillStyle = function(t, e, r, n) {
  var a = this.createGradientStyleFor(t, "background", e, r, n);
  if (!a) return null;
  t.fillStyle = a;
};
Sr.colorFillStyle = function(t, e, r, n, a) {
  t.fillStyle = "rgba(" + e + "," + r + "," + n + "," + a + ")";
};
Sr.eleFillStyle = function(t, e, r) {
  var n = e.pstyle("background-fill").value;
  if (n === "linear-gradient" || n === "radial-gradient")
    this.gradientFillStyle(t, e, n, r);
  else {
    var a = e.pstyle("background-color").value;
    this.colorFillStyle(t, a[0], a[1], a[2], r);
  }
};
Sr.gradientStrokeStyle = function(t, e, r, n) {
  var a = this.createGradientStyleFor(t, "line", e, r, n);
  if (!a) return null;
  t.strokeStyle = a;
};
Sr.colorStrokeStyle = function(t, e, r, n, a) {
  t.strokeStyle = "rgba(" + e + "," + r + "," + n + "," + a + ")";
};
Sr.eleStrokeStyle = function(t, e, r) {
  var n = e.pstyle("line-fill").value;
  if (n === "linear-gradient" || n === "radial-gradient")
    this.gradientStrokeStyle(t, e, n, r);
  else {
    var a = e.pstyle("line-color").value;
    this.colorStrokeStyle(t, a[0], a[1], a[2], r);
  }
};
Sr.matchCanvasSize = function(t) {
  var e = this, r = e.data, n = e.findContainerClientCoords(), a = n[2], i = n[3], o = e.getPixelRatio(), s = e.motionBlurPxRatio;
  (t === e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE] || t === e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG]) && (o = s);
  var u = a * o, l = i * o, c;
  if (!(u === e.canvasWidth && l === e.canvasHeight)) {
    e.fontCaches = null;
    var d = r.canvasContainer;
    d.style.width = a + "px", d.style.height = i + "px";
    for (var f = 0; f < e.CANVAS_LAYERS; f++)
      c = r.canvases[f], c.width = u, c.height = l, c.style.width = a + "px", c.style.height = i + "px";
    for (var f = 0; f < e.BUFFER_COUNT; f++)
      c = r.bufferCanvases[f], c.width = u, c.height = l, c.style.width = a + "px", c.style.height = i + "px";
    e.textureMult = 1, o <= 1 && (c = r.bufferCanvases[e.TEXTURE_BUFFER], e.textureMult = 2, c.width = u * e.textureMult, c.height = l * e.textureMult), e.canvasWidth = u, e.canvasHeight = l;
  }
};
Sr.renderTo = function(t, e, r, n) {
  this.render({
    forcedContext: t,
    forcedZoom: e,
    forcedPan: r,
    drawAllLayers: !0,
    forcedPxRatio: n
  });
};
Sr.render = function(t) {
  t = t || hS();
  var e = t.forcedContext, r = t.drawAllLayers, n = t.drawOnlyNodeLayer, a = t.forcedZoom, i = t.forcedPan, o = this, s = t.forcedPxRatio === void 0 ? this.getPixelRatio() : t.forcedPxRatio, u = o.cy, l = o.data, c = l.canvasNeedsRedraw, d = o.textureOnViewport && !e && (o.pinching || o.hoverData.dragging || o.swipePanning || o.data.wheelZooming), f = t.motionBlur !== void 0 ? t.motionBlur : o.motionBlur, h = o.motionBlurPxRatio, v = u.hasCompoundNodes(), p = o.hoverData.draggingEles, g = !!(o.hoverData.selecting || o.touchData.selecting);
  f = f && !e && o.motionBlurEnabled && !g;
  var y = f;
  e || (o.prevPxRatio !== s && (o.invalidateContainerClientCoordsCache(), o.matchCanvasSize(o.container), o.redrawHint("eles", !0), o.redrawHint("drag", !0)), o.prevPxRatio = s), !e && o.motionBlurTimeout && clearTimeout(o.motionBlurTimeout), f && (o.mbFrames == null && (o.mbFrames = 0), o.mbFrames++, o.mbFrames < 3 && (y = !1), o.mbFrames > o.minMbLowQualFrames && (o.motionBlurPxRatio = o.mbPxRBlurry)), o.clearingMotionBlur && (o.motionBlurPxRatio = 1), o.textureDrawLastFrame && !d && (c[o.NODE] = !0, c[o.SELECT_BOX] = !0);
  var m = u.style(), b = u.zoom(), w = a !== void 0 ? a : b, x = u.pan(), E = {
    x: x.x,
    y: x.y
  }, C = {
    zoom: b,
    pan: {
      x: x.x,
      y: x.y
    }
  }, k = o.prevViewport, S = k === void 0 || C.zoom !== k.zoom || C.pan.x !== k.pan.x || C.pan.y !== k.pan.y;
  !S && !(p && !v) && (o.motionBlurPxRatio = 1), i && (E = i), w *= s, E.x *= s, E.y *= s;
  var _ = o.getCachedZSortedEles();
  function T(fe, ce, be, ve, xe) {
    var _e = fe.globalCompositeOperation;
    fe.globalCompositeOperation = "destination-out", o.colorFillStyle(fe, 255, 255, 255, o.motionBlurTransparency), fe.fillRect(ce, be, ve, xe), fe.globalCompositeOperation = _e;
  }
  function O(fe, ce) {
    var be, ve, xe, _e;
    !o.clearingMotionBlur && (fe === l.bufferContexts[o.MOTIONBLUR_BUFFER_NODE] || fe === l.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]) ? (be = {
      x: x.x * h,
      y: x.y * h
    }, ve = b * h, xe = o.canvasWidth * h, _e = o.canvasHeight * h) : (be = E, ve = w, xe = o.canvasWidth, _e = o.canvasHeight), fe.setTransform(1, 0, 0, 1, 0, 0), ce === "motionBlur" ? T(fe, 0, 0, xe, _e) : !e && (ce === void 0 || ce) && fe.clearRect(0, 0, xe, _e), r || (fe.translate(be.x, be.y), fe.scale(ve, ve)), i && fe.translate(i.x, i.y), a && fe.scale(a, a);
  }
  if (d || (o.textureDrawLastFrame = !1), d) {
    if (o.textureDrawLastFrame = !0, !o.textureCache) {
      o.textureCache = {}, o.textureCache.bb = u.mutableElements().boundingBox(), o.textureCache.texture = o.data.bufferCanvases[o.TEXTURE_BUFFER];
      var D = o.data.bufferContexts[o.TEXTURE_BUFFER];
      D.setTransform(1, 0, 0, 1, 0, 0), D.clearRect(0, 0, o.canvasWidth * o.textureMult, o.canvasHeight * o.textureMult), o.render({
        forcedContext: D,
        drawOnlyNodeLayer: !0,
        forcedPxRatio: s * o.textureMult
      });
      var C = o.textureCache.viewport = {
        zoom: u.zoom(),
        pan: u.pan(),
        width: o.canvasWidth,
        height: o.canvasHeight
      };
      C.mpan = {
        x: (0 - C.pan.x) / C.zoom,
        y: (0 - C.pan.y) / C.zoom
      };
    }
    c[o.DRAG] = !1, c[o.NODE] = !1;
    var A = l.contexts[o.NODE], F = o.textureCache.texture, C = o.textureCache.viewport;
    A.setTransform(1, 0, 0, 1, 0, 0), f ? T(A, 0, 0, C.width, C.height) : A.clearRect(0, 0, C.width, C.height);
    var R = m.core("outside-texture-bg-color").value, M = m.core("outside-texture-bg-opacity").value;
    o.colorFillStyle(A, R[0], R[1], R[2], M), A.fillRect(0, 0, C.width, C.height);
    var b = u.zoom();
    O(A, !1), A.clearRect(C.mpan.x, C.mpan.y, C.width / C.zoom / s, C.height / C.zoom / s), A.drawImage(F, C.mpan.x, C.mpan.y, C.width / C.zoom / s, C.height / C.zoom / s);
  } else o.textureOnViewport && !e && (o.textureCache = null);
  var L = u.extent(), V = o.pinching || o.hoverData.dragging || o.swipePanning || o.data.wheelZooming || o.hoverData.draggingEles || o.cy.animated(), Y = o.hideEdgesOnViewport && V, H = [];
  if (H[o.NODE] = !c[o.NODE] && f && !o.clearedForMotionBlur[o.NODE] || o.clearingMotionBlur, H[o.NODE] && (o.clearedForMotionBlur[o.NODE] = !0), H[o.DRAG] = !c[o.DRAG] && f && !o.clearedForMotionBlur[o.DRAG] || o.clearingMotionBlur, H[o.DRAG] && (o.clearedForMotionBlur[o.DRAG] = !0), c[o.NODE] || r || n || H[o.NODE]) {
    var K = f && !H[o.NODE] && h !== 1, A = e || (K ? o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE] : l.contexts[o.NODE]), ne = f && !K ? "motionBlur" : void 0;
    O(A, ne), Y ? o.drawCachedNodes(A, _.nondrag, s, L) : o.drawLayeredElements(A, _.nondrag, s, L), o.debug && o.drawDebugPoints(A, _.nondrag), !r && !f && (c[o.NODE] = !1);
  }
  if (!n && (c[o.DRAG] || r || H[o.DRAG])) {
    var K = f && !H[o.DRAG] && h !== 1, A = e || (K ? o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG] : l.contexts[o.DRAG]);
    O(A, f && !K ? "motionBlur" : void 0), Y ? o.drawCachedNodes(A, _.drag, s, L) : o.drawCachedElements(A, _.drag, s, L), o.debug && o.drawDebugPoints(A, _.drag), !r && !f && (c[o.DRAG] = !1);
  }
  if (o.showFps || !n && c[o.SELECT_BOX] && !r) {
    var A = e || l.contexts[o.SELECT_BOX];
    if (O(A), o.selection[4] == 1 && (o.hoverData.selecting || o.touchData.selecting)) {
      var b = o.cy.zoom(), B = m.core("selection-box-border-width").value / b;
      A.lineWidth = B, A.fillStyle = "rgba(" + m.core("selection-box-color").value[0] + "," + m.core("selection-box-color").value[1] + "," + m.core("selection-box-color").value[2] + "," + m.core("selection-box-opacity").value + ")", A.fillRect(o.selection[0], o.selection[1], o.selection[2] - o.selection[0], o.selection[3] - o.selection[1]), B > 0 && (A.strokeStyle = "rgba(" + m.core("selection-box-border-color").value[0] + "," + m.core("selection-box-border-color").value[1] + "," + m.core("selection-box-border-color").value[2] + "," + m.core("selection-box-opacity").value + ")", A.strokeRect(o.selection[0], o.selection[1], o.selection[2] - o.selection[0], o.selection[3] - o.selection[1]));
    }
    if (l.bgActivePosistion && !o.hoverData.selecting) {
      var b = o.cy.zoom(), $ = l.bgActivePosistion;
      A.fillStyle = "rgba(" + m.core("active-bg-color").value[0] + "," + m.core("active-bg-color").value[1] + "," + m.core("active-bg-color").value[2] + "," + m.core("active-bg-opacity").value + ")", A.beginPath(), A.arc($.x, $.y, m.core("active-bg-size").pfValue / b, 0, 2 * Math.PI), A.fill();
    }
    var z = o.lastRedrawTime;
    if (o.showFps && z) {
      z = Math.round(z);
      var W = Math.round(1e3 / z);
      A.setTransform(1, 0, 0, 1, 0, 0), A.fillStyle = "rgba(255, 0, 0, 0.75)", A.strokeStyle = "rgba(255, 0, 0, 0.75)", A.lineWidth = 1, A.fillText("1 frame = " + z + " ms = " + W + " fps", 0, 20);
      var Z = 60;
      A.strokeRect(0, 30, 250, 20), A.fillRect(0, 30, 250 * Math.min(W / Z, 1), 20);
    }
    r || (c[o.SELECT_BOX] = !1);
  }
  if (f && h !== 1) {
    var N = l.contexts[o.NODE], X = o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_NODE], Q = l.contexts[o.DRAG], ge = o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_DRAG], we = function(ce, be, ve) {
      ce.setTransform(1, 0, 0, 1, 0, 0), ve || !y ? ce.clearRect(0, 0, o.canvasWidth, o.canvasHeight) : T(ce, 0, 0, o.canvasWidth, o.canvasHeight);
      var xe = h;
      ce.drawImage(
        be,
        // img
        0,
        0,
        // sx, sy
        o.canvasWidth * xe,
        o.canvasHeight * xe,
        // sw, sh
        0,
        0,
        // x, y
        o.canvasWidth,
        o.canvasHeight
        // w, h
      );
    };
    (c[o.NODE] || H[o.NODE]) && (we(N, X, H[o.NODE]), c[o.NODE] = !1), (c[o.DRAG] || H[o.DRAG]) && (we(Q, ge, H[o.DRAG]), c[o.DRAG] = !1);
  }
  o.prevViewport = C, o.clearingMotionBlur && (o.clearingMotionBlur = !1, o.motionBlurCleared = !0, o.motionBlur = !0), f && (o.motionBlurTimeout = setTimeout(function() {
    o.motionBlurTimeout = null, o.clearedForMotionBlur[o.NODE] = !1, o.clearedForMotionBlur[o.DRAG] = !1, o.motionBlur = !1, o.clearingMotionBlur = !d, o.mbFrames = 0, c[o.NODE] = !0, c[o.DRAG] = !0, o.redraw();
  }, EV)), e || u.emit("render");
};
var ua = {};
ua.drawPolygonPath = function(t, e, r, n, a, i) {
  var o = n / 2, s = a / 2;
  t.beginPath && t.beginPath(), t.moveTo(e + o * i[0], r + s * i[1]);
  for (var u = 1; u < i.length / 2; u++)
    t.lineTo(e + o * i[u * 2], r + s * i[u * 2 + 1]);
  t.closePath();
};
ua.drawRoundPolygonPath = function(t, e, r, n, a, i, o) {
  o.forEach(function(s) {
    return fk(t, s);
  }), t.closePath();
};
ua.drawRoundRectanglePath = function(t, e, r, n, a, i) {
  var o = n / 2, s = a / 2, u = i === "auto" ? Ra(n, a) : Math.min(i, s, o);
  t.beginPath && t.beginPath(), t.moveTo(e, r - s), t.arcTo(e + o, r - s, e + o, r, u), t.arcTo(e + o, r + s, e, r + s, u), t.arcTo(e - o, r + s, e - o, r, u), t.arcTo(e - o, r - s, e, r - s, u), t.lineTo(e, r - s), t.closePath();
};
ua.drawBottomRoundRectanglePath = function(t, e, r, n, a, i) {
  var o = n / 2, s = a / 2, u = i === "auto" ? Ra(n, a) : i;
  t.beginPath && t.beginPath(), t.moveTo(e, r - s), t.lineTo(e + o, r - s), t.lineTo(e + o, r), t.arcTo(e + o, r + s, e, r + s, u), t.arcTo(e - o, r + s, e - o, r, u), t.lineTo(e - o, r - s), t.lineTo(e, r - s), t.closePath();
};
ua.drawCutRectanglePath = function(t, e, r, n, a, i, o) {
  var s = n / 2, u = a / 2, l = o === "auto" ? Lg() : o;
  t.beginPath && t.beginPath(), t.moveTo(e - s + l, r - u), t.lineTo(e + s - l, r - u), t.lineTo(e + s, r - u + l), t.lineTo(e + s, r + u - l), t.lineTo(e + s - l, r + u), t.lineTo(e - s + l, r + u), t.lineTo(e - s, r + u - l), t.lineTo(e - s, r - u + l), t.closePath();
};
ua.drawBarrelPath = function(t, e, r, n, a) {
  var i = n / 2, o = a / 2, s = e - i, u = e + i, l = r - o, c = r + o, d = _p(n, a), f = d.widthOffset, h = d.heightOffset, v = d.ctrlPtOffsetPct * f;
  t.beginPath && t.beginPath(), t.moveTo(s, l + h), t.lineTo(s, c - h), t.quadraticCurveTo(s + v, c, s + f, c), t.lineTo(u - f, c), t.quadraticCurveTo(u - v, c, u, c - h), t.lineTo(u, l + h), t.quadraticCurveTo(u - v, l, u - f, l), t.lineTo(s + f, l), t.quadraticCurveTo(s + v, l, s, l + h), t.closePath();
};
var Z0 = Math.sin(0), X0 = Math.cos(0), Bp = {}, $p = {}, kk = Math.PI / 40;
for (var ii = 0 * Math.PI; ii < 2 * Math.PI; ii += kk)
  Bp[ii] = Math.sin(ii), $p[ii] = Math.cos(ii);
ua.drawEllipsePath = function(t, e, r, n, a) {
  if (t.beginPath && t.beginPath(), t.ellipse)
    t.ellipse(e, r, n / 2, a / 2, 0, 0, 2 * Math.PI);
  else
    for (var i, o, s = n / 2, u = a / 2, l = 0 * Math.PI; l < 2 * Math.PI; l += kk)
      i = e - s * Bp[l] * Z0 + s * $p[l] * X0, o = r + u * $p[l] * Z0 + u * Bp[l] * X0, l === 0 ? t.moveTo(i, o) : t.lineTo(i, o);
  t.closePath();
};
var us = {};
us.createBuffer = function(t, e) {
  var r = document.createElement("canvas");
  return r.width = t, r.height = e, [r, r.getContext("2d")];
};
us.bufferCanvasImage = function(t) {
  var e = this.cy, r = e.mutableElements(), n = r.boundingBox(), a = this.findContainerClientCoords(), i = t.full ? Math.ceil(n.w) : a[2], o = t.full ? Math.ceil(n.h) : a[3], s = Ce(t.maxWidth) || Ce(t.maxHeight), u = this.getPixelRatio(), l = 1;
  if (t.scale !== void 0)
    i *= t.scale, o *= t.scale, l = t.scale;
  else if (s) {
    var c = 1 / 0, d = 1 / 0;
    Ce(t.maxWidth) && (c = l * t.maxWidth / i), Ce(t.maxHeight) && (d = l * t.maxHeight / o), l = Math.min(c, d), i *= l, o *= l;
  }
  s || (i *= u, o *= u, l *= u);
  var f = document.createElement("canvas");
  f.width = i, f.height = o, f.style.width = i + "px", f.style.height = o + "px";
  var h = f.getContext("2d");
  if (i > 0 && o > 0) {
    h.clearRect(0, 0, i, o), h.globalCompositeOperation = "source-over";
    var v = this.getCachedZSortedEles();
    if (t.full)
      h.translate(-n.x1 * l, -n.y1 * l), h.scale(l, l), this.drawElements(h, v), h.scale(1 / l, 1 / l), h.translate(n.x1 * l, n.y1 * l);
    else {
      var p = e.pan(), g = {
        x: p.x * l,
        y: p.y * l
      };
      l *= e.zoom(), h.translate(g.x, g.y), h.scale(l, l), this.drawElements(h, v), h.scale(1 / l, 1 / l), h.translate(-g.x, -g.y);
    }
    t.bg && (h.globalCompositeOperation = "destination-over", h.fillStyle = t.bg, h.rect(0, 0, i, o), h.fill());
  }
  return f;
};
function SV(t, e) {
  for (var r = atob(t), n = new ArrayBuffer(r.length), a = new Uint8Array(n), i = 0; i < r.length; i++)
    a[i] = r.charCodeAt(i);
  return new Blob([n], {
    type: e
  });
}
function J0(t) {
  var e = t.indexOf(",");
  return t.substr(e + 1);
}
function _k(t, e, r) {
  var n = function() {
    return e.toDataURL(r, t.quality);
  };
  switch (t.output) {
    case "blob-promise":
      return new Mi(function(a, i) {
        try {
          e.toBlob(function(o) {
            o != null ? a(o) : i(new Error("`canvas.toBlob()` sent a null value in its callback"));
          }, r, t.quality);
        } catch (o) {
          i(o);
        }
      });
    case "blob":
      return SV(J0(n()), r);
    case "base64":
      return J0(n());
    case "base64uri":
    default:
      return n();
  }
}
us.png = function(t) {
  return _k(t, this.bufferCanvasImage(t), "image/png");
};
us.jpg = function(t) {
  return _k(t, this.bufferCanvasImage(t), "image/jpeg");
};
var Tk = {};
Tk.nodeShapeImpl = function(t, e, r, n, a, i, o, s) {
  switch (t) {
    case "ellipse":
      return this.drawEllipsePath(e, r, n, a, i);
    case "polygon":
      return this.drawPolygonPath(e, r, n, a, i, o);
    case "round-polygon":
      return this.drawRoundPolygonPath(e, r, n, a, i, o, s);
    case "roundrectangle":
    case "round-rectangle":
      return this.drawRoundRectanglePath(e, r, n, a, i, s);
    case "cutrectangle":
    case "cut-rectangle":
      return this.drawCutRectanglePath(e, r, n, a, i, o, s);
    case "bottomroundrectangle":
    case "bottom-round-rectangle":
      return this.drawBottomRoundRectanglePath(e, r, n, a, i, s);
    case "barrel":
      return this.drawBarrelPath(e, r, n, a, i);
  }
};
var kV = Ik, Je = Ik.prototype;
Je.CANVAS_LAYERS = 3;
Je.SELECT_BOX = 0;
Je.DRAG = 1;
Je.NODE = 2;
Je.BUFFER_COUNT = 3;
Je.TEXTURE_BUFFER = 0;
Je.MOTIONBLUR_BUFFER_NODE = 1;
Je.MOTIONBLUR_BUFFER_DRAG = 2;
function Ik(t) {
  var e = this, r = e.cy.window(), n = r.document;
  e.data = {
    canvases: new Array(Je.CANVAS_LAYERS),
    contexts: new Array(Je.CANVAS_LAYERS),
    canvasNeedsRedraw: new Array(Je.CANVAS_LAYERS),
    bufferCanvases: new Array(Je.BUFFER_COUNT),
    bufferContexts: new Array(Je.CANVAS_LAYERS)
  };
  var a = "-webkit-tap-highlight-color", i = "rgba(0,0,0,0)";
  e.data.canvasContainer = n.createElement("div");
  var o = e.data.canvasContainer.style;
  e.data.canvasContainer.style[a] = i, o.position = "relative", o.zIndex = "0", o.overflow = "hidden";
  var s = t.cy.container();
  s.appendChild(e.data.canvasContainer), s.style[a] = i;
  var u = {
    "-webkit-user-select": "none",
    "-moz-user-select": "-moz-none",
    "user-select": "none",
    "-webkit-tap-highlight-color": "rgba(0,0,0,0)",
    "outline-style": "none"
  };
  fB() && (u["-ms-touch-action"] = "none", u["touch-action"] = "none");
  for (var l = 0; l < Je.CANVAS_LAYERS; l++) {
    var c = e.data.canvases[l] = n.createElement("canvas");
    e.data.contexts[l] = c.getContext("2d"), Object.keys(u).forEach(function(Z) {
      c.style[Z] = u[Z];
    }), c.style.position = "absolute", c.setAttribute("data-id", "layer" + l), c.style.zIndex = String(Je.CANVAS_LAYERS - l), e.data.canvasContainer.appendChild(c), e.data.canvasNeedsRedraw[l] = !1;
  }
  e.data.topCanvas = e.data.canvases[0], e.data.canvases[Je.NODE].setAttribute("data-id", "layer" + Je.NODE + "-node"), e.data.canvases[Je.SELECT_BOX].setAttribute("data-id", "layer" + Je.SELECT_BOX + "-selectbox"), e.data.canvases[Je.DRAG].setAttribute("data-id", "layer" + Je.DRAG + "-drag");
  for (var l = 0; l < Je.BUFFER_COUNT; l++)
    e.data.bufferCanvases[l] = n.createElement("canvas"), e.data.bufferContexts[l] = e.data.bufferCanvases[l].getContext("2d"), e.data.bufferCanvases[l].style.position = "absolute", e.data.bufferCanvases[l].setAttribute("data-id", "buffer" + l), e.data.bufferCanvases[l].style.zIndex = String(-l - 1), e.data.bufferCanvases[l].style.visibility = "hidden";
  e.pathsEnabled = !0;
  var d = br(), f = function(N) {
    return {
      x: (N.x1 + N.x2) / 2,
      y: (N.y1 + N.y2) / 2
    };
  }, h = function(N) {
    return {
      x: -N.w / 2,
      y: -N.h / 2
    };
  }, v = function(N) {
    var X = N[0]._private, Q = X.oldBackgroundTimestamp === X.backgroundTimestamp;
    return !Q;
  }, p = function(N) {
    return N[0]._private.nodeKey;
  }, g = function(N) {
    return N[0]._private.labelStyleKey;
  }, y = function(N) {
    return N[0]._private.sourceLabelStyleKey;
  }, m = function(N) {
    return N[0]._private.targetLabelStyleKey;
  }, b = function(N, X, Q, ge, we) {
    return e.drawElement(N, X, Q, !1, !1, we);
  }, w = function(N, X, Q, ge, we) {
    return e.drawElementText(N, X, Q, ge, "main", we);
  }, x = function(N, X, Q, ge, we) {
    return e.drawElementText(N, X, Q, ge, "source", we);
  }, E = function(N, X, Q, ge, we) {
    return e.drawElementText(N, X, Q, ge, "target", we);
  }, C = function(N) {
    return N.boundingBox(), N[0]._private.bodyBounds;
  }, k = function(N) {
    return N.boundingBox(), N[0]._private.labelBounds.main || d;
  }, S = function(N) {
    return N.boundingBox(), N[0]._private.labelBounds.source || d;
  }, _ = function(N) {
    return N.boundingBox(), N[0]._private.labelBounds.target || d;
  }, T = function(N, X) {
    return X;
  }, O = function(N) {
    return f(C(N));
  }, D = function(N, X, Q) {
    var ge = N ? N + "-" : "";
    return {
      x: X.x + Q.pstyle(ge + "text-margin-x").pfValue,
      y: X.y + Q.pstyle(ge + "text-margin-y").pfValue
    };
  }, A = function(N, X, Q) {
    var ge = N[0]._private.rscratch;
    return {
      x: ge[X],
      y: ge[Q]
    };
  }, F = function(N) {
    return D("", A(N, "labelX", "labelY"), N);
  }, R = function(N) {
    return D("source", A(N, "sourceLabelX", "sourceLabelY"), N);
  }, M = function(N) {
    return D("target", A(N, "targetLabelX", "targetLabelY"), N);
  }, L = function(N) {
    return h(C(N));
  }, V = function(N) {
    return h(S(N));
  }, Y = function(N) {
    return h(_(N));
  }, H = function(N) {
    var X = k(N), Q = h(k(N));
    if (N.isNode()) {
      switch (N.pstyle("text-halign").value) {
        case "left":
          Q.x = -X.w;
          break;
        case "right":
          Q.x = 0;
          break;
      }
      switch (N.pstyle("text-valign").value) {
        case "top":
          Q.y = -X.h;
          break;
        case "bottom":
          Q.y = 0;
          break;
      }
    }
    return Q;
  }, K = e.data.eleTxrCache = new vo(e, {
    getKey: p,
    doesEleInvalidateKey: v,
    drawElement: b,
    getBoundingBox: C,
    getRotationPoint: O,
    getRotationOffset: L,
    allowEdgeTxrCaching: !1,
    allowParentTxrCaching: !1
  }), ne = e.data.lblTxrCache = new vo(e, {
    getKey: g,
    drawElement: w,
    getBoundingBox: k,
    getRotationPoint: F,
    getRotationOffset: H,
    isVisible: T
  }), B = e.data.slbTxrCache = new vo(e, {
    getKey: y,
    drawElement: x,
    getBoundingBox: S,
    getRotationPoint: R,
    getRotationOffset: V,
    isVisible: T
  }), $ = e.data.tlbTxrCache = new vo(e, {
    getKey: m,
    drawElement: E,
    getBoundingBox: _,
    getRotationPoint: M,
    getRotationOffset: Y,
    isVisible: T
  }), z = e.data.lyrTxrCache = new Ck(e);
  e.onUpdateEleCalcs(function(N, X) {
    K.invalidateElements(X), ne.invalidateElements(X), B.invalidateElements(X), $.invalidateElements(X), z.invalidateElements(X);
    for (var Q = 0; Q < X.length; Q++) {
      var ge = X[Q]._private;
      ge.oldBackgroundTimestamp = ge.backgroundTimestamp;
    }
  });
  var W = function(N) {
    for (var X = 0; X < N.length; X++)
      z.enqueueElementRefinement(N[X].ele);
  };
  K.onDequeue(W), ne.onDequeue(W), B.onDequeue(W), $.onDequeue(W);
}
Je.redrawHint = function(t, e) {
  var r = this;
  switch (t) {
    case "eles":
      r.data.canvasNeedsRedraw[Je.NODE] = e;
      break;
    case "drag":
      r.data.canvasNeedsRedraw[Je.DRAG] = e;
      break;
    case "select":
      r.data.canvasNeedsRedraw[Je.SELECT_BOX] = e;
      break;
  }
};
var _V = typeof Path2D < "u";
Je.path2dEnabled = function(t) {
  if (t === void 0)
    return this.pathsEnabled;
  this.pathsEnabled = !!t;
};
Je.usePaths = function() {
  return _V && this.pathsEnabled;
};
Je.setImgSmoothing = function(t, e) {
  t.imageSmoothingEnabled != null ? t.imageSmoothingEnabled = e : (t.webkitImageSmoothingEnabled = e, t.mozImageSmoothingEnabled = e, t.msImageSmoothingEnabled = e);
};
Je.getImgSmoothing = function(t) {
  return t.imageSmoothingEnabled != null ? t.imageSmoothingEnabled : t.webkitImageSmoothingEnabled || t.mozImageSmoothingEnabled || t.msImageSmoothingEnabled;
};
Je.makeOffscreenCanvas = function(t, e) {
  var r;
  if ((typeof OffscreenCanvas > "u" ? "undefined" : Nt(OffscreenCanvas)) !== "undefined")
    r = new OffscreenCanvas(t, e);
  else {
    var n = this.cy.window(), a = n.document;
    r = a.createElement("canvas"), r.width = t, r.height = e;
  }
  return r;
};
[xk, vn, Dn, jg, Ga, Ki, Sr, ua, us, Tk].forEach(function(t) {
  ze(Je, t);
});
var TV = [{
  name: "null",
  impl: uk
}, {
  name: "base",
  impl: bk
}, {
  name: "canvas",
  impl: kV
}], IV = [{
  type: "layout",
  extensions: L8
}, {
  type: "renderer",
  extensions: TV
}], Ok = {}, Ak = {};
function Pk(t, e, r) {
  var n = r, a = function(k) {
    tt("Can not register `" + e + "` for `" + t + "` since `" + k + "` already exists in the prototype and can not be overridden");
  };
  if (t === "core") {
    if (zo.prototype[e])
      return a(e);
    zo.prototype[e] = r;
  } else if (t === "collection") {
    if (Yt.prototype[e])
      return a(e);
    Yt.prototype[e] = r;
  } else if (t === "layout") {
    for (var i = function(k) {
      this.options = k, r.call(this, k), Xe(this._private) || (this._private = {}), this._private.cy = k.cy, this._private.listeners = [], this.createEmitter();
    }, o = i.prototype = Object.create(r.prototype), s = [], u = 0; u < s.length; u++) {
      var l = s[u];
      o[l] = o[l] || function() {
        return this;
      };
    }
    o.start && !o.run ? o.run = function() {
      return this.start(), this;
    } : !o.start && o.run && (o.start = function() {
      return this.run(), this;
    });
    var c = r.prototype.stop;
    o.stop = function() {
      var C = this.options;
      if (C && C.animate) {
        var k = this.animations;
        if (k)
          for (var S = 0; S < k.length; S++)
            k[S].stop();
      }
      return c ? c.call(this) : this.emit("layoutstop"), this;
    }, o.destroy || (o.destroy = function() {
      return this;
    }), o.cy = function() {
      return this._private.cy;
    };
    var d = function(k) {
      return k._private.cy;
    }, f = {
      addEventFields: function(k, S) {
        S.layout = k, S.cy = d(k), S.target = k;
      },
      bubble: function() {
        return !0;
      },
      parent: function(k) {
        return d(k);
      }
    };
    ze(o, {
      createEmitter: function() {
        return this._private.emitter = new Hl(f, this), this;
      },
      emitter: function() {
        return this._private.emitter;
      },
      on: function(k, S) {
        return this.emitter().on(k, S), this;
      },
      one: function(k, S) {
        return this.emitter().one(k, S), this;
      },
      once: function(k, S) {
        return this.emitter().one(k, S), this;
      },
      removeListener: function(k, S) {
        return this.emitter().removeListener(k, S), this;
      },
      removeAllListeners: function() {
        return this.emitter().removeAllListeners(), this;
      },
      emit: function(k, S) {
        return this.emitter().emit(k, S), this;
      }
    }), et.eventAliasesOn(o), n = i;
  } else if (t === "renderer" && e !== "null" && e !== "base") {
    var h = Dk("renderer", "base"), v = h.prototype, p = r, g = r.prototype, y = function() {
      h.apply(this, arguments), p.apply(this, arguments);
    }, m = y.prototype;
    for (var b in v) {
      var w = v[b], x = g[b] != null;
      if (x)
        return a(b);
      m[b] = w;
    }
    for (var E in g)
      m[E] = g[E];
    v.clientFunctions.forEach(function(C) {
      m[C] = m[C] || function() {
        bt("Renderer does not implement `renderer." + C + "()` on its prototype");
      };
    }), n = y;
  } else if (t === "__proto__" || t === "constructor" || t === "prototype")
    return bt(t + " is an illegal type to be registered, possibly lead to prototype pollutions");
  return nS({
    map: Ok,
    keys: [t, e],
    value: n
  });
}
function Dk(t, e) {
  return aS({
    map: Ok,
    keys: [t, e]
  });
}
function OV(t, e, r, n, a) {
  return nS({
    map: Ak,
    keys: [t, e, r, n],
    value: a
  });
}
function AV(t, e, r, n) {
  return aS({
    map: Ak,
    keys: [t, e, r, n]
  });
}
var qp = function() {
  if (arguments.length === 2)
    return Dk.apply(null, arguments);
  if (arguments.length === 3)
    return Pk.apply(null, arguments);
  if (arguments.length === 4)
    return AV.apply(null, arguments);
  if (arguments.length === 5)
    return OV.apply(null, arguments);
  bt("Invalid extension access syntax");
};
zo.prototype.extension = qp;
IV.forEach(function(t) {
  t.extensions.forEach(function(e) {
    Pk(t.type, e.name, e.impl);
  });
});
var Rk = function t() {
  if (!(this instanceof t))
    return new t();
  this.length = 0;
}, Ma = Rk.prototype;
Ma.instanceString = function() {
  return "stylesheet";
};
Ma.selector = function(t) {
  var e = this.length++;
  return this[e] = {
    selector: t,
    properties: []
  }, this;
};
Ma.css = function(t, e) {
  var r = this.length - 1;
  if (Me(t))
    this[r].properties.push({
      name: t,
      value: e
    });
  else if (Xe(t))
    for (var n = t, a = Object.keys(n), i = 0; i < a.length; i++) {
      var o = a[i], s = n[o];
      if (s != null) {
        var u = ar.properties[o] || ar.properties[Rl(o)];
        if (u != null) {
          var l = u.name, c = s;
          this[r].properties.push({
            name: l,
            value: c
          });
        }
      }
    }
  return this;
};
Ma.style = Ma.css;
Ma.generateStyle = function(t) {
  var e = new ar(t);
  return this.appendToStyle(e);
};
Ma.appendToStyle = function(t) {
  for (var e = 0; e < this.length; e++) {
    var r = this[e], n = r.selector, a = r.properties;
    t.selector(n);
    for (var i = 0; i < a.length; i++) {
      var o = a[i];
      t.css(o.name, o.value);
    }
  }
  return t;
};
var PV = "3.30.2", ia = function(e) {
  if (e === void 0 && (e = {}), Xe(e))
    return new zo(e);
  if (Me(e))
    return qp.apply(qp, arguments);
};
ia.use = function(t) {
  var e = Array.prototype.slice.call(arguments, 1);
  return e.unshift(ia), t.apply(null, e), this;
};
ia.warnings = function(t) {
  return fS(t);
};
ia.version = PV;
ia.stylesheet = ia.Stylesheet = Rk;
var Lk = { exports: {} };
function Yg(t) {
  throw new Error('Could not dynamically require "' + t + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
}
var Hu, Q0;
function DV() {
  if (Q0) return Hu;
  Q0 = 1;
  function t() {
    this.__data__ = [], this.size = 0;
  }
  return Hu = t, Hu;
}
var Ku, eb;
function Gi() {
  if (eb) return Ku;
  eb = 1;
  function t(e, r) {
    return e === r || e !== e && r !== r;
  }
  return Ku = t, Ku;
}
var Gu, tb;
function Xl() {
  if (tb) return Gu;
  tb = 1;
  var t = Gi();
  function e(r, n) {
    for (var a = r.length; a--; )
      if (t(r[a][0], n))
        return a;
    return -1;
  }
  return Gu = e, Gu;
}
var Uu, rb;
function RV() {
  if (rb) return Uu;
  rb = 1;
  var t = Xl(), e = Array.prototype, r = e.splice;
  function n(a) {
    var i = this.__data__, o = t(i, a);
    if (o < 0)
      return !1;
    var s = i.length - 1;
    return o == s ? i.pop() : r.call(i, o, 1), --this.size, !0;
  }
  return Uu = n, Uu;
}
var Wu, nb;
function LV() {
  if (nb) return Wu;
  nb = 1;
  var t = Xl();
  function e(r) {
    var n = this.__data__, a = t(n, r);
    return a < 0 ? void 0 : n[a][1];
  }
  return Wu = e, Wu;
}
var ju, ab;
function FV() {
  if (ab) return ju;
  ab = 1;
  var t = Xl();
  function e(r) {
    return t(this.__data__, r) > -1;
  }
  return ju = e, ju;
}
var Yu, ib;
function MV() {
  if (ib) return Yu;
  ib = 1;
  var t = Xl();
  function e(r, n) {
    var a = this.__data__, i = t(a, r);
    return i < 0 ? (++this.size, a.push([r, n])) : a[i][1] = n, this;
  }
  return Yu = e, Yu;
}
var Zu, ob;
function Jl() {
  if (ob) return Zu;
  ob = 1;
  var t = DV(), e = RV(), r = LV(), n = FV(), a = MV();
  function i(o) {
    var s = -1, u = o == null ? 0 : o.length;
    for (this.clear(); ++s < u; ) {
      var l = o[s];
      this.set(l[0], l[1]);
    }
  }
  return i.prototype.clear = t, i.prototype.delete = e, i.prototype.get = r, i.prototype.has = n, i.prototype.set = a, Zu = i, Zu;
}
var Xu, sb;
function NV() {
  if (sb) return Xu;
  sb = 1;
  var t = Jl();
  function e() {
    this.__data__ = new t(), this.size = 0;
  }
  return Xu = e, Xu;
}
var Ju, lb;
function BV() {
  if (lb) return Ju;
  lb = 1;
  function t(e) {
    var r = this.__data__, n = r.delete(e);
    return this.size = r.size, n;
  }
  return Ju = t, Ju;
}
var Qu, ub;
function $V() {
  if (ub) return Qu;
  ub = 1;
  function t(e) {
    return this.__data__.get(e);
  }
  return Qu = t, Qu;
}
var ec, cb;
function qV() {
  if (cb) return ec;
  cb = 1;
  function t(e) {
    return this.__data__.has(e);
  }
  return ec = t, ec;
}
var tc, db;
function Fk() {
  if (db) return tc;
  db = 1;
  var t = typeof oo == "object" && oo && oo.Object === Object && oo;
  return tc = t, tc;
}
var rc, fb;
function Jr() {
  if (fb) return rc;
  fb = 1;
  var t = Fk(), e = typeof self == "object" && self && self.Object === Object && self, r = t || e || Function("return this")();
  return rc = r, rc;
}
var nc, vb;
function Ui() {
  if (vb) return nc;
  vb = 1;
  var t = Jr(), e = t.Symbol;
  return nc = e, nc;
}
var ac, hb;
function zV() {
  if (hb) return ac;
  hb = 1;
  var t = Ui(), e = Object.prototype, r = e.hasOwnProperty, n = e.toString, a = t ? t.toStringTag : void 0;
  function i(o) {
    var s = r.call(o, a), u = o[a];
    try {
      o[a] = void 0;
      var l = !0;
    } catch {
    }
    var c = n.call(o);
    return l && (s ? o[a] = u : delete o[a]), c;
  }
  return ac = i, ac;
}
var ic, pb;
function VV() {
  if (pb) return ic;
  pb = 1;
  var t = Object.prototype, e = t.toString;
  function r(n) {
    return e.call(n);
  }
  return ic = r, ic;
}
var oc, gb;
function Ua() {
  if (gb) return oc;
  gb = 1;
  var t = Ui(), e = zV(), r = VV(), n = "[object Null]", a = "[object Undefined]", i = t ? t.toStringTag : void 0;
  function o(s) {
    return s == null ? s === void 0 ? a : n : i && i in Object(s) ? e(s) : r(s);
  }
  return oc = o, oc;
}
var sc, yb;
function Fr() {
  if (yb) return sc;
  yb = 1;
  function t(e) {
    var r = typeof e;
    return e != null && (r == "object" || r == "function");
  }
  return sc = t, sc;
}
var lc, mb;
function cs() {
  if (mb) return lc;
  mb = 1;
  var t = Ua(), e = Fr(), r = "[object AsyncFunction]", n = "[object Function]", a = "[object GeneratorFunction]", i = "[object Proxy]";
  function o(s) {
    if (!e(s))
      return !1;
    var u = t(s);
    return u == n || u == a || u == r || u == i;
  }
  return lc = o, lc;
}
var uc, bb;
function HV() {
  if (bb) return uc;
  bb = 1;
  var t = Jr(), e = t["__core-js_shared__"];
  return uc = e, uc;
}
var cc, wb;
function KV() {
  if (wb) return cc;
  wb = 1;
  var t = HV(), e = function() {
    var n = /[^.]+$/.exec(t && t.keys && t.keys.IE_PROTO || "");
    return n ? "Symbol(src)_1." + n : "";
  }();
  function r(n) {
    return !!e && e in n;
  }
  return cc = r, cc;
}
var dc, Cb;
function Mk() {
  if (Cb) return dc;
  Cb = 1;
  var t = Function.prototype, e = t.toString;
  function r(n) {
    if (n != null) {
      try {
        return e.call(n);
      } catch {
      }
      try {
        return n + "";
      } catch {
      }
    }
    return "";
  }
  return dc = r, dc;
}
var fc, xb;
function GV() {
  if (xb) return fc;
  xb = 1;
  var t = cs(), e = KV(), r = Fr(), n = Mk(), a = /[\\^$.*+?()[\]{}|]/g, i = /^\[object .+?Constructor\]$/, o = Function.prototype, s = Object.prototype, u = o.toString, l = s.hasOwnProperty, c = RegExp(
    "^" + u.call(l).replace(a, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
  );
  function d(f) {
    if (!r(f) || e(f))
      return !1;
    var h = t(f) ? c : i;
    return h.test(n(f));
  }
  return fc = d, fc;
}
var vc, Eb;
function UV() {
  if (Eb) return vc;
  Eb = 1;
  function t(e, r) {
    return e == null ? void 0 : e[r];
  }
  return vc = t, vc;
}
var hc, Sb;
function Wa() {
  if (Sb) return hc;
  Sb = 1;
  var t = GV(), e = UV();
  function r(n, a) {
    var i = e(n, a);
    return t(i) ? i : void 0;
  }
  return hc = r, hc;
}
var pc, kb;
function Zg() {
  if (kb) return pc;
  kb = 1;
  var t = Wa(), e = Jr(), r = t(e, "Map");
  return pc = r, pc;
}
var gc, _b;
function Ql() {
  if (_b) return gc;
  _b = 1;
  var t = Wa(), e = t(Object, "create");
  return gc = e, gc;
}
var yc, Tb;
function WV() {
  if (Tb) return yc;
  Tb = 1;
  var t = Ql();
  function e() {
    this.__data__ = t ? t(null) : {}, this.size = 0;
  }
  return yc = e, yc;
}
var mc, Ib;
function jV() {
  if (Ib) return mc;
  Ib = 1;
  function t(e) {
    var r = this.has(e) && delete this.__data__[e];
    return this.size -= r ? 1 : 0, r;
  }
  return mc = t, mc;
}
var bc, Ob;
function YV() {
  if (Ob) return bc;
  Ob = 1;
  var t = Ql(), e = "__lodash_hash_undefined__", r = Object.prototype, n = r.hasOwnProperty;
  function a(i) {
    var o = this.__data__;
    if (t) {
      var s = o[i];
      return s === e ? void 0 : s;
    }
    return n.call(o, i) ? o[i] : void 0;
  }
  return bc = a, bc;
}
var wc, Ab;
function ZV() {
  if (Ab) return wc;
  Ab = 1;
  var t = Ql(), e = Object.prototype, r = e.hasOwnProperty;
  function n(a) {
    var i = this.__data__;
    return t ? i[a] !== void 0 : r.call(i, a);
  }
  return wc = n, wc;
}
var Cc, Pb;
function XV() {
  if (Pb) return Cc;
  Pb = 1;
  var t = Ql(), e = "__lodash_hash_undefined__";
  function r(n, a) {
    var i = this.__data__;
    return this.size += this.has(n) ? 0 : 1, i[n] = t && a === void 0 ? e : a, this;
  }
  return Cc = r, Cc;
}
var xc, Db;
function JV() {
  if (Db) return xc;
  Db = 1;
  var t = WV(), e = jV(), r = YV(), n = ZV(), a = XV();
  function i(o) {
    var s = -1, u = o == null ? 0 : o.length;
    for (this.clear(); ++s < u; ) {
      var l = o[s];
      this.set(l[0], l[1]);
    }
  }
  return i.prototype.clear = t, i.prototype.delete = e, i.prototype.get = r, i.prototype.has = n, i.prototype.set = a, xc = i, xc;
}
var Ec, Rb;
function QV() {
  if (Rb) return Ec;
  Rb = 1;
  var t = JV(), e = Jl(), r = Zg();
  function n() {
    this.size = 0, this.__data__ = {
      hash: new t(),
      map: new (r || e)(),
      string: new t()
    };
  }
  return Ec = n, Ec;
}
var Sc, Lb;
function e6() {
  if (Lb) return Sc;
  Lb = 1;
  function t(e) {
    var r = typeof e;
    return r == "string" || r == "number" || r == "symbol" || r == "boolean" ? e !== "__proto__" : e === null;
  }
  return Sc = t, Sc;
}
var kc, Fb;
function eu() {
  if (Fb) return kc;
  Fb = 1;
  var t = e6();
  function e(r, n) {
    var a = r.__data__;
    return t(n) ? a[typeof n == "string" ? "string" : "hash"] : a.map;
  }
  return kc = e, kc;
}
var _c, Mb;
function t6() {
  if (Mb) return _c;
  Mb = 1;
  var t = eu();
  function e(r) {
    var n = t(this, r).delete(r);
    return this.size -= n ? 1 : 0, n;
  }
  return _c = e, _c;
}
var Tc, Nb;
function r6() {
  if (Nb) return Tc;
  Nb = 1;
  var t = eu();
  function e(r) {
    return t(this, r).get(r);
  }
  return Tc = e, Tc;
}
var Ic, Bb;
function n6() {
  if (Bb) return Ic;
  Bb = 1;
  var t = eu();
  function e(r) {
    return t(this, r).has(r);
  }
  return Ic = e, Ic;
}
var Oc, $b;
function a6() {
  if ($b) return Oc;
  $b = 1;
  var t = eu();
  function e(r, n) {
    var a = t(this, r), i = a.size;
    return a.set(r, n), this.size += a.size == i ? 0 : 1, this;
  }
  return Oc = e, Oc;
}
var Ac, qb;
function Xg() {
  if (qb) return Ac;
  qb = 1;
  var t = QV(), e = t6(), r = r6(), n = n6(), a = a6();
  function i(o) {
    var s = -1, u = o == null ? 0 : o.length;
    for (this.clear(); ++s < u; ) {
      var l = o[s];
      this.set(l[0], l[1]);
    }
  }
  return i.prototype.clear = t, i.prototype.delete = e, i.prototype.get = r, i.prototype.has = n, i.prototype.set = a, Ac = i, Ac;
}
var Pc, zb;
function i6() {
  if (zb) return Pc;
  zb = 1;
  var t = Jl(), e = Zg(), r = Xg(), n = 200;
  function a(i, o) {
    var s = this.__data__;
    if (s instanceof t) {
      var u = s.__data__;
      if (!e || u.length < n - 1)
        return u.push([i, o]), this.size = ++s.size, this;
      s = this.__data__ = new r(u);
    }
    return s.set(i, o), this.size = s.size, this;
  }
  return Pc = a, Pc;
}
var Dc, Vb;
function tu() {
  if (Vb) return Dc;
  Vb = 1;
  var t = Jl(), e = NV(), r = BV(), n = $V(), a = qV(), i = i6();
  function o(s) {
    var u = this.__data__ = new t(s);
    this.size = u.size;
  }
  return o.prototype.clear = e, o.prototype.delete = r, o.prototype.get = n, o.prototype.has = a, o.prototype.set = i, Dc = o, Dc;
}
var Rc, Hb;
function Jg() {
  if (Hb) return Rc;
  Hb = 1;
  function t(e, r) {
    for (var n = -1, a = e == null ? 0 : e.length; ++n < a && r(e[n], n, e) !== !1; )
      ;
    return e;
  }
  return Rc = t, Rc;
}
var Lc, Kb;
function Nk() {
  if (Kb) return Lc;
  Kb = 1;
  var t = Wa(), e = function() {
    try {
      var r = t(Object, "defineProperty");
      return r({}, "", {}), r;
    } catch {
    }
  }();
  return Lc = e, Lc;
}
var Fc, Gb;
function ru() {
  if (Gb) return Fc;
  Gb = 1;
  var t = Nk();
  function e(r, n, a) {
    n == "__proto__" && t ? t(r, n, {
      configurable: !0,
      enumerable: !0,
      value: a,
      writable: !0
    }) : r[n] = a;
  }
  return Fc = e, Fc;
}
var Mc, Ub;
function nu() {
  if (Ub) return Mc;
  Ub = 1;
  var t = ru(), e = Gi(), r = Object.prototype, n = r.hasOwnProperty;
  function a(i, o, s) {
    var u = i[o];
    (!(n.call(i, o) && e(u, s)) || s === void 0 && !(o in i)) && t(i, o, s);
  }
  return Mc = a, Mc;
}
var Nc, Wb;
function ds() {
  if (Wb) return Nc;
  Wb = 1;
  var t = nu(), e = ru();
  function r(n, a, i, o) {
    var s = !i;
    i || (i = {});
    for (var u = -1, l = a.length; ++u < l; ) {
      var c = a[u], d = o ? o(i[c], n[c], c, i, n) : void 0;
      d === void 0 && (d = n[c]), s ? e(i, c, d) : t(i, c, d);
    }
    return i;
  }
  return Nc = r, Nc;
}
var Bc, jb;
function o6() {
  if (jb) return Bc;
  jb = 1;
  function t(e, r) {
    for (var n = -1, a = Array(e); ++n < e; )
      a[n] = r(n);
    return a;
  }
  return Bc = t, Bc;
}
var $c, Yb;
function hn() {
  if (Yb) return $c;
  Yb = 1;
  function t(e) {
    return e != null && typeof e == "object";
  }
  return $c = t, $c;
}
var qc, Zb;
function s6() {
  if (Zb) return qc;
  Zb = 1;
  var t = Ua(), e = hn(), r = "[object Arguments]";
  function n(a) {
    return e(a) && t(a) == r;
  }
  return qc = n, qc;
}
var zc, Xb;
function fs() {
  if (Xb) return zc;
  Xb = 1;
  var t = s6(), e = hn(), r = Object.prototype, n = r.hasOwnProperty, a = r.propertyIsEnumerable, i = t(/* @__PURE__ */ function() {
    return arguments;
  }()) ? t : function(o) {
    return e(o) && n.call(o, "callee") && !a.call(o, "callee");
  };
  return zc = i, zc;
}
var Vc, Jb;
function At() {
  if (Jb) return Vc;
  Jb = 1;
  var t = Array.isArray;
  return Vc = t, Vc;
}
var ho = { exports: {} }, Hc, Qb;
function l6() {
  if (Qb) return Hc;
  Qb = 1;
  function t() {
    return !1;
  }
  return Hc = t, Hc;
}
ho.exports;
var e1;
function Wi() {
  return e1 || (e1 = 1, function(t, e) {
    var r = Jr(), n = l6(), a = e && !e.nodeType && e, i = a && !0 && t && !t.nodeType && t, o = i && i.exports === a, s = o ? r.Buffer : void 0, u = s ? s.isBuffer : void 0, l = u || n;
    t.exports = l;
  }(ho, ho.exports)), ho.exports;
}
var Kc, t1;
function au() {
  if (t1) return Kc;
  t1 = 1;
  var t = 9007199254740991, e = /^(?:0|[1-9]\d*)$/;
  function r(n, a) {
    var i = typeof n;
    return a = a ?? t, !!a && (i == "number" || i != "symbol" && e.test(n)) && n > -1 && n % 1 == 0 && n < a;
  }
  return Kc = r, Kc;
}
var Gc, r1;
function Qg() {
  if (r1) return Gc;
  r1 = 1;
  var t = 9007199254740991;
  function e(r) {
    return typeof r == "number" && r > -1 && r % 1 == 0 && r <= t;
  }
  return Gc = e, Gc;
}
var Uc, n1;
function u6() {
  if (n1) return Uc;
  n1 = 1;
  var t = Ua(), e = Qg(), r = hn(), n = "[object Arguments]", a = "[object Array]", i = "[object Boolean]", o = "[object Date]", s = "[object Error]", u = "[object Function]", l = "[object Map]", c = "[object Number]", d = "[object Object]", f = "[object RegExp]", h = "[object Set]", v = "[object String]", p = "[object WeakMap]", g = "[object ArrayBuffer]", y = "[object DataView]", m = "[object Float32Array]", b = "[object Float64Array]", w = "[object Int8Array]", x = "[object Int16Array]", E = "[object Int32Array]", C = "[object Uint8Array]", k = "[object Uint8ClampedArray]", S = "[object Uint16Array]", _ = "[object Uint32Array]", T = {};
  T[m] = T[b] = T[w] = T[x] = T[E] = T[C] = T[k] = T[S] = T[_] = !0, T[n] = T[a] = T[g] = T[i] = T[y] = T[o] = T[s] = T[u] = T[l] = T[c] = T[d] = T[f] = T[h] = T[v] = T[p] = !1;
  function O(D) {
    return r(D) && e(D.length) && !!T[t(D)];
  }
  return Uc = O, Uc;
}
var Wc, a1;
function iu() {
  if (a1) return Wc;
  a1 = 1;
  function t(e) {
    return function(r) {
      return e(r);
    };
  }
  return Wc = t, Wc;
}
var po = { exports: {} };
po.exports;
var i1;
function ey() {
  return i1 || (i1 = 1, function(t, e) {
    var r = Fk(), n = e && !e.nodeType && e, a = n && !0 && t && !t.nodeType && t, i = a && a.exports === n, o = i && r.process, s = function() {
      try {
        var u = a && a.require && a.require("util").types;
        return u || o && o.binding && o.binding("util");
      } catch {
      }
    }();
    t.exports = s;
  }(po, po.exports)), po.exports;
}
var jc, o1;
function vs() {
  if (o1) return jc;
  o1 = 1;
  var t = u6(), e = iu(), r = ey(), n = r && r.isTypedArray, a = n ? e(n) : t;
  return jc = a, jc;
}
var Yc, s1;
function Bk() {
  if (s1) return Yc;
  s1 = 1;
  var t = o6(), e = fs(), r = At(), n = Wi(), a = au(), i = vs(), o = Object.prototype, s = o.hasOwnProperty;
  function u(l, c) {
    var d = r(l), f = !d && e(l), h = !d && !f && n(l), v = !d && !f && !h && i(l), p = d || f || h || v, g = p ? t(l.length, String) : [], y = g.length;
    for (var m in l)
      (c || s.call(l, m)) && !(p && // Safari 9 has enumerable `arguments.length` in strict mode.
      (m == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
      h && (m == "offset" || m == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
      v && (m == "buffer" || m == "byteLength" || m == "byteOffset") || // Skip index properties.
      a(m, y))) && g.push(m);
    return g;
  }
  return Yc = u, Yc;
}
var Zc, l1;
function ou() {
  if (l1) return Zc;
  l1 = 1;
  var t = Object.prototype;
  function e(r) {
    var n = r && r.constructor, a = typeof n == "function" && n.prototype || t;
    return r === a;
  }
  return Zc = e, Zc;
}
var Xc, u1;
function $k() {
  if (u1) return Xc;
  u1 = 1;
  function t(e, r) {
    return function(n) {
      return e(r(n));
    };
  }
  return Xc = t, Xc;
}
var Jc, c1;
function c6() {
  if (c1) return Jc;
  c1 = 1;
  var t = $k(), e = t(Object.keys, Object);
  return Jc = e, Jc;
}
var Qc, d1;
function ty() {
  if (d1) return Qc;
  d1 = 1;
  var t = ou(), e = c6(), r = Object.prototype, n = r.hasOwnProperty;
  function a(i) {
    if (!t(i))
      return e(i);
    var o = [];
    for (var s in Object(i))
      n.call(i, s) && s != "constructor" && o.push(s);
    return o;
  }
  return Qc = a, Qc;
}
var ed, f1;
function Rn() {
  if (f1) return ed;
  f1 = 1;
  var t = cs(), e = Qg();
  function r(n) {
    return n != null && e(n.length) && !t(n);
  }
  return ed = r, ed;
}
var td, v1;
function ca() {
  if (v1) return td;
  v1 = 1;
  var t = Bk(), e = ty(), r = Rn();
  function n(a) {
    return r(a) ? t(a) : e(a);
  }
  return td = n, td;
}
var rd, h1;
function d6() {
  if (h1) return rd;
  h1 = 1;
  var t = ds(), e = ca();
  function r(n, a) {
    return n && t(a, e(a), n);
  }
  return rd = r, rd;
}
var nd, p1;
function f6() {
  if (p1) return nd;
  p1 = 1;
  function t(e) {
    var r = [];
    if (e != null)
      for (var n in Object(e))
        r.push(n);
    return r;
  }
  return nd = t, nd;
}
var ad, g1;
function v6() {
  if (g1) return ad;
  g1 = 1;
  var t = Fr(), e = ou(), r = f6(), n = Object.prototype, a = n.hasOwnProperty;
  function i(o) {
    if (!t(o))
      return r(o);
    var s = e(o), u = [];
    for (var l in o)
      l == "constructor" && (s || !a.call(o, l)) || u.push(l);
    return u;
  }
  return ad = i, ad;
}
var id, y1;
function ja() {
  if (y1) return id;
  y1 = 1;
  var t = Bk(), e = v6(), r = Rn();
  function n(a) {
    return r(a) ? t(a, !0) : e(a);
  }
  return id = n, id;
}
var od, m1;
function h6() {
  if (m1) return od;
  m1 = 1;
  var t = ds(), e = ja();
  function r(n, a) {
    return n && t(a, e(a), n);
  }
  return od = r, od;
}
var go = { exports: {} };
go.exports;
var b1;
function qk() {
  return b1 || (b1 = 1, function(t, e) {
    var r = Jr(), n = e && !e.nodeType && e, a = n && !0 && t && !t.nodeType && t, i = a && a.exports === n, o = i ? r.Buffer : void 0, s = o ? o.allocUnsafe : void 0;
    function u(l, c) {
      if (c)
        return l.slice();
      var d = l.length, f = s ? s(d) : new l.constructor(d);
      return l.copy(f), f;
    }
    t.exports = u;
  }(go, go.exports)), go.exports;
}
var sd, w1;
function zk() {
  if (w1) return sd;
  w1 = 1;
  function t(e, r) {
    var n = -1, a = e.length;
    for (r || (r = Array(a)); ++n < a; )
      r[n] = e[n];
    return r;
  }
  return sd = t, sd;
}
var ld, C1;
function Vk() {
  if (C1) return ld;
  C1 = 1;
  function t(e, r) {
    for (var n = -1, a = e == null ? 0 : e.length, i = 0, o = []; ++n < a; ) {
      var s = e[n];
      r(s, n, e) && (o[i++] = s);
    }
    return o;
  }
  return ld = t, ld;
}
var ud, x1;
function Hk() {
  if (x1) return ud;
  x1 = 1;
  function t() {
    return [];
  }
  return ud = t, ud;
}
var cd, E1;
function ry() {
  if (E1) return cd;
  E1 = 1;
  var t = Vk(), e = Hk(), r = Object.prototype, n = r.propertyIsEnumerable, a = Object.getOwnPropertySymbols, i = a ? function(o) {
    return o == null ? [] : (o = Object(o), t(a(o), function(s) {
      return n.call(o, s);
    }));
  } : e;
  return cd = i, cd;
}
var dd, S1;
function p6() {
  if (S1) return dd;
  S1 = 1;
  var t = ds(), e = ry();
  function r(n, a) {
    return t(n, e(n), a);
  }
  return dd = r, dd;
}
var fd, k1;
function ny() {
  if (k1) return fd;
  k1 = 1;
  function t(e, r) {
    for (var n = -1, a = r.length, i = e.length; ++n < a; )
      e[i + n] = r[n];
    return e;
  }
  return fd = t, fd;
}
var vd, _1;
function su() {
  if (_1) return vd;
  _1 = 1;
  var t = $k(), e = t(Object.getPrototypeOf, Object);
  return vd = e, vd;
}
var hd, T1;
function Kk() {
  if (T1) return hd;
  T1 = 1;
  var t = ny(), e = su(), r = ry(), n = Hk(), a = Object.getOwnPropertySymbols, i = a ? function(o) {
    for (var s = []; o; )
      t(s, r(o)), o = e(o);
    return s;
  } : n;
  return hd = i, hd;
}
var pd, I1;
function g6() {
  if (I1) return pd;
  I1 = 1;
  var t = ds(), e = Kk();
  function r(n, a) {
    return t(n, e(n), a);
  }
  return pd = r, pd;
}
var gd, O1;
function Gk() {
  if (O1) return gd;
  O1 = 1;
  var t = ny(), e = At();
  function r(n, a, i) {
    var o = a(n);
    return e(n) ? o : t(o, i(n));
  }
  return gd = r, gd;
}
var yd, A1;
function Uk() {
  if (A1) return yd;
  A1 = 1;
  var t = Gk(), e = ry(), r = ca();
  function n(a) {
    return t(a, r, e);
  }
  return yd = n, yd;
}
var md, P1;
function y6() {
  if (P1) return md;
  P1 = 1;
  var t = Gk(), e = Kk(), r = ja();
  function n(a) {
    return t(a, r, e);
  }
  return md = n, md;
}
var bd, D1;
function m6() {
  if (D1) return bd;
  D1 = 1;
  var t = Wa(), e = Jr(), r = t(e, "DataView");
  return bd = r, bd;
}
var wd, R1;
function b6() {
  if (R1) return wd;
  R1 = 1;
  var t = Wa(), e = Jr(), r = t(e, "Promise");
  return wd = r, wd;
}
var Cd, L1;
function Wk() {
  if (L1) return Cd;
  L1 = 1;
  var t = Wa(), e = Jr(), r = t(e, "Set");
  return Cd = r, Cd;
}
var xd, F1;
function w6() {
  if (F1) return xd;
  F1 = 1;
  var t = Wa(), e = Jr(), r = t(e, "WeakMap");
  return xd = r, xd;
}
var Ed, M1;
function ji() {
  if (M1) return Ed;
  M1 = 1;
  var t = m6(), e = Zg(), r = b6(), n = Wk(), a = w6(), i = Ua(), o = Mk(), s = "[object Map]", u = "[object Object]", l = "[object Promise]", c = "[object Set]", d = "[object WeakMap]", f = "[object DataView]", h = o(t), v = o(e), p = o(r), g = o(n), y = o(a), m = i;
  return (t && m(new t(new ArrayBuffer(1))) != f || e && m(new e()) != s || r && m(r.resolve()) != l || n && m(new n()) != c || a && m(new a()) != d) && (m = function(b) {
    var w = i(b), x = w == u ? b.constructor : void 0, E = x ? o(x) : "";
    if (E)
      switch (E) {
        case h:
          return f;
        case v:
          return s;
        case p:
          return l;
        case g:
          return c;
        case y:
          return d;
      }
    return w;
  }), Ed = m, Ed;
}
var Sd, N1;
function C6() {
  if (N1) return Sd;
  N1 = 1;
  var t = Object.prototype, e = t.hasOwnProperty;
  function r(n) {
    var a = n.length, i = new n.constructor(a);
    return a && typeof n[0] == "string" && e.call(n, "index") && (i.index = n.index, i.input = n.input), i;
  }
  return Sd = r, Sd;
}
var kd, B1;
function jk() {
  if (B1) return kd;
  B1 = 1;
  var t = Jr(), e = t.Uint8Array;
  return kd = e, kd;
}
var _d, $1;
function ay() {
  if ($1) return _d;
  $1 = 1;
  var t = jk();
  function e(r) {
    var n = new r.constructor(r.byteLength);
    return new t(n).set(new t(r)), n;
  }
  return _d = e, _d;
}
var Td, q1;
function x6() {
  if (q1) return Td;
  q1 = 1;
  var t = ay();
  function e(r, n) {
    var a = n ? t(r.buffer) : r.buffer;
    return new r.constructor(a, r.byteOffset, r.byteLength);
  }
  return Td = e, Td;
}
var Id, z1;
function E6() {
  if (z1) return Id;
  z1 = 1;
  var t = /\w*$/;
  function e(r) {
    var n = new r.constructor(r.source, t.exec(r));
    return n.lastIndex = r.lastIndex, n;
  }
  return Id = e, Id;
}
var Od, V1;
function S6() {
  if (V1) return Od;
  V1 = 1;
  var t = Ui(), e = t ? t.prototype : void 0, r = e ? e.valueOf : void 0;
  function n(a) {
    return r ? Object(r.call(a)) : {};
  }
  return Od = n, Od;
}
var Ad, H1;
function Yk() {
  if (H1) return Ad;
  H1 = 1;
  var t = ay();
  function e(r, n) {
    var a = n ? t(r.buffer) : r.buffer;
    return new r.constructor(a, r.byteOffset, r.length);
  }
  return Ad = e, Ad;
}
var Pd, K1;
function k6() {
  if (K1) return Pd;
  K1 = 1;
  var t = ay(), e = x6(), r = E6(), n = S6(), a = Yk(), i = "[object Boolean]", o = "[object Date]", s = "[object Map]", u = "[object Number]", l = "[object RegExp]", c = "[object Set]", d = "[object String]", f = "[object Symbol]", h = "[object ArrayBuffer]", v = "[object DataView]", p = "[object Float32Array]", g = "[object Float64Array]", y = "[object Int8Array]", m = "[object Int16Array]", b = "[object Int32Array]", w = "[object Uint8Array]", x = "[object Uint8ClampedArray]", E = "[object Uint16Array]", C = "[object Uint32Array]";
  function k(S, _, T) {
    var O = S.constructor;
    switch (_) {
      case h:
        return t(S);
      case i:
      case o:
        return new O(+S);
      case v:
        return e(S, T);
      case p:
      case g:
      case y:
      case m:
      case b:
      case w:
      case x:
      case E:
      case C:
        return a(S, T);
      case s:
        return new O();
      case u:
      case d:
        return new O(S);
      case l:
        return r(S);
      case c:
        return new O();
      case f:
        return n(S);
    }
  }
  return Pd = k, Pd;
}
var Dd, G1;
function Zk() {
  if (G1) return Dd;
  G1 = 1;
  var t = Fr(), e = Object.create, r = /* @__PURE__ */ function() {
    function n() {
    }
    return function(a) {
      if (!t(a))
        return {};
      if (e)
        return e(a);
      n.prototype = a;
      var i = new n();
      return n.prototype = void 0, i;
    };
  }();
  return Dd = r, Dd;
}
var Rd, U1;
function Xk() {
  if (U1) return Rd;
  U1 = 1;
  var t = Zk(), e = su(), r = ou();
  function n(a) {
    return typeof a.constructor == "function" && !r(a) ? t(e(a)) : {};
  }
  return Rd = n, Rd;
}
var Ld, W1;
function _6() {
  if (W1) return Ld;
  W1 = 1;
  var t = ji(), e = hn(), r = "[object Map]";
  function n(a) {
    return e(a) && t(a) == r;
  }
  return Ld = n, Ld;
}
var Fd, j1;
function T6() {
  if (j1) return Fd;
  j1 = 1;
  var t = _6(), e = iu(), r = ey(), n = r && r.isMap, a = n ? e(n) : t;
  return Fd = a, Fd;
}
var Md, Y1;
function I6() {
  if (Y1) return Md;
  Y1 = 1;
  var t = ji(), e = hn(), r = "[object Set]";
  function n(a) {
    return e(a) && t(a) == r;
  }
  return Md = n, Md;
}
var Nd, Z1;
function O6() {
  if (Z1) return Nd;
  Z1 = 1;
  var t = I6(), e = iu(), r = ey(), n = r && r.isSet, a = n ? e(n) : t;
  return Nd = a, Nd;
}
var Bd, X1;
function Jk() {
  if (X1) return Bd;
  X1 = 1;
  var t = tu(), e = Jg(), r = nu(), n = d6(), a = h6(), i = qk(), o = zk(), s = p6(), u = g6(), l = Uk(), c = y6(), d = ji(), f = C6(), h = k6(), v = Xk(), p = At(), g = Wi(), y = T6(), m = Fr(), b = O6(), w = ca(), x = ja(), E = 1, C = 2, k = 4, S = "[object Arguments]", _ = "[object Array]", T = "[object Boolean]", O = "[object Date]", D = "[object Error]", A = "[object Function]", F = "[object GeneratorFunction]", R = "[object Map]", M = "[object Number]", L = "[object Object]", V = "[object RegExp]", Y = "[object Set]", H = "[object String]", K = "[object Symbol]", ne = "[object WeakMap]", B = "[object ArrayBuffer]", $ = "[object DataView]", z = "[object Float32Array]", W = "[object Float64Array]", Z = "[object Int8Array]", N = "[object Int16Array]", X = "[object Int32Array]", Q = "[object Uint8Array]", ge = "[object Uint8ClampedArray]", we = "[object Uint16Array]", fe = "[object Uint32Array]", ce = {};
  ce[S] = ce[_] = ce[B] = ce[$] = ce[T] = ce[O] = ce[z] = ce[W] = ce[Z] = ce[N] = ce[X] = ce[R] = ce[M] = ce[L] = ce[V] = ce[Y] = ce[H] = ce[K] = ce[Q] = ce[ge] = ce[we] = ce[fe] = !0, ce[D] = ce[A] = ce[ne] = !1;
  function be(ve, xe, _e, He, Ve, De) {
    var Ne, ue = xe & E, I = xe & C, G = xe & k;
    if (_e && (Ne = Ve ? _e(ve, He, Ve, De) : _e(ve)), Ne !== void 0)
      return Ne;
    if (!m(ve))
      return ve;
    var se = p(ve);
    if (se) {
      if (Ne = f(ve), !ue)
        return o(ve, Ne);
    } else {
      var ee = d(ve), te = ee == A || ee == F;
      if (g(ve))
        return i(ve, ue);
      if (ee == L || ee == S || te && !Ve) {
        if (Ne = I || te ? {} : v(ve), !ue)
          return I ? u(ve, a(Ne, ve)) : s(ve, n(Ne, ve));
      } else {
        if (!ce[ee])
          return Ve ? ve : {};
        Ne = h(ve, ee, ue);
      }
    }
    De || (De = new t());
    var ye = De.get(ve);
    if (ye)
      return ye;
    De.set(ve, Ne), b(ve) ? ve.forEach(function(Oe) {
      Ne.add(be(Oe, xe, _e, Oe, ve, De));
    }) : y(ve) && ve.forEach(function(Oe, Pe) {
      Ne.set(Pe, be(Oe, xe, _e, Pe, ve, De));
    });
    var oe = G ? I ? c : l : I ? x : w, he = se ? void 0 : oe(ve);
    return e(he || ve, function(Oe, Pe) {
      he && (Pe = Oe, Oe = ve[Pe]), r(Ne, Pe, be(Oe, xe, _e, Pe, ve, De));
    }), Ne;
  }
  return Bd = be, Bd;
}
var $d, J1;
function A6() {
  if (J1) return $d;
  J1 = 1;
  var t = Jk(), e = 4;
  function r(n) {
    return t(n, e);
  }
  return $d = r, $d;
}
var qd, Q1;
function iy() {
  if (Q1) return qd;
  Q1 = 1;
  function t(e) {
    return function() {
      return e;
    };
  }
  return qd = t, qd;
}
var zd, ew;
function P6() {
  if (ew) return zd;
  ew = 1;
  function t(e) {
    return function(r, n, a) {
      for (var i = -1, o = Object(r), s = a(r), u = s.length; u--; ) {
        var l = s[e ? u : ++i];
        if (n(o[l], l, o) === !1)
          break;
      }
      return r;
    };
  }
  return zd = t, zd;
}
var Vd, tw;
function oy() {
  if (tw) return Vd;
  tw = 1;
  var t = P6(), e = t();
  return Vd = e, Vd;
}
var Hd, rw;
function sy() {
  if (rw) return Hd;
  rw = 1;
  var t = oy(), e = ca();
  function r(n, a) {
    return n && t(n, a, e);
  }
  return Hd = r, Hd;
}
var Kd, nw;
function D6() {
  if (nw) return Kd;
  nw = 1;
  var t = Rn();
  function e(r, n) {
    return function(a, i) {
      if (a == null)
        return a;
      if (!t(a))
        return r(a, i);
      for (var o = a.length, s = n ? o : -1, u = Object(a); (n ? s-- : ++s < o) && i(u[s], s, u) !== !1; )
        ;
      return a;
    };
  }
  return Kd = e, Kd;
}
var Gd, aw;
function lu() {
  if (aw) return Gd;
  aw = 1;
  var t = sy(), e = D6(), r = e(t);
  return Gd = r, Gd;
}
var Ud, iw;
function Ya() {
  if (iw) return Ud;
  iw = 1;
  function t(e) {
    return e;
  }
  return Ud = t, Ud;
}
var Wd, ow;
function Qk() {
  if (ow) return Wd;
  ow = 1;
  var t = Ya();
  function e(r) {
    return typeof r == "function" ? r : t;
  }
  return Wd = e, Wd;
}
var jd, sw;
function e_() {
  if (sw) return jd;
  sw = 1;
  var t = Jg(), e = lu(), r = Qk(), n = At();
  function a(i, o) {
    var s = n(i) ? t : e;
    return s(i, r(o));
  }
  return jd = a, jd;
}
var Yd, lw;
function t_() {
  return lw || (lw = 1, Yd = e_()), Yd;
}
var Zd, uw;
function R6() {
  if (uw) return Zd;
  uw = 1;
  var t = lu();
  function e(r, n) {
    var a = [];
    return t(r, function(i, o, s) {
      n(i, o, s) && a.push(i);
    }), a;
  }
  return Zd = e, Zd;
}
var Xd, cw;
function L6() {
  if (cw) return Xd;
  cw = 1;
  var t = "__lodash_hash_undefined__";
  function e(r) {
    return this.__data__.set(r, t), this;
  }
  return Xd = e, Xd;
}
var Jd, dw;
function F6() {
  if (dw) return Jd;
  dw = 1;
  function t(e) {
    return this.__data__.has(e);
  }
  return Jd = t, Jd;
}
var Qd, fw;
function r_() {
  if (fw) return Qd;
  fw = 1;
  var t = Xg(), e = L6(), r = F6();
  function n(a) {
    var i = -1, o = a == null ? 0 : a.length;
    for (this.__data__ = new t(); ++i < o; )
      this.add(a[i]);
  }
  return n.prototype.add = n.prototype.push = e, n.prototype.has = r, Qd = n, Qd;
}
var ef, vw;
function M6() {
  if (vw) return ef;
  vw = 1;
  function t(e, r) {
    for (var n = -1, a = e == null ? 0 : e.length; ++n < a; )
      if (r(e[n], n, e))
        return !0;
    return !1;
  }
  return ef = t, ef;
}
var tf, hw;
function n_() {
  if (hw) return tf;
  hw = 1;
  function t(e, r) {
    return e.has(r);
  }
  return tf = t, tf;
}
var rf, pw;
function a_() {
  if (pw) return rf;
  pw = 1;
  var t = r_(), e = M6(), r = n_(), n = 1, a = 2;
  function i(o, s, u, l, c, d) {
    var f = u & n, h = o.length, v = s.length;
    if (h != v && !(f && v > h))
      return !1;
    var p = d.get(o), g = d.get(s);
    if (p && g)
      return p == s && g == o;
    var y = -1, m = !0, b = u & a ? new t() : void 0;
    for (d.set(o, s), d.set(s, o); ++y < h; ) {
      var w = o[y], x = s[y];
      if (l)
        var E = f ? l(x, w, y, s, o, d) : l(w, x, y, o, s, d);
      if (E !== void 0) {
        if (E)
          continue;
        m = !1;
        break;
      }
      if (b) {
        if (!e(s, function(C, k) {
          if (!r(b, k) && (w === C || c(w, C, u, l, d)))
            return b.push(k);
        })) {
          m = !1;
          break;
        }
      } else if (!(w === x || c(w, x, u, l, d))) {
        m = !1;
        break;
      }
    }
    return d.delete(o), d.delete(s), m;
  }
  return rf = i, rf;
}
var nf, gw;
function N6() {
  if (gw) return nf;
  gw = 1;
  function t(e) {
    var r = -1, n = Array(e.size);
    return e.forEach(function(a, i) {
      n[++r] = [i, a];
    }), n;
  }
  return nf = t, nf;
}
var af, yw;
function ly() {
  if (yw) return af;
  yw = 1;
  function t(e) {
    var r = -1, n = Array(e.size);
    return e.forEach(function(a) {
      n[++r] = a;
    }), n;
  }
  return af = t, af;
}
var of, mw;
function B6() {
  if (mw) return of;
  mw = 1;
  var t = Ui(), e = jk(), r = Gi(), n = a_(), a = N6(), i = ly(), o = 1, s = 2, u = "[object Boolean]", l = "[object Date]", c = "[object Error]", d = "[object Map]", f = "[object Number]", h = "[object RegExp]", v = "[object Set]", p = "[object String]", g = "[object Symbol]", y = "[object ArrayBuffer]", m = "[object DataView]", b = t ? t.prototype : void 0, w = b ? b.valueOf : void 0;
  function x(E, C, k, S, _, T, O) {
    switch (k) {
      case m:
        if (E.byteLength != C.byteLength || E.byteOffset != C.byteOffset)
          return !1;
        E = E.buffer, C = C.buffer;
      case y:
        return !(E.byteLength != C.byteLength || !T(new e(E), new e(C)));
      case u:
      case l:
      case f:
        return r(+E, +C);
      case c:
        return E.name == C.name && E.message == C.message;
      case h:
      case p:
        return E == C + "";
      case d:
        var D = a;
      case v:
        var A = S & o;
        if (D || (D = i), E.size != C.size && !A)
          return !1;
        var F = O.get(E);
        if (F)
          return F == C;
        S |= s, O.set(E, C);
        var R = n(D(E), D(C), S, _, T, O);
        return O.delete(E), R;
      case g:
        if (w)
          return w.call(E) == w.call(C);
    }
    return !1;
  }
  return of = x, of;
}
var sf, bw;
function $6() {
  if (bw) return sf;
  bw = 1;
  var t = Uk(), e = 1, r = Object.prototype, n = r.hasOwnProperty;
  function a(i, o, s, u, l, c) {
    var d = s & e, f = t(i), h = f.length, v = t(o), p = v.length;
    if (h != p && !d)
      return !1;
    for (var g = h; g--; ) {
      var y = f[g];
      if (!(d ? y in o : n.call(o, y)))
        return !1;
    }
    var m = c.get(i), b = c.get(o);
    if (m && b)
      return m == o && b == i;
    var w = !0;
    c.set(i, o), c.set(o, i);
    for (var x = d; ++g < h; ) {
      y = f[g];
      var E = i[y], C = o[y];
      if (u)
        var k = d ? u(C, E, y, o, i, c) : u(E, C, y, i, o, c);
      if (!(k === void 0 ? E === C || l(E, C, s, u, c) : k)) {
        w = !1;
        break;
      }
      x || (x = y == "constructor");
    }
    if (w && !x) {
      var S = i.constructor, _ = o.constructor;
      S != _ && "constructor" in i && "constructor" in o && !(typeof S == "function" && S instanceof S && typeof _ == "function" && _ instanceof _) && (w = !1);
    }
    return c.delete(i), c.delete(o), w;
  }
  return sf = a, sf;
}
var lf, ww;
function q6() {
  if (ww) return lf;
  ww = 1;
  var t = tu(), e = a_(), r = B6(), n = $6(), a = ji(), i = At(), o = Wi(), s = vs(), u = 1, l = "[object Arguments]", c = "[object Array]", d = "[object Object]", f = Object.prototype, h = f.hasOwnProperty;
  function v(p, g, y, m, b, w) {
    var x = i(p), E = i(g), C = x ? c : a(p), k = E ? c : a(g);
    C = C == l ? d : C, k = k == l ? d : k;
    var S = C == d, _ = k == d, T = C == k;
    if (T && o(p)) {
      if (!o(g))
        return !1;
      x = !0, S = !1;
    }
    if (T && !S)
      return w || (w = new t()), x || s(p) ? e(p, g, y, m, b, w) : r(p, g, C, y, m, b, w);
    if (!(y & u)) {
      var O = S && h.call(p, "__wrapped__"), D = _ && h.call(g, "__wrapped__");
      if (O || D) {
        var A = O ? p.value() : p, F = D ? g.value() : g;
        return w || (w = new t()), b(A, F, y, m, w);
      }
    }
    return T ? (w || (w = new t()), n(p, g, y, m, b, w)) : !1;
  }
  return lf = v, lf;
}
var uf, Cw;
function i_() {
  if (Cw) return uf;
  Cw = 1;
  var t = q6(), e = hn();
  function r(n, a, i, o, s) {
    return n === a ? !0 : n == null || a == null || !e(n) && !e(a) ? n !== n && a !== a : t(n, a, i, o, r, s);
  }
  return uf = r, uf;
}
var cf, xw;
function z6() {
  if (xw) return cf;
  xw = 1;
  var t = tu(), e = i_(), r = 1, n = 2;
  function a(i, o, s, u) {
    var l = s.length, c = l, d = !u;
    if (i == null)
      return !c;
    for (i = Object(i); l--; ) {
      var f = s[l];
      if (d && f[2] ? f[1] !== i[f[0]] : !(f[0] in i))
        return !1;
    }
    for (; ++l < c; ) {
      f = s[l];
      var h = f[0], v = i[h], p = f[1];
      if (d && f[2]) {
        if (v === void 0 && !(h in i))
          return !1;
      } else {
        var g = new t();
        if (u)
          var y = u(v, p, h, i, o, g);
        if (!(y === void 0 ? e(p, v, r | n, u, g) : y))
          return !1;
      }
    }
    return !0;
  }
  return cf = a, cf;
}
var df, Ew;
function o_() {
  if (Ew) return df;
  Ew = 1;
  var t = Fr();
  function e(r) {
    return r === r && !t(r);
  }
  return df = e, df;
}
var ff, Sw;
function V6() {
  if (Sw) return ff;
  Sw = 1;
  var t = o_(), e = ca();
  function r(n) {
    for (var a = e(n), i = a.length; i--; ) {
      var o = a[i], s = n[o];
      a[i] = [o, s, t(s)];
    }
    return a;
  }
  return ff = r, ff;
}
var vf, kw;
function s_() {
  if (kw) return vf;
  kw = 1;
  function t(e, r) {
    return function(n) {
      return n == null ? !1 : n[e] === r && (r !== void 0 || e in Object(n));
    };
  }
  return vf = t, vf;
}
var hf, _w;
function H6() {
  if (_w) return hf;
  _w = 1;
  var t = z6(), e = V6(), r = s_();
  function n(a) {
    var i = e(a);
    return i.length == 1 && i[0][2] ? r(i[0][0], i[0][1]) : function(o) {
      return o === a || t(o, a, i);
    };
  }
  return hf = n, hf;
}
var pf, Tw;
function Yi() {
  if (Tw) return pf;
  Tw = 1;
  var t = Ua(), e = hn(), r = "[object Symbol]";
  function n(a) {
    return typeof a == "symbol" || e(a) && t(a) == r;
  }
  return pf = n, pf;
}
var gf, Iw;
function uy() {
  if (Iw) return gf;
  Iw = 1;
  var t = At(), e = Yi(), r = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, n = /^\w*$/;
  function a(i, o) {
    if (t(i))
      return !1;
    var s = typeof i;
    return s == "number" || s == "symbol" || s == "boolean" || i == null || e(i) ? !0 : n.test(i) || !r.test(i) || o != null && i in Object(o);
  }
  return gf = a, gf;
}
var yf, Ow;
function K6() {
  if (Ow) return yf;
  Ow = 1;
  var t = Xg(), e = "Expected a function";
  function r(n, a) {
    if (typeof n != "function" || a != null && typeof a != "function")
      throw new TypeError(e);
    var i = function() {
      var o = arguments, s = a ? a.apply(this, o) : o[0], u = i.cache;
      if (u.has(s))
        return u.get(s);
      var l = n.apply(this, o);
      return i.cache = u.set(s, l) || u, l;
    };
    return i.cache = new (r.Cache || t)(), i;
  }
  return r.Cache = t, yf = r, yf;
}
var mf, Aw;
function G6() {
  if (Aw) return mf;
  Aw = 1;
  var t = K6(), e = 500;
  function r(n) {
    var a = t(n, function(o) {
      return i.size === e && i.clear(), o;
    }), i = a.cache;
    return a;
  }
  return mf = r, mf;
}
var bf, Pw;
function U6() {
  if (Pw) return bf;
  Pw = 1;
  var t = G6(), e = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, r = /\\(\\)?/g, n = t(function(a) {
    var i = [];
    return a.charCodeAt(0) === 46 && i.push(""), a.replace(e, function(o, s, u, l) {
      i.push(u ? l.replace(r, "$1") : s || o);
    }), i;
  });
  return bf = n, bf;
}
var wf, Dw;
function uu() {
  if (Dw) return wf;
  Dw = 1;
  function t(e, r) {
    for (var n = -1, a = e == null ? 0 : e.length, i = Array(a); ++n < a; )
      i[n] = r(e[n], n, e);
    return i;
  }
  return wf = t, wf;
}
var Cf, Rw;
function W6() {
  if (Rw) return Cf;
  Rw = 1;
  var t = Ui(), e = uu(), r = At(), n = Yi(), a = 1 / 0, i = t ? t.prototype : void 0, o = i ? i.toString : void 0;
  function s(u) {
    if (typeof u == "string")
      return u;
    if (r(u))
      return e(u, s) + "";
    if (n(u))
      return o ? o.call(u) : "";
    var l = u + "";
    return l == "0" && 1 / u == -a ? "-0" : l;
  }
  return Cf = s, Cf;
}
var xf, Lw;
function l_() {
  if (Lw) return xf;
  Lw = 1;
  var t = W6();
  function e(r) {
    return r == null ? "" : t(r);
  }
  return xf = e, xf;
}
var Ef, Fw;
function cu() {
  if (Fw) return Ef;
  Fw = 1;
  var t = At(), e = uy(), r = U6(), n = l_();
  function a(i, o) {
    return t(i) ? i : e(i, o) ? [i] : r(n(i));
  }
  return Ef = a, Ef;
}
var Sf, Mw;
function hs() {
  if (Mw) return Sf;
  Mw = 1;
  var t = Yi(), e = 1 / 0;
  function r(n) {
    if (typeof n == "string" || t(n))
      return n;
    var a = n + "";
    return a == "0" && 1 / n == -e ? "-0" : a;
  }
  return Sf = r, Sf;
}
var kf, Nw;
function du() {
  if (Nw) return kf;
  Nw = 1;
  var t = cu(), e = hs();
  function r(n, a) {
    a = t(a, n);
    for (var i = 0, o = a.length; n != null && i < o; )
      n = n[e(a[i++])];
    return i && i == o ? n : void 0;
  }
  return kf = r, kf;
}
var _f, Bw;
function j6() {
  if (Bw) return _f;
  Bw = 1;
  var t = du();
  function e(r, n, a) {
    var i = r == null ? void 0 : t(r, n);
    return i === void 0 ? a : i;
  }
  return _f = e, _f;
}
var Tf, $w;
function Y6() {
  if ($w) return Tf;
  $w = 1;
  function t(e, r) {
    return e != null && r in Object(e);
  }
  return Tf = t, Tf;
}
var If, qw;
function u_() {
  if (qw) return If;
  qw = 1;
  var t = cu(), e = fs(), r = At(), n = au(), a = Qg(), i = hs();
  function o(s, u, l) {
    u = t(u, s);
    for (var c = -1, d = u.length, f = !1; ++c < d; ) {
      var h = i(u[c]);
      if (!(f = s != null && l(s, h)))
        break;
      s = s[h];
    }
    return f || ++c != d ? f : (d = s == null ? 0 : s.length, !!d && a(d) && n(h, d) && (r(s) || e(s)));
  }
  return If = o, If;
}
var Of, zw;
function c_() {
  if (zw) return Of;
  zw = 1;
  var t = Y6(), e = u_();
  function r(n, a) {
    return n != null && e(n, a, t);
  }
  return Of = r, Of;
}
var Af, Vw;
function Z6() {
  if (Vw) return Af;
  Vw = 1;
  var t = i_(), e = j6(), r = c_(), n = uy(), a = o_(), i = s_(), o = hs(), s = 1, u = 2;
  function l(c, d) {
    return n(c) && a(d) ? i(o(c), d) : function(f) {
      var h = e(f, c);
      return h === void 0 && h === d ? r(f, c) : t(d, h, s | u);
    };
  }
  return Af = l, Af;
}
var Pf, Hw;
function d_() {
  if (Hw) return Pf;
  Hw = 1;
  function t(e) {
    return function(r) {
      return r == null ? void 0 : r[e];
    };
  }
  return Pf = t, Pf;
}
var Df, Kw;
function X6() {
  if (Kw) return Df;
  Kw = 1;
  var t = du();
  function e(r) {
    return function(n) {
      return t(n, r);
    };
  }
  return Df = e, Df;
}
var Rf, Gw;
function J6() {
  if (Gw) return Rf;
  Gw = 1;
  var t = d_(), e = X6(), r = uy(), n = hs();
  function a(i) {
    return r(i) ? t(n(i)) : e(i);
  }
  return Rf = a, Rf;
}
var Lf, Uw;
function Ln() {
  if (Uw) return Lf;
  Uw = 1;
  var t = H6(), e = Z6(), r = Ya(), n = At(), a = J6();
  function i(o) {
    return typeof o == "function" ? o : o == null ? r : typeof o == "object" ? n(o) ? e(o[0], o[1]) : t(o) : a(o);
  }
  return Lf = i, Lf;
}
var Ff, Ww;
function f_() {
  if (Ww) return Ff;
  Ww = 1;
  var t = Vk(), e = R6(), r = Ln(), n = At();
  function a(i, o) {
    var s = n(i) ? t : e;
    return s(i, r(o, 3));
  }
  return Ff = a, Ff;
}
var Mf, jw;
function Q6() {
  if (jw) return Mf;
  jw = 1;
  var t = Object.prototype, e = t.hasOwnProperty;
  function r(n, a) {
    return n != null && e.call(n, a);
  }
  return Mf = r, Mf;
}
var Nf, Yw;
function v_() {
  if (Yw) return Nf;
  Yw = 1;
  var t = Q6(), e = u_();
  function r(n, a) {
    return n != null && e(n, a, t);
  }
  return Nf = r, Nf;
}
var Bf, Zw;
function e9() {
  if (Zw) return Bf;
  Zw = 1;
  var t = ty(), e = ji(), r = fs(), n = At(), a = Rn(), i = Wi(), o = ou(), s = vs(), u = "[object Map]", l = "[object Set]", c = Object.prototype, d = c.hasOwnProperty;
  function f(h) {
    if (h == null)
      return !0;
    if (a(h) && (n(h) || typeof h == "string" || typeof h.splice == "function" || i(h) || s(h) || r(h)))
      return !h.length;
    var v = e(h);
    if (v == u || v == l)
      return !h.size;
    if (o(h))
      return !t(h).length;
    for (var p in h)
      if (d.call(h, p))
        return !1;
    return !0;
  }
  return Bf = f, Bf;
}
var $f, Xw;
function h_() {
  if (Xw) return $f;
  Xw = 1;
  function t(e) {
    return e === void 0;
  }
  return $f = t, $f;
}
var qf, Jw;
function p_() {
  if (Jw) return qf;
  Jw = 1;
  var t = lu(), e = Rn();
  function r(n, a) {
    var i = -1, o = e(n) ? Array(n.length) : [];
    return t(n, function(s, u, l) {
      o[++i] = a(s, u, l);
    }), o;
  }
  return qf = r, qf;
}
var zf, Qw;
function g_() {
  if (Qw) return zf;
  Qw = 1;
  var t = uu(), e = Ln(), r = p_(), n = At();
  function a(i, o) {
    var s = n(i) ? t : r;
    return s(i, e(o, 3));
  }
  return zf = a, zf;
}
var Vf, eC;
function t9() {
  if (eC) return Vf;
  eC = 1;
  function t(e, r, n, a) {
    var i = -1, o = e == null ? 0 : e.length;
    for (a && o && (n = e[++i]); ++i < o; )
      n = r(n, e[i], i, e);
    return n;
  }
  return Vf = t, Vf;
}
var Hf, tC;
function r9() {
  if (tC) return Hf;
  tC = 1;
  function t(e, r, n, a, i) {
    return i(e, function(o, s, u) {
      n = a ? (a = !1, o) : r(n, o, s, u);
    }), n;
  }
  return Hf = t, Hf;
}
var Kf, rC;
function y_() {
  if (rC) return Kf;
  rC = 1;
  var t = t9(), e = lu(), r = Ln(), n = r9(), a = At();
  function i(o, s, u) {
    var l = a(o) ? t : n, c = arguments.length < 3;
    return l(o, r(s, 4), u, c, e);
  }
  return Kf = i, Kf;
}
var Gf, nC;
function n9() {
  if (nC) return Gf;
  nC = 1;
  var t = Ua(), e = At(), r = hn(), n = "[object String]";
  function a(i) {
    return typeof i == "string" || !e(i) && r(i) && t(i) == n;
  }
  return Gf = a, Gf;
}
var Uf, aC;
function a9() {
  if (aC) return Uf;
  aC = 1;
  var t = d_(), e = t("length");
  return Uf = e, Uf;
}
var Wf, iC;
function i9() {
  if (iC) return Wf;
  iC = 1;
  var t = "\\ud800-\\udfff", e = "\\u0300-\\u036f", r = "\\ufe20-\\ufe2f", n = "\\u20d0-\\u20ff", a = e + r + n, i = "\\ufe0e\\ufe0f", o = "\\u200d", s = RegExp("[" + o + t + a + i + "]");
  function u(l) {
    return s.test(l);
  }
  return Wf = u, Wf;
}
var jf, oC;
function o9() {
  if (oC) return jf;
  oC = 1;
  var t = "\\ud800-\\udfff", e = "\\u0300-\\u036f", r = "\\ufe20-\\ufe2f", n = "\\u20d0-\\u20ff", a = e + r + n, i = "\\ufe0e\\ufe0f", o = "[" + t + "]", s = "[" + a + "]", u = "\\ud83c[\\udffb-\\udfff]", l = "(?:" + s + "|" + u + ")", c = "[^" + t + "]", d = "(?:\\ud83c[\\udde6-\\uddff]){2}", f = "[\\ud800-\\udbff][\\udc00-\\udfff]", h = "\\u200d", v = l + "?", p = "[" + i + "]?", g = "(?:" + h + "(?:" + [c, d, f].join("|") + ")" + p + v + ")*", y = p + v + g, m = "(?:" + [c + s + "?", s, d, f, o].join("|") + ")", b = RegExp(u + "(?=" + u + ")|" + m + y, "g");
  function w(x) {
    for (var E = b.lastIndex = 0; b.test(x); )
      ++E;
    return E;
  }
  return jf = w, jf;
}
var Yf, sC;
function s9() {
  if (sC) return Yf;
  sC = 1;
  var t = a9(), e = i9(), r = o9();
  function n(a) {
    return e(a) ? r(a) : t(a);
  }
  return Yf = n, Yf;
}
var Zf, lC;
function l9() {
  if (lC) return Zf;
  lC = 1;
  var t = ty(), e = ji(), r = Rn(), n = n9(), a = s9(), i = "[object Map]", o = "[object Set]";
  function s(u) {
    if (u == null)
      return 0;
    if (r(u))
      return n(u) ? a(u) : u.length;
    var l = e(u);
    return l == i || l == o ? u.size : t(u).length;
  }
  return Zf = s, Zf;
}
var Xf, uC;
function u9() {
  if (uC) return Xf;
  uC = 1;
  var t = Jg(), e = Zk(), r = sy(), n = Ln(), a = su(), i = At(), o = Wi(), s = cs(), u = Fr(), l = vs();
  function c(d, f, h) {
    var v = i(d), p = v || o(d) || l(d);
    if (f = n(f, 4), h == null) {
      var g = d && d.constructor;
      p ? h = v ? new g() : [] : u(d) ? h = s(g) ? e(a(d)) : {} : h = {};
    }
    return (p ? t : r)(d, function(y, m, b) {
      return f(h, y, m, b);
    }), h;
  }
  return Xf = c, Xf;
}
var Jf, cC;
function c9() {
  if (cC) return Jf;
  cC = 1;
  var t = Ui(), e = fs(), r = At(), n = t ? t.isConcatSpreadable : void 0;
  function a(i) {
    return r(i) || e(i) || !!(n && i && i[n]);
  }
  return Jf = a, Jf;
}
var Qf, dC;
function cy() {
  if (dC) return Qf;
  dC = 1;
  var t = ny(), e = c9();
  function r(n, a, i, o, s) {
    var u = -1, l = n.length;
    for (i || (i = e), s || (s = []); ++u < l; ) {
      var c = n[u];
      a > 0 && i(c) ? a > 1 ? r(c, a - 1, i, o, s) : t(s, c) : o || (s[s.length] = c);
    }
    return s;
  }
  return Qf = r, Qf;
}
var ev, fC;
function d9() {
  if (fC) return ev;
  fC = 1;
  function t(e, r, n) {
    switch (n.length) {
      case 0:
        return e.call(r);
      case 1:
        return e.call(r, n[0]);
      case 2:
        return e.call(r, n[0], n[1]);
      case 3:
        return e.call(r, n[0], n[1], n[2]);
    }
    return e.apply(r, n);
  }
  return ev = t, ev;
}
var tv, vC;
function m_() {
  if (vC) return tv;
  vC = 1;
  var t = d9(), e = Math.max;
  function r(n, a, i) {
    return a = e(a === void 0 ? n.length - 1 : a, 0), function() {
      for (var o = arguments, s = -1, u = e(o.length - a, 0), l = Array(u); ++s < u; )
        l[s] = o[a + s];
      s = -1;
      for (var c = Array(a + 1); ++s < a; )
        c[s] = o[s];
      return c[a] = i(l), t(n, this, c);
    };
  }
  return tv = r, tv;
}
var rv, hC;
function f9() {
  if (hC) return rv;
  hC = 1;
  var t = iy(), e = Nk(), r = Ya(), n = e ? function(a, i) {
    return e(a, "toString", {
      configurable: !0,
      enumerable: !1,
      value: t(i),
      writable: !0
    });
  } : r;
  return rv = n, rv;
}
var nv, pC;
function v9() {
  if (pC) return nv;
  pC = 1;
  var t = 800, e = 16, r = Date.now;
  function n(a) {
    var i = 0, o = 0;
    return function() {
      var s = r(), u = e - (s - o);
      if (o = s, u > 0) {
        if (++i >= t)
          return arguments[0];
      } else
        i = 0;
      return a.apply(void 0, arguments);
    };
  }
  return nv = n, nv;
}
var av, gC;
function b_() {
  if (gC) return av;
  gC = 1;
  var t = f9(), e = v9(), r = e(t);
  return av = r, av;
}
var iv, yC;
function fu() {
  if (yC) return iv;
  yC = 1;
  var t = Ya(), e = m_(), r = b_();
  function n(a, i) {
    return r(e(a, i, t), a + "");
  }
  return iv = n, iv;
}
var ov, mC;
function w_() {
  if (mC) return ov;
  mC = 1;
  function t(e, r, n, a) {
    for (var i = e.length, o = n + (a ? 1 : -1); a ? o-- : ++o < i; )
      if (r(e[o], o, e))
        return o;
    return -1;
  }
  return ov = t, ov;
}
var sv, bC;
function h9() {
  if (bC) return sv;
  bC = 1;
  function t(e) {
    return e !== e;
  }
  return sv = t, sv;
}
var lv, wC;
function p9() {
  if (wC) return lv;
  wC = 1;
  function t(e, r, n) {
    for (var a = n - 1, i = e.length; ++a < i; )
      if (e[a] === r)
        return a;
    return -1;
  }
  return lv = t, lv;
}
var uv, CC;
function g9() {
  if (CC) return uv;
  CC = 1;
  var t = w_(), e = h9(), r = p9();
  function n(a, i, o) {
    return i === i ? r(a, i, o) : t(a, e, o);
  }
  return uv = n, uv;
}
var cv, xC;
function y9() {
  if (xC) return cv;
  xC = 1;
  var t = g9();
  function e(r, n) {
    var a = r == null ? 0 : r.length;
    return !!a && t(r, n, 0) > -1;
  }
  return cv = e, cv;
}
var dv, EC;
function m9() {
  if (EC) return dv;
  EC = 1;
  function t(e, r, n) {
    for (var a = -1, i = e == null ? 0 : e.length; ++a < i; )
      if (n(r, e[a]))
        return !0;
    return !1;
  }
  return dv = t, dv;
}
var fv, SC;
function b9() {
  if (SC) return fv;
  SC = 1;
  function t() {
  }
  return fv = t, fv;
}
var vv, kC;
function w9() {
  if (kC) return vv;
  kC = 1;
  var t = Wk(), e = b9(), r = ly(), n = 1 / 0, a = t && 1 / r(new t([, -0]))[1] == n ? function(i) {
    return new t(i);
  } : e;
  return vv = a, vv;
}
var hv, _C;
function C9() {
  if (_C) return hv;
  _C = 1;
  var t = r_(), e = y9(), r = m9(), n = n_(), a = w9(), i = ly(), o = 200;
  function s(u, l, c) {
    var d = -1, f = e, h = u.length, v = !0, p = [], g = p;
    if (c)
      v = !1, f = r;
    else if (h >= o) {
      var y = l ? null : a(u);
      if (y)
        return i(y);
      v = !1, f = n, g = new t();
    } else
      g = l ? [] : p;
    e:
      for (; ++d < h; ) {
        var m = u[d], b = l ? l(m) : m;
        if (m = c || m !== 0 ? m : 0, v && b === b) {
          for (var w = g.length; w--; )
            if (g[w] === b)
              continue e;
          l && g.push(b), p.push(m);
        } else f(g, b, c) || (g !== p && g.push(b), p.push(m));
      }
    return p;
  }
  return hv = s, hv;
}
var pv, TC;
function C_() {
  if (TC) return pv;
  TC = 1;
  var t = Rn(), e = hn();
  function r(n) {
    return e(n) && t(n);
  }
  return pv = r, pv;
}
var gv, IC;
function x9() {
  if (IC) return gv;
  IC = 1;
  var t = cy(), e = fu(), r = C9(), n = C_(), a = e(function(i) {
    return r(t(i, 1, n, !0));
  });
  return gv = a, gv;
}
var yv, OC;
function E9() {
  if (OC) return yv;
  OC = 1;
  var t = uu();
  function e(r, n) {
    return t(n, function(a) {
      return r[a];
    });
  }
  return yv = e, yv;
}
var mv, AC;
function x_() {
  if (AC) return mv;
  AC = 1;
  var t = E9(), e = ca();
  function r(n) {
    return n == null ? [] : t(n, e(n));
  }
  return mv = r, mv;
}
var bv, PC;
function Mr() {
  if (PC) return bv;
  PC = 1;
  var t;
  if (typeof Yg == "function")
    try {
      t = {
        clone: A6(),
        constant: iy(),
        each: t_(),
        filter: f_(),
        has: v_(),
        isArray: At(),
        isEmpty: e9(),
        isFunction: cs(),
        isUndefined: h_(),
        keys: ca(),
        map: g_(),
        reduce: y_(),
        size: l9(),
        transform: u9(),
        union: x9(),
        values: x_()
      };
    } catch {
    }
  return t || (t = window._), bv = t, bv;
}
var wv, DC;
function dy() {
  if (DC) return wv;
  DC = 1;
  var t = Mr();
  wv = a;
  var e = "\0", r = "\0", n = "";
  function a(c) {
    this._isDirected = t.has(c, "directed") ? c.directed : !0, this._isMultigraph = t.has(c, "multigraph") ? c.multigraph : !1, this._isCompound = t.has(c, "compound") ? c.compound : !1, this._label = void 0, this._defaultNodeLabelFn = t.constant(void 0), this._defaultEdgeLabelFn = t.constant(void 0), this._nodes = {}, this._isCompound && (this._parent = {}, this._children = {}, this._children[r] = {}), this._in = {}, this._preds = {}, this._out = {}, this._sucs = {}, this._edgeObjs = {}, this._edgeLabels = {};
  }
  a.prototype._nodeCount = 0, a.prototype._edgeCount = 0, a.prototype.isDirected = function() {
    return this._isDirected;
  }, a.prototype.isMultigraph = function() {
    return this._isMultigraph;
  }, a.prototype.isCompound = function() {
    return this._isCompound;
  }, a.prototype.setGraph = function(c) {
    return this._label = c, this;
  }, a.prototype.graph = function() {
    return this._label;
  }, a.prototype.setDefaultNodeLabel = function(c) {
    return t.isFunction(c) || (c = t.constant(c)), this._defaultNodeLabelFn = c, this;
  }, a.prototype.nodeCount = function() {
    return this._nodeCount;
  }, a.prototype.nodes = function() {
    return t.keys(this._nodes);
  }, a.prototype.sources = function() {
    var c = this;
    return t.filter(this.nodes(), function(d) {
      return t.isEmpty(c._in[d]);
    });
  }, a.prototype.sinks = function() {
    var c = this;
    return t.filter(this.nodes(), function(d) {
      return t.isEmpty(c._out[d]);
    });
  }, a.prototype.setNodes = function(c, d) {
    var f = arguments, h = this;
    return t.each(c, function(v) {
      f.length > 1 ? h.setNode(v, d) : h.setNode(v);
    }), this;
  }, a.prototype.setNode = function(c, d) {
    return t.has(this._nodes, c) ? (arguments.length > 1 && (this._nodes[c] = d), this) : (this._nodes[c] = arguments.length > 1 ? d : this._defaultNodeLabelFn(c), this._isCompound && (this._parent[c] = r, this._children[c] = {}, this._children[r][c] = !0), this._in[c] = {}, this._preds[c] = {}, this._out[c] = {}, this._sucs[c] = {}, ++this._nodeCount, this);
  }, a.prototype.node = function(c) {
    return this._nodes[c];
  }, a.prototype.hasNode = function(c) {
    return t.has(this._nodes, c);
  }, a.prototype.removeNode = function(c) {
    var d = this;
    if (t.has(this._nodes, c)) {
      var f = function(h) {
        d.removeEdge(d._edgeObjs[h]);
      };
      delete this._nodes[c], this._isCompound && (this._removeFromParentsChildList(c), delete this._parent[c], t.each(this.children(c), function(h) {
        d.setParent(h);
      }), delete this._children[c]), t.each(t.keys(this._in[c]), f), delete this._in[c], delete this._preds[c], t.each(t.keys(this._out[c]), f), delete this._out[c], delete this._sucs[c], --this._nodeCount;
    }
    return this;
  }, a.prototype.setParent = function(c, d) {
    if (!this._isCompound)
      throw new Error("Cannot set parent in a non-compound graph");
    if (t.isUndefined(d))
      d = r;
    else {
      d += "";
      for (var f = d; !t.isUndefined(f); f = this.parent(f))
        if (f === c)
          throw new Error("Setting " + d + " as parent of " + c + " would create a cycle");
      this.setNode(d);
    }
    return this.setNode(c), this._removeFromParentsChildList(c), this._parent[c] = d, this._children[d][c] = !0, this;
  }, a.prototype._removeFromParentsChildList = function(c) {
    delete this._children[this._parent[c]][c];
  }, a.prototype.parent = function(c) {
    if (this._isCompound) {
      var d = this._parent[c];
      if (d !== r)
        return d;
    }
  }, a.prototype.children = function(c) {
    if (t.isUndefined(c) && (c = r), this._isCompound) {
      var d = this._children[c];
      if (d)
        return t.keys(d);
    } else {
      if (c === r)
        return this.nodes();
      if (this.hasNode(c))
        return [];
    }
  }, a.prototype.predecessors = function(c) {
    var d = this._preds[c];
    if (d)
      return t.keys(d);
  }, a.prototype.successors = function(c) {
    var d = this._sucs[c];
    if (d)
      return t.keys(d);
  }, a.prototype.neighbors = function(c) {
    var d = this.predecessors(c);
    if (d)
      return t.union(d, this.successors(c));
  }, a.prototype.isLeaf = function(c) {
    var d;
    return this.isDirected() ? d = this.successors(c) : d = this.neighbors(c), d.length === 0;
  }, a.prototype.filterNodes = function(c) {
    var d = new this.constructor({
      directed: this._isDirected,
      multigraph: this._isMultigraph,
      compound: this._isCompound
    });
    d.setGraph(this.graph());
    var f = this;
    t.each(this._nodes, function(p, g) {
      c(g) && d.setNode(g, p);
    }), t.each(this._edgeObjs, function(p) {
      d.hasNode(p.v) && d.hasNode(p.w) && d.setEdge(p, f.edge(p));
    });
    var h = {};
    function v(p) {
      var g = f.parent(p);
      return g === void 0 || d.hasNode(g) ? (h[p] = g, g) : g in h ? h[g] : v(g);
    }
    return this._isCompound && t.each(d.nodes(), function(p) {
      d.setParent(p, v(p));
    }), d;
  }, a.prototype.setDefaultEdgeLabel = function(c) {
    return t.isFunction(c) || (c = t.constant(c)), this._defaultEdgeLabelFn = c, this;
  }, a.prototype.edgeCount = function() {
    return this._edgeCount;
  }, a.prototype.edges = function() {
    return t.values(this._edgeObjs);
  }, a.prototype.setPath = function(c, d) {
    var f = this, h = arguments;
    return t.reduce(c, function(v, p) {
      return h.length > 1 ? f.setEdge(v, p, d) : f.setEdge(v, p), p;
    }), this;
  }, a.prototype.setEdge = function() {
    var c, d, f, h, v = !1, p = arguments[0];
    typeof p == "object" && p !== null && "v" in p ? (c = p.v, d = p.w, f = p.name, arguments.length === 2 && (h = arguments[1], v = !0)) : (c = p, d = arguments[1], f = arguments[3], arguments.length > 2 && (h = arguments[2], v = !0)), c = "" + c, d = "" + d, t.isUndefined(f) || (f = "" + f);
    var g = s(this._isDirected, c, d, f);
    if (t.has(this._edgeLabels, g))
      return v && (this._edgeLabels[g] = h), this;
    if (!t.isUndefined(f) && !this._isMultigraph)
      throw new Error("Cannot set a named edge when isMultigraph = false");
    this.setNode(c), this.setNode(d), this._edgeLabels[g] = v ? h : this._defaultEdgeLabelFn(c, d, f);
    var y = u(this._isDirected, c, d, f);
    return c = y.v, d = y.w, Object.freeze(y), this._edgeObjs[g] = y, i(this._preds[d], c), i(this._sucs[c], d), this._in[d][g] = y, this._out[c][g] = y, this._edgeCount++, this;
  }, a.prototype.edge = function(c, d, f) {
    var h = arguments.length === 1 ? l(this._isDirected, arguments[0]) : s(this._isDirected, c, d, f);
    return this._edgeLabels[h];
  }, a.prototype.hasEdge = function(c, d, f) {
    var h = arguments.length === 1 ? l(this._isDirected, arguments[0]) : s(this._isDirected, c, d, f);
    return t.has(this._edgeLabels, h);
  }, a.prototype.removeEdge = function(c, d, f) {
    var h = arguments.length === 1 ? l(this._isDirected, arguments[0]) : s(this._isDirected, c, d, f), v = this._edgeObjs[h];
    return v && (c = v.v, d = v.w, delete this._edgeLabels[h], delete this._edgeObjs[h], o(this._preds[d], c), o(this._sucs[c], d), delete this._in[d][h], delete this._out[c][h], this._edgeCount--), this;
  }, a.prototype.inEdges = function(c, d) {
    var f = this._in[c];
    if (f) {
      var h = t.values(f);
      return d ? t.filter(h, function(v) {
        return v.v === d;
      }) : h;
    }
  }, a.prototype.outEdges = function(c, d) {
    var f = this._out[c];
    if (f) {
      var h = t.values(f);
      return d ? t.filter(h, function(v) {
        return v.w === d;
      }) : h;
    }
  }, a.prototype.nodeEdges = function(c, d) {
    var f = this.inEdges(c, d);
    if (f)
      return f.concat(this.outEdges(c, d));
  };
  function i(c, d) {
    c[d] ? c[d]++ : c[d] = 1;
  }
  function o(c, d) {
    --c[d] || delete c[d];
  }
  function s(c, d, f, h) {
    var v = "" + d, p = "" + f;
    if (!c && v > p) {
      var g = v;
      v = p, p = g;
    }
    return v + n + p + n + (t.isUndefined(h) ? e : h);
  }
  function u(c, d, f, h) {
    var v = "" + d, p = "" + f;
    if (!c && v > p) {
      var g = v;
      v = p, p = g;
    }
    var y = { v, w: p };
    return h && (y.name = h), y;
  }
  function l(c, d) {
    return s(c, d.v, d.w, d.name);
  }
  return wv;
}
var Cv, RC;
function S9() {
  return RC || (RC = 1, Cv = "2.1.8"), Cv;
}
var xv, LC;
function k9() {
  return LC || (LC = 1, xv = {
    Graph: dy(),
    version: S9()
  }), xv;
}
var Ev, FC;
function _9() {
  if (FC) return Ev;
  FC = 1;
  var t = Mr(), e = dy();
  Ev = {
    write: r,
    read: i
  };
  function r(o) {
    var s = {
      options: {
        directed: o.isDirected(),
        multigraph: o.isMultigraph(),
        compound: o.isCompound()
      },
      nodes: n(o),
      edges: a(o)
    };
    return t.isUndefined(o.graph()) || (s.value = t.clone(o.graph())), s;
  }
  function n(o) {
    return t.map(o.nodes(), function(s) {
      var u = o.node(s), l = o.parent(s), c = { v: s };
      return t.isUndefined(u) || (c.value = u), t.isUndefined(l) || (c.parent = l), c;
    });
  }
  function a(o) {
    return t.map(o.edges(), function(s) {
      var u = o.edge(s), l = { v: s.v, w: s.w };
      return t.isUndefined(s.name) || (l.name = s.name), t.isUndefined(u) || (l.value = u), l;
    });
  }
  function i(o) {
    var s = new e(o.options).setGraph(o.value);
    return t.each(o.nodes, function(u) {
      s.setNode(u.v, u.value), u.parent && s.setParent(u.v, u.parent);
    }), t.each(o.edges, function(u) {
      s.setEdge({ v: u.v, w: u.w, name: u.name }, u.value);
    }), s;
  }
  return Ev;
}
var Sv, MC;
function T9() {
  if (MC) return Sv;
  MC = 1;
  var t = Mr();
  Sv = e;
  function e(r) {
    var n = {}, a = [], i;
    function o(s) {
      t.has(n, s) || (n[s] = !0, i.push(s), t.each(r.successors(s), o), t.each(r.predecessors(s), o));
    }
    return t.each(r.nodes(), function(s) {
      i = [], o(s), i.length && a.push(i);
    }), a;
  }
  return Sv;
}
var kv, NC;
function E_() {
  if (NC) return kv;
  NC = 1;
  var t = Mr();
  kv = e;
  function e() {
    this._arr = [], this._keyIndices = {};
  }
  return e.prototype.size = function() {
    return this._arr.length;
  }, e.prototype.keys = function() {
    return this._arr.map(function(r) {
      return r.key;
    });
  }, e.prototype.has = function(r) {
    return t.has(this._keyIndices, r);
  }, e.prototype.priority = function(r) {
    var n = this._keyIndices[r];
    if (n !== void 0)
      return this._arr[n].priority;
  }, e.prototype.min = function() {
    if (this.size() === 0)
      throw new Error("Queue underflow");
    return this._arr[0].key;
  }, e.prototype.add = function(r, n) {
    var a = this._keyIndices;
    if (r = String(r), !t.has(a, r)) {
      var i = this._arr, o = i.length;
      return a[r] = o, i.push({ key: r, priority: n }), this._decrease(o), !0;
    }
    return !1;
  }, e.prototype.removeMin = function() {
    this._swap(0, this._arr.length - 1);
    var r = this._arr.pop();
    return delete this._keyIndices[r.key], this._heapify(0), r.key;
  }, e.prototype.decrease = function(r, n) {
    var a = this._keyIndices[r];
    if (n > this._arr[a].priority)
      throw new Error("New priority is greater than current priority. Key: " + r + " Old: " + this._arr[a].priority + " New: " + n);
    this._arr[a].priority = n, this._decrease(a);
  }, e.prototype._heapify = function(r) {
    var n = this._arr, a = 2 * r, i = a + 1, o = r;
    a < n.length && (o = n[a].priority < n[o].priority ? a : o, i < n.length && (o = n[i].priority < n[o].priority ? i : o), o !== r && (this._swap(r, o), this._heapify(o)));
  }, e.prototype._decrease = function(r) {
    for (var n = this._arr, a = n[r].priority, i; r !== 0 && (i = r >> 1, !(n[i].priority < a)); )
      this._swap(r, i), r = i;
  }, e.prototype._swap = function(r, n) {
    var a = this._arr, i = this._keyIndices, o = a[r], s = a[n];
    a[r] = s, a[n] = o, i[s.key] = r, i[o.key] = n;
  }, kv;
}
var _v, BC;
function S_() {
  if (BC) return _v;
  BC = 1;
  var t = Mr(), e = E_();
  _v = n;
  var r = t.constant(1);
  function n(i, o, s, u) {
    return a(
      i,
      String(o),
      s || r,
      u || function(l) {
        return i.outEdges(l);
      }
    );
  }
  function a(i, o, s, u) {
    var l = {}, c = new e(), d, f, h = function(v) {
      var p = v.v !== d ? v.v : v.w, g = l[p], y = s(v), m = f.distance + y;
      if (y < 0)
        throw new Error("dijkstra does not allow negative edge weights. Bad edge: " + v + " Weight: " + y);
      m < g.distance && (g.distance = m, g.predecessor = d, c.decrease(p, m));
    };
    for (i.nodes().forEach(function(v) {
      var p = v === o ? 0 : Number.POSITIVE_INFINITY;
      l[v] = { distance: p }, c.add(v, p);
    }); c.size() > 0 && (d = c.removeMin(), f = l[d], f.distance !== Number.POSITIVE_INFINITY); )
      u(d).forEach(h);
    return l;
  }
  return _v;
}
var Tv, $C;
function I9() {
  if ($C) return Tv;
  $C = 1;
  var t = S_(), e = Mr();
  Tv = r;
  function r(n, a, i) {
    return e.transform(n.nodes(), function(o, s) {
      o[s] = t(n, s, a, i);
    }, {});
  }
  return Tv;
}
var Iv, qC;
function k_() {
  if (qC) return Iv;
  qC = 1;
  var t = Mr();
  Iv = e;
  function e(r) {
    var n = 0, a = [], i = {}, o = [];
    function s(u) {
      var l = i[u] = {
        onStack: !0,
        lowlink: n,
        index: n++
      };
      if (a.push(u), r.successors(u).forEach(function(f) {
        t.has(i, f) ? i[f].onStack && (l.lowlink = Math.min(l.lowlink, i[f].index)) : (s(f), l.lowlink = Math.min(l.lowlink, i[f].lowlink));
      }), l.lowlink === l.index) {
        var c = [], d;
        do
          d = a.pop(), i[d].onStack = !1, c.push(d);
        while (u !== d);
        o.push(c);
      }
    }
    return r.nodes().forEach(function(u) {
      t.has(i, u) || s(u);
    }), o;
  }
  return Iv;
}
var Ov, zC;
function O9() {
  if (zC) return Ov;
  zC = 1;
  var t = Mr(), e = k_();
  Ov = r;
  function r(n) {
    return t.filter(e(n), function(a) {
      return a.length > 1 || a.length === 1 && n.hasEdge(a[0], a[0]);
    });
  }
  return Ov;
}
var Av, VC;
function A9() {
  if (VC) return Av;
  VC = 1;
  var t = Mr();
  Av = r;
  var e = t.constant(1);
  function r(a, i, o) {
    return n(
      a,
      i || e,
      o || function(s) {
        return a.outEdges(s);
      }
    );
  }
  function n(a, i, o) {
    var s = {}, u = a.nodes();
    return u.forEach(function(l) {
      s[l] = {}, s[l][l] = { distance: 0 }, u.forEach(function(c) {
        l !== c && (s[l][c] = { distance: Number.POSITIVE_INFINITY });
      }), o(l).forEach(function(c) {
        var d = c.v === l ? c.w : c.v, f = i(c);
        s[l][d] = { distance: f, predecessor: l };
      });
    }), u.forEach(function(l) {
      var c = s[l];
      u.forEach(function(d) {
        var f = s[d];
        u.forEach(function(h) {
          var v = f[l], p = c[h], g = f[h], y = v.distance + p.distance;
          y < g.distance && (g.distance = y, g.predecessor = p.predecessor);
        });
      });
    }), s;
  }
  return Av;
}
var Pv, HC;
function __() {
  if (HC) return Pv;
  HC = 1;
  var t = Mr();
  Pv = e, e.CycleException = r;
  function e(n) {
    var a = {}, i = {}, o = [];
    function s(u) {
      if (t.has(i, u))
        throw new r();
      t.has(a, u) || (i[u] = !0, a[u] = !0, t.each(n.predecessors(u), s), delete i[u], o.push(u));
    }
    if (t.each(n.sinks(), s), t.size(a) !== n.nodeCount())
      throw new r();
    return o;
  }
  function r() {
  }
  return r.prototype = new Error(), Pv;
}
var Dv, KC;
function P9() {
  if (KC) return Dv;
  KC = 1;
  var t = __();
  Dv = e;
  function e(r) {
    try {
      t(r);
    } catch (n) {
      if (n instanceof t.CycleException)
        return !1;
      throw n;
    }
    return !0;
  }
  return Dv;
}
var Rv, GC;
function T_() {
  if (GC) return Rv;
  GC = 1;
  var t = Mr();
  Rv = e;
  function e(n, a, i) {
    t.isArray(a) || (a = [a]);
    var o = (n.isDirected() ? n.successors : n.neighbors).bind(n), s = [], u = {};
    return t.each(a, function(l) {
      if (!n.hasNode(l))
        throw new Error("Graph does not have node: " + l);
      r(n, l, i === "post", u, o, s);
    }), s;
  }
  function r(n, a, i, o, s, u) {
    t.has(o, a) || (o[a] = !0, i || u.push(a), t.each(s(a), function(l) {
      r(n, l, i, o, s, u);
    }), i && u.push(a));
  }
  return Rv;
}
var Lv, UC;
function D9() {
  if (UC) return Lv;
  UC = 1;
  var t = T_();
  Lv = e;
  function e(r, n) {
    return t(r, n, "post");
  }
  return Lv;
}
var Fv, WC;
function R9() {
  if (WC) return Fv;
  WC = 1;
  var t = T_();
  Fv = e;
  function e(r, n) {
    return t(r, n, "pre");
  }
  return Fv;
}
var Mv, jC;
function L9() {
  if (jC) return Mv;
  jC = 1;
  var t = Mr(), e = dy(), r = E_();
  Mv = n;
  function n(a, i) {
    var o = new e(), s = {}, u = new r(), l;
    function c(f) {
      var h = f.v === l ? f.w : f.v, v = u.priority(h);
      if (v !== void 0) {
        var p = i(f);
        p < v && (s[h] = l, u.decrease(h, p));
      }
    }
    if (a.nodeCount() === 0)
      return o;
    t.each(a.nodes(), function(f) {
      u.add(f, Number.POSITIVE_INFINITY), o.setNode(f);
    }), u.decrease(a.nodes()[0], 0);
    for (var d = !1; u.size() > 0; ) {
      if (l = u.removeMin(), t.has(s, l))
        o.setEdge(l, s[l]);
      else {
        if (d)
          throw new Error("Input graph is not connected: " + a);
        d = !0;
      }
      a.nodeEdges(l).forEach(c);
    }
    return o;
  }
  return Mv;
}
var Nv, YC;
function F9() {
  return YC || (YC = 1, Nv = {
    components: T9(),
    dijkstra: S_(),
    dijkstraAll: I9(),
    findCycles: O9(),
    floydWarshall: A9(),
    isAcyclic: P9(),
    postorder: D9(),
    preorder: R9(),
    prim: L9(),
    tarjan: k_(),
    topsort: __()
  }), Nv;
}
var Bv, ZC;
function M9() {
  if (ZC) return Bv;
  ZC = 1;
  var t = k9();
  return Bv = {
    Graph: t.Graph,
    json: _9(),
    alg: F9(),
    version: t.version
  }, Bv;
}
var $v, XC;
function Yr() {
  if (XC) return $v;
  XC = 1;
  var t;
  if (typeof Yg == "function")
    try {
      t = M9();
    } catch {
    }
  return t || (t = window.graphlib), $v = t, $v;
}
var qv, JC;
function N9() {
  if (JC) return qv;
  JC = 1;
  var t = Jk(), e = 1, r = 4;
  function n(a) {
    return t(a, e | r);
  }
  return qv = n, qv;
}
var zv, QC;
function vu() {
  if (QC) return zv;
  QC = 1;
  var t = Gi(), e = Rn(), r = au(), n = Fr();
  function a(i, o, s) {
    if (!n(s))
      return !1;
    var u = typeof o;
    return (u == "number" ? e(s) && r(o, s.length) : u == "string" && o in s) ? t(s[o], i) : !1;
  }
  return zv = a, zv;
}
var Vv, ex;
function B9() {
  if (ex) return Vv;
  ex = 1;
  var t = fu(), e = Gi(), r = vu(), n = ja(), a = Object.prototype, i = a.hasOwnProperty, o = t(function(s, u) {
    s = Object(s);
    var l = -1, c = u.length, d = c > 2 ? u[2] : void 0;
    for (d && r(u[0], u[1], d) && (c = 1); ++l < c; )
      for (var f = u[l], h = n(f), v = -1, p = h.length; ++v < p; ) {
        var g = h[v], y = s[g];
        (y === void 0 || e(y, a[g]) && !i.call(s, g)) && (s[g] = f[g]);
      }
    return s;
  });
  return Vv = o, Vv;
}
var Hv, tx;
function $9() {
  if (tx) return Hv;
  tx = 1;
  var t = Ln(), e = Rn(), r = ca();
  function n(a) {
    return function(i, o, s) {
      var u = Object(i);
      if (!e(i)) {
        var l = t(o, 3);
        i = r(i), o = function(d) {
          return l(u[d], d, u);
        };
      }
      var c = a(i, o, s);
      return c > -1 ? u[l ? i[c] : c] : void 0;
    };
  }
  return Hv = n, Hv;
}
var Kv, rx;
function q9() {
  if (rx) return Kv;
  rx = 1;
  var t = /\s/;
  function e(r) {
    for (var n = r.length; n-- && t.test(r.charAt(n)); )
      ;
    return n;
  }
  return Kv = e, Kv;
}
var Gv, nx;
function z9() {
  if (nx) return Gv;
  nx = 1;
  var t = q9(), e = /^\s+/;
  function r(n) {
    return n && n.slice(0, t(n) + 1).replace(e, "");
  }
  return Gv = r, Gv;
}
var Uv, ax;
function V9() {
  if (ax) return Uv;
  ax = 1;
  var t = z9(), e = Fr(), r = Yi(), n = NaN, a = /^[-+]0x[0-9a-f]+$/i, i = /^0b[01]+$/i, o = /^0o[0-7]+$/i, s = parseInt;
  function u(l) {
    if (typeof l == "number")
      return l;
    if (r(l))
      return n;
    if (e(l)) {
      var c = typeof l.valueOf == "function" ? l.valueOf() : l;
      l = e(c) ? c + "" : c;
    }
    if (typeof l != "string")
      return l === 0 ? l : +l;
    l = t(l);
    var d = i.test(l);
    return d || o.test(l) ? s(l.slice(2), d ? 2 : 8) : a.test(l) ? n : +l;
  }
  return Uv = u, Uv;
}
var Wv, ix;
function I_() {
  if (ix) return Wv;
  ix = 1;
  var t = V9(), e = 1 / 0, r = 17976931348623157e292;
  function n(a) {
    if (!a)
      return a === 0 ? a : 0;
    if (a = t(a), a === e || a === -e) {
      var i = a < 0 ? -1 : 1;
      return i * r;
    }
    return a === a ? a : 0;
  }
  return Wv = n, Wv;
}
var jv, ox;
function H9() {
  if (ox) return jv;
  ox = 1;
  var t = I_();
  function e(r) {
    var n = t(r), a = n % 1;
    return n === n ? a ? n - a : n : 0;
  }
  return jv = e, jv;
}
var Yv, sx;
function K9() {
  if (sx) return Yv;
  sx = 1;
  var t = w_(), e = Ln(), r = H9(), n = Math.max;
  function a(i, o, s) {
    var u = i == null ? 0 : i.length;
    if (!u)
      return -1;
    var l = s == null ? 0 : r(s);
    return l < 0 && (l = n(u + l, 0)), t(i, e(o, 3), l);
  }
  return Yv = a, Yv;
}
var Zv, lx;
function G9() {
  if (lx) return Zv;
  lx = 1;
  var t = $9(), e = K9(), r = t(e);
  return Zv = r, Zv;
}
var Xv, ux;
function O_() {
  if (ux) return Xv;
  ux = 1;
  var t = cy();
  function e(r) {
    var n = r == null ? 0 : r.length;
    return n ? t(r, 1) : [];
  }
  return Xv = e, Xv;
}
var Jv, cx;
function U9() {
  if (cx) return Jv;
  cx = 1;
  var t = oy(), e = Qk(), r = ja();
  function n(a, i) {
    return a == null ? a : t(a, e(i), r);
  }
  return Jv = n, Jv;
}
var Qv, dx;
function W9() {
  if (dx) return Qv;
  dx = 1;
  function t(e) {
    var r = e == null ? 0 : e.length;
    return r ? e[r - 1] : void 0;
  }
  return Qv = t, Qv;
}
var eh, fx;
function j9() {
  if (fx) return eh;
  fx = 1;
  var t = ru(), e = sy(), r = Ln();
  function n(a, i) {
    var o = {};
    return i = r(i, 3), e(a, function(s, u, l) {
      t(o, u, i(s, u, l));
    }), o;
  }
  return eh = n, eh;
}
var th, vx;
function fy() {
  if (vx) return th;
  vx = 1;
  var t = Yi();
  function e(r, n, a) {
    for (var i = -1, o = r.length; ++i < o; ) {
      var s = r[i], u = n(s);
      if (u != null && (l === void 0 ? u === u && !t(u) : a(u, l)))
        var l = u, c = s;
    }
    return c;
  }
  return th = e, th;
}
var rh, hx;
function Y9() {
  if (hx) return rh;
  hx = 1;
  function t(e, r) {
    return e > r;
  }
  return rh = t, rh;
}
var nh, px;
function Z9() {
  if (px) return nh;
  px = 1;
  var t = fy(), e = Y9(), r = Ya();
  function n(a) {
    return a && a.length ? t(a, r, e) : void 0;
  }
  return nh = n, nh;
}
var ah, gx;
function A_() {
  if (gx) return ah;
  gx = 1;
  var t = ru(), e = Gi();
  function r(n, a, i) {
    (i !== void 0 && !e(n[a], i) || i === void 0 && !(a in n)) && t(n, a, i);
  }
  return ah = r, ah;
}
var ih, yx;
function X9() {
  if (yx) return ih;
  yx = 1;
  var t = Ua(), e = su(), r = hn(), n = "[object Object]", a = Function.prototype, i = Object.prototype, o = a.toString, s = i.hasOwnProperty, u = o.call(Object);
  function l(c) {
    if (!r(c) || t(c) != n)
      return !1;
    var d = e(c);
    if (d === null)
      return !0;
    var f = s.call(d, "constructor") && d.constructor;
    return typeof f == "function" && f instanceof f && o.call(f) == u;
  }
  return ih = l, ih;
}
var oh, mx;
function P_() {
  if (mx) return oh;
  mx = 1;
  function t(e, r) {
    if (!(r === "constructor" && typeof e[r] == "function") && r != "__proto__")
      return e[r];
  }
  return oh = t, oh;
}
var sh, bx;
function J9() {
  if (bx) return sh;
  bx = 1;
  var t = ds(), e = ja();
  function r(n) {
    return t(n, e(n));
  }
  return sh = r, sh;
}
var lh, wx;
function Q9() {
  if (wx) return lh;
  wx = 1;
  var t = A_(), e = qk(), r = Yk(), n = zk(), a = Xk(), i = fs(), o = At(), s = C_(), u = Wi(), l = cs(), c = Fr(), d = X9(), f = vs(), h = P_(), v = J9();
  function p(g, y, m, b, w, x, E) {
    var C = h(g, m), k = h(y, m), S = E.get(k);
    if (S) {
      t(g, m, S);
      return;
    }
    var _ = x ? x(C, k, m + "", g, y, E) : void 0, T = _ === void 0;
    if (T) {
      var O = o(k), D = !O && u(k), A = !O && !D && f(k);
      _ = k, O || D || A ? o(C) ? _ = C : s(C) ? _ = n(C) : D ? (T = !1, _ = e(k, !0)) : A ? (T = !1, _ = r(k, !0)) : _ = [] : d(k) || i(k) ? (_ = C, i(C) ? _ = v(C) : (!c(C) || l(C)) && (_ = a(k))) : T = !1;
    }
    T && (E.set(k, _), w(_, k, b, x, E), E.delete(k)), t(g, m, _);
  }
  return lh = p, lh;
}
var uh, Cx;
function eH() {
  if (Cx) return uh;
  Cx = 1;
  var t = tu(), e = A_(), r = oy(), n = Q9(), a = Fr(), i = ja(), o = P_();
  function s(u, l, c, d, f) {
    u !== l && r(l, function(h, v) {
      if (f || (f = new t()), a(h))
        n(u, l, v, c, s, d, f);
      else {
        var p = d ? d(o(u, v), h, v + "", u, l, f) : void 0;
        p === void 0 && (p = h), e(u, v, p);
      }
    }, i);
  }
  return uh = s, uh;
}
var ch, xx;
function tH() {
  if (xx) return ch;
  xx = 1;
  var t = fu(), e = vu();
  function r(n) {
    return t(function(a, i) {
      var o = -1, s = i.length, u = s > 1 ? i[s - 1] : void 0, l = s > 2 ? i[2] : void 0;
      for (u = n.length > 3 && typeof u == "function" ? (s--, u) : void 0, l && e(i[0], i[1], l) && (u = s < 3 ? void 0 : u, s = 1), a = Object(a); ++o < s; ) {
        var c = i[o];
        c && n(a, c, o, u);
      }
      return a;
    });
  }
  return ch = r, ch;
}
var dh, Ex;
function rH() {
  if (Ex) return dh;
  Ex = 1;
  var t = eH(), e = tH(), r = e(function(n, a, i) {
    t(n, a, i);
  });
  return dh = r, dh;
}
var fh, Sx;
function D_() {
  if (Sx) return fh;
  Sx = 1;
  function t(e, r) {
    return e < r;
  }
  return fh = t, fh;
}
var vh, kx;
function nH() {
  if (kx) return vh;
  kx = 1;
  var t = fy(), e = D_(), r = Ya();
  function n(a) {
    return a && a.length ? t(a, r, e) : void 0;
  }
  return vh = n, vh;
}
var hh, _x;
function aH() {
  if (_x) return hh;
  _x = 1;
  var t = fy(), e = Ln(), r = D_();
  function n(a, i) {
    return a && a.length ? t(a, e(i, 2), r) : void 0;
  }
  return hh = n, hh;
}
var ph, Tx;
function iH() {
  if (Tx) return ph;
  Tx = 1;
  var t = Jr(), e = function() {
    return t.Date.now();
  };
  return ph = e, ph;
}
var gh, Ix;
function oH() {
  if (Ix) return gh;
  Ix = 1;
  var t = nu(), e = cu(), r = au(), n = Fr(), a = hs();
  function i(o, s, u, l) {
    if (!n(o))
      return o;
    s = e(s, o);
    for (var c = -1, d = s.length, f = d - 1, h = o; h != null && ++c < d; ) {
      var v = a(s[c]), p = u;
      if (v === "__proto__" || v === "constructor" || v === "prototype")
        return o;
      if (c != f) {
        var g = h[v];
        p = l ? l(g, v, h) : void 0, p === void 0 && (p = n(g) ? g : r(s[c + 1]) ? [] : {});
      }
      t(h, v, p), h = h[v];
    }
    return o;
  }
  return gh = i, gh;
}
var yh, Ox;
function sH() {
  if (Ox) return yh;
  Ox = 1;
  var t = du(), e = oH(), r = cu();
  function n(a, i, o) {
    for (var s = -1, u = i.length, l = {}; ++s < u; ) {
      var c = i[s], d = t(a, c);
      o(d, c) && e(l, r(c, a), d);
    }
    return l;
  }
  return yh = n, yh;
}
var mh, Ax;
function lH() {
  if (Ax) return mh;
  Ax = 1;
  var t = sH(), e = c_();
  function r(n, a) {
    return t(n, a, function(i, o) {
      return e(n, o);
    });
  }
  return mh = r, mh;
}
var bh, Px;
function uH() {
  if (Px) return bh;
  Px = 1;
  var t = O_(), e = m_(), r = b_();
  function n(a) {
    return r(e(a, void 0, t), a + "");
  }
  return bh = n, bh;
}
var wh, Dx;
function cH() {
  if (Dx) return wh;
  Dx = 1;
  var t = lH(), e = uH(), r = e(function(n, a) {
    return n == null ? {} : t(n, a);
  });
  return wh = r, wh;
}
var Ch, Rx;
function dH() {
  if (Rx) return Ch;
  Rx = 1;
  var t = Math.ceil, e = Math.max;
  function r(n, a, i, o) {
    for (var s = -1, u = e(t((a - n) / (i || 1)), 0), l = Array(u); u--; )
      l[o ? u : ++s] = n, n += i;
    return l;
  }
  return Ch = r, Ch;
}
var xh, Lx;
function fH() {
  if (Lx) return xh;
  Lx = 1;
  var t = dH(), e = vu(), r = I_();
  function n(a) {
    return function(i, o, s) {
      return s && typeof s != "number" && e(i, o, s) && (o = s = void 0), i = r(i), o === void 0 ? (o = i, i = 0) : o = r(o), s = s === void 0 ? i < o ? 1 : -1 : r(s), t(i, o, s, a);
    };
  }
  return xh = n, xh;
}
var Eh, Fx;
function vH() {
  if (Fx) return Eh;
  Fx = 1;
  var t = fH(), e = t();
  return Eh = e, Eh;
}
var Sh, Mx;
function hH() {
  if (Mx) return Sh;
  Mx = 1;
  function t(e, r) {
    var n = e.length;
    for (e.sort(r); n--; )
      e[n] = e[n].value;
    return e;
  }
  return Sh = t, Sh;
}
var kh, Nx;
function pH() {
  if (Nx) return kh;
  Nx = 1;
  var t = Yi();
  function e(r, n) {
    if (r !== n) {
      var a = r !== void 0, i = r === null, o = r === r, s = t(r), u = n !== void 0, l = n === null, c = n === n, d = t(n);
      if (!l && !d && !s && r > n || s && u && c && !l && !d || i && u && c || !a && c || !o)
        return 1;
      if (!i && !s && !d && r < n || d && a && o && !i && !s || l && a && o || !u && o || !c)
        return -1;
    }
    return 0;
  }
  return kh = e, kh;
}
var _h, Bx;
function gH() {
  if (Bx) return _h;
  Bx = 1;
  var t = pH();
  function e(r, n, a) {
    for (var i = -1, o = r.criteria, s = n.criteria, u = o.length, l = a.length; ++i < u; ) {
      var c = t(o[i], s[i]);
      if (c) {
        if (i >= l)
          return c;
        var d = a[i];
        return c * (d == "desc" ? -1 : 1);
      }
    }
    return r.index - n.index;
  }
  return _h = e, _h;
}
var Th, $x;
function yH() {
  if ($x) return Th;
  $x = 1;
  var t = uu(), e = du(), r = Ln(), n = p_(), a = hH(), i = iu(), o = gH(), s = Ya(), u = At();
  function l(c, d, f) {
    d.length ? d = t(d, function(p) {
      return u(p) ? function(g) {
        return e(g, p.length === 1 ? p[0] : p);
      } : p;
    }) : d = [s];
    var h = -1;
    d = t(d, i(r));
    var v = n(c, function(p, g, y) {
      var m = t(d, function(b) {
        return b(p);
      });
      return { criteria: m, index: ++h, value: p };
    });
    return a(v, function(p, g) {
      return o(p, g, f);
    });
  }
  return Th = l, Th;
}
var Ih, qx;
function mH() {
  if (qx) return Ih;
  qx = 1;
  var t = cy(), e = yH(), r = fu(), n = vu(), a = r(function(i, o) {
    if (i == null)
      return [];
    var s = o.length;
    return s > 1 && n(i, o[0], o[1]) ? o = [] : s > 2 && n(o[0], o[1], o[2]) && (o = [o[0]]), e(i, t(o, 1), []);
  });
  return Ih = a, Ih;
}
var Oh, zx;
function bH() {
  if (zx) return Oh;
  zx = 1;
  var t = l_(), e = 0;
  function r(n) {
    var a = ++e;
    return t(n) + a;
  }
  return Oh = r, Oh;
}
var Ah, Vx;
function wH() {
  if (Vx) return Ah;
  Vx = 1;
  function t(e, r, n) {
    for (var a = -1, i = e.length, o = r.length, s = {}; ++a < i; ) {
      var u = a < o ? r[a] : void 0;
      n(s, e[a], u);
    }
    return s;
  }
  return Ah = t, Ah;
}
var Ph, Hx;
function CH() {
  if (Hx) return Ph;
  Hx = 1;
  var t = nu(), e = wH();
  function r(n, a) {
    return e(n || [], a || [], t);
  }
  return Ph = r, Ph;
}
var Dh, Kx;
function gt() {
  if (Kx) return Dh;
  Kx = 1;
  var t;
  if (typeof Yg == "function")
    try {
      t = {
        cloneDeep: N9(),
        constant: iy(),
        defaults: B9(),
        each: t_(),
        filter: f_(),
        find: G9(),
        flatten: O_(),
        forEach: e_(),
        forIn: U9(),
        has: v_(),
        isUndefined: h_(),
        last: W9(),
        map: g_(),
        mapValues: j9(),
        max: Z9(),
        merge: rH(),
        min: nH(),
        minBy: aH(),
        now: iH(),
        pick: cH(),
        range: vH(),
        reduce: y_(),
        sortBy: mH(),
        uniqueId: bH(),
        values: x_(),
        zipObject: CH()
      };
    } catch {
    }
  return t || (t = window._), Dh = t, Dh;
}
var Rh, Gx;
function xH() {
  if (Gx) return Rh;
  Gx = 1, Rh = t;
  function t() {
    var n = {};
    n._next = n._prev = n, this._sentinel = n;
  }
  t.prototype.dequeue = function() {
    var n = this._sentinel, a = n._prev;
    if (a !== n)
      return e(a), a;
  }, t.prototype.enqueue = function(n) {
    var a = this._sentinel;
    n._prev && n._next && e(n), n._next = a._next, a._next._prev = n, a._next = n, n._prev = a;
  }, t.prototype.toString = function() {
    for (var n = [], a = this._sentinel, i = a._prev; i !== a; )
      n.push(JSON.stringify(i, r)), i = i._prev;
    return "[" + n.join(", ") + "]";
  };
  function e(n) {
    n._prev._next = n._next, n._next._prev = n._prev, delete n._next, delete n._prev;
  }
  function r(n, a) {
    if (n !== "_next" && n !== "_prev")
      return a;
  }
  return Rh;
}
var Lh, Ux;
function EH() {
  if (Ux) return Lh;
  Ux = 1;
  var t = gt(), e = Yr().Graph, r = xH();
  Lh = a;
  var n = t.constant(1);
  function a(l, c) {
    if (l.nodeCount() <= 1)
      return [];
    var d = s(l, c || n), f = i(d.graph, d.buckets, d.zeroIdx);
    return t.flatten(t.map(f, function(h) {
      return l.outEdges(h.v, h.w);
    }), !0);
  }
  function i(l, c, d) {
    for (var f = [], h = c[c.length - 1], v = c[0], p; l.nodeCount(); ) {
      for (; p = v.dequeue(); )
        o(l, c, d, p);
      for (; p = h.dequeue(); )
        o(l, c, d, p);
      if (l.nodeCount()) {
        for (var g = c.length - 2; g > 0; --g)
          if (p = c[g].dequeue(), p) {
            f = f.concat(o(l, c, d, p, !0));
            break;
          }
      }
    }
    return f;
  }
  function o(l, c, d, f, h) {
    var v = h ? [] : void 0;
    return t.forEach(l.inEdges(f.v), function(p) {
      var g = l.edge(p), y = l.node(p.v);
      h && v.push({ v: p.v, w: p.w }), y.out -= g, u(c, d, y);
    }), t.forEach(l.outEdges(f.v), function(p) {
      var g = l.edge(p), y = p.w, m = l.node(y);
      m.in -= g, u(c, d, m);
    }), l.removeNode(f.v), v;
  }
  function s(l, c) {
    var d = new e(), f = 0, h = 0;
    t.forEach(l.nodes(), function(g) {
      d.setNode(g, { v: g, in: 0, out: 0 });
    }), t.forEach(l.edges(), function(g) {
      var y = d.edge(g.v, g.w) || 0, m = c(g), b = y + m;
      d.setEdge(g.v, g.w, b), h = Math.max(h, d.node(g.v).out += m), f = Math.max(f, d.node(g.w).in += m);
    });
    var v = t.range(h + f + 3).map(function() {
      return new r();
    }), p = f + 1;
    return t.forEach(d.nodes(), function(g) {
      u(v, p, d.node(g));
    }), { graph: d, buckets: v, zeroIdx: p };
  }
  function u(l, c, d) {
    d.out ? d.in ? l[d.out - d.in + c].enqueue(d) : l[l.length - 1].enqueue(d) : l[0].enqueue(d);
  }
  return Lh;
}
var Fh, Wx;
function SH() {
  if (Wx) return Fh;
  Wx = 1;
  var t = gt(), e = EH();
  Fh = {
    run: r,
    undo: a
  };
  function r(i) {
    var o = i.graph().acyclicer === "greedy" ? e(i, s(i)) : n(i);
    t.forEach(o, function(u) {
      var l = i.edge(u);
      i.removeEdge(u), l.forwardName = u.name, l.reversed = !0, i.setEdge(u.w, u.v, l, t.uniqueId("rev"));
    });
    function s(u) {
      return function(l) {
        return u.edge(l).weight;
      };
    }
  }
  function n(i) {
    var o = [], s = {}, u = {};
    function l(c) {
      t.has(u, c) || (u[c] = !0, s[c] = !0, t.forEach(i.outEdges(c), function(d) {
        t.has(s, d.w) ? o.push(d) : l(d.w);
      }), delete s[c]);
    }
    return t.forEach(i.nodes(), l), o;
  }
  function a(i) {
    t.forEach(i.edges(), function(o) {
      var s = i.edge(o);
      if (s.reversed) {
        i.removeEdge(o);
        var u = s.forwardName;
        delete s.reversed, delete s.forwardName, i.setEdge(o.w, o.v, s, u);
      }
    });
  }
  return Fh;
}
var Mh, jx;
function yr() {
  if (jx) return Mh;
  jx = 1;
  var t = gt(), e = Yr().Graph;
  Mh = {
    addDummyNode: r,
    simplify: n,
    asNonCompoundGraph: a,
    successorWeights: i,
    predecessorWeights: o,
    intersectRect: s,
    buildLayerMatrix: u,
    normalizeRanks: l,
    removeEmptyRanks: c,
    addBorderNode: d,
    maxRank: f,
    partition: h,
    time: v,
    notime: p
  };
  function r(g, y, m, b) {
    var w;
    do
      w = t.uniqueId(b);
    while (g.hasNode(w));
    return m.dummy = y, g.setNode(w, m), w;
  }
  function n(g) {
    var y = new e().setGraph(g.graph());
    return t.forEach(g.nodes(), function(m) {
      y.setNode(m, g.node(m));
    }), t.forEach(g.edges(), function(m) {
      var b = y.edge(m.v, m.w) || { weight: 0, minlen: 1 }, w = g.edge(m);
      y.setEdge(m.v, m.w, {
        weight: b.weight + w.weight,
        minlen: Math.max(b.minlen, w.minlen)
      });
    }), y;
  }
  function a(g) {
    var y = new e({ multigraph: g.isMultigraph() }).setGraph(g.graph());
    return t.forEach(g.nodes(), function(m) {
      g.children(m).length || y.setNode(m, g.node(m));
    }), t.forEach(g.edges(), function(m) {
      y.setEdge(m, g.edge(m));
    }), y;
  }
  function i(g) {
    var y = t.map(g.nodes(), function(m) {
      var b = {};
      return t.forEach(g.outEdges(m), function(w) {
        b[w.w] = (b[w.w] || 0) + g.edge(w).weight;
      }), b;
    });
    return t.zipObject(g.nodes(), y);
  }
  function o(g) {
    var y = t.map(g.nodes(), function(m) {
      var b = {};
      return t.forEach(g.inEdges(m), function(w) {
        b[w.v] = (b[w.v] || 0) + g.edge(w).weight;
      }), b;
    });
    return t.zipObject(g.nodes(), y);
  }
  function s(g, y) {
    var m = g.x, b = g.y, w = y.x - m, x = y.y - b, E = g.width / 2, C = g.height / 2;
    if (!w && !x)
      throw new Error("Not possible to find intersection inside of the rectangle");
    var k, S;
    return Math.abs(x) * E > Math.abs(w) * C ? (x < 0 && (C = -C), k = C * w / x, S = C) : (w < 0 && (E = -E), k = E, S = E * x / w), { x: m + k, y: b + S };
  }
  function u(g) {
    var y = t.map(t.range(f(g) + 1), function() {
      return [];
    });
    return t.forEach(g.nodes(), function(m) {
      var b = g.node(m), w = b.rank;
      t.isUndefined(w) || (y[w][b.order] = m);
    }), y;
  }
  function l(g) {
    var y = t.min(t.map(g.nodes(), function(m) {
      return g.node(m).rank;
    }));
    t.forEach(g.nodes(), function(m) {
      var b = g.node(m);
      t.has(b, "rank") && (b.rank -= y);
    });
  }
  function c(g) {
    var y = t.min(t.map(g.nodes(), function(x) {
      return g.node(x).rank;
    })), m = [];
    t.forEach(g.nodes(), function(x) {
      var E = g.node(x).rank - y;
      m[E] || (m[E] = []), m[E].push(x);
    });
    var b = 0, w = g.graph().nodeRankFactor;
    t.forEach(m, function(x, E) {
      t.isUndefined(x) && E % w !== 0 ? --b : b && t.forEach(x, function(C) {
        g.node(C).rank += b;
      });
    });
  }
  function d(g, y, m, b) {
    var w = {
      width: 0,
      height: 0
    };
    return arguments.length >= 4 && (w.rank = m, w.order = b), r(g, "border", w, y);
  }
  function f(g) {
    return t.max(t.map(g.nodes(), function(y) {
      var m = g.node(y).rank;
      if (!t.isUndefined(m))
        return m;
    }));
  }
  function h(g, y) {
    var m = { lhs: [], rhs: [] };
    return t.forEach(g, function(b) {
      y(b) ? m.lhs.push(b) : m.rhs.push(b);
    }), m;
  }
  function v(g, y) {
    var m = t.now();
    try {
      return y();
    } finally {
      console.log(g + " time: " + (t.now() - m) + "ms");
    }
  }
  function p(g, y) {
    return y();
  }
  return Mh;
}
var Nh, Yx;
function kH() {
  if (Yx) return Nh;
  Yx = 1;
  var t = gt(), e = yr();
  Nh = {
    run: r,
    undo: a
  };
  function r(i) {
    i.graph().dummyChains = [], t.forEach(i.edges(), function(o) {
      n(i, o);
    });
  }
  function n(i, o) {
    var s = o.v, u = i.node(s).rank, l = o.w, c = i.node(l).rank, d = o.name, f = i.edge(o), h = f.labelRank;
    if (c !== u + 1) {
      i.removeEdge(o);
      var v, p, g;
      for (g = 0, ++u; u < c; ++g, ++u)
        f.points = [], p = {
          width: 0,
          height: 0,
          edgeLabel: f,
          edgeObj: o,
          rank: u
        }, v = e.addDummyNode(i, "edge", p, "_d"), u === h && (p.width = f.width, p.height = f.height, p.dummy = "edge-label", p.labelpos = f.labelpos), i.setEdge(s, v, { weight: f.weight }, d), g === 0 && i.graph().dummyChains.push(v), s = v;
      i.setEdge(s, l, { weight: f.weight }, d);
    }
  }
  function a(i) {
    t.forEach(i.graph().dummyChains, function(o) {
      var s = i.node(o), u = s.edgeLabel, l;
      for (i.setEdge(s.edgeObj, u); s.dummy; )
        l = i.successors(o)[0], i.removeNode(o), u.points.push({ x: s.x, y: s.y }), s.dummy === "edge-label" && (u.x = s.x, u.y = s.y, u.width = s.width, u.height = s.height), o = l, s = i.node(o);
    });
  }
  return Nh;
}
var Bh, Zx;
function ml() {
  if (Zx) return Bh;
  Zx = 1;
  var t = gt();
  Bh = {
    longestPath: e,
    slack: r
  };
  function e(n) {
    var a = {};
    function i(o) {
      var s = n.node(o);
      if (t.has(a, o))
        return s.rank;
      a[o] = !0;
      var u = t.min(t.map(n.outEdges(o), function(l) {
        return i(l.w) - n.edge(l).minlen;
      }));
      return (u === Number.POSITIVE_INFINITY || // return value of _.map([]) for Lodash 3
      u === void 0 || // return value of _.map([]) for Lodash 4
      u === null) && (u = 0), s.rank = u;
    }
    t.forEach(n.sources(), i);
  }
  function r(n, a) {
    return n.node(a.w).rank - n.node(a.v).rank - n.edge(a).minlen;
  }
  return Bh;
}
var $h, Xx;
function R_() {
  if (Xx) return $h;
  Xx = 1;
  var t = gt(), e = Yr().Graph, r = ml().slack;
  $h = n;
  function n(s) {
    var u = new e({ directed: !1 }), l = s.nodes()[0], c = s.nodeCount();
    u.setNode(l, {});
    for (var d, f; a(u, s) < c; )
      d = i(u, s), f = u.hasNode(d.v) ? r(s, d) : -r(s, d), o(u, s, f);
    return u;
  }
  function a(s, u) {
    function l(c) {
      t.forEach(u.nodeEdges(c), function(d) {
        var f = d.v, h = c === f ? d.w : f;
        !s.hasNode(h) && !r(u, d) && (s.setNode(h, {}), s.setEdge(c, h, {}), l(h));
      });
    }
    return t.forEach(s.nodes(), l), s.nodeCount();
  }
  function i(s, u) {
    return t.minBy(u.edges(), function(l) {
      if (s.hasNode(l.v) !== s.hasNode(l.w))
        return r(u, l);
    });
  }
  function o(s, u, l) {
    t.forEach(s.nodes(), function(c) {
      u.node(c).rank += l;
    });
  }
  return $h;
}
var qh, Jx;
function _H() {
  if (Jx) return qh;
  Jx = 1;
  var t = gt(), e = R_(), r = ml().slack, n = ml().longestPath, a = Yr().alg.preorder, i = Yr().alg.postorder, o = yr().simplify;
  qh = s, s.initLowLimValues = d, s.initCutValues = u, s.calcCutValue = c, s.leaveEdge = h, s.enterEdge = v, s.exchangeEdges = p;
  function s(b) {
    b = o(b), n(b);
    var w = e(b);
    d(w), u(w, b);
    for (var x, E; x = h(w); )
      E = v(w, b, x), p(w, b, x, E);
  }
  function u(b, w) {
    var x = i(b, b.nodes());
    x = x.slice(0, x.length - 1), t.forEach(x, function(E) {
      l(b, w, E);
    });
  }
  function l(b, w, x) {
    var E = b.node(x), C = E.parent;
    b.edge(x, C).cutvalue = c(b, w, x);
  }
  function c(b, w, x) {
    var E = b.node(x), C = E.parent, k = !0, S = w.edge(x, C), _ = 0;
    return S || (k = !1, S = w.edge(C, x)), _ = S.weight, t.forEach(w.nodeEdges(x), function(T) {
      var O = T.v === x, D = O ? T.w : T.v;
      if (D !== C) {
        var A = O === k, F = w.edge(T).weight;
        if (_ += A ? F : -F, y(b, x, D)) {
          var R = b.edge(x, D).cutvalue;
          _ += A ? -R : R;
        }
      }
    }), _;
  }
  function d(b, w) {
    arguments.length < 2 && (w = b.nodes()[0]), f(b, {}, 1, w);
  }
  function f(b, w, x, E, C) {
    var k = x, S = b.node(E);
    return w[E] = !0, t.forEach(b.neighbors(E), function(_) {
      t.has(w, _) || (x = f(b, w, x, _, E));
    }), S.low = k, S.lim = x++, C ? S.parent = C : delete S.parent, x;
  }
  function h(b) {
    return t.find(b.edges(), function(w) {
      return b.edge(w).cutvalue < 0;
    });
  }
  function v(b, w, x) {
    var E = x.v, C = x.w;
    w.hasEdge(E, C) || (E = x.w, C = x.v);
    var k = b.node(E), S = b.node(C), _ = k, T = !1;
    k.lim > S.lim && (_ = S, T = !0);
    var O = t.filter(w.edges(), function(D) {
      return T === m(b, b.node(D.v), _) && T !== m(b, b.node(D.w), _);
    });
    return t.minBy(O, function(D) {
      return r(w, D);
    });
  }
  function p(b, w, x, E) {
    var C = x.v, k = x.w;
    b.removeEdge(C, k), b.setEdge(E.v, E.w, {}), d(b), u(b, w), g(b, w);
  }
  function g(b, w) {
    var x = t.find(b.nodes(), function(C) {
      return !w.node(C).parent;
    }), E = a(b, x);
    E = E.slice(1), t.forEach(E, function(C) {
      var k = b.node(C).parent, S = w.edge(C, k), _ = !1;
      S || (S = w.edge(k, C), _ = !0), w.node(C).rank = w.node(k).rank + (_ ? S.minlen : -S.minlen);
    });
  }
  function y(b, w, x) {
    return b.hasEdge(w, x);
  }
  function m(b, w, x) {
    return x.low <= w.lim && w.lim <= x.lim;
  }
  return qh;
}
var zh, Qx;
function TH() {
  if (Qx) return zh;
  Qx = 1;
  var t = ml(), e = t.longestPath, r = R_(), n = _H();
  zh = a;
  function a(u) {
    switch (u.graph().ranker) {
      case "network-simplex":
        s(u);
        break;
      case "tight-tree":
        o(u);
        break;
      case "longest-path":
        i(u);
        break;
      default:
        s(u);
    }
  }
  var i = e;
  function o(u) {
    e(u), r(u);
  }
  function s(u) {
    n(u);
  }
  return zh;
}
var Vh, eE;
function IH() {
  if (eE) return Vh;
  eE = 1;
  var t = gt();
  Vh = e;
  function e(a) {
    var i = n(a);
    t.forEach(a.graph().dummyChains, function(o) {
      for (var s = a.node(o), u = s.edgeObj, l = r(a, i, u.v, u.w), c = l.path, d = l.lca, f = 0, h = c[f], v = !0; o !== u.w; ) {
        if (s = a.node(o), v) {
          for (; (h = c[f]) !== d && a.node(h).maxRank < s.rank; )
            f++;
          h === d && (v = !1);
        }
        if (!v) {
          for (; f < c.length - 1 && a.node(h = c[f + 1]).minRank <= s.rank; )
            f++;
          h = c[f];
        }
        a.setParent(o, h), o = a.successors(o)[0];
      }
    });
  }
  function r(a, i, o, s) {
    var u = [], l = [], c = Math.min(i[o].low, i[s].low), d = Math.max(i[o].lim, i[s].lim), f, h;
    f = o;
    do
      f = a.parent(f), u.push(f);
    while (f && (i[f].low > c || d > i[f].lim));
    for (h = f, f = s; (f = a.parent(f)) !== h; )
      l.push(f);
    return { path: u.concat(l.reverse()), lca: h };
  }
  function n(a) {
    var i = {}, o = 0;
    function s(u) {
      var l = o;
      t.forEach(a.children(u), s), i[u] = { low: l, lim: o++ };
    }
    return t.forEach(a.children(), s), i;
  }
  return Vh;
}
var Hh, tE;
function OH() {
  if (tE) return Hh;
  tE = 1;
  var t = gt(), e = yr();
  Hh = {
    run: r,
    cleanup: o
  };
  function r(s) {
    var u = e.addDummyNode(s, "root", {}, "_root"), l = a(s), c = t.max(t.values(l)) - 1, d = 2 * c + 1;
    s.graph().nestingRoot = u, t.forEach(s.edges(), function(h) {
      s.edge(h).minlen *= d;
    });
    var f = i(s) + 1;
    t.forEach(s.children(), function(h) {
      n(s, u, d, f, c, l, h);
    }), s.graph().nodeRankFactor = d;
  }
  function n(s, u, l, c, d, f, h) {
    var v = s.children(h);
    if (!v.length) {
      h !== u && s.setEdge(u, h, { weight: 0, minlen: l });
      return;
    }
    var p = e.addBorderNode(s, "_bt"), g = e.addBorderNode(s, "_bb"), y = s.node(h);
    s.setParent(p, h), y.borderTop = p, s.setParent(g, h), y.borderBottom = g, t.forEach(v, function(m) {
      n(s, u, l, c, d, f, m);
      var b = s.node(m), w = b.borderTop ? b.borderTop : m, x = b.borderBottom ? b.borderBottom : m, E = b.borderTop ? c : 2 * c, C = w !== x ? 1 : d - f[h] + 1;
      s.setEdge(p, w, {
        weight: E,
        minlen: C,
        nestingEdge: !0
      }), s.setEdge(x, g, {
        weight: E,
        minlen: C,
        nestingEdge: !0
      });
    }), s.parent(h) || s.setEdge(u, p, { weight: 0, minlen: d + f[h] });
  }
  function a(s) {
    var u = {};
    function l(c, d) {
      var f = s.children(c);
      f && f.length && t.forEach(f, function(h) {
        l(h, d + 1);
      }), u[c] = d;
    }
    return t.forEach(s.children(), function(c) {
      l(c, 1);
    }), u;
  }
  function i(s) {
    return t.reduce(s.edges(), function(u, l) {
      return u + s.edge(l).weight;
    }, 0);
  }
  function o(s) {
    var u = s.graph();
    s.removeNode(u.nestingRoot), delete u.nestingRoot, t.forEach(s.edges(), function(l) {
      var c = s.edge(l);
      c.nestingEdge && s.removeEdge(l);
    });
  }
  return Hh;
}
var Kh, rE;
function AH() {
  if (rE) return Kh;
  rE = 1;
  var t = gt(), e = yr();
  Kh = r;
  function r(a) {
    function i(o) {
      var s = a.children(o), u = a.node(o);
      if (s.length && t.forEach(s, i), t.has(u, "minRank")) {
        u.borderLeft = [], u.borderRight = [];
        for (var l = u.minRank, c = u.maxRank + 1; l < c; ++l)
          n(a, "borderLeft", "_bl", o, u, l), n(a, "borderRight", "_br", o, u, l);
      }
    }
    t.forEach(a.children(), i);
  }
  function n(a, i, o, s, u, l) {
    var c = { width: 0, height: 0, rank: l, borderType: i }, d = u[i][l - 1], f = e.addDummyNode(a, "border", c, o);
    u[i][l] = f, a.setParent(f, s), d && a.setEdge(d, f, { weight: 1 });
  }
  return Kh;
}
var Gh, nE;
function PH() {
  if (nE) return Gh;
  nE = 1;
  var t = gt();
  Gh = {
    adjust: e,
    undo: r
  };
  function e(l) {
    var c = l.graph().rankdir.toLowerCase();
    (c === "lr" || c === "rl") && n(l);
  }
  function r(l) {
    var c = l.graph().rankdir.toLowerCase();
    (c === "bt" || c === "rl") && i(l), (c === "lr" || c === "rl") && (s(l), n(l));
  }
  function n(l) {
    t.forEach(l.nodes(), function(c) {
      a(l.node(c));
    }), t.forEach(l.edges(), function(c) {
      a(l.edge(c));
    });
  }
  function a(l) {
    var c = l.width;
    l.width = l.height, l.height = c;
  }
  function i(l) {
    t.forEach(l.nodes(), function(c) {
      o(l.node(c));
    }), t.forEach(l.edges(), function(c) {
      var d = l.edge(c);
      t.forEach(d.points, o), t.has(d, "y") && o(d);
    });
  }
  function o(l) {
    l.y = -l.y;
  }
  function s(l) {
    t.forEach(l.nodes(), function(c) {
      u(l.node(c));
    }), t.forEach(l.edges(), function(c) {
      var d = l.edge(c);
      t.forEach(d.points, u), t.has(d, "x") && u(d);
    });
  }
  function u(l) {
    var c = l.x;
    l.x = l.y, l.y = c;
  }
  return Gh;
}
var Uh, aE;
function DH() {
  if (aE) return Uh;
  aE = 1;
  var t = gt();
  Uh = e;
  function e(r) {
    var n = {}, a = t.filter(r.nodes(), function(l) {
      return !r.children(l).length;
    }), i = t.max(t.map(a, function(l) {
      return r.node(l).rank;
    })), o = t.map(t.range(i + 1), function() {
      return [];
    });
    function s(l) {
      if (!t.has(n, l)) {
        n[l] = !0;
        var c = r.node(l);
        o[c.rank].push(l), t.forEach(r.successors(l), s);
      }
    }
    var u = t.sortBy(a, function(l) {
      return r.node(l).rank;
    });
    return t.forEach(u, s), o;
  }
  return Uh;
}
var Wh, iE;
function RH() {
  if (iE) return Wh;
  iE = 1;
  var t = gt();
  Wh = e;
  function e(n, a) {
    for (var i = 0, o = 1; o < a.length; ++o)
      i += r(n, a[o - 1], a[o]);
    return i;
  }
  function r(n, a, i) {
    for (var o = t.zipObject(
      i,
      t.map(i, function(f, h) {
        return h;
      })
    ), s = t.flatten(t.map(a, function(f) {
      return t.sortBy(t.map(n.outEdges(f), function(h) {
        return { pos: o[h.w], weight: n.edge(h).weight };
      }), "pos");
    }), !0), u = 1; u < i.length; ) u <<= 1;
    var l = 2 * u - 1;
    u -= 1;
    var c = t.map(new Array(l), function() {
      return 0;
    }), d = 0;
    return t.forEach(s.forEach(function(f) {
      var h = f.pos + u;
      c[h] += f.weight;
      for (var v = 0; h > 0; )
        h % 2 && (v += c[h + 1]), h = h - 1 >> 1, c[h] += f.weight;
      d += f.weight * v;
    })), d;
  }
  return Wh;
}
var jh, oE;
function LH() {
  if (oE) return jh;
  oE = 1;
  var t = gt();
  jh = e;
  function e(r, n) {
    return t.map(n, function(a) {
      var i = r.inEdges(a);
      if (i.length) {
        var o = t.reduce(i, function(s, u) {
          var l = r.edge(u), c = r.node(u.v);
          return {
            sum: s.sum + l.weight * c.order,
            weight: s.weight + l.weight
          };
        }, { sum: 0, weight: 0 });
        return {
          v: a,
          barycenter: o.sum / o.weight,
          weight: o.weight
        };
      } else
        return { v: a };
    });
  }
  return jh;
}
var Yh, sE;
function FH() {
  if (sE) return Yh;
  sE = 1;
  var t = gt();
  Yh = e;
  function e(a, i) {
    var o = {};
    t.forEach(a, function(u, l) {
      var c = o[u.v] = {
        indegree: 0,
        in: [],
        out: [],
        vs: [u.v],
        i: l
      };
      t.isUndefined(u.barycenter) || (c.barycenter = u.barycenter, c.weight = u.weight);
    }), t.forEach(i.edges(), function(u) {
      var l = o[u.v], c = o[u.w];
      !t.isUndefined(l) && !t.isUndefined(c) && (c.indegree++, l.out.push(o[u.w]));
    });
    var s = t.filter(o, function(u) {
      return !u.indegree;
    });
    return r(s);
  }
  function r(a) {
    var i = [];
    function o(l) {
      return function(c) {
        c.merged || (t.isUndefined(c.barycenter) || t.isUndefined(l.barycenter) || c.barycenter >= l.barycenter) && n(l, c);
      };
    }
    function s(l) {
      return function(c) {
        c.in.push(l), --c.indegree === 0 && a.push(c);
      };
    }
    for (; a.length; ) {
      var u = a.pop();
      i.push(u), t.forEach(u.in.reverse(), o(u)), t.forEach(u.out, s(u));
    }
    return t.map(
      t.filter(i, function(l) {
        return !l.merged;
      }),
      function(l) {
        return t.pick(l, ["vs", "i", "barycenter", "weight"]);
      }
    );
  }
  function n(a, i) {
    var o = 0, s = 0;
    a.weight && (o += a.barycenter * a.weight, s += a.weight), i.weight && (o += i.barycenter * i.weight, s += i.weight), a.vs = i.vs.concat(a.vs), a.barycenter = o / s, a.weight = s, a.i = Math.min(i.i, a.i), i.merged = !0;
  }
  return Yh;
}
var Zh, lE;
function MH() {
  if (lE) return Zh;
  lE = 1;
  var t = gt(), e = yr();
  Zh = r;
  function r(i, o) {
    var s = e.partition(i, function(p) {
      return t.has(p, "barycenter");
    }), u = s.lhs, l = t.sortBy(s.rhs, function(p) {
      return -p.i;
    }), c = [], d = 0, f = 0, h = 0;
    u.sort(a(!!o)), h = n(c, l, h), t.forEach(u, function(p) {
      h += p.vs.length, c.push(p.vs), d += p.barycenter * p.weight, f += p.weight, h = n(c, l, h);
    });
    var v = { vs: t.flatten(c, !0) };
    return f && (v.barycenter = d / f, v.weight = f), v;
  }
  function n(i, o, s) {
    for (var u; o.length && (u = t.last(o)).i <= s; )
      o.pop(), i.push(u.vs), s++;
    return s;
  }
  function a(i) {
    return function(o, s) {
      return o.barycenter < s.barycenter ? -1 : o.barycenter > s.barycenter ? 1 : i ? s.i - o.i : o.i - s.i;
    };
  }
  return Zh;
}
var Xh, uE;
function NH() {
  if (uE) return Xh;
  uE = 1;
  var t = gt(), e = LH(), r = FH(), n = MH();
  Xh = a;
  function a(s, u, l, c) {
    var d = s.children(u), f = s.node(u), h = f ? f.borderLeft : void 0, v = f ? f.borderRight : void 0, p = {};
    h && (d = t.filter(d, function(x) {
      return x !== h && x !== v;
    }));
    var g = e(s, d);
    t.forEach(g, function(x) {
      if (s.children(x.v).length) {
        var E = a(s, x.v, l, c);
        p[x.v] = E, t.has(E, "barycenter") && o(x, E);
      }
    });
    var y = r(g, l);
    i(y, p);
    var m = n(y, c);
    if (h && (m.vs = t.flatten([h, m.vs, v], !0), s.predecessors(h).length)) {
      var b = s.node(s.predecessors(h)[0]), w = s.node(s.predecessors(v)[0]);
      t.has(m, "barycenter") || (m.barycenter = 0, m.weight = 0), m.barycenter = (m.barycenter * m.weight + b.order + w.order) / (m.weight + 2), m.weight += 2;
    }
    return m;
  }
  function i(s, u) {
    t.forEach(s, function(l) {
      l.vs = t.flatten(l.vs.map(function(c) {
        return u[c] ? u[c].vs : c;
      }), !0);
    });
  }
  function o(s, u) {
    t.isUndefined(s.barycenter) ? (s.barycenter = u.barycenter, s.weight = u.weight) : (s.barycenter = (s.barycenter * s.weight + u.barycenter * u.weight) / (s.weight + u.weight), s.weight += u.weight);
  }
  return Xh;
}
var Jh, cE;
function BH() {
  if (cE) return Jh;
  cE = 1;
  var t = gt(), e = Yr().Graph;
  Jh = r;
  function r(a, i, o) {
    var s = n(a), u = new e({ compound: !0 }).setGraph({ root: s }).setDefaultNodeLabel(function(l) {
      return a.node(l);
    });
    return t.forEach(a.nodes(), function(l) {
      var c = a.node(l), d = a.parent(l);
      (c.rank === i || c.minRank <= i && i <= c.maxRank) && (u.setNode(l), u.setParent(l, d || s), t.forEach(a[o](l), function(f) {
        var h = f.v === l ? f.w : f.v, v = u.edge(h, l), p = t.isUndefined(v) ? 0 : v.weight;
        u.setEdge(h, l, { weight: a.edge(f).weight + p });
      }), t.has(c, "minRank") && u.setNode(l, {
        borderLeft: c.borderLeft[i],
        borderRight: c.borderRight[i]
      }));
    }), u;
  }
  function n(a) {
    for (var i; a.hasNode(i = t.uniqueId("_root")); ) ;
    return i;
  }
  return Jh;
}
var Qh, dE;
function $H() {
  if (dE) return Qh;
  dE = 1;
  var t = gt();
  Qh = e;
  function e(r, n, a) {
    var i = {}, o;
    t.forEach(a, function(s) {
      for (var u = r.parent(s), l, c; u; ) {
        if (l = r.parent(u), l ? (c = i[l], i[l] = u) : (c = o, o = u), c && c !== u) {
          n.setEdge(c, u);
          return;
        }
        u = l;
      }
    });
  }
  return Qh;
}
var ep, fE;
function qH() {
  if (fE) return ep;
  fE = 1;
  var t = gt(), e = DH(), r = RH(), n = NH(), a = BH(), i = $H(), o = Yr().Graph, s = yr();
  ep = u;
  function u(f) {
    var h = s.maxRank(f), v = l(f, t.range(1, h + 1), "inEdges"), p = l(f, t.range(h - 1, -1, -1), "outEdges"), g = e(f);
    d(f, g);
    for (var y = Number.POSITIVE_INFINITY, m, b = 0, w = 0; w < 4; ++b, ++w) {
      c(b % 2 ? v : p, b % 4 >= 2), g = s.buildLayerMatrix(f);
      var x = r(f, g);
      x < y && (w = 0, m = t.cloneDeep(g), y = x);
    }
    d(f, m);
  }
  function l(f, h, v) {
    return t.map(h, function(p) {
      return a(f, p, v);
    });
  }
  function c(f, h) {
    var v = new o();
    t.forEach(f, function(p) {
      var g = p.graph().root, y = n(p, g, v, h);
      t.forEach(y.vs, function(m, b) {
        p.node(m).order = b;
      }), i(p, v, y.vs);
    });
  }
  function d(f, h) {
    t.forEach(h, function(v) {
      t.forEach(v, function(p, g) {
        f.node(p).order = g;
      });
    });
  }
  return ep;
}
var tp, vE;
function zH() {
  if (vE) return tp;
  vE = 1;
  var t = gt(), e = Yr().Graph, r = yr();
  tp = {
    positionX: v,
    findType1Conflicts: n,
    findType2Conflicts: a,
    addConflict: o,
    hasConflict: s,
    verticalAlignment: u,
    horizontalCompaction: l,
    alignCoordinates: f,
    findSmallestWidthAlignment: d,
    balance: h
  };
  function n(y, m) {
    var b = {};
    function w(x, E) {
      var C = 0, k = 0, S = x.length, _ = t.last(E);
      return t.forEach(E, function(T, O) {
        var D = i(y, T), A = D ? y.node(D).order : S;
        (D || T === _) && (t.forEach(E.slice(k, O + 1), function(F) {
          t.forEach(y.predecessors(F), function(R) {
            var M = y.node(R), L = M.order;
            (L < C || A < L) && !(M.dummy && y.node(F).dummy) && o(b, R, F);
          });
        }), k = O + 1, C = A);
      }), E;
    }
    return t.reduce(m, w), b;
  }
  function a(y, m) {
    var b = {};
    function w(E, C, k, S, _) {
      var T;
      t.forEach(t.range(C, k), function(O) {
        T = E[O], y.node(T).dummy && t.forEach(y.predecessors(T), function(D) {
          var A = y.node(D);
          A.dummy && (A.order < S || A.order > _) && o(b, D, T);
        });
      });
    }
    function x(E, C) {
      var k = -1, S, _ = 0;
      return t.forEach(C, function(T, O) {
        if (y.node(T).dummy === "border") {
          var D = y.predecessors(T);
          D.length && (S = y.node(D[0]).order, w(C, _, O, k, S), _ = O, k = S);
        }
        w(C, _, C.length, S, E.length);
      }), C;
    }
    return t.reduce(m, x), b;
  }
  function i(y, m) {
    if (y.node(m).dummy)
      return t.find(y.predecessors(m), function(b) {
        return y.node(b).dummy;
      });
  }
  function o(y, m, b) {
    if (m > b) {
      var w = m;
      m = b, b = w;
    }
    var x = y[m];
    x || (y[m] = x = {}), x[b] = !0;
  }
  function s(y, m, b) {
    if (m > b) {
      var w = m;
      m = b, b = w;
    }
    return t.has(y[m], b);
  }
  function u(y, m, b, w) {
    var x = {}, E = {}, C = {};
    return t.forEach(m, function(k) {
      t.forEach(k, function(S, _) {
        x[S] = S, E[S] = S, C[S] = _;
      });
    }), t.forEach(m, function(k) {
      var S = -1;
      t.forEach(k, function(_) {
        var T = w(_);
        if (T.length) {
          T = t.sortBy(T, function(R) {
            return C[R];
          });
          for (var O = (T.length - 1) / 2, D = Math.floor(O), A = Math.ceil(O); D <= A; ++D) {
            var F = T[D];
            E[_] === _ && S < C[F] && !s(b, _, F) && (E[F] = _, E[_] = x[_] = x[F], S = C[F]);
          }
        }
      });
    }), { root: x, align: E };
  }
  function l(y, m, b, w, x) {
    var E = {}, C = c(y, m, b, x), k = x ? "borderLeft" : "borderRight";
    function S(O, D) {
      for (var A = C.nodes(), F = A.pop(), R = {}; F; )
        R[F] ? O(F) : (R[F] = !0, A.push(F), A = A.concat(D(F))), F = A.pop();
    }
    function _(O) {
      E[O] = C.inEdges(O).reduce(function(D, A) {
        return Math.max(D, E[A.v] + C.edge(A));
      }, 0);
    }
    function T(O) {
      var D = C.outEdges(O).reduce(function(F, R) {
        return Math.min(F, E[R.w] - C.edge(R));
      }, Number.POSITIVE_INFINITY), A = y.node(O);
      D !== Number.POSITIVE_INFINITY && A.borderType !== k && (E[O] = Math.max(E[O], D));
    }
    return S(_, C.predecessors.bind(C)), S(T, C.successors.bind(C)), t.forEach(w, function(O) {
      E[O] = E[b[O]];
    }), E;
  }
  function c(y, m, b, w) {
    var x = new e(), E = y.graph(), C = p(E.nodesep, E.edgesep, w);
    return t.forEach(m, function(k) {
      var S;
      t.forEach(k, function(_) {
        var T = b[_];
        if (x.setNode(T), S) {
          var O = b[S], D = x.edge(O, T);
          x.setEdge(O, T, Math.max(C(y, _, S), D || 0));
        }
        S = _;
      });
    }), x;
  }
  function d(y, m) {
    return t.minBy(t.values(m), function(b) {
      var w = Number.NEGATIVE_INFINITY, x = Number.POSITIVE_INFINITY;
      return t.forIn(b, function(E, C) {
        var k = g(y, C) / 2;
        w = Math.max(E + k, w), x = Math.min(E - k, x);
      }), w - x;
    });
  }
  function f(y, m) {
    var b = t.values(m), w = t.min(b), x = t.max(b);
    t.forEach(["u", "d"], function(E) {
      t.forEach(["l", "r"], function(C) {
        var k = E + C, S = y[k], _;
        if (S !== m) {
          var T = t.values(S);
          _ = C === "l" ? w - t.min(T) : x - t.max(T), _ && (y[k] = t.mapValues(S, function(O) {
            return O + _;
          }));
        }
      });
    });
  }
  function h(y, m) {
    return t.mapValues(y.ul, function(b, w) {
      if (m)
        return y[m.toLowerCase()][w];
      var x = t.sortBy(t.map(y, w));
      return (x[1] + x[2]) / 2;
    });
  }
  function v(y) {
    var m = r.buildLayerMatrix(y), b = t.merge(
      n(y, m),
      a(y, m)
    ), w = {}, x;
    t.forEach(["u", "d"], function(C) {
      x = C === "u" ? m : t.values(m).reverse(), t.forEach(["l", "r"], function(k) {
        k === "r" && (x = t.map(x, function(O) {
          return t.values(O).reverse();
        }));
        var S = (C === "u" ? y.predecessors : y.successors).bind(y), _ = u(y, x, b, S), T = l(
          y,
          x,
          _.root,
          _.align,
          k === "r"
        );
        k === "r" && (T = t.mapValues(T, function(O) {
          return -O;
        })), w[C + k] = T;
      });
    });
    var E = d(y, w);
    return f(w, E), h(w, y.graph().align);
  }
  function p(y, m, b) {
    return function(w, x, E) {
      var C = w.node(x), k = w.node(E), S = 0, _;
      if (S += C.width / 2, t.has(C, "labelpos"))
        switch (C.labelpos.toLowerCase()) {
          case "l":
            _ = -C.width / 2;
            break;
          case "r":
            _ = C.width / 2;
            break;
        }
      if (_ && (S += b ? _ : -_), _ = 0, S += (C.dummy ? m : y) / 2, S += (k.dummy ? m : y) / 2, S += k.width / 2, t.has(k, "labelpos"))
        switch (k.labelpos.toLowerCase()) {
          case "l":
            _ = k.width / 2;
            break;
          case "r":
            _ = -k.width / 2;
            break;
        }
      return _ && (S += b ? _ : -_), _ = 0, S;
    };
  }
  function g(y, m) {
    return y.node(m).width;
  }
  return tp;
}
var rp, hE;
function VH() {
  if (hE) return rp;
  hE = 1;
  var t = gt(), e = yr(), r = zH().positionX;
  rp = n;
  function n(i) {
    i = e.asNonCompoundGraph(i), a(i), t.forEach(r(i), function(o, s) {
      i.node(s).x = o;
    });
  }
  function a(i) {
    var o = e.buildLayerMatrix(i), s = i.graph().ranksep, u = 0;
    t.forEach(o, function(l) {
      var c = t.max(t.map(l, function(d) {
        return i.node(d).height;
      }));
      t.forEach(l, function(d) {
        i.node(d).y = u + c / 2;
      }), u += c + s;
    });
  }
  return rp;
}
var np, pE;
function HH() {
  if (pE) return np;
  pE = 1;
  var t = gt(), e = SH(), r = kH(), n = TH(), a = yr().normalizeRanks, i = IH(), o = yr().removeEmptyRanks, s = OH(), u = AH(), l = PH(), c = qH(), d = VH(), f = yr(), h = Yr().Graph;
  np = v;
  function v(B, $) {
    var z = $ && $.debugTiming ? f.time : f.notime;
    z("layout", function() {
      var W = z("  buildLayoutGraph", function() {
        return S(B);
      });
      z("  runLayout", function() {
        p(W, z);
      }), z("  updateInputGraph", function() {
        g(B, W);
      });
    });
  }
  function p(B, $) {
    $("    makeSpaceForEdgeLabels", function() {
      _(B);
    }), $("    removeSelfEdges", function() {
      V(B);
    }), $("    acyclic", function() {
      e.run(B);
    }), $("    nestingGraph.run", function() {
      s.run(B);
    }), $("    rank", function() {
      n(f.asNonCompoundGraph(B));
    }), $("    injectEdgeLabelProxies", function() {
      T(B);
    }), $("    removeEmptyRanks", function() {
      o(B);
    }), $("    nestingGraph.cleanup", function() {
      s.cleanup(B);
    }), $("    normalizeRanks", function() {
      a(B);
    }), $("    assignRankMinMax", function() {
      O(B);
    }), $("    removeEdgeLabelProxies", function() {
      D(B);
    }), $("    normalize.run", function() {
      r.run(B);
    }), $("    parentDummyChains", function() {
      i(B);
    }), $("    addBorderSegments", function() {
      u(B);
    }), $("    order", function() {
      c(B);
    }), $("    insertSelfEdges", function() {
      Y(B);
    }), $("    adjustCoordinateSystem", function() {
      l.adjust(B);
    }), $("    position", function() {
      d(B);
    }), $("    positionSelfEdges", function() {
      H(B);
    }), $("    removeBorderNodes", function() {
      L(B);
    }), $("    normalize.undo", function() {
      r.undo(B);
    }), $("    fixupEdgeLabelCoords", function() {
      R(B);
    }), $("    undoCoordinateSystem", function() {
      l.undo(B);
    }), $("    translateGraph", function() {
      A(B);
    }), $("    assignNodeIntersects", function() {
      F(B);
    }), $("    reversePoints", function() {
      M(B);
    }), $("    acyclic.undo", function() {
      e.undo(B);
    });
  }
  function g(B, $) {
    t.forEach(B.nodes(), function(z) {
      var W = B.node(z), Z = $.node(z);
      W && (W.x = Z.x, W.y = Z.y, $.children(z).length && (W.width = Z.width, W.height = Z.height));
    }), t.forEach(B.edges(), function(z) {
      var W = B.edge(z), Z = $.edge(z);
      W.points = Z.points, t.has(Z, "x") && (W.x = Z.x, W.y = Z.y);
    }), B.graph().width = $.graph().width, B.graph().height = $.graph().height;
  }
  var y = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], m = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" }, b = ["acyclicer", "ranker", "rankdir", "align"], w = ["width", "height"], x = { width: 0, height: 0 }, E = ["minlen", "weight", "width", "height", "labeloffset"], C = {
    minlen: 1,
    weight: 1,
    width: 0,
    height: 0,
    labeloffset: 10,
    labelpos: "r"
  }, k = ["labelpos"];
  function S(B) {
    var $ = new h({ multigraph: !0, compound: !0 }), z = ne(B.graph());
    return $.setGraph(t.merge(
      {},
      m,
      K(z, y),
      t.pick(z, b)
    )), t.forEach(B.nodes(), function(W) {
      var Z = ne(B.node(W));
      $.setNode(W, t.defaults(K(Z, w), x)), $.setParent(W, B.parent(W));
    }), t.forEach(B.edges(), function(W) {
      var Z = ne(B.edge(W));
      $.setEdge(W, t.merge(
        {},
        C,
        K(Z, E),
        t.pick(Z, k)
      ));
    }), $;
  }
  function _(B) {
    var $ = B.graph();
    $.ranksep /= 2, t.forEach(B.edges(), function(z) {
      var W = B.edge(z);
      W.minlen *= 2, W.labelpos.toLowerCase() !== "c" && ($.rankdir === "TB" || $.rankdir === "BT" ? W.width += W.labeloffset : W.height += W.labeloffset);
    });
  }
  function T(B) {
    t.forEach(B.edges(), function($) {
      var z = B.edge($);
      if (z.width && z.height) {
        var W = B.node($.v), Z = B.node($.w), N = { rank: (Z.rank - W.rank) / 2 + W.rank, e: $ };
        f.addDummyNode(B, "edge-proxy", N, "_ep");
      }
    });
  }
  function O(B) {
    var $ = 0;
    t.forEach(B.nodes(), function(z) {
      var W = B.node(z);
      W.borderTop && (W.minRank = B.node(W.borderTop).rank, W.maxRank = B.node(W.borderBottom).rank, $ = t.max($, W.maxRank));
    }), B.graph().maxRank = $;
  }
  function D(B) {
    t.forEach(B.nodes(), function($) {
      var z = B.node($);
      z.dummy === "edge-proxy" && (B.edge(z.e).labelRank = z.rank, B.removeNode($));
    });
  }
  function A(B) {
    var $ = Number.POSITIVE_INFINITY, z = 0, W = Number.POSITIVE_INFINITY, Z = 0, N = B.graph(), X = N.marginx || 0, Q = N.marginy || 0;
    function ge(we) {
      var fe = we.x, ce = we.y, be = we.width, ve = we.height;
      $ = Math.min($, fe - be / 2), z = Math.max(z, fe + be / 2), W = Math.min(W, ce - ve / 2), Z = Math.max(Z, ce + ve / 2);
    }
    t.forEach(B.nodes(), function(we) {
      ge(B.node(we));
    }), t.forEach(B.edges(), function(we) {
      var fe = B.edge(we);
      t.has(fe, "x") && ge(fe);
    }), $ -= X, W -= Q, t.forEach(B.nodes(), function(we) {
      var fe = B.node(we);
      fe.x -= $, fe.y -= W;
    }), t.forEach(B.edges(), function(we) {
      var fe = B.edge(we);
      t.forEach(fe.points, function(ce) {
        ce.x -= $, ce.y -= W;
      }), t.has(fe, "x") && (fe.x -= $), t.has(fe, "y") && (fe.y -= W);
    }), N.width = z - $ + X, N.height = Z - W + Q;
  }
  function F(B) {
    t.forEach(B.edges(), function($) {
      var z = B.edge($), W = B.node($.v), Z = B.node($.w), N, X;
      z.points ? (N = z.points[0], X = z.points[z.points.length - 1]) : (z.points = [], N = Z, X = W), z.points.unshift(f.intersectRect(W, N)), z.points.push(f.intersectRect(Z, X));
    });
  }
  function R(B) {
    t.forEach(B.edges(), function($) {
      var z = B.edge($);
      if (t.has(z, "x"))
        switch ((z.labelpos === "l" || z.labelpos === "r") && (z.width -= z.labeloffset), z.labelpos) {
          case "l":
            z.x -= z.width / 2 + z.labeloffset;
            break;
          case "r":
            z.x += z.width / 2 + z.labeloffset;
            break;
        }
    });
  }
  function M(B) {
    t.forEach(B.edges(), function($) {
      var z = B.edge($);
      z.reversed && z.points.reverse();
    });
  }
  function L(B) {
    t.forEach(B.nodes(), function($) {
      if (B.children($).length) {
        var z = B.node($), W = B.node(z.borderTop), Z = B.node(z.borderBottom), N = B.node(t.last(z.borderLeft)), X = B.node(t.last(z.borderRight));
        z.width = Math.abs(X.x - N.x), z.height = Math.abs(Z.y - W.y), z.x = N.x + z.width / 2, z.y = W.y + z.height / 2;
      }
    }), t.forEach(B.nodes(), function($) {
      B.node($).dummy === "border" && B.removeNode($);
    });
  }
  function V(B) {
    t.forEach(B.edges(), function($) {
      if ($.v === $.w) {
        var z = B.node($.v);
        z.selfEdges || (z.selfEdges = []), z.selfEdges.push({ e: $, label: B.edge($) }), B.removeEdge($);
      }
    });
  }
  function Y(B) {
    var $ = f.buildLayerMatrix(B);
    t.forEach($, function(z) {
      var W = 0;
      t.forEach(z, function(Z, N) {
        var X = B.node(Z);
        X.order = N + W, t.forEach(X.selfEdges, function(Q) {
          f.addDummyNode(B, "selfedge", {
            width: Q.label.width,
            height: Q.label.height,
            rank: X.rank,
            order: N + ++W,
            e: Q.e,
            label: Q.label
          }, "_se");
        }), delete X.selfEdges;
      });
    });
  }
  function H(B) {
    t.forEach(B.nodes(), function($) {
      var z = B.node($);
      if (z.dummy === "selfedge") {
        var W = B.node(z.e.v), Z = W.x + W.width / 2, N = W.y, X = z.x - Z, Q = W.height / 2;
        B.setEdge(z.e, z.label), B.removeNode($), z.label.points = [
          { x: Z + 2 * X / 3, y: N - Q },
          { x: Z + 5 * X / 6, y: N - Q },
          { x: Z + X, y: N },
          { x: Z + 5 * X / 6, y: N + Q },
          { x: Z + 2 * X / 3, y: N + Q }
        ], z.label.x = z.x, z.label.y = z.y;
      }
    });
  }
  function K(B, $) {
    return t.mapValues(t.pick(B, $), Number);
  }
  function ne(B) {
    var $ = {};
    return t.forEach(B, function(z, W) {
      $[W.toLowerCase()] = z;
    }), $;
  }
  return np;
}
var ap, gE;
function KH() {
  if (gE) return ap;
  gE = 1;
  var t = gt(), e = yr(), r = Yr().Graph;
  ap = {
    debugOrdering: n
  };
  function n(a) {
    var i = e.buildLayerMatrix(a), o = new r({ compound: !0, multigraph: !0 }).setGraph({});
    return t.forEach(a.nodes(), function(s) {
      o.setNode(s, { label: s }), o.setParent(s, "layer" + a.node(s).rank);
    }), t.forEach(a.edges(), function(s) {
      o.setEdge(s.v, s.w, {}, s.name);
    }), t.forEach(i, function(s, u) {
      var l = "layer" + u;
      o.setNode(l, { rank: "same" }), t.reduce(s, function(c, d) {
        return o.setEdge(c, d, { style: "invis" }), d;
      });
    }), o;
  }
  return ap;
}
var ip, yE;
function GH() {
  return yE || (yE = 1, ip = "0.8.5"), ip;
}
var op, mE;
function UH() {
  return mE || (mE = 1, op = {
    graphlib: Yr(),
    layout: HH(),
    debug: KH(),
    util: {
      time: yr().time,
      notime: yr().notime
    },
    version: GH()
  }), op;
}
(function(t, e) {
  (function(n, a) {
    t.exports = a(UH());
  })(oo, function(r) {
    return (
      /******/
      function(n) {
        var a = {};
        function i(o) {
          if (a[o])
            return a[o].exports;
          var s = a[o] = {
            /******/
            i: o,
            /******/
            l: !1,
            /******/
            exports: {}
            /******/
          };
          return n[o].call(s.exports, s, s.exports, i), s.l = !0, s.exports;
        }
        return i.m = n, i.c = a, i.d = function(o, s, u) {
          i.o(o, s) || Object.defineProperty(o, s, { enumerable: !0, get: u });
        }, i.r = function(o) {
          typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(o, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(o, "__esModule", { value: !0 });
        }, i.t = function(o, s) {
          if (s & 1 && (o = i(o)), s & 8 || s & 4 && typeof o == "object" && o && o.__esModule) return o;
          var u = /* @__PURE__ */ Object.create(null);
          if (i.r(u), Object.defineProperty(u, "default", { enumerable: !0, value: o }), s & 2 && typeof o != "string") for (var l in o) i.d(u, l, (function(c) {
            return o[c];
          }).bind(null, l));
          return u;
        }, i.n = function(o) {
          var s = o && o.__esModule ? (
            /******/
            function() {
              return o.default;
            }
          ) : (
            /******/
            function() {
              return o;
            }
          );
          return i.d(s, "a", s), s;
        }, i.o = function(o, s) {
          return Object.prototype.hasOwnProperty.call(o, s);
        }, i.p = "", i(i.s = 0);
      }([
        /* 0 */
        /***/
        function(n, a, i) {
          var o = i(1), s = function(l) {
            l && l("layout", "dagre", o);
          };
          typeof cytoscape < "u" && s(cytoscape), n.exports = s;
        },
        /* 1 */
        /***/
        function(n, a, i) {
          function o(f) {
            "@babel/helpers - typeof";
            return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? o = function(v) {
              return typeof v;
            } : o = function(v) {
              return v && typeof Symbol == "function" && v.constructor === Symbol && v !== Symbol.prototype ? "symbol" : typeof v;
            }, o(f);
          }
          var s = function(h) {
            return typeof h == "function";
          }, u = i(2), l = i(3), c = i(4);
          function d(f) {
            this.options = l({}, u, f);
          }
          d.prototype.run = function() {
            var f = this.options, h = this, v = f.cy, p = f.eles, g = function(H, K) {
              return s(K) ? K.apply(H, [H]) : K;
            }, y = f.boundingBox || {
              x1: 0,
              y1: 0,
              w: v.width(),
              h: v.height()
            };
            y.x2 === void 0 && (y.x2 = y.x1 + y.w), y.w === void 0 && (y.w = y.x2 - y.x1), y.y2 === void 0 && (y.y2 = y.y1 + y.h), y.h === void 0 && (y.h = y.y2 - y.y1);
            var m = new c.graphlib.Graph({
              multigraph: !0,
              compound: !0
            }), b = {}, w = function(H, K) {
              K != null && (b[H] = K);
            };
            w("nodesep", f.nodeSep), w("edgesep", f.edgeSep), w("ranksep", f.rankSep), w("rankdir", f.rankDir), w("align", f.align), w("ranker", f.ranker), w("acyclicer", f.acyclicer), m.setGraph(b), m.setDefaultEdgeLabel(function() {
              return {};
            }), m.setDefaultNodeLabel(function() {
              return {};
            });
            var x = p.nodes();
            s(f.sort) && (x = x.sort(f.sort));
            for (var E = 0; E < x.length; E++) {
              var C = x[E], k = C.layoutDimensions(f);
              m.setNode(C.id(), {
                width: k.w,
                height: k.h,
                name: C.id()
              });
            }
            for (var S = 0; S < x.length; S++) {
              var _ = x[S];
              _.isChild() && m.setParent(_.id(), _.parent().id());
            }
            var T = p.edges().stdFilter(function(Y) {
              return !Y.source().isParent() && !Y.target().isParent();
            });
            s(f.sort) && (T = T.sort(f.sort));
            for (var O = 0; O < T.length; O++) {
              var D = T[O];
              m.setEdge(D.source().id(), D.target().id(), {
                minlen: g(D, f.minLen),
                weight: g(D, f.edgeWeight),
                name: D.id()
              }, D.id());
            }
            c.layout(m);
            for (var A = m.nodes(), F = 0; F < A.length; F++) {
              var R = A[F], M = m.node(R);
              v.getElementById(R).scratch().dagre = M;
            }
            var L;
            f.boundingBox ? (L = {
              x1: 1 / 0,
              x2: -1 / 0,
              y1: 1 / 0,
              y2: -1 / 0
            }, x.forEach(function(Y) {
              var H = Y.scratch().dagre;
              L.x1 = Math.min(L.x1, H.x), L.x2 = Math.max(L.x2, H.x), L.y1 = Math.min(L.y1, H.y), L.y2 = Math.max(L.y2, H.y);
            }), L.w = L.x2 - L.x1, L.h = L.y2 - L.y1) : L = y;
            var V = function(H) {
              if (f.boundingBox) {
                var K = L.w === 0 ? 0 : (H.x - L.x1) / L.w, ne = L.h === 0 ? 0 : (H.y - L.y1) / L.h;
                return {
                  x: y.x1 + K * y.w,
                  y: y.y1 + ne * y.h
                };
              } else
                return H;
            };
            return x.layoutPositions(h, f, function(Y) {
              Y = o(Y) === "object" ? Y : this;
              var H = Y.scratch().dagre;
              return V({
                x: H.x,
                y: H.y
              });
            }), this;
          }, n.exports = d;
        },
        /* 2 */
        /***/
        function(n, a) {
          var i = {
            // dagre algo options, uses default value on undefined
            nodeSep: void 0,
            // the separation between adjacent nodes in the same rank
            edgeSep: void 0,
            // the separation between adjacent edges in the same rank
            rankSep: void 0,
            // the separation between adjacent nodes in the same rank
            rankDir: void 0,
            // 'TB' for top to bottom flow, 'LR' for left to right,
            align: void 0,
            // alignment for rank nodes. Can be 'UL', 'UR', 'DL', or 'DR', where U = up, D = down, L = left, and R = right
            acyclicer: void 0,
            // If set to 'greedy', uses a greedy heuristic for finding a feedback arc set for a graph.
            // A feedback arc set is a set of edges that can be removed to make a graph acyclic.
            ranker: void 0,
            // Type of algorithm to assigns a rank to each node in the input graph.
            // Possible values: network-simplex, tight-tree or longest-path
            minLen: function(s) {
              return 1;
            },
            // number of ranks to keep between the source and target of the edge
            edgeWeight: function(s) {
              return 1;
            },
            // higher weight edges are generally made shorter and straighter than lower weight edges
            // general layout options
            fit: !0,
            // whether to fit to viewport
            padding: 30,
            // fit padding
            spacingFactor: void 0,
            // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up
            nodeDimensionsIncludeLabels: !1,
            // whether labels should be included in determining the space used by a node
            animate: !1,
            // whether to transition the node positions
            animateFilter: function(s, u) {
              return !0;
            },
            // whether to animate specific nodes when animation is on; non-animated nodes immediately go to their final positions
            animationDuration: 500,
            // duration of animation in ms if enabled
            animationEasing: void 0,
            // easing of animation if enabled
            boundingBox: void 0,
            // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }
            transform: function(s, u) {
              return u;
            },
            // a function that applies a transform to the final node position
            ready: function() {
            },
            // on layoutready
            sort: void 0,
            // a sorting function to order the nodes and edges; e.g. function(a, b){ return a.data('weight') - b.data('weight') }
            // because cytoscape dagre creates a directed graph, and directed graphs use the node order as a tie breaker when
            // defining the topology of a graph, this sort function can help ensure the correct order of the nodes/edges.
            // this feature is most useful when adding and removing the same nodes and edges multiple times in a graph.
            stop: function() {
            }
            // on layoutstop
          };
          n.exports = i;
        },
        /* 3 */
        /***/
        function(n, a) {
          n.exports = Object.assign != null ? Object.assign.bind(Object) : function(i) {
            for (var o = arguments.length, s = new Array(o > 1 ? o - 1 : 0), u = 1; u < o; u++)
              s[u - 1] = arguments[u];
            return s.forEach(function(l) {
              Object.keys(l).forEach(function(c) {
                return i[c] = l[c];
              });
            }), i;
          };
        },
        /* 4 */
        /***/
        function(n, a) {
          n.exports = r;
        }
        /******/
      ])
    );
  });
})(Lk);
var WH = Lk.exports;
const jH = /* @__PURE__ */ oM(WH);
ia.use(jH);
const bE = function(t, e) {
  if (!t || !e) return !1;
  let r = JSON.stringify(t), n = JSON.stringify(e);
  return r.indexOf(n) !== -1;
}, YH = function(t) {
  return t ? [...new Set(t.map((e) => JSON.stringify(e)))].map(
    (e) => JSON.parse(e)
  ) : [];
}, ZH = function(t, e, r) {
  let n = t.connectivity.flat(), a = YH(n), i = [], o = !1;
  return a.forEach((s) => {
    o = !1, bE(e, s) && (o = !0), bE(r, s) && (o = !0), o || i.push(s);
  }), i;
};
let XH = class extends EventTarget {
  constructor(r, n) {
    super();
    Tr(this, "cyg", null);
    Tr(this, "nodes", []);
    Tr(this, "edges", []);
    Tr(this, "axons", []);
    Tr(this, "dendrites", []);
    Tr(this, "somas", []);
    Tr(this, "labelCache", /* @__PURE__ */ new Map());
    Tr(this, "graphCanvas", null);
    Tr(this, "hasPhenotypes", !1);
    this.labelCache = r, this.graphCanvas = n;
  }
  async addConnectivity(r) {
    var n;
    if (r && r["node-phenotypes"]) {
      const a = ["ilxtr:hasSomaLocatedIn"], i = ["ilxtr:hasAxonPresynapticElementIn", "ilxtr:hasAxonSensorySubcellularElementIn"], o = [], s = [];
      a.forEach((l) => {
        o.push(...r["node-phenotypes"][l]);
      }), i.forEach((l) => {
        s.push(...r["node-phenotypes"][l]);
      });
      const u = ZH(r, o, s);
      this.dendrites = o.map((l) => JSON.stringify(l)), this.axons = s.map((l) => JSON.stringify(l)), u != null && u.length && (this.somas = u.map((l) => JSON.stringify(l))), this.hasPhenotypes = !0;
    } else
      this.axons = r.axons.map((a) => JSON.stringify(a)), this.dendrites = r.dendrites.map((a) => JSON.stringify(a)), (n = r.somas) != null && n.length && (this.somas = r.somas.map((a) => JSON.stringify(a))), this.hasPhenotypes = !1;
    if (r.connectivity.length)
      for (const a of r.connectivity) {
        const i = await this.graphNode(a[0]), o = await this.graphNode(a[1]);
        this.nodes.push(i), this.nodes.push(o), this.edges.push({
          id: `${i.id}_${o.id}`,
          source: i.id,
          target: o.id
        });
      }
    else
      this.nodes.push({
        id: "MISSING",
        label: "NO PATHS"
      });
  }
  showConnectivity(r) {
    this.cyg = new nK(this, r), this.cyg.on("tap-node", (n) => {
      const a = new CustomEvent("tap-node", {
        detail: n.detail
      });
      this.dispatchEvent(a);
    });
  }
  selectConnectivity(r) {
    var n;
    if ((n = this.cyg) != null && n.cy) {
      let a = "";
      this.cyg.cy.elements().forEach((i) => {
        const o = i.data("label"), s = zp(o);
        rK(r, s) && (a = i.id());
      }), a && this.cyg.cy.$id(a).select();
    }
  }
  clearConnectivity() {
    var r;
    (r = this.cyg) != null && r.cy && (this.cyg.cy.remove(), this.cyg.cy = null);
  }
  reset() {
    var r;
    (r = this.cyg) != null && r.cy && this.cyg.cy.reset();
  }
  zoom(r) {
    var n;
    if ((n = this.cyg) != null && n.cy) {
      const a = this.cyg.cy.zoom(), i = this.cyg.cy.width(), o = this.cyg.cy.height(), s = {
        x: i / 2,
        y: o / 2
      };
      this.cyg.cy.zoom({
        level: a + r,
        renderedPosition: s
      });
    }
  }
  enableZoom(r) {
    var n;
    (n = this.cyg) != null && n.cy && this.cyg.cy.userZoomingEnabled(r);
  }
  get elements() {
    return [
      ...this.nodes.map((r) => ({ data: r })),
      ...this.edges.map((r) => ({ data: r }))
    ];
  }
  get roots() {
    return this.hasPhenotypes ? [
      ...this.dendrites
    ] : [
      ...this.dendrites,
      ...this.somas
    ];
  }
  async graphNode(r) {
    const n = JSON.stringify(r), a = [r[0], ...r[1]], i = [];
    for (const s of a) {
      const u = this.labelCache.has(s) ? this.labelCache.get(s) : "";
      i.push(u);
    }
    a.push(...i);
    const o = {
      id: n,
      label: a.join(`
`)
    };
    return this.hasPhenotypes ? this.axons.includes(n) ? o.axon = !0 : this.dendrites.includes(n) ? o.dendrite = !0 : o.somas = !0 : this.axons.includes(n) ? this.dendrites.includes(n) || this.somas.includes(n) ? o.somas = !0 : o.axon = !0 : (this.dendrites.includes(n) || this.somas.includes(n)) && (o.dendrite = !0), o;
  }
  on(r, n) {
    this.addEventListener(r, n);
  }
};
const JH = "#8300bf", QH = "#f3ecf6", eK = [
  {
    selector: "node",
    style: {
      label: function(t) {
        return tK(t.data("label"));
      },
      // 'background-color': '#80F0F0',
      "background-color": "transparent",
      "background-opacity": "0",
      "text-valign": "center",
      "text-wrap": "wrap",
      width: "80px",
      height: "80px",
      "text-max-width": "80px",
      "font-size": "6px",
      shape: "round-rectangle",
      "border-width": 1,
      "border-style": "solid",
      "border-color": "gray"
    }
  },
  {
    selector: "node[axon]",
    style: {
      // 'background-color': 'green',
      shape: "round-diamond",
      width: "100px",
      height: "100px"
    }
  },
  {
    selector: "node[dendrite]",
    style: {
      // 'background-color': 'red',
      shape: "ellipse"
    }
  },
  {
    selector: "node[somas]",
    style: {
      // 'background-color': 'gray',
      shape: "round-rectangle"
    }
  },
  {
    selector: "edge",
    style: {
      width: 1,
      "line-color": "dimgray",
      "curve-style": "bezier"
    }
  },
  {
    selector: "node.active",
    style: {
      "border-color": JH,
      "background-color": QH,
      "background-opacity": 0.75
    }
  }
];
function tK(t) {
  const e = t.split(`
`), r = e.length / 2, n = e.slice(r);
  return L_(n.join(`
`));
}
function L_(t) {
  return t.split(`
`).map((e) => e && e[0] >= "a" && e[0] <= "z" ? e.charAt(0).toUpperCase() + e.slice(1) : e).join(`
`);
}
function zp(t) {
  const e = t ? t.split(`
`) : [], r = [];
  for (let n = 0; n < e.length / 2; n++)
    r.push({
      id: e[n],
      label: e[n + e.length / 2]
    });
  return r;
}
function rK(t, e) {
  t.sort((r, n) => r.id < n.id ? -1 : r.id > n.id ? 1 : 0), e.sort((r, n) => r.id < n.id ? -1 : r.id > n.id ? 1 : 0);
  for (let r = 0; r < t.length; r++)
    if (JSON.stringify(t[r]) !== JSON.stringify(e[r]))
      return !1;
  return !0;
}
class nK extends EventTarget {
  constructor(r, n) {
    var a;
    super();
    Tr(this, "cy");
    Tr(this, "tooltip");
    this.cy = ia({
      container: n,
      elements: r.elements,
      layout: {
        name: "dagre",
        nodeSep: 150,
        edgeSep: 50,
        rankSep: 100,
        rankDir: "TB",
        roots: r.roots.length ? r.roots : void 0
      },
      style: eK,
      minZoom: 0.1,
      maxZoom: 10,
      wheelSensitivity: 0.4
    }).on("mouseover", "node", this.overNode.bind(this)).on("mouseout", "node", this.exitNode.bind(this)).on("position", "node", this.moveNode.bind(this)), this.tooltip = document.createElement("div"), this.tooltip.className = "cy-graph-tooltip", this.tooltip.hidden = !0, (a = n == null ? void 0 : n.lastChild) == null || a.appendChild(this.tooltip);
  }
  remove() {
    this.cy && this.cy.destroy();
  }
  checkRightBoundary(r) {
    var n;
    r + this.tooltip.offsetWidth >= ((n = this.tooltip.parentElement) == null ? void 0 : n.offsetWidth) && (this.tooltip.style.left = `${r - this.tooltip.offsetWidth}px`);
  }
  overNode(r) {
    const a = r.target.data(), { label: i } = a, s = zp(i).map((u) => u.label + " (" + u.id + ")");
    this.tooltip.innerText = L_(s.join(`
`)), this.tooltip.style.left = `${r.renderedPosition.x}px`, this.tooltip.style.top = `${r.renderedPosition.y}px`, this.tooltip.style.maxWidth = "240px", this.tooltip.style.zIndex = 2, this.tooltip.hidden = !1, this.checkRightBoundary(r.renderedPosition.x), this.tapNode(r, !0);
  }
  moveNode(r) {
    const n = r.target;
    this.tooltip.style.left = `${n.renderedPosition().x}px`, this.tooltip.style.top = `${n.renderedPosition().y}px`, this.checkRightBoundary(n.renderedPosition().x);
  }
  exitNode(r) {
    this.tooltip.hidden = !0, this.tapNode(r, !1);
  }
  tapNode(r, n) {
    const a = r.target, i = a.data();
    let { label: o } = i;
    n ? a.addClass("active") : (a.removeClass("active"), o = "", setTimeout(() => {
      a.unselect();
    }));
    const s = zp(o), u = new CustomEvent("tap-node", {
      detail: s
    });
    this.dispatchEvent(u);
  }
  on(r, n) {
    this.addEventListener(r, n);
  }
}
const aK = 1.3, iK = 24 * 60 * 60 * 1e3, oK = "Reset position", wE = "Lock zoom", sK = "Unlock zoom", lK = "Zoom in", uK = "Zoom out", CE = 0.25, cK = "#8300bf", dK = {
  name: "ConnectivityGraph",
  props: {
    /**
     * Entity to load its connectivity graph.
     */
    entry: {
      type: String,
      default: ""
    },
    mapServer: {
      type: String,
      default: ""
    },
    sckanVersion: {
      type: String,
      default: ""
    },
    selectedConnectivityData: {
      type: Array,
      default: []
    },
    connectivityFromMap: {
      type: Object,
      default: () => null
    },
    connectivityError: {
      type: Object,
      default: () => {
      }
    }
  },
  data: function() {
    return {
      loading: !0,
      loadingError: "",
      connectivityGraph: null,
      selectedSource: "",
      availableSources: [],
      pathList: [],
      schemaVersion: "",
      knowledgeByPath: /* @__PURE__ */ new Map(),
      labelledTerms: /* @__PURE__ */ new Set(),
      labelCache: /* @__PURE__ */ new Map(),
      resetLabel: oK,
      zoomLockLabel: wE,
      zoomInLabel: lK,
      zoomOutLabel: uK,
      iconColor: cK,
      zoomEnabled: !1,
      connectivityGraphContainer: null
    };
  },
  watch: {
    connectivityFromMap: function(t, e) {
      t != e && (this.showSpinner(), this.start());
    }
  },
  mounted() {
    this.showSpinner(), this.updateTooltipContainer(), this.refreshCache(), this.loadCacheData(), this.start();
  },
  methods: {
    updateTooltipContainer: function() {
      this.connectivityGraphContainer = this.$refs.connectivityGraphRef;
    },
    loadCacheData: function() {
      const t = sessionStorage.getItem("connectivity-graph-sources"), e = sessionStorage.getItem("connectivity-graph-labels"), r = sessionStorage.getItem("connectivity-graph-pathlist"), n = sessionStorage.getItem("connectivity-graph-schema-version");
      if (this.sckanVersion && (this.selectedSource = this.sckanVersion), sessionStorage.setItem("connectivity-graph-selected-source", this.selectedSource), this.updateCacheExpiry(), t && (this.availableSources = JSON.parse(t)), r && (this.pathList = JSON.parse(r)), e) {
        const a = JSON.parse(e);
        this.labelCache = new Map(Object.entries(a));
      }
      n && (this.schemaVersion = n);
    },
    isValidKnowledgeSource: function() {
      const t = sessionStorage.getItem("connectivity-graph-selected-source");
      return !(this.sckanVersion && this.sckanVersion !== t);
    },
    removeAllCacheData: function() {
      [
        "connectivity-graph-expiry",
        "connectivity-graph-selected-source",
        "connectivity-graph-source",
        // to clear old data
        "connectivity-graph-sources",
        "connectivity-graph-labels",
        "connectivity-graph-pathlist",
        "connectivity-graph-schema-version"
      ].forEach((e) => {
        sessionStorage.removeItem(e);
      });
    },
    refreshCache: function() {
      const t = sessionStorage.getItem("connectivity-graph-expiry"), e = /* @__PURE__ */ new Date(), r = this.isValidKnowledgeSource();
      (e.getTime() > t || !r) && this.removeAllCacheData();
    },
    updateCacheExpiry: function() {
      const e = (/* @__PURE__ */ new Date()).getTime() + iK;
      sessionStorage.setItem("connectivity-graph-expiry", e);
    },
    start: function() {
      this.run().then((t) => {
        t != null && t.success ? this.showGraph(this.entry) : t != null && t.error ? (this.loadingError = t.error, this.hideSpinner()) : (this.loadingError = "Loading error!", this.hideSpinner());
      }).catch((t) => {
        this.loadingError = "Loading error!", this.hideSpinner();
      });
    },
    run: async function() {
      return this.schemaVersion || (this.schemaVersion = await this.getSchemaVersion(), sessionStorage.setItem("connectivity-graph-schema-version", this.schemaVersion), this.updateCacheExpiry()), this.schemaVersion < aK ? {
        error: `No server available for schema-version ${this.schemaVersion}.`
      } : (this.availableSources.length || (this.availableSources = await this.loadAvailableSources()), !this.connectivityFromMap && !this.isSCKANVersionAvailable() ? {
        error: `No data available for SCKAN version ${this.selectedSource}.`
      } : (await this.setPathList(this.selectedSource), {
        success: !0
      }));
    },
    showGraph: async function(t) {
      const e = this.$refs.graphCanvas;
      this.connectivityFromMap && (this.cacheLabels(this.connectivityFromMap), await this.getCachedTermLabels()), this.connectivityGraph = new XH(this.labelCache, e);
      const r = this.knowledgeByPath.get(t);
      this.connectivityFromMap && (r.axons = this.connectivityFromMap.axons, r.connectivity = this.connectivityFromMap.connectivity, r.dendrites = this.connectivityFromMap.dendrites, r.somas = this.connectivityFromMap.somas), await this.connectivityGraph.addConnectivity(r), this.connectivityGraph.showConnectivity(e), this.selectedConnectivityData.length && this.connectivityGraph.selectConnectivity(this.selectedConnectivityData), this.connectivityGraph.on("tap-node", (n) => {
        const a = n.detail;
        this.$emit("tap-node", a);
      }), this.hideSpinner();
    },
    query: async function(t, e) {
      const r = `${this.mapServer}knowledge/query/`, n = { sql: t, params: e };
      try {
        const a = await fetch(r, {
          method: "POST",
          headers: {
            Accept: "application/json; charset=utf-8",
            "Cache-Control": "no-store",
            "Content-Type": "application/json"
          },
          body: JSON.stringify(n)
        });
        if (!a.ok)
          throw new Error(`Cannot access ${r}`);
        return await a.json();
      } catch {
        return {
          values: []
        };
      }
    },
    isSCKANVersionAvailable: function() {
      return this.availableSources.includes(this.selectedSource);
    },
    loadAvailableSources: async function() {
      const t = await this.getJsonData(`${this.mapServer}knowledge/sources`), r = (t ? t.sources || [] : []).filter((n) => n);
      return sessionStorage.setItem("connectivity-graph-sources", JSON.stringify(r)), this.updateCacheExpiry(), r;
    },
    loadPathData: async function(t) {
      const e = await this.query(
        `select entity, knowledge from knowledge
          where entity like 'ilxtr:%' and source=?
          order by entity`,
        [t]
      );
      return e ? e.values : [];
    },
    setPathList: async function(t) {
      this.pathList.length || (this.pathList = await this.loadPathData(t), sessionStorage.setItem("connectivity-graph-pathlist", JSON.stringify(this.pathList)), this.updateCacheExpiry()), this.knowledgeByPath.clear(), this.labelledTerms = /* @__PURE__ */ new Set();
      for (const [e, r] of this.pathList) {
        const n = JSON.parse(r);
        "connectivity" in n && (this.knowledgeByPath.set(e, n), this.cacheLabels(n));
      }
      return this.labelCache.size || await this.getCachedTermLabels(), "";
    },
    getSchemaVersion: async function() {
      const t = await this.getJsonData(`${this.mapServer}knowledge/schema-version`);
      return t && +t.version || 0;
    },
    getJsonData: async function(t) {
      try {
        const e = await fetch(t, {
          method: "GET",
          headers: {
            Accept: "application/json; charset=utf-8",
            "Cache-Control": "no-store",
            "Content-Type": "application/json"
          }
        });
        return e.ok || console.error(`Cannot access ${t}`), await e.json();
      } catch {
        return null;
      }
    },
    getCachedTermLabels: async function() {
      if (this.labelledTerms.size) {
        const t = await this.query(
          `select entity, knowledge from knowledge
            where entity in (?${", ?".repeat(this.labelledTerms.size - 1)})
            order by source desc`,
          [...this.labelledTerms.values()]
        );
        let e = null;
        for (const [n, a] of t.values)
          if (n !== e) {
            const i = JSON.parse(a);
            this.labelCache.set(n, i.label || n), e = n;
          }
        const r = Object.fromEntries(this.labelCache);
        sessionStorage.setItem("connectivity-graph-labels", JSON.stringify(r)), this.updateCacheExpiry();
      }
    },
    cacheNodeLabels: function(t) {
      for (const e of [t[0], ...t[1]])
        this.labelledTerms.add(e);
    },
    cacheLabels: async function(t) {
      for (const e of t.connectivity)
        this.cacheNodeLabels(e[0]), this.cacheNodeLabels(e[1]);
    },
    showSpinner: function() {
      this.loading = !0;
    },
    hideSpinner: function() {
      this.loading = !1;
    },
    reset: function() {
      this.connectivityGraph.reset();
    },
    zoomIn: function() {
      this.connectivityGraph.zoom(CE);
    },
    zoomOut: function() {
      this.connectivityGraph.zoom(-CE);
    },
    /**
     * Enable/disable user zoom for scrolling
     */
    toggleZoom: function() {
      this.zoomEnabled = !this.zoomEnabled, this.zoomLockLabel = this.zoomEnabled ? sK : wE, this.connectivityGraph.enableZoom(!this.zoomEnabled);
    }
  }
}, fK = {
  class: "connectivity-graph",
  ref: "connectivityGraphRef"
}, vK = {
  ref: "graphCanvas",
  class: "graph-canvas"
}, hK = { class: "control-panel control-panel-tools" }, pK = { class: "visually-hidden" }, gK = { class: "visually-hidden" }, yK = { class: "visually-hidden" }, mK = { class: "visually-hidden" }, bK = /* @__PURE__ */ nI('<div class="control-panel control-panel-nodes" data-v-95331209><div class="node-key" data-v-95331209><div class="key-box-container" data-v-95331209><div class="key-box key-box-dendrite" data-v-95331209> Origin </div><div class="key-box key-box-node" data-v-95331209> Components </div><div class="key-box key-box-axon" data-v-95331209> Destination </div></div></div></div>', 1), wK = { class: "connectivity-graph-error" }, CK = {
  key: 0,
  class: "loading-error"
};
function xK(t, e, r, n, a, i) {
  const o = FT, s = Ft, u = mr, l = Jo, c = MT, d = NT, f = BT, h = $T, v = Eg;
  return Ye((q(), ie("div", fK, [
    ae("div", vK, null, 512),
    ae("div", hK, [
      ae("div", {
        class: le(["tools", { "zoom-locked": t.zoomEnabled }])
      }, [
        J(l, {
          content: t.resetLabel,
          placement: "top",
          effect: "control-tooltip",
          teleported: !0,
          "append-to": t.connectivityGraphContainer
        }, {
          default: U(() => [
            J(u, {
              class: "control-button",
              size: "small",
              onClick: i.reset
            }, {
              default: U(() => [
                J(s, { color: "white" }, {
                  default: U(() => [
                    J(o)
                  ]),
                  _: 1
                }),
                ae("span", pK, ke(t.resetLabel), 1)
              ]),
              _: 1
            }, 8, ["onClick"])
          ]),
          _: 1
        }, 8, ["content", "append-to"]),
        J(l, {
          content: t.zoomLockLabel,
          placement: "top",
          effect: "control-tooltip",
          teleported: !0,
          "append-to": t.connectivityGraphContainer
        }, {
          default: U(() => [
            J(u, {
              class: "control-button",
              size: "small",
              onClick: i.toggleZoom
            }, {
              default: U(() => [
                J(s, { color: "white" }, {
                  default: U(() => [
                    t.zoomEnabled ? (q(), me(c, { key: 0 })) : (q(), me(d, { key: 1 }))
                  ]),
                  _: 1
                }),
                ae("span", gK, ke(t.zoomLockLabel), 1)
              ]),
              _: 1
            }, 8, ["onClick"])
          ]),
          _: 1
        }, 8, ["content", "append-to"]),
        J(l, {
          content: t.zoomInLabel,
          placement: "left",
          effect: "control-tooltip",
          teleported: !0,
          "append-to": t.connectivityGraphContainer
        }, {
          default: U(() => [
            J(u, {
              class: "control-button",
              size: "small",
              onClick: i.zoomIn
            }, {
              default: U(() => [
                J(s, { color: "white" }, {
                  default: U(() => [
                    J(f)
                  ]),
                  _: 1
                }),
                ae("span", yK, ke(t.zoomInLabel), 1)
              ]),
              _: 1
            }, 8, ["onClick"])
          ]),
          _: 1
        }, 8, ["content", "append-to"]),
        J(l, {
          content: t.zoomOutLabel,
          placement: "left",
          effect: "control-tooltip",
          teleported: !0,
          "append-to": t.connectivityGraphContainer
        }, {
          default: U(() => [
            J(u, {
              class: "control-button",
              size: "small",
              onClick: i.zoomOut
            }, {
              default: U(() => [
                J(s, { color: "white" }, {
                  default: U(() => [
                    J(h)
                  ]),
                  _: 1
                }),
                ae("span", mK, ke(t.zoomOutLabel), 1)
              ]),
              _: 1
            }, 8, ["onClick"])
          ]),
          _: 1
        }, 8, ["content", "append-to"])
      ], 2)
    ]),
    bK,
    Ye(ae("div", wK, [
      ae("strong", null, ke(r.connectivityError.errorConnectivities), 1),
      Be(" " + ke(r.connectivityError.errorMessage), 1)
    ], 512), [
      [dt, r.connectivityError.errorConnectivities]
    ]),
    t.loadingError ? (q(), ie("div", CK, ke(t.loadingError), 1)) : pe("", !0)
  ])), [
    [v, t.loading]
  ]);
}
const B7 = /* @__PURE__ */ Er(dK, [["render", xK], ["__scopeId", "data-v-95331209"]]), F_ = (t) => t && t.charAt(0).toUpperCase() + t.slice(1), EK = (t) => t.replace(/\w\S*/g, (e) => e.charAt(0).toUpperCase() + e.substr(1).toLowerCase()), SK = (t) => new Promise((e) => setTimeout(e, t)), kK = {
  name: "ConnectivityList",
  components: {
    Button: mr,
    Container: bg,
    Icon: Ft,
    ElIconWarning: bl,
    ElIconSearch: xE
  },
  props: {
    entry: {
      type: Object,
      default: () => ({
        destinations: [],
        origins: [],
        components: [],
        destinationsWithDatasets: [],
        originsWithDatasets: [],
        componentsWithDatasets: [],
        resource: void 0,
        featuresAlert: void 0
      })
    },
    origins: {
      type: Array,
      default: () => []
    },
    components: {
      type: Array,
      default: () => []
    },
    destinations: {
      type: Array,
      default: () => []
    },
    originsWithDatasets: {
      type: Array,
      default: () => []
    },
    componentsWithDatasets: {
      type: Array,
      default: () => []
    },
    destinationsWithDatasets: {
      type: Array,
      default: () => []
    },
    availableAnatomyFacets: {
      type: Array,
      default: () => []
    },
    connectivityError: {
      type: Object,
      default: () => {
      }
    }
  },
  data: function() {
    return {
      alertTop: 0,
      originDescriptions: {
        motor: "is the location of the initial cell body of the circuit",
        sensory: "is the location of the initial cell body in the PNS circuit"
      },
      facetList: []
    };
  },
  watch: {
    availableAnatomyFacets: {
      handler: function(t) {
        this.convertFacetsToList(t);
      },
      immediate: !0,
      deep: !0
    }
  },
  computed: {
    originDescription: function() {
      return this.entry && this.entry.title && this.entry.title.toLowerCase().includes("motor") ? this.originDescriptions.motor : this.originDescriptions.sensory;
    }
  },
  methods: {
    capitalise: function(t) {
      return F_(t);
    },
    onConnectivityHovered: function(t, e) {
      this.$emit("connectivity-hovered", t), e && (this.alertTop = e.srcElement.offsetParent.offsetTop + e.srcElement.offsetTop);
    },
    onConnectivityClicked: function(t) {
      const e = this.connectivityError.errorConnectivities, r = e ? t.replace(new RegExp(`\\s*,?\\s*${e}\\s*,?\\s*`, "gi"), "").trim() : t;
      this.$emit("connectivity-clicked", r);
    },
    // shouldShowMagnifyGlass: Checks whether the hovered terms contain valid term or not
    shouldShowMagnifyGlass: function(t) {
      const e = this.connectivityError.errorConnectivities;
      return (e == null ? void 0 : e.toLowerCase()) !== t.toLowerCase();
    },
    // shouldShowExploreButton: Checks if the feature is in the list of available anatomy facets
    shouldShowExploreButton: function(t) {
      if (!this.facetList.length)
        return !0;
      for (let e = 0; e < t.length; e++)
        if (this.facetList.includes(t[e].name.toLowerCase()))
          return !0;
      return !1;
    },
    // convertFacetsToList: Converts the available anatomy facets to a list for easy searching
    convertFacetsToList: function(t) {
      t.forEach((e) => {
        e.children ? this.convertFacetsToList(e.children) : this.facetList.push(e.label.toLowerCase());
      });
    },
    openAll: function() {
      this.$emit("connectivity-action-click", {
        type: "Facets",
        labels: this.componentsWithDatasets.map((t) => t.name.toLowerCase())
      });
    },
    openAxons: function() {
      this.$emit("connectivity-action-click", {
        type: "Facets",
        labels: this.destinationsWithDatasets.map((t) => t.name.toLowerCase())
      });
    },
    openDendrites: function() {
      this.$emit("connectivity-action-click", {
        type: "Facets",
        labels: this.originsWithDatasets.map((t) => t.name.toLowerCase())
      });
    }
  }
}, da = (t) => (Ba("data-v-81bbd5ff"), t = t(), $a(), t), _K = {
  ref: "connectivityList",
  class: "connectivity-list"
}, TK = {
  key: 0,
  class: "block"
}, IK = { class: "attribute-title-container" }, OK = /* @__PURE__ */ da(() => /* @__PURE__ */ ae("span", { class: "attribute-title" }, "Origin", -1)), AK = { style: { "word-break": "keep-all" } }, PK = /* @__PURE__ */ da(() => /* @__PURE__ */ ae("i", null, "Origin", -1)), DK = ["origin-item-label", "onMouseenter"], RK = /* @__PURE__ */ da(() => /* @__PURE__ */ ae("span", null, "Search connectivity", -1)), LK = {
  key: 1,
  class: "block"
}, FK = /* @__PURE__ */ da(() => /* @__PURE__ */ ae("div", { class: "attribute-title-container" }, [
  /* @__PURE__ */ ae("span", { class: "attribute-title" }, "Components")
], -1)), MK = ["component-item-label", "onMouseenter"], NK = /* @__PURE__ */ da(() => /* @__PURE__ */ ae("span", null, "Search connectivity", -1)), BK = {
  key: 2,
  class: "block"
}, $K = { class: "attribute-title-container" }, qK = /* @__PURE__ */ da(() => /* @__PURE__ */ ae("span", { class: "attribute-title" }, "Destination", -1)), zK = /* @__PURE__ */ da(() => /* @__PURE__ */ ae("span", { style: { "word-break": "keep-all" } }, [
  /* @__PURE__ */ ae("i", null, "Destination"),
  /* @__PURE__ */ Be(" is where the axons terminate ")
], -1)), VK = ["destination-item-label", "onMouseenter"], HK = /* @__PURE__ */ da(() => /* @__PURE__ */ ae("span", null, "Search connectivity", -1)), KK = { class: "block" };
function GK(t, e, r, n, a, i) {
  const o = Li, s = bl, u = Ft, l = xE, c = mr;
  return q(), ie("div", _K, [
    J(o, {
      width: "250",
      "show-arrow": !1,
      trigger: "manual",
      teleported: !1,
      placement: "left-start",
      visible: !!r.connectivityError.errorConnectivities,
      "popper-class": "connectivity-error-container"
    }, {
      reference: U(() => [
        ae("div", {
          class: "connectivity-alert",
          style: st({ top: t.alertTop + "px" })
        }, null, 4)
      ]),
      default: U(() => [
        ae("strong", null, ke(r.connectivityError.errorConnectivities), 1),
        Be(" " + ke(r.connectivityError.errorMessage), 1)
      ]),
      _: 1
    }, 8, ["visible"]),
    Be(" " + ke(r.entry.paths) + " ", 1),
    r.origins && r.origins.length > 0 ? (q(), ie("div", TK, [
      ae("div", IK, [
        OK,
        J(o, {
          width: "250",
          trigger: "hover",
          teleported: !1,
          "popper-class": "popover-origin-help"
        }, {
          reference: U(() => [
            J(u, { class: "info" }, {
              default: U(() => [
                J(s)
              ]),
              _: 1
            })
          ]),
          default: U(() => [
            ae("span", AK, [
              PK,
              Be(" " + ke(i.originDescription), 1)
            ])
          ]),
          _: 1
        })
      ]),
      (q(!0), ie(je, null, Lt(r.origins, (d, f) => (q(), ie("div", {
        class: "attribute-content",
        "origin-item-label": d,
        key: d,
        onMouseenter: (h) => i.onConnectivityHovered(d, h),
        onMouseleave: e[0] || (e[0] = (h) => i.onConnectivityHovered())
      }, [
        J(o, {
          width: "150",
          trigger: "hover",
          teleported: !1,
          "popper-class": "popover-origin-help"
        }, {
          reference: U(() => [
            Ye(J(u, {
              class: "magnify-glass",
              onClick: (h) => i.onConnectivityClicked(d)
            }, {
              default: U(() => [
                J(l)
              ]),
              _: 2
            }, 1032, ["onClick"]), [
              [dt, i.shouldShowMagnifyGlass(d)]
            ])
          ]),
          default: U(() => [
            RK
          ]),
          _: 2
        }, 1024),
        ae("span", null, ke(i.capitalise(d)), 1)
      ], 40, DK))), 128)),
      Ye(J(c, {
        class: "button",
        id: "open-dendrites-button",
        onClick: i.openDendrites
      }, {
        default: U(() => [
          Be(" Explore origin data ")
        ]),
        _: 1
      }, 8, ["onClick"]), [
        [
          dt,
          r.originsWithDatasets && r.originsWithDatasets.length > 0 && i.shouldShowExploreButton(r.originsWithDatasets)
        ]
      ])
    ])) : pe("", !0),
    r.components && r.components.length > 0 ? (q(), ie("div", LK, [
      FK,
      (q(!0), ie(je, null, Lt(r.components, (d, f) => (q(), ie("div", {
        class: "attribute-content",
        "component-item-label": d,
        key: d,
        onMouseenter: (h) => i.onConnectivityHovered(d, h),
        onMouseleave: e[1] || (e[1] = (h) => i.onConnectivityHovered())
      }, [
        J(o, {
          width: "150",
          trigger: "hover",
          teleported: !1,
          "popper-class": "popover-origin-help"
        }, {
          reference: U(() => [
            Ye(J(u, {
              class: "magnify-glass",
              onClick: (h) => i.onConnectivityClicked(d)
            }, {
              default: U(() => [
                J(l)
              ]),
              _: 2
            }, 1032, ["onClick"]), [
              [dt, i.shouldShowMagnifyGlass(d)]
            ])
          ]),
          default: U(() => [
            NK
          ]),
          _: 2
        }, 1024),
        ae("span", null, ke(i.capitalise(d)), 1)
      ], 40, MK))), 128))
    ])) : pe("", !0),
    r.destinations && r.destinations.length > 0 ? (q(), ie("div", BK, [
      ae("div", $K, [
        qK,
        J(o, {
          width: "250",
          trigger: "hover",
          teleported: !1,
          "popper-class": "popover-origin-help"
        }, {
          reference: U(() => [
            J(u, { class: "info" }, {
              default: U(() => [
                J(s)
              ]),
              _: 1
            })
          ]),
          default: U(() => [
            zK
          ]),
          _: 1
        })
      ]),
      (q(!0), ie(je, null, Lt(r.destinations, (d, f) => (q(), ie("div", {
        class: "attribute-content",
        "destination-item-label": d,
        key: d,
        onMouseenter: (h) => i.onConnectivityHovered(d, h),
        onMouseleave: e[2] || (e[2] = (h) => i.onConnectivityHovered())
      }, [
        J(o, {
          width: "150",
          trigger: "hover",
          teleported: !1,
          "popper-class": "popover-origin-help"
        }, {
          reference: U(() => [
            Ye(J(u, {
              class: "magnify-glass",
              onClick: (h) => i.onConnectivityClicked(d)
            }, {
              default: U(() => [
                J(l)
              ]),
              _: 2
            }, 1032, ["onClick"]), [
              [dt, i.shouldShowMagnifyGlass(d)]
            ])
          ]),
          default: U(() => [
            HK
          ]),
          _: 2
        }, 1024),
        ae("span", null, ke(i.capitalise(d)), 1)
      ], 40, VK))), 128)),
      Ye(J(c, {
        class: "button",
        onClick: i.openAxons
      }, {
        default: U(() => [
          Be(" Explore destination data ")
        ]),
        _: 1
      }, 8, ["onClick"]), [
        [
          dt,
          r.destinationsWithDatasets && r.destinationsWithDatasets.length > 0 && i.shouldShowExploreButton(r.destinationsWithDatasets)
        ]
      ])
    ])) : pe("", !0),
    Ye(ae("div", KK, [
      J(c, {
        class: "button",
        onClick: i.openAll
      }, {
        default: U(() => [
          Be(" Search for data on components ")
        ]),
        _: 1
      }, 8, ["onClick"])
    ], 512), [
      [
        dt,
        r.componentsWithDatasets && r.componentsWithDatasets.length > 0 && i.shouldShowExploreButton(r.componentsWithDatasets)
      ]
    ])
  ], 512);
}
const M_ = /* @__PURE__ */ Er(kK, [["render", GK], ["__scopeId", "data-v-81bbd5ff"]]), UK = function(t) {
  return t ? t.charAt(0).toUpperCase() + t.slice(1) : "";
}, WK = {
  name: "ConnectionDialog",
  props: {
    connectionEntry: {
      type: Object,
      default: {}
    },
    inDrawing: {
      type: Boolean,
      default: !1
    },
    connectionExist: {
      type: Boolean,
      default: !1
    }
  },
  data: function() {
    return {
      tooltipId: void 0
    };
  },
  methods: {
    shadowDisplay: function(t) {
      return this.tooltipId === t ? "always" : "hover";
    },
    capitalize: function(t) {
      return UK(t);
    },
    handleTooltip: function(t) {
      this.tooltipId = this.tooltipId === t ? void 0 : t, this.$emit("featureTooltip", this.tooltipId);
    }
  }
}, vy = (t) => (Ba("data-v-1ddab772"), t = t(), $a(), t), jK = { class: "dialog-container" }, YK = /* @__PURE__ */ vy(() => /* @__PURE__ */ ae("span", { class: "dialog-title" }, "Finalize drawing", -1)), ZK = /* @__PURE__ */ vy(() => /* @__PURE__ */ ae("span", { class: "dialog-title" }, "Visualize connection", -1)), XK = /* @__PURE__ */ vy(() => /* @__PURE__ */ ae("b", null, [
  /* @__PURE__ */ ae("span", null, "Related Features")
], -1)), JK = { class: "connection-label" };
function QK(t, e, r, n, a, i) {
  const o = mr, s = Dl, u = Qo, l = Li, c = dM;
  return q(), ie("div", jK, [
    J(s, null, {
      default: U(() => [
        J(u, null, {
          default: U(() => [
            r.inDrawing ? (q(), me(s, { key: 0 }, {
              default: U(() => [
                YK,
                J(o, {
                  type: "primary",
                  plain: "",
                  onClick: e[0] || (e[0] = (d) => t.$emit("confirmDrawn", !0))
                }, {
                  default: U(() => [
                    Be(" Confirm ")
                  ]),
                  _: 1
                }),
                J(o, {
                  type: "primary",
                  plain: "",
                  onClick: e[1] || (e[1] = (d) => t.$emit("cancelDrawn", !0))
                }, {
                  default: U(() => [
                    Be(" Cancel ")
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })) : (q(), me(s, { key: 1 }, {
              default: U(() => [
                ZK,
                J(o, {
                  type: "primary",
                  plain: "",
                  onClick: e[2] || (e[2] = (d) => t.$emit("dialogDisplay", !1))
                }, {
                  default: U(() => [
                    Be(" Close ")
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }))
          ]),
          _: 1
        })
      ]),
      _: 1
    }),
    r.connectionExist ? (q(), me(s, { key: 0 }, {
      default: U(() => [
        J(u, null, {
          default: U(() => [
            XK,
            (q(!0), ie(je, null, Lt(r.connectionEntry, (d, f) => (q(), me(s, { key: f }, {
              default: U(() => [
                J(c, {
                  shadow: i.shadowDisplay(f),
                  onClick: (h) => i.handleTooltip(f)
                }, {
                  default: U(() => [
                    J(l, {
                      trigger: "hover",
                      disabled: d.label.length < 20,
                      width: 200,
                      content: i.capitalize(d.label)
                    }, {
                      reference: U(() => [
                        ae("span", JK, ke(i.capitalize(d.label)), 1)
                      ]),
                      _: 2
                    }, 1032, ["disabled", "content"])
                  ]),
                  _: 2
                }, 1032, ["shadow", "onClick"])
              ]),
              _: 2
            }, 1024))), 128))
          ]),
          _: 1
        })
      ]),
      _: 1
    })) : pe("", !0)
  ]);
}
const eG = /* @__PURE__ */ Er(WK, [["render", QK], ["__scopeId", "data-v-1ddab772"]]), N_ = (t, e) => {
  const r = t.__vccOpts || t;
  for (const [n, a] of e)
    r[n] = a;
  return r;
}, tG = ["xlink:href"], rG = {
  __name: "SvgIcon",
  props: {
    /**
     * The svg icon to show.
     */
    icon: {
      type: String,
      required: !0
    },
    /**
     * The option to spin the icon.
     */
    spin: {
      type: Boolean,
      default: !1
    }
  },
  setup(t) {
    return (e, r) => (q(), ie("svg", {
      class: le(["map-icon", { "map-icon-spin": t.spin }])
    }, [
      ae("use", {
        "xlink:href": `#${t.icon}`
      }, null, 8, tG)
    ], 2));
  }
}, nG = /* @__PURE__ */ N_(rG, [["__scopeId", "data-v-e172d5ff"]]), B_ = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>2horpanel</title>
    <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-10-Copy-4">
            <g id="Group-15-Copy" fill="currentColor">
                <circle id="Oval-Copy" cx="12" cy="12" r="12"></circle>
                <text id="?" font-family="Asap-Bold, Asap" font-size="16" font-weight="bold">
                    <tspan x="8.5" y="18">?</tspan>
                </text>
            </g>
            <rect id="Rectangle" stroke="#FFFFFF" x="5" y="7" width="14" height="10"></rect>
            <line x1="18.5" y1="12" x2="5.5" y2="12" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
        </g>
    </g>
</svg>`, $_ = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>2vertpanel</title>
    <g id="2vertpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-10-Copy-3">
            <g id="Group-15-Copy" fill="currentColor">
                <circle id="Oval-Copy" cx="12" cy="12" r="12"></circle>
                <text id="?" font-family="Asap-Bold, Asap" font-size="16" font-weight="bold">
                    <tspan x="8.5" y="18">?</tspan>
                </text>
            </g>
            <rect id="Rectangle" stroke="#FFFFFF" x="5" y="7" width="14" height="10"></rect>
            <line x1="12" y1="7.5" x2="12" y2="16.5" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
        </g>
    </g>
</svg>`, q_ = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>3panel</title>
    <g id="3panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-10-Copy">
            <g id="Group-15-Copy" fill="currentColor">
                <circle id="Oval-Copy" cx="12" cy="12" r="12"></circle>
                <text id="?" font-family="Asap-Bold, Asap" font-size="16" font-weight="bold">
                    <tspan x="8.5" y="18">?</tspan>
                </text>
            </g>
            <rect id="Rectangle" stroke="#FFFFFF" x="5" y="7" width="14" height="10"></rect>
            <line x1="11.5" y1="7.5" x2="11.5" y2="16.5" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
            <line x1="18.5" y1="11.5" x2="11.5" y2="11.5" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
        </g>
    </g>
</svg>`, z_ = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>4panel</title>
    <g id="4panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-10-Copy-2">
            <g id="Group-15-Copy" fill="currentColor">
                <circle id="Oval-Copy" cx="12" cy="12" r="12"></circle>
                <text id="?" font-family="Asap-Bold, Asap" font-size="16" font-weight="bold">
                    <tspan x="8.5" y="18">?</tspan>
                </text>
            </g>
            <rect id="Rectangle" stroke="#FFFFFF" x="5" y="7" width="14" height="10"></rect>
            <line x1="12" y1="7.5" x2="12" y2="16.5" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
            <line x1="18.5" y1="12" x2="5.5" y2="12" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
        </g>
    </g>
</svg>`, V_ = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>2horpanel</title>
    <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-10-Copy-4">
            <g id="Group-15-Copy" fill="currentColor">
                <circle id="Oval-Copy" cx="12" cy="12" r="12"></circle>
                <text id="?" font-family="Asap-Bold, Asap" font-size="16" font-weight="bold">
                    <tspan x="8.5" y="18">?</tspan>
                </text>
            </g>
            <rect id="Rectangle" stroke="#FFFFFF" x="5" y="7" width="14" height="10"></rect>
            <line x1="18.5" y1="12" x2="5.5" y2="12" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
          <line x1="12" y1="12.5" x2="12" y2="16.5" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
          <line x1="14.5" y1="12" x2="14.5" y2="7" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
          <line x1="9.5" y1="12" x2="9.5" y2="7" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
        </g>
    </g>
</svg>`, H_ = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>2horpanel</title>
    <g id="2horpanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-10-Copy-4">
            <g id="Group-15-Copy" fill="currentColor">
                <circle id="Oval-Copy" cx="12" cy="12" r="12"></circle>
                <text id="?" font-family="Asap-Bold, Asap" font-size="16" font-weight="bold">
                    <tspan x="8.5" y="18">?</tspan>
                </text>
            </g>
            <rect id="Rectangle" stroke="#FFFFFF" x="5" y="7" width="14" height="10"></rect>
            <line x1="18.5" y1="12" x2="5.5" y2="12" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
          <line x1="14.5" y1="16" x2="14.5" y2="7" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
          <line x1="9.5" y1="16" x2="9.5" y2="7" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
        </g>
    </g>
</svg>`, K_ = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>4panel</title>
    <g id="4panel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-10-Copy-2">
            <g id="Group-15-Copy" fill="currentColor">
                <circle id="Oval-Copy" cx="12" cy="12" r="12"></circle>
                <text id="?" font-family="Asap-Bold, Asap" font-size="16" font-weight="bold">
                    <tspan x="8.5" y="18">?</tspan>
                </text>
            </g>
            <rect id="Rectangle" stroke="#FFFFFF" x="5" y="7" width="14" height="10"></rect>
            <line x1="12" y1="7.5" x2="12" y2="16.5" id="Line-6" stroke="#FFFFFF" stroke-linecap="square"></line>
            <line x1="18.5" y1="10.5" x2="5.5" y2="10.5" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
            <line x1="18.5" y1="13.8" x2="5.5" y2="13.8" id="Line-10" stroke="#FFFFFF" stroke-linecap="square"></line>
        </g>
    </g>
</svg>`, G_ = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>changeBckgd</title>
    <g id="changeBckgd" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-5">
            <circle id="Oval-Copy" fill="currentColor" cx="12" cy="12" r="12"></circle>
            <rect id="Rectangle" stroke="#FFFFFF" x="7" y="6" width="10" height="7"></rect>
            <line x1="12" y1="13.5" x2="12" y2="16.5" id="Line-4" stroke="#FFFFFF" stroke-width="2"></line>
            <line x1="7" y1="16.5" x2="17" y2="16.5" id="Line" stroke="#FFFFFF" stroke-linecap="square"></line>
        </g>
    </g>
</svg>`, U_ = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>close no bk</title>
    <g id="close-no-bk" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="square">
        <g id="Group-13" transform="translate(12.000000, 12.000000) rotate(-315.000000) translate(-12.000000, -12.000000) translate(5.000000, 5.000000)" stroke="#FFFFFF" stroke-width="2">
            <line x1="0" y1="7" x2="14" y2="7" id="Line-9"></line>
            <line x1="7" y1="0" x2="7" y2="14" id="Line-9"></line>
        </g>
    </g>
</svg>`, W_ = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>close</title>
    <g id="close" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-9">
            <g id="Group-8" fill="currentColor">
                <circle id="Oval" cx="12" cy="12" r="12"></circle>
            </g>
            <g id="Group-13" transform="translate(12.000000, 12.000000) rotate(-315.000000) translate(-12.000000, -12.000000) translate(5.000000, 5.000000)" stroke="#FFFFFF" stroke-linecap="square" stroke-width="2">
                <line x1="0" y1="7" x2="14" y2="7" id="Line-9"></line>
                <line x1="7" y1="0" x2="7" y2="14" id="Line-9"></line>
            </g>
        </g>
    </g>
</svg>`, j_ = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>closeFullScreen</title>
    <g id="closeFullScreen" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group">
            <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
            <polyline id="Line-5" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="square" transform="translate(6.750000, 7.750000) rotate(-180.000000) translate(-6.750000, -7.750000) " points="5 9.5 5 6 8.5 6"></polyline>
            <polyline id="Line-5" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="square" transform="translate(17.250000, 15.750000) rotate(-360.000000) translate(-17.250000, -15.750000) " points="15.5 17.5 15.5 14 19 14"></polyline>
            <polyline id="Line-5" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="square" transform="translate(6.750000, 15.750000) scale(1, -1) rotate(-180.000000) translate(-6.750000, -15.750000) " points="5 17.5 5 14 8.5 14"></polyline>
            <polyline id="Line-5" stroke="#FFFFFF" stroke-width="1.5" stroke-linecap="square" transform="translate(17.250000, 7.750000) scale(1, -1) rotate(-360.000000) translate(-17.250000, -7.750000) " points="15.5 9.5 15.5 6 19 6"></polyline>
        </g>
    </g>
</svg>`, Y_ = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>Comment</title>
    <g id="Comment" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <circle id="Oval" fill="currentColor" cx="512" cy="512" r="512"></circle>
        <path fill="#FFFFFF" transform="scale(0.75, 0.75) translate(165, 215)"
            d="M736 504a56 56 0 1 1 0-112 56 56 0 0 1 0 112m-224 0a56 56 0 1 1 0-112 56 56 0 0 1 0 112m-224 0a56 56 0 1 1 0-112 56 56 0 0 1 0 112M128 128v640h192v160l224-160h352V128z" />
    </g>
</svg>`, Z_ = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>Connection</title>
    <g id="Connection" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <circle id="Oval" fill="currentColor" cx="512" cy="512" r="512"></circle>
        <path fill="#FFFFFF" transform="scale(0.75, 0.75) translate(175, 175)"
            d="M640 384v64H448a128 128 0 0 0-128 128v128a128 128 0 0 0 128 128h320a128 128 0 0 0 128-128V576a128 128 0 0 0-64-110.848V394.88c74.56 26.368 128 97.472 128 181.056v128a192 192 0 0 1-192 192H448a192 192 0 0 1-192-192V576a192 192 0 0 1 192-192z" />
        <path fill="#FFFFFF" transform="scale(0.75, 0.75) translate(175, 175)"
            d="M384 640v-64h192a128 128 0 0 0 128-128V320a128 128 0 0 0-128-128H256a128 128 0 0 0-128 128v128a128 128 0 0 0 64 110.848v70.272A192.064 192.064 0 0 1 64 448V320a192 192 0 0 1 192-192h320a192 192 0 0 1 192 192v128a192 192 0 0 1-192 192z" />
    </g>
</svg>`, X_ = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>dock</title>
    <g id="dock" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-8-Copy-2">
            <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
            <g id="Group-5" transform="translate(2.972940, 3.512563)" stroke="#FFFFFF" stroke-linecap="square" stroke-width="2">
                <line x1="10.7289628" y1="7.03553391" x2="14.9716035" y2="2.79289322" id="Line"></line>
                <g id="Group" transform="translate(14.264497, 3.500000) rotate(-315.000000) translate(-14.264497, -3.500000) translate(11.264497, 2.000000)">
                    <line x1="2.27373675e-13" y1="2.82842712" x2="2.82842712" y2="0" id="Line"></line>
                    <line x1="3" y1="0" x2="5.82842712" y2="2.82842712" id="Line"></line>
                </g>
                <line x1="7.53553391" y1="10.1584369" x2="3.29289322" y2="14.4010776" id="Line"></line>
                <g id="Group" transform="translate(4.000000, 13.693971) rotate(-135.000000) translate(-4.000000, -13.693971) translate(1.000000, 12.193971)">
                    <line x1="2.27373675e-13" y1="2.82842712" x2="2.82842712" y2="0" id="Line"></line>
                    <line x1="3" y1="0" x2="5.82842712" y2="2.82842712" id="Line"></line>
                </g>
            </g>
        </g>
    </g>
</svg>`, J_ = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>drawLine</title>
    <g id="drawLine" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
        <path fill="#FFFFFF" transform="translate(2 2.0625)" d="m13.5 3.5c-1.4 0-2.5 1.1-2.5 2.5 0 .3 0 .6.2.9l-3.8 3.8c-.3-.1-.6-.2-.9-.2-1.4 0-2.5 1.1-2.5 2.5s1.1 2.5 2.5 2.5 2.5-1.1 2.5-2.5c0-.3 0-.6-.2-.9l3.8-3.8c.3.1.6.2.9.2 1.4 0 2.5-1.1 2.5-2.5s-1.1-2.5-2.5-2.5z" />
    </g>
</svg>`, Q_ = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>drawPoint</title>
    <g id="drawPoint" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
        <path fill="#FFFFFF" transform="translate(1.875 2.5)" d="m10 2c-3.3 0-6 2.7-6 6s6 9 6 9 6-5.7 6-9-2.7-6-6-6zm0 2c2.1 0 3.8 1.7 3.8 3.8 0 1.5-1.8 3.9-2.9 5.2h-1.7c-1.1-1.4-2.9-3.8-2.9-5.2-.1-2.1 1.6-3.8 3.7-3.8z" />
    </g>
</svg>`, eT = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>drawPolygon</title>
    <g id="drawPolygon" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
        <path fill="#FFFFFF" transform="translate(1.875 1.625)" d="m15 12.3v-4.6c.6-.3 1-1 1-1.7 0-1.1-.9-2-2-2-.7 0-1.4.4-1.7 1h-4.6c-.3-.6-1-1-1.7-1-1.1 0-2 .9-2 2 0 .7.4 1.4 1 1.7v4.6c-.6.3-1 1-1 1.7 0 1.1.9 2 2 2 .7 0 1.4-.4 1.7-1h4.6c.3.6 1 1 1.7 1 1.1 0 2-.9 2-2 0-.7-.4-1.4-1-1.7zm-8-.3v-4l1-1h4l1 1v4l-1 1h-4z" />
    </g>
</svg>`, tT = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>drawTrash</title>
    <g id="drawTrash" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
        <path fill="#FFFFFF" transform="translate(2 1.5)" d="M10,3.4 c-0.8,0-1.5,0.5-1.8,1.2H5l-1,1v1h12v-1l-1-1h-3.2C11.5,3.9,10.8,3.4,10,3.4z M5,8v7c0,1,1,2,2,2h6c1,0,2-1,2-2V8h-2v5.5h-1.5V8h-3 v5.5H7V8H5z" />
    </g>
</svg>`, rT = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>fitWindow</title>
    <g id="fitWindow" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-3">
            <g id="Group-8-Copy">
                <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
                <g id="Group" transform="translate(5.000000, 6.000000)" stroke="#FFFFFF" stroke-linecap="square" stroke-width="1.5">
                    <polyline id="Line-5" points="0 3.5 0 0 4.80123862 0"></polyline>
                    <polyline id="Line-5" transform="translate(2.400619, 9.750000) scale(1, -1) translate(-2.400619, -9.750000) " points="0 11.5 0 8 4.80123862 8"></polyline>
                    <polyline id="Line-5" transform="translate(11.600619, 1.750000) scale(1, -1) rotate(-180.000000) translate(-11.600619, -1.750000) " points="9.2 3.5 9.2 0 14.0012386 0"></polyline>
                </g>
            </g>
            <g id="Group-12" transform="translate(9.000000, 8.500000)" stroke="#FFFFFF" stroke-width="2">
                <circle id="Oval" cx="3.5" cy="3.5" r="3.5"></circle>
                <line x1="8.75" y1="8.75" x2="6.25" y2="6.25" id="Line-8" stroke-linecap="square"></line>
            </g>
        </g>
    </g>
</svg>`, nT = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>fullScreen</title>
    <g id="fullScreen" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-8-Copy">
            <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
            <g id="Group" transform="translate(5.000000, 6.000000)" stroke="#FFFFFF" stroke-linecap="square" stroke-width="1.5">
                <polyline id="Line-5" points="7.68274333e-14 3.5 7.68274333e-14 0 4.80123862 0"></polyline>
                <polyline id="Line-5" transform="translate(11.600619, 9.750000) rotate(-180.000000) translate(-11.600619, -9.750000) " points="9.2 11.5 9.2 8 14.0012386 8"></polyline>
                <polyline id="Line-5" transform="translate(2.400619, 9.750000) scale(1, -1) translate(-2.400619, -9.750000) " points="7.68274333e-14 11.5 7.68274333e-14 8 4.80123862 8"></polyline>
                <polyline id="Line-5" transform="translate(11.600619, 1.750000) scale(1, -1) rotate(-180.000000) translate(-11.600619, -1.750000) " points="9.2 3.5 9.2 0 14.0012386 0"></polyline>
            </g>
        </g>
    </g>
</svg>`, aT = '<svg id="icons" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>DataPortal-Icons</title><circle cx="12" cy="15.824" r="0.753"/><path d="M12,14.256a.75.75,0,0,1-.75-.75v-1c0-.529.419-.818.862-1.124.623-.43,1.138-.83,1.138-1.376A1.209,1.209,0,0,0,12,8.756a1.252,1.252,0,0,0-1.25,1.25.75.75,0,0,1-1.5,0A2.753,2.753,0,0,1,12,7.256a2.721,2.721,0,0,1,2.75,2.75,3.3,3.3,0,0,1-1.786,2.61c-.079.055-.152.1-.214.147v.743A.75.75,0,0,1,12,14.256Z"/><path d="M12,5a7,7,0,1,1-7,7,7.008,7.008,0,0,1,7-7m0-2a9,9,0,1,0,9,9,9,9,0,0,0-9-9Z"/></svg>', iT = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>magnifyingGlass</title>
    <g id="magnifyingGlass" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-19-Copy">
            <g id="Group-13-Copy">
                <circle id="Oval-Copy-2" fill="currentColor" cx="12" cy="12" r="12"></circle>
                <g id="Group-12" transform="translate(5.000000, 4.000000)" stroke="#FFFFFF" stroke-width="2">
                    <circle id="Oval" cx="5.5" cy="5.5" r="5.5"></circle>
                    <line x1="13.5833333" y1="13.5833333" x2="9.41666667" y2="9.41666667" id="Line-8" stroke-linecap="square"></line>
                </g>
            </g>
        </g>
    </g>
</svg>`, oT = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0" x="0px" y="0px" viewBox="0 0 960 1200" enable-background="new 0 0 960 960" xml:space="preserve"><g><path fill="#000000" d="M670,499.992c0,5.5-4.5,10-10,10H300c-5.516,0-10-4.5-10-10v-40c0-5.5,4.484-10,10-10h360   c5.5,0,10,4.5,10,10V499.992z"/><path fill="#000000" d="M530,649.992c0,5.5-4.5,10-10,10h-80c-5.516,0-10-4.5-10-10v-40c0-5.5,4.484-10,10-10h80   c5.5,0,10,4.5,10,10V649.992z"/><path fill="#000000" d="M780,350.008c0,5.5-4.5,10-10,10H190c-5.516,0-10-4.5-10-10v-40c0-5.516,4.484-10,10-10h580   c5.5,0,10,4.484,10,10V350.008z"/></g><text x="0" y="975" fill="#000000" font-size="5px" font-weight="bold" font-family="'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif">Created by Wahyu Prihantoro</text><text x="0" y="980" fill="#000000" font-size="5px" font-weight="bold" font-family="'Helvetica Neue', Helvetica, Arial-Unicode, Arial, Sans-serif">from the Noun Project</text></svg>`, sT = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>openMap</title>
    <g id="openMap" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-5-Copy" fill="currentColor">
            <circle id="Oval-Copy" cx="12" cy="12" r="12"></circle>
        </g>
        <rect id="Rectangle" stroke="#FFFFFF" x="5" y="10" width="10" height="7"></rect>
        <rect id="Rectangle-Copy" stroke="#FFFFFF" x="9" y="6" width="10" height="7"></rect>
    </g>
</svg>`, lT = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>Artboard Copy 6</title>
    <g id="Artboard-Copy-6" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-5-Copy" fill="currentColor">
            <circle id="Oval-Copy" cx="12" cy="12" r="12"></circle>
        </g>
        <line x1="9" y1="8" x2="9" y2="16" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
        <line x1="15" y1="8" x2="15" y2="16" id="Line-6-Copy-3" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
    </g>
</svg>`, uT = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>permalink</title>
    <g id="permalink" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
        <line x1="12.5" y1="9" x2="12.5" y2="15" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square" transform="translate(12.500000, 12.000000) rotate(45.000000) translate(-12.500000, -12.000000) "></line>
        <path d="M17,13 L17,16.5 C17,18.9852814 14.9852814,21 12.5,21 C10.0147186,21 8,18.9852814 8,16.5 L8,13 L10,13 L10,16.5 C10,17.8807119 11.1192881,19 12.5,19 C13.8254834,19 14.9100387,17.9684641 14.9946823,16.6643757 L15,16.5 L15,13 L17,13 Z M12.5,3 C14.9852814,3 17,5.01471863 17,7.5 L17,11 L15,11 L15,7.5 C15,6.11928813 13.8807119,5 12.5,5 C11.1745166,5 10.0899613,6.03153594 10.0053177,7.33562431 L10,7.5 L10,11 L8,11 L8,7.5 C8,5.01471863 10.0147186,3 12.5,3 Z" id="Combined-Shape" fill="#FFFFFF" transform="translate(12.500000, 12.000000) rotate(45.000000) translate(-12.500000, -12.000000) "></path>
    </g>
</svg>`, cT = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>play</title>
    <g id="play" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-9">
            <g id="Group-5-Copy" fill="currentColor">
                <circle id="Oval-Copy" cx="12" cy="12" r="12"></circle>
            </g>
            <polygon id="Triangle" fill="#FFFFFF" class="st0" transform="translate(13.000000, 11.500000) rotate(-270.000000) translate(-13.000000, -11.500000) " points="13 8 19 15 7 15"></polygon>
        </g>
    </g>
</svg>`, dT = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>resetZoom</title>
    <g id="resetZoom" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-13-Copy-2">
            <circle id="Oval-Copy-2" fill="currentColor" cx="12" cy="12" r="12"></circle>
            <g id="Group-12" transform="translate(5.000000, 4.000000)" stroke="#FFFFFF" stroke-width="2">
                <circle id="Oval" cx="5.5" cy="5.5" r="5.5"></circle>
                <line x1="13.5833333" y1="13.5833333" x2="9.41666667" y2="9.41666667" id="Line-8" stroke-linecap="square"></line>
            </g>
            <g id="Group-4" transform="translate(7.500000, 7.000000)">
                <path d="M3,5 C3.83613696,5 4.57640148,4.58952131 5.03027306,3.95908443 C5.19488093,3.73044075 5.32181864,3.47286529 5.40199763,3.19544657 C5.46580562,2.97467142 5.5,2.74132897 5.5,2.5 C5.5,2.26693547 5.46810753,2.04131982 5.40844867,1.82727914 C5.31560782,1.49418996 5.15552386,1.18913241 4.9437468,0.927656488 C4.48541251,0.361762414 3.78495332,0 3,0 C1.61928813,0 0.5,1.11928813 0.5,2.5 C0.5,3.88071187 1.61928813,5 3,5 Z" id="Oval" stroke="#FFFFFF"></path>
                <rect id="Rectangle" fill="currentColor" x="2.5" y="2" width="4" height="1"></rect>
                <line x1="5.5" y1="1.5" x2="5.5" y2="0.5" id="Line-7" stroke="#FFFFFF" stroke-linecap="square"></line>
                <line x1="4.5" y1="1.5" x2="5.5" y2="1.5" id="Line-7" stroke="#FFFFFF" stroke-linecap="square"></line>
            </g>
        </g>
    </g>
</svg>`, fT = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>singlepanel</title>
    <g id="singlepanel" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-10-Copy-5">
            <g id="Group-15-Copy" fill="currentColor">
                <circle id="Oval-Copy" cx="12" cy="12" r="12"></circle>
                <text id="?" font-family="Asap-Bold, Asap" font-size="16" font-weight="bold">
                    <tspan x="8.5" y="18">?</tspan>
                </text>
            </g>
            <rect id="Rectangle" stroke="#FFFFFF" x="5" y="7" width="14" height="10"></rect>
        </g>
    </g>
</svg>`, vT = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>tooltips</title>
    <g id="tooltips" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-15">
            <circle id="Oval-Copy" fill="currentColor" cx="12" cy="12" r="12"></circle>
            <path d="M6,5 L18,5 C19.1045695,5 20,5.8954305 20,7 L20,15.5714286 C20,16.6759981 19.1045695,17.5714286 18,17.5714286 L15.4003471,17.5714286 L15.4003471,17.5714286 L12.8157442,20.271248 C12.4338253,20.6701921 11.8008107,20.6839938 11.4018666,20.3020749 C11.3997428,20.3000417 11.3976279,20.2979991 11.3955221,20.2959473 L8.59934577,17.5714286 L8.59934577,17.5714286 L6,17.5714286 C4.8954305,17.5714286 4,16.6759981 4,15.5714286 L4,7 C4,5.8954305 4.8954305,5 6,5 Z" id="Rectangle" fill="#FFFFFF"></path>
            <text id="?" font-family="Asap-Bold, Asap" font-size="16" font-weight="bold" fill="currentColor">
                <tspan x="8.5" y="18">?</tspan>
            </text>
        </g>
    </g>
</svg>`, hT = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>undock</title>
    <g id="undock" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-9">
            <circle id="Oval" fill="currentColor" cx="12" cy="12" r="12"></circle>
            <g id="Group-5" transform="translate(5.500000, 6.000000)" stroke="#FFFFFF" stroke-linecap="square" stroke-width="2">
                <line x1="0.728962778" y1="12.0355339" x2="4.97160346" y2="7.79289322" id="Line"></line>
                <g id="Group" transform="translate(4.264497, 8.500000) rotate(-315.000000) translate(-4.264497, -8.500000) translate(1.264497, 7.000000)">
                    <line x1="2.27373675e-13" y1="2.82842712" x2="2.82842712" y2="0" id="Line"></line>
                    <line x1="3" y1="0" x2="5.82842712" y2="2.82842712" id="Line"></line>
                </g>
                <line x1="12.5355339" y1="0.158436893" x2="8.29289322" y2="4.40107758" id="Line"></line>
                <g id="Group" transform="translate(9.000000, 3.693971) rotate(-135.000000) translate(-9.000000, -3.693971) translate(6.000000, 2.193971)">
                    <line x1="2.27373675e-13" y1="2.82842712" x2="2.82842712" y2="0" id="Line"></line>
                    <line x1="3" y1="0" x2="5.82842712" y2="2.82842712" id="Line"></line>
                </g>
            </g>
        </g>
    </g>
</svg>`, pT = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>zoomIn</title>
    <g id="zoomIn" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-19-Copy">
            <g id="Group-13-Copy">
                <circle id="Oval-Copy-2" fill="currentColor" cx="12" cy="12" r="12"></circle>
                <g id="Group-12" transform="translate(5.000000, 4.000000)" stroke="#FFFFFF" stroke-width="2">
                    <circle id="Oval" cx="5.5" cy="5.5" r="5.5"></circle>
                    <line x1="13.5833333" y1="13.5833333" x2="9.41666667" y2="9.41666667" id="Line-8" stroke-linecap="square"></line>
                </g>
            </g>
            <line x1="9" y1="9.5" x2="12" y2="9.5" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
            <line x1="9" y1="9.5" x2="12" y2="9.5" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square" transform="translate(10.500000, 9.500000) rotate(90.000000) translate(-10.500000, -9.500000) "></line>
        </g>
    </g>
</svg>`, gT = `<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <title>zoomOut</title>
    <g id="zoomOut" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <g id="Group-19-Copy-3">
            <g id="Group-13-Copy">
                <circle id="Oval-Copy-2" fill="currentColor" cx="12" cy="12" r="12"></circle>
                <g id="Group-12" transform="translate(5.000000, 4.000000)" stroke="#FFFFFF" stroke-width="2">
                    <circle id="Oval" cx="5.5" cy="5.5" r="5.5"></circle>
                    <line x1="13.5833333" y1="13.5833333" x2="9.41666667" y2="9.41666667" id="Line-8" stroke-linecap="square"></line>
                </g>
            </g>
            <line x1="9" y1="9.5" x2="12" y2="9.5" id="Line-6-Copy-2" stroke="#FFFFFF" stroke-width="2" stroke-linecap="square"></line>
        </g>
    </g>
</svg>`, yT = (t, e, r, n) => {
  const a = ["title", "desc", "defs", "style"], i = ["width", "height"], o = n || [];
  let s = document.createElement("div");
  s.innerHTML = t, a.map((l) => {
    const c = s.querySelector(l);
    c && c.remove();
  }), i.map((l) => {
    s.querySelector("svg").removeAttribute(l);
  }), n && o.map((l) => {
    Object.values(s.querySelectorAll(`[${l}]`)).map((c) => {
      c.removeAttribute(l);
    });
  });
  const u = s.innerHTML;
  return s = null, u;
}, mT = (t) => [
  // Remove XML stuffs and comments
  [/<\?xml[\s\S]*?>/gi, ""],
  [/<!doctype[\s\S]*?>/gi, ""],
  [/<!--.*-->/gi, ""],
  // SVG XML -> HTML5
  [/\<([A-Za-z]+)([^\>]*)\/\>/g, "<$1$2></$1>"],
  // convert self-closing XML SVG nodes to explicitly closed HTML5 SVG nodes
  [/\s+/g, " "],
  // replace whitespace sequences with a single space
  [/\> \</g, "><"]
  // remove whitespace between tags
].reduce((e, r) => "".replace.apply(e, r), t).trim(), aG = !0, iG = !0, oG = ["fill"], Vp = /* @__PURE__ */ Object.assign({
  "/assets/icons/2horpanel.svg": B_,
  "/assets/icons/2vertpanel.svg": $_,
  "/assets/icons/3panel.svg": q_,
  "/assets/icons/4panel.svg": z_,
  "/assets/icons/5panel.svg": V_,
  "/assets/icons/6panel.svg": H_,
  "/assets/icons/6panelVertical.svg": K_,
  "/assets/icons/changeBckgd.svg": G_,
  "/assets/icons/close-no-bk.svg": U_,
  "/assets/icons/close.svg": W_,
  "/assets/icons/closeFullScreen.svg": j_,
  "/assets/icons/comment.svg": Y_,
  "/assets/icons/connection.svg": Z_,
  "/assets/icons/dock.svg": X_,
  "/assets/icons/drawLine.svg": J_,
  "/assets/icons/drawPoint.svg": Q_,
  "/assets/icons/drawPolygon.svg": eT,
  "/assets/icons/drawTrash.svg": tT,
  "/assets/icons/fitWindow.svg": rT,
  "/assets/icons/fullScreen.svg": nT,
  "/assets/icons/help.svg": aT,
  "/assets/icons/magnifyingGlass.svg": iT,
  "/assets/icons/noun-filter.svg": oT,
  "/assets/icons/openMap.svg": sT,
  "/assets/icons/pause.svg": lT,
  "/assets/icons/permalink.svg": uT,
  "/assets/icons/play.svg": cT,
  "/assets/icons/resetZoom.svg": dT,
  "/assets/icons/singlepanel.svg": fT,
  "/assets/icons/tooltips.svg": vT,
  "/assets/icons/undock.svg": hT,
  "/assets/icons/zoomIn.svg": pT,
  "/assets/icons/zoomOut.svg": gT
}), sG = Object.keys(Vp).map((t) => {
  const e = yT(Vp[t], aG, iG, oG), r = t.replace(/^.+\/(\w+).svg$/, "$1");
  return mT(e).replace("<svg", `<symbol id="${r}"`).replace("svg>", "symbol>");
});
sG.join(`
`);
const Hp = /* @__PURE__ */ Object.assign({
  "/assets/icons/2horpanel.svg": B_,
  "/assets/icons/2vertpanel.svg": $_,
  "/assets/icons/3panel.svg": q_,
  "/assets/icons/4panel.svg": z_,
  "/assets/icons/5panel.svg": V_,
  "/assets/icons/6panel.svg": H_,
  "/assets/icons/6panelVertical.svg": K_,
  "/assets/icons/changeBckgd.svg": G_,
  "/assets/icons/close-no-bk.svg": U_,
  "/assets/icons/close.svg": W_,
  "/assets/icons/closeFullScreen.svg": j_,
  "/assets/icons/comment.svg": Y_,
  "/assets/icons/connection.svg": Z_,
  "/assets/icons/dock.svg": X_,
  "/assets/icons/drawLine.svg": J_,
  "/assets/icons/drawPoint.svg": Q_,
  "/assets/icons/drawPolygon.svg": eT,
  "/assets/icons/drawTrash.svg": tT,
  "/assets/icons/fitWindow.svg": rT,
  "/assets/icons/fullScreen.svg": nT,
  "/assets/icons/help.svg": aT,
  "/assets/icons/magnifyingGlass.svg": iT,
  "/assets/icons/noun-filter.svg": oT,
  "/assets/icons/openMap.svg": sT,
  "/assets/icons/pause.svg": lT,
  "/assets/icons/permalink.svg": uT,
  "/assets/icons/play.svg": cT,
  "/assets/icons/resetZoom.svg": dT,
  "/assets/icons/singlepanel.svg": fT,
  "/assets/icons/tooltips.svg": vT,
  "/assets/icons/undock.svg": hT,
  "/assets/icons/zoomIn.svg": pT,
  "/assets/icons/zoomOut.svg": gT
}), lG = Object.keys(Hp).map((t) => {
  const e = yT(Hp[t]), r = t.replace(/^.+\/(\w+).svg$/, "$1");
  return mT(e).replace("<svg", `<symbol id="${r}"`).replace("svg>", "symbol>");
}), uG = {
  name: "MapSvgSpriteColor",
  svgContext: Hp,
  svgSprite: lG.join(`
`)
  // concatenate all symbols into $options.svgSprite
}, cG = ["innerHTML"];
function dG(t, e, r, n, a, i) {
  return q(), ie("svg", {
    width: "0",
    height: "0",
    style: { display: "none" },
    innerHTML: t.$options.svgSprite
  }, null, 8, cG);
}
const fG = /* @__PURE__ */ N_(uG, [["render", dG]]), vG = (t, e) => {
  let r, n, a, i, o, s;
  e.style.left = "", e.style.top = "", e.addEventListener(
    "mousedown",
    (l) => {
      l.preventDefault(), r = e.offsetLeft, n = e.offsetTop, a = l.clientX, i = l.clientY, e.addEventListener("mousemove", u, !1), document.addEventListener(
        "mouseup",
        () => {
          e.removeEventListener("mousemove", u, !1);
        },
        !1
      );
    },
    !1
  );
  function u(l) {
    l.preventDefault(), o = r - (a - l.clientX), s = n - (i - l.clientY), e.style.left = `${o}px`, e.style.top = `${s}px`;
  }
}, hG = {
  name: "DrawToolbar",
  components: {
    MapSvgIcon: nG,
    MapSvgSpriteColor: fG
  },
  props: {
    /**
     * Optional
     *
     * Associated with the Connection dialog.
     * This is needed to display the dialog and provides the additional drag capability to the dialog.
     *
     * e.g.
     * :mapCanvas="{
     *   containerHTML: appRef, // Reference to the map canvas container.
     *   class: '.maplibregl-canvas', // CSS selector for the map canvas.
     * }"
     */
    mapCanvas: {
      type: Object,
      default: void 0
    },
    /**
     * Array of toolbar options to display.
     * 'Connection' requires 'LineString' is included in the toolbar options.
     */
    toolbarOptions: {
      type: Array,
      default: [
        "Edit",
        "Delete",
        "Point",
        "LineString",
        "Polygon",
        "Connection"
      ]
    },
    /**
     * Optional
     *
     * To update the toolbar icons or filter the features based on the tool type.
     * e.g. "All tools", "Point", "LineString", "Polygon" or "None".
     */
    drawnType: {
      type: String,
      default: "All tools"
    },
    activeDrawTool: {
      required: !0
    },
    activeDrawMode: {
      required: !0
    },
    /**
     * Optional
     *
     * Associated with the Connection dialog.
     * This will popup a dialog if new feature is drawn and map canvas exists.
     */
    newlyDrawnEntry: {
      type: Object,
      default: {}
    },
    /**
     * Optional
     *
     * Associated with the Connection dialog.
     * This will add entries to the dialog.
     */
    connectionEntry: {
      type: Object,
      default: {}
    },
    /**
     * Add following to the top hoverVisibilities array to enable tooltips for each icon.
     * [
     *  { value: false, refs: 'toolbarPopover', ref: 'editPopover' },
     *  { value: false, refs: 'toolbarPopover', ref: 'deletePopover' },
     *  { value: false, refs: 'toolbarPopover', ref: 'pointPopover' },
     *  { value: false, refs: 'toolbarPopover', ref: 'lineStringPopover' },
     *  { value: false, refs: 'toolbarPopover', ref: 'polygonPopover' },
     *  { value: false, refs: 'toolbarPopover', ref: 'connectionPopover' },
     * ]
     */
    hoverVisibilities: {
      type: Array,
      required: !0,
      default: [
        { value: !1, ref: "editPopover" },
        { value: !1, ref: "deletePopover" },
        { value: !1, ref: "pointPopover" },
        { value: !1, ref: "lineStringPopover" },
        { value: !1, ref: "polygonPopover" },
        { value: !1, ref: "connectionPopover" }
      ]
    }
  },
  data: function() {
    return {
      toolbarIcons: [
        { name: "Edit", active: !1, disabled: !1, type: "mode" },
        { name: "Delete", active: !1, disabled: !1, type: "mode" },
        { name: "Point", active: !1, disabled: !1, type: "tool" },
        { name: "LineString", active: !1, disabled: !1, type: "tool" },
        { name: "Polygon", active: !1, disabled: !1, type: "tool" },
        { name: "Connection", active: !1, disabled: !0, type: "conn" }
      ],
      connectionDisplay: !1,
      dialogPosition: {
        offsetX: 0,
        offsetY: 0,
        x: void 0,
        y: void 0
      }
    };
  },
  computed: {
    showAllToolIcons: function() {
      return this.drawnType === "All tools" || this.drawnType === "None";
    },
    showEditModeIcon: function() {
      return this.toolbarOptions.includes("Edit");
    },
    showDeleteModeIcon: function() {
      return this.toolbarOptions.includes("Delete");
    },
    showDrawPointIcon: function() {
      return this.toolbarOptions.includes("Point") && (this.showAllToolIcons || this.drawnType === "Point");
    },
    showDrawLineStringIcon: function() {
      return this.toolbarOptions.includes("LineString") && (this.showAllToolIcons || this.drawnType === "LineString");
    },
    showDrawPolygonIcon: function() {
      return this.toolbarOptions.includes("Polygon") && (this.showAllToolIcons || this.drawnType === "Polygon");
    },
    showConnectionIcon: function() {
      return this.toolbarOptions.includes("Connection") && this.toolbarOptions.includes("LineString") && (this.showAllToolIcons || this.drawnType === "LineString");
    },
    inDrawing: function() {
      return this.activeDrawTool !== void 0;
    },
    newlyDrawnExist: function() {
      return Object.keys(this.newlyDrawnEntry).length > 0;
    },
    connectionExist: function() {
      return Object.keys(this.connectionEntry).length > 0;
    }
  },
  watch: {
    drawnType: function() {
      this.disabledToolbarConnectionIcon(!0);
    },
    activeDrawMode: function(t) {
      this.updateToolbarIcons(t, "mode"), t === "Delete" && (this.connectionDisplay = !1);
    },
    activeDrawTool: function(t) {
      this.updateToolbarIcons(t, "tool"), t || (this.connectionDisplay = !1);
    },
    newlyDrawnExist: function(t) {
      t && (this.connectionDisplay = !0);
    },
    connectionExist: function(t) {
      this.disabledToolbarConnectionIcon(!t), t || (this.connectionDisplay = !1);
    },
    connectionDisplay: function(t) {
      this.activeToolbarConnectionIcon(t), t ? this.dialogCssHacks() : this.$emit("featureTooltip", void 0);
    },
    dialogPosition: {
      handler: function() {
        const t = this.$el.getBoundingClientRect();
        this.dialogPosition.offsetX = t.x, this.dialogPosition.offsetY = t.y;
      },
      deep: !0,
      once: !0
    }
  },
  methods: {
    iconDisabled: function(t) {
      return this.toolbarIcons.filter((e) => e.name === t)[0].disabled;
    },
    modeClickEvent: function(t) {
      if (!this.iconDisabled(t)) {
        const e = this.activeDrawMode === t ? void 0 : t;
        this.$emit("clickToolbar", "mode", e);
      }
    },
    toolClickEvent: function(t) {
      if (!this.iconDisabled(t)) {
        const e = this.activeDrawTool === t ? void 0 : t;
        this.$emit("clickToolbar", "tool", e);
      }
    },
    connectionClickEvent: function() {
      !this.iconDisabled("Connection") && !this.newlyDrawnExist && (this.connectionDisplay = !this.connectionDisplay);
    },
    updateToolbarIcons: function(t, e) {
      this.toolbarIcons.map((r) => {
        r.name === t ? r.active = !0 : r.active = !1;
      }), this.toolbarIcons.filter((r) => r.type !== "conn").filter((r) => r.type !== e).map((r) => {
        t ? r.disabled = !0 : r.disabled = !1;
      }), this.toolbarCssHacks();
    },
    disabledToolbarConnectionIcon: function(t) {
      this.toolbarIcons.filter((e) => e.type === "conn").map((e) => {
        t ? e.disabled = !0 : e.disabled = !1, this.activeDrawMode === "Delete" && (e.disabled = !0);
      }), this.toolbarCssHacks();
    },
    activeToolbarConnectionIcon: function(t) {
      this.toolbarIcons.filter((e) => e.type === "conn").map((e) => {
        t ? e.active = !0 : e.active = !1;
      }), this.toolbarCssHacks();
    },
    toolbarCssHacks: function() {
      this.$nextTick(() => {
        this.toolbarIcons.map((t) => {
          const e = this.$el.querySelector(`.draw${t.name}`);
          e && (t.active ? e.classList.add("active") : e.classList.remove("active"), t.disabled ? e.classList.add("disabled") : e.classList.remove("disabled"));
        });
      });
    },
    dialogCssHacks: function() {
      this.$nextTick(() => {
        const t = this.$el.querySelector(".connection-dialog");
        vG(this.mapCanvas.containerHTML, t);
        let e, r;
        const n = this.mapCanvas.containerHTML.getBoundingClientRect(), a = t.getBoundingClientRect();
        this.dialogPosition.x > n.width / 2 ? e = this.dialogPosition.x - a.width : e = this.dialogPosition.x, this.dialogPosition.y > n.height / 2 ? r = this.dialogPosition.y - a.height : r = this.dialogPosition.y, t.style.transform = `translate(${e - this.dialogPosition.offsetX}px, ${r - this.dialogPosition.offsetY}px)`;
      });
    },
    hoverIndex: function(t) {
      return this.hoverVisibilities.findIndex((e) => e.ref === t);
    },
    showTooltip: function(t) {
      this.$emit("showTooltip", t);
    },
    hideTooltip: function(t) {
      this.$emit("hideTooltip", t);
    },
    dialogPopUpPositionHandler: function(t) {
      t.preventDefault(), this.dialogPosition.x = t.clientX, this.dialogPosition.y = t.clientY, this.activeDrawTool === "Point" && this.dialogCssHacks();
    }
  },
  mounted: function() {
    this.$nextTick(() => {
      this.toolbarCssHacks(), this.mapCanvas && this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).addEventListener("click", this.dialogPopUpPositionHandler, !1);
    });
  },
  destroyed: function() {
    this.mapCanvas && this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).removeEventListener("click", this.dialogPopUpPositionHandler, !1);
  }
}, pG = { class: "toolbar-container" }, gG = { class: "toolbar-icons" };
function yG(t, e, r, n, a, i) {
  const o = tr("map-svg-sprite-color"), s = tr("map-svg-icon"), u = Li, l = eG;
  return q(), ie("div", pG, [
    J(o),
    ae("div", gG, [
      i.showEditModeIcon ? (q(), me(u, {
        key: 0,
        content: "Edit Mode",
        placement: "top",
        teleported: !1,
        trigger: "manual",
        width: "100",
        "popper-class": "flatmap-popper",
        visible: r.hoverVisibilities[i.hoverIndex("editPopover")].value,
        ref: "editPopover"
      }, {
        reference: U(() => [
          J(s, {
            icon: "comment",
            class: "icon-button drawEdit",
            onClick: e[0] || (e[0] = (c) => i.modeClickEvent("Edit")),
            onMouseover: e[1] || (e[1] = (c) => i.showTooltip(i.hoverIndex("editPopover"))),
            onMouseout: e[2] || (e[2] = (c) => i.hideTooltip(i.hoverIndex("editPopover")))
          })
        ]),
        _: 1
      }, 8, ["visible"])) : pe("", !0),
      i.showDeleteModeIcon ? (q(), me(u, {
        key: 1,
        content: "Delete Mode",
        placement: "top",
        teleported: !1,
        trigger: "manual",
        width: "100",
        "popper-class": "flatmap-popper",
        visible: r.hoverVisibilities[i.hoverIndex("deletePopover")].value,
        ref: "deletePopover"
      }, {
        reference: U(() => [
          J(s, {
            icon: "drawTrash",
            class: "icon-button drawDelete",
            onClick: e[3] || (e[3] = (c) => i.modeClickEvent("Delete")),
            onMouseover: e[4] || (e[4] = (c) => i.showTooltip(i.hoverIndex("deletePopover"))),
            onMouseout: e[5] || (e[5] = (c) => i.hideTooltip(i.hoverIndex("deletePopover")))
          })
        ]),
        _: 1
      }, 8, ["visible"])) : pe("", !0),
      i.showDrawPointIcon ? (q(), me(u, {
        key: 2,
        content: "Draw Point",
        placement: "top",
        teleported: !1,
        trigger: "manual",
        width: "100",
        "popper-class": "flatmap-popper",
        visible: r.hoverVisibilities[i.hoverIndex("pointPopover")].value,
        ref: "pointPopover"
      }, {
        reference: U(() => [
          J(s, {
            icon: "drawPoint",
            class: "icon-button drawPoint",
            onClick: e[6] || (e[6] = (c) => i.toolClickEvent("Point")),
            onMouseover: e[7] || (e[7] = (c) => i.showTooltip(i.hoverIndex("pointPopover"))),
            onMouseout: e[8] || (e[8] = (c) => i.hideTooltip(i.hoverIndex("pointPopover")))
          })
        ]),
        _: 1
      }, 8, ["visible"])) : pe("", !0),
      i.showDrawLineStringIcon ? (q(), me(u, {
        key: 3,
        content: "Draw LineString",
        placement: "top",
        teleported: !1,
        trigger: "manual",
        width: "100",
        "popper-class": "flatmap-popper",
        visible: r.hoverVisibilities[i.hoverIndex("lineStringPopover")].value,
        ref: "drawLinePopover"
      }, {
        reference: U(() => [
          J(s, {
            icon: "drawLine",
            class: "icon-button drawLineString",
            onClick: e[9] || (e[9] = (c) => i.toolClickEvent("LineString")),
            onMouseover: e[10] || (e[10] = (c) => i.showTooltip(i.hoverIndex("lineStringPopover"))),
            onMouseout: e[11] || (e[11] = (c) => i.hideTooltip(i.hoverIndex("lineStringPopover")))
          })
        ]),
        _: 1
      }, 8, ["visible"])) : pe("", !0),
      i.showDrawPolygonIcon ? (q(), me(u, {
        key: 4,
        content: "Draw Polygon",
        placement: "top",
        teleported: !1,
        trigger: "manual",
        width: "100",
        "popper-class": "flatmap-popper",
        visible: r.hoverVisibilities[i.hoverIndex("polygonPopover")].value,
        ref: "polygonPopover"
      }, {
        reference: U(() => [
          J(s, {
            icon: "drawPolygon",
            class: "icon-button drawPolygon",
            onClick: e[12] || (e[12] = (c) => i.toolClickEvent("Polygon")),
            onMouseover: e[13] || (e[13] = (c) => i.showTooltip(i.hoverIndex("polygonPopover"))),
            onMouseout: e[14] || (e[14] = (c) => i.hideTooltip(i.hoverIndex("polygonPopover")))
          })
        ]),
        _: 1
      }, 8, ["visible"])) : pe("", !0),
      i.showConnectionIcon ? (q(), me(u, {
        key: 5,
        content: "Connectivity",
        placement: "top",
        teleported: !1,
        trigger: "manual",
        width: "100",
        "popper-class": "flatmap-popper",
        visible: r.hoverVisibilities[i.hoverIndex("connectionPopover")].value,
        ref: "connectionPopover"
      }, {
        reference: U(() => [
          J(s, {
            icon: "connection",
            class: "icon-button drawConnection",
            onClick: e[15] || (e[15] = (c) => i.connectionClickEvent()),
            onMouseover: e[16] || (e[16] = (c) => i.showTooltip(i.hoverIndex("connectionPopover"))),
            onMouseout: e[17] || (e[17] = (c) => i.hideTooltip(i.hoverIndex("connectionPopover")))
          })
        ]),
        _: 1
      }, 8, ["visible"])) : pe("", !0)
    ]),
    r.mapCanvas ? Ye((q(), me(l, {
      key: 0,
      class: "connection-dialog",
      connectionEntry: r.connectionEntry,
      inDrawing: i.inDrawing,
      connectionExist: i.connectionExist,
      onDialogDisplay: e[18] || (e[18] = (c) => i.connectionClickEvent()),
      onConfirmDrawn: e[19] || (e[19] = (c) => t.$emit("confirmDrawn", c)),
      onCancelDrawn: e[20] || (e[20] = (c) => t.$emit("cancelDrawn", c)),
      onFeatureTooltip: e[21] || (e[21] = (c) => t.$emit("featureTooltip", c))
    }, null, 8, ["connectionEntry", "inDrawing", "connectionExist"])), [
      [dt, t.connectionDisplay]
    ]) : pe("", !0)
  ]);
}
const $7 = /* @__PURE__ */ Er(hG, [["render", yG], ["__scopeId", "data-v-21e6f6bd"]]), mG = {
  name: "HelpModeDialog",
  props: {
    /**
     * MultiFlatmapRef from multiflatmapvuer. Provide this when using with MultiFlatmap.
     */
    multiflatmapRef: {
      type: Object,
      default: null
    },
    /**
     * FlatmapRef from flatmapvuer. Provide this when using with Flatmap.
     */
    flatmapRef: {
      type: Object,
      default: null
    },
    /**
     * ScaffoldRef from scaffoldvuer. Provide this when using with Scaffold.
     */
    scaffoldRef: {
      type: Object,
      default: null
    },
    /**
     * The flag for last tooltip item.
     */
    lastItem: {
      type: Boolean,
      default: !1,
      required: !1
    }
  },
  mounted: function() {
    this.toggleHelpModeHighlight(!0), this.toggleTooltipHighlight();
  },
  unmounted: function() {
    this.toggleHelpModeHighlight(!1);
  },
  watch: {
    lastItem: function(t) {
      t && this.toggleTooltipHighlight();
    }
  },
  methods: {
    /**
     * This function will be called on clicking Next button.
     *
     * @public
     */
    showNext: function() {
      this.$emit("show-next");
    },
    /**
     * This function will be called on clicking Finish button.
     *
     * @public
     */
    finishHelpMode: function() {
      this.$emit("finish-help-mode");
    },
    /**
     * This function must be called on 'shown-map-tooltip' event.
     *
     * @public
     */
    toggleTooltipPinHighlight: function() {
      const t = this.getCurrentFlatmap();
      this.resetHighlightedItems(), this.$nextTick(() => {
        var i;
        const e = t.querySelectorAll(".maplibregl-marker"), r = t.querySelector(
          ".flatmap-popup-popper"
        ), n = ((i = r == null ? void 0 : r.style) == null ? void 0 : i.transform) || "", a = this.extractMarkerPosition(n);
        e.forEach((o) => {
          const s = o.style.transform;
          this.extractMarkerPosition(s) === a && o.classList.add("in-help-highlight");
        });
      });
    },
    /**
     * This function must be called on 'shown-tooltip' event.
     *
     * @public
     */
    toggleTooltipHighlight: function() {
      this.resetHighlightedItems(), this.$nextTick(() => {
        document.querySelectorAll(
          '.el-popper:not([style*="none"])'
        ).forEach((e) => {
          const r = e.classList.contains("flatmap-popper"), n = e.classList.contains(
            "el-fade-in-linear-enter-active"
          );
          (r || n) && this.toggleHighlight(e);
        });
      });
    },
    toggleHighlight: function(t) {
      const e = (t == null ? void 0 : t.id) || "", r = document.querySelector(
        `[aria-describedby="${e}"]`
      );
      r && r.classList.add("in-help-highlight");
    },
    resetHighlightedItems: function() {
      document.querySelectorAll(".in-help-highlight").forEach((e) => {
        e.classList.remove("in-help-highlight");
      });
    },
    getCurrentScaffold: function() {
      var e;
      return ((e = this.scaffoldRef) == null ? void 0 : e.$el) || null;
    },
    getCurrentMultiflatmap: function() {
      var e;
      return ((e = this.multiflatmapRef) == null ? void 0 : e.$el) || null;
    },
    getCurrentFlatmap: function() {
      var r;
      const t = this.flatmapRef || ((r = this.multiflatmapRef) == null ? void 0 : r.getCurrentFlatmap());
      return (t == null ? void 0 : t.$el) || null;
    },
    toggleHelpModeHighlight: function(t) {
      const e = this.getCurrentMultiflatmap(), r = this.getCurrentFlatmap(), n = this.getCurrentScaffold(), a = document.querySelectorAll(".in-help-highlight");
      e && (t ? e.classList.add("in-help") : e.classList.remove("in-help")), r && (t ? r.classList.add("in-help") : r.classList.remove("in-help")), n && (t ? n.classList.add("in-help") : n.classList.remove("in-help")), t || a.forEach((i) => {
        i.classList.remove("in-help-highlight");
      });
    },
    /**
     * Temporary solution to find the position of map marker from popover
     */
    extractMarkerPosition: function(t) {
      const e = /translate\((.*?)\)/g, r = t.match(e);
      return r ? r[r.length - 1].slice(10, -1) : "";
    }
  }
}, hy = (t) => (Ba("data-v-3efb89fb"), t = t(), $a(), t), bG = /* @__PURE__ */ hy(() => /* @__PURE__ */ ae("h4", null, "Help Mode", -1)), wG = /* @__PURE__ */ hy(() => /* @__PURE__ */ ae("p", null, [
  /* @__PURE__ */ Be(" All caught up! "),
  /* @__PURE__ */ ae("br"),
  /* @__PURE__ */ Be(" Click 'Help' to restart. ")
], -1)), CG = /* @__PURE__ */ hy(() => /* @__PURE__ */ ae("p", null, 'Click "Next" to see the next item.', -1));
function xG(t, e, r, n, a, i) {
  const o = mr;
  return q(), ie("div", {
    class: le(["help-mode-dialog", { finish: r.lastItem }])
  }, [
    bG,
    r.lastItem ? (q(), ie(je, { key: 0 }, [
      wG,
      ae("div", null, [
        J(o, {
          class: "button",
          onClick: i.finishHelpMode
        }, {
          default: U(() => [
            Be(" Finish ")
          ]),
          _: 1
        }, 8, ["onClick"])
      ])
    ], 64)) : (q(), ie(je, { key: 1 }, [
      CG,
      ae("div", null, [
        J(o, {
          class: "button",
          onClick: i.showNext
        }, {
          default: U(() => [
            Be(" Next ")
          ]),
          _: 1
        }, 8, ["onClick"]),
        J(o, {
          class: "button secondary",
          onClick: i.finishHelpMode
        }, {
          default: U(() => [
            Be(" Exit Help Mode ")
          ]),
          _: 1
        }, 8, ["onClick"])
      ])
    ], 64))
  ], 2);
}
const q7 = /* @__PURE__ */ Er(mG, [["render", xG], ["__scopeId", "data-v-3efb89fb"]]), EG = {
  name: "RelatedConnectivitiesButton",
  props: {
    resource: {
      type: String,
      required: !0
    }
  }
}, SG = { class: "reference-button-container" };
function kG(t, e, r, n, a, i) {
  const o = mr;
  return q(), ie("div", SG, [
    J(o, {
      class: "reference-icon-button",
      size: "small",
      onClick: e[0] || (e[0] = (s) => t.$emit("show-related-connectivities", r.resource))
    }, {
      default: U(() => [
        Be(" Show related connectivities ")
      ]),
      _: 1
    })
  ]);
}
const bT = /* @__PURE__ */ Er(EG, [["render", kG], ["__scopeId", "data-v-2f3dd1db"]]), _G = "https://citation.doi.org", TG = [
  {
    label: "APA",
    value: "apa"
  },
  {
    label: "Chicago",
    value: "chicago-author-date"
  },
  {
    label: "IEEE",
    value: "ieee"
  },
  {
    label: "Bibtex",
    value: "bibtex"
  }
], sp = "apa", IG = 600, OG = {
  name: "ExternalResourceCard",
  components: {
    CopyToClipboard: Sg,
    RelatedConnectivitiesButton: bT
  },
  props: {
    resources: {
      type: Array,
      default: () => []
    }
  },
  data: function() {
    return {
      pubMedReferences: [],
      openLibReferences: [],
      isbnDBReferences: [],
      referecesListContent: "",
      citationOptions: TG,
      citationType: sp,
      crosscite_host: _G
    };
  },
  watch: {
    resources: function(t) {
      this.formatReferences([...t]), this.getCitationText(sp);
    }
  },
  computed: {
    referencesWithDOI: function() {
      return this.pubMedReferences.filter((e) => e.type === "doi" || e.doi).length;
    }
  },
  mounted: function() {
    this.formatReferences([...this.resources]), this.getCitationText(sp);
  },
  methods: {
    showRelatedConnectivities: function(t) {
      this.$emit("show-reference-connectivities", t);
      const e = {
        event: "interaction_event",
        event_name: "portal_maps_show_related_connectivities",
        category: t,
        location: "map_connectivity_references"
      };
      this.$emit("trackEvent", e);
    },
    formatReferences: function(t) {
      const e = this.extractNonPubMedReferences(t), r = t.filter((n) => !e.includes(n));
      this.pubMedReferences = r.map(
        (n) => typeof n == "object" ? this.extractPublicationIdFromURLString(n[0]) : this.extractPublicationIdFromURLString(n)
      ), this.pubMedReferences.forEach((n) => {
        if (n.type === "pmc") {
          const a = n.id;
          this.searchPMID(a).then((i) => {
            if (i && i.esearchresult) {
              const o = i.esearchresult.idlist || [];
              n.id = o[0], n.type = "pmid";
            }
          });
        }
      }), this.formatNonPubMedReferences(e).then((n) => {
        this.openLibReferences = n.filter((a) => a.type === "openlib"), this.isbnDBReferences = n.filter((a) => a.type === "isbndb"), this.formatOpenLibReferences();
      });
    },
    extractNonPubMedReferences: function(t) {
      const e = [], r = this.getPubMedDomains();
      return t.forEach((n) => {
        let a = 0;
        r.forEach((i) => {
          n.includes(i) && a++;
        }), a || e.push(n);
      }), e;
    },
    formatNonPubMedReferences: async function(t) {
      const e = [], r = t.filter((l) => l.indexOf("isbn") !== -1), n = r.map((l) => "ISBN:" + l.split("/").pop()), a = n.join(","), i = n.slice(), o = (l) => r.find((c) => c.includes(l)), s = `https://openlibrary.org/api/books?bibkeys=${a}&format=json`, u = await this.fetchData(s);
      for (const l in u) {
        const c = i.indexOf(l);
        i.splice(c, 1);
        const d = u[l].info_url, f = d.split("/"), h = f.indexOf("books"), v = f[h + 1], p = l.split(":")[1], g = o(p);
        e.push({
          id: p,
          type: "openlib",
          url: d,
          bookId: v,
          resource: g
        });
      }
      return i.forEach((l) => {
        const c = l.split(":")[1], d = `https://isbndb.com/book/${c}`, f = o(c);
        e.push({
          id: c,
          url: d,
          type: "isbndb",
          resource: f
        });
      }), e;
    },
    extractPublicationIdFromURLString: function(t) {
      if (!t) return;
      const e = decodeURIComponent(t);
      let r = { id: "", type: "", citation: {}, resource: t };
      return this.getPubMedDomains().forEach((a) => {
        const i = e.lastIndexOf(a);
        i !== -1 && (r.id = e.slice(i + a.length), a === "doi.org/" ? r.type = "doi" : a === "pmc/articles/" ? r.type = "pmc" : r.type = "pmid");
      }), r.id === "" && (t.includes("doi:") ? (r.id = this.stripPMIDPrefix(t), r.type = "doi") : t.includes("PMID:") && (r.id = this.stripPMIDPrefix(t), r.type = "pmid")), r.id.endsWith("/") && (r.id = r.id.slice(0, -1)), r;
    },
    getPubMedDomains: function() {
      return [
        "doi.org/",
        "nih.gov/pubmed/",
        "pmc/articles/",
        "pubmed.ncbi.nlm.nih.gov/"
      ];
    },
    stripPMIDPrefix: function(t) {
      return t.split(":")[1];
    },
    onCitationFormatChange: function(t) {
      this.citationType = t, this.getCitationText(t);
    },
    generateCitationText: function(t, e) {
      const { id: r, type: n, doi: a } = t;
      if (!(t.citation && t.citation[e]) && r)
        if (t.citation[e] = "", t.citation.error = null, n === "doi" || a) {
          const i = n === "doi" ? r : a;
          this.getCitationTextByDOI(i).then((o) => {
            const s = this.replaceLinkInText(o);
            t.citation[e] = s, this.updateCopyContents();
          }).catch((o) => {
            t.citation.error = {
              type: e,
              ref: "doi"
            };
          });
        } else n === "pmid" && this.getDOIFromPubMedID(r).then((i) => {
          if (i != null && i.result) {
            const o = i.result[r], u = ((o == null ? void 0 : o.articleids) || []).find((c) => c.idtype === "doi"), l = u == null ? void 0 : u.value;
            if (l)
              t.doi = l, this.getCitationTextByDOI(l).then((c) => {
                const d = this.replaceLinkInText(c);
                t.citation[e] = d, this.updateCopyContents();
              }).catch((c) => {
                t.citation.error = {
                  type: e,
                  ref: "doi"
                };
              });
            else {
              const { title: c, pubdate: d, authors: f } = o, h = f ? f.map((p) => p.name) : [], v = this.formatCopyReference({
                title: c || "",
                date: d || "",
                authors: h,
                url: `https://pubmed.ncbi.nlm.nih.gov/${r}`
              });
              t.citation[e] = v, this.updateCopyContents();
            }
          }
        }).catch((i) => {
          t.citation.error = {
            type: e,
            ref: "pubmed"
          };
        });
    },
    getCitationText: function(t) {
      async function e(r) {
        for (let n = 0; n < r.pubMedReferences.length; n++)
          r.generateCitationText(r.pubMedReferences[n], t), r.pubMedReferences.length > 3 && n < r.pubMedReferences.length - 1 && await SK(IG);
      }
      e(this);
    },
    reloadCitation: function(t) {
      this.generateCitationText(t, this.citationType);
    },
    isCitationLoading: function(t) {
      return t && !t[this.citationType] && !t.error;
    },
    isCitationError: function(t) {
      return t && t.error && t.error.type === this.citationType;
    },
    updateCopyContents: function() {
      const t = this.citationOptions.find((n) => n.value === this.citationType);
      let e = "";
      const r = [];
      if (this.referencesWithDOI && (e = t == null ? void 0 : t.label), this.pubMedReferences.forEach((n) => {
        r.push(n.citation[this.citationType]);
      }), this.openLibReferences.forEach((n) => {
        r.push(this.formatCopyReference(n));
      }), this.isbnDBReferences.forEach((n) => {
        r.push(n.url);
      }), r.length) {
        const a = `<ul>${r.map((o) => `<li>${o}</li>`).join(`
`)}</ul>`, i = "<div><strong>References</strong></div>";
        this.referecesListContent = i + `
` + a;
      }
      this.$emit("references-loaded", {
        style: e,
        list: r
      });
    },
    replaceLinkInText: function(t) {
      const e = "https://";
      let r = t.split(e)[1];
      if (r) {
        r = r.split(" ")[0], r = r.trim(), r.endsWith(".") && (r = r.substring(0, r.length - 1));
        const n = e + r, a = `<a href="${n}" target="_blank">${n}</a>`;
        return t.replace(n, a);
      }
      return t;
    },
    searchPMID: async function(t) {
      const e = `https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=${t}&format=json`;
      return await this.fetchData(e);
    },
    getCitationTextByDOI: async function(t) {
      const e = `${this.crosscite_host}/format?doi=${t}&style=${this.citationType}&lang=en-US`;
      return await this.fetchData(e, "text");
    },
    getDOIFromPubMedID: async function(t) {
      const e = `https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&id=${t}&format=json`;
      return await this.fetchData(e);
    },
    formatOpenLibReferences: function() {
      this.openLibReferences.forEach((t) => {
        const { bookId: e } = t;
        this.getBookData(e).then((r) => {
          const { title: n, authors: a, publish_date: i } = r;
          n && (t.title = n), i && (t.date = i), a && (t.authors = [], a.forEach((o) => {
            this.getBookAuthor(o.key).then((s) => {
              const { name: u } = s;
              u && (t.authors.push(u), this.updateCopyContents());
            });
          })), this.updateCopyContents();
        });
      });
    },
    getBookData: async function(t) {
      const e = `https://openlibrary.org/books/${t}.json`;
      return await this.fetchData(e);
    },
    getBookAuthor: async function(t) {
      const e = `https://openlibrary.org${t}.json`;
      return await this.fetchData(e);
    },
    formatCopyReference: function(t) {
      const e = [], { title: r, date: n, authors: a, url: i } = t;
      return r && e.push(r), n && e.push(`(${n})`), a && e.push(`- ${a.join(", ")}`), e.push(`<div><a href="${i}" target="_blank">${i}</a></div>`), e.join(" ");
    },
    fetchData: async function(t, e) {
      try {
        const r = await fetch(t);
        if (!r.ok)
          throw new Error(`Response status: ${r.status}`);
        return e === "text" ? await r.text() : await r.json();
      } catch (r) {
        throw new Error(r);
      }
    },
    onCopied: function(t, e) {
      let r = "Reference List", n = "", a = this.citationType;
      e ? (r = e.resource, n = e.type === "doi" ? e.id : "") : r = [
        ...this.pubMedReferences,
        ...this.openLibReferences,
        ...this.isbnDBReferences
      ].map((u) => u.type === "doi" ? u.id : u.resource).join(", ");
      const i = {
        event: "interaction_event",
        event_name: "portal_maps_copy_citation",
        category: r,
        doi: n,
        citation_type: a,
        location: "map_connectivity_references"
      };
      this.$emit("trackEvent", i);
    }
  }
}, Za = (t) => (Ba("data-v-e4259096"), t = t(), $a(), t), AG = { class: "resource-container" }, PG = { class: "attribute-title-container" }, DG = /* @__PURE__ */ Za(() => /* @__PURE__ */ ae("div", { class: "attribute-title" }, "References", -1)), RG = { class: "copy-button" }, LG = {
  key: 0,
  class: "citation-tabs"
}, FG = { class: "citation-list" }, MG = /* @__PURE__ */ Za(() => /* @__PURE__ */ ae("span", null, "Internal Server Error", -1)), NG = /* @__PURE__ */ Za(() => /* @__PURE__ */ ae("br", null, null, -1)), BG = /* @__PURE__ */ Za(() => /* @__PURE__ */ ae("br", null, null, -1)), $G = ["href"], qG = /* @__PURE__ */ Za(() => /* @__PURE__ */ ae("br", null, null, -1)), zG = /* @__PURE__ */ Za(() => /* @__PURE__ */ ae("span", null, "Sorry, something went wrong.", -1)), VG = /* @__PURE__ */ Za(() => /* @__PURE__ */ ae("br", null, null, -1)), HG = ["onClick"], KG = ["innerHTML"], GG = ["innerHTML"], UG = ["href"];
function WG(t, e, r, n, a, i) {
  const o = Sg, s = mr, u = bT;
  return q(), ie("div", AG, [
    ae("div", PG, [
      DG,
      ae("div", RG, [
        J(o, {
          onCopied: e[0] || (e[0] = (l) => i.onCopied(l, "")),
          label: "Copy list to clipboard",
          content: t.referecesListContent
        }, null, 8, ["content"])
      ])
    ]),
    i.referencesWithDOI ? (q(), ie("div", LG, [
      (q(!0), ie(je, null, Lt(t.citationOptions, (l) => (q(), me(s, {
        link: "",
        key: l.value,
        type: t.citationType === l.value ? "primary" : "",
        onClick: (c) => i.onCitationFormatChange(l.value)
      }, {
        default: U(() => [
          Be(ke(l.label), 1)
        ]),
        _: 2
      }, 1032, ["type", "onClick"]))), 128))
    ])) : pe("", !0),
    ae("ul", FG, [
      (q(!0), ie(je, null, Lt(t.pubMedReferences, (l) => {
        var c, d, f, h;
        return q(), ie("li", {
          key: l.id,
          class: le({
            loading: i.isCitationLoading(l.citation),
            error: i.isCitationError(l.citation)
          })
        }, [
          l.citation ? (q(), ie(je, { key: 0 }, [
            ((c = l.citation.error) == null ? void 0 : c.ref) === "doi" && ((d = l.citation.error) == null ? void 0 : d.type) === t.citationType ? (q(), ie(je, { key: 0 }, [
              MG,
              NG,
              Be(" Sorry, something went wrong."),
              BG,
              Be(" The dataset citation generator ("),
              ae("a", {
                href: t.crosscite_host,
                target: "_blank"
              }, ke(t.crosscite_host), 9, $G),
              Be(") encountered an internal error and was unable to complete your request."),
              qG,
              Be(" Please come back later. ")
            ], 64)) : ((f = l.citation.error) == null ? void 0 : f.ref) === "pubmed" && ((h = l.citation.error) == null ? void 0 : h.type) === t.citationType ? (q(), ie(je, { key: 1 }, [
              zG,
              VG,
              Be(" Please try again. "),
              ae("span", {
                class: "reload-button",
                onClick: (v) => i.reloadCitation(l)
              }, "Reload", 8, HG)
            ], 64)) : (q(), ie(je, { key: 2 }, [
              ae("span", {
                innerHTML: l.citation[t.citationType]
              }, null, 8, KG),
              J(u, {
                resource: l.resource,
                onShowRelatedConnectivities: i.showRelatedConnectivities
              }, null, 8, ["resource", "onShowRelatedConnectivities"]),
              J(o, {
                onCopied: (v) => i.onCopied(v, l),
                content: l.citation[t.citationType]
              }, null, 8, ["onCopied", "content"])
            ], 64))
          ], 64)) : pe("", !0)
        ], 2);
      }), 128)),
      (q(!0), ie(je, null, Lt(t.openLibReferences, (l) => (q(), ie("li", {
        key: l.id
      }, [
        ae("div", {
          innerHTML: i.formatCopyReference(l)
        }, null, 8, GG),
        J(u, {
          resource: l.resource,
          onShowRelatedConnectivities: i.showRelatedConnectivities
        }, null, 8, ["resource", "onShowRelatedConnectivities"]),
        J(o, {
          onCopied: (c) => i.onCopied(c, l),
          content: i.formatCopyReference(l)
        }, null, 8, ["onCopied", "content"])
      ]))), 128)),
      (q(!0), ie(je, null, Lt(t.isbnDBReferences, (l) => (q(), ie("li", {
        key: l.id
      }, [
        ae("a", {
          href: l.url,
          target: "_blank"
        }, ke(l.url), 9, UG),
        J(u, {
          resource: l.resource,
          onShowRelatedConnectivities: i.showRelatedConnectivities
        }, null, 8, ["resource", "onShowRelatedConnectivities"]),
        J(o, {
          onCopied: (c) => i.onCopied(c, l),
          content: l.url
        }, null, 8, ["onCopied", "content"])
      ]))), 128))
    ])
  ]);
}
const wT = /* @__PURE__ */ Er(OG, [["render", WG], ["__scopeId", "data-v-e4259096"]]);
function jG(t) {
  return { all: t = t || /* @__PURE__ */ new Map(), on: function(e, r) {
    var n = t.get(e);
    n ? n.push(r) : t.set(e, [r]);
  }, off: function(e, r) {
    var n = t.get(e);
    n && (r ? n.splice(n.indexOf(r) >>> 0, 1) : t.set(e, []));
  }, emit: function(e, r) {
    var n = t.get(e);
    n && n.slice().map(function(a) {
      a(r);
    }), (n = t.get("*")) && n.slice().map(function(a) {
      a(e, r);
    });
  } };
}
const CT = new jG(), YG = {
  name: "ProvenancePopup",
  components: {
    ElIconArrowUp: Up,
    ElIconArrowDown: Vo,
    ElIconWarning: bl,
    ConnectivityList: M_,
    ExternalResourceCard: wT
  },
  props: {
    tooltipEntry: {
      type: Array,
      default: []
    }
  },
  data: function() {
    return {
      loading: !1,
      showDetails: !1,
      originDescriptions: {
        motor: "is the location of the initial cell body of the circuit",
        sensory: "is the location of the initial cell body in the PNS circuit"
      },
      entryIndex: 0,
      availableAnatomyFacets: [],
      connectivityError: {}
    };
  },
  computed: {
    entry: function() {
      return this.tooltipEntry[this.entryIndex];
    },
    previousLabel: function() {
      var t;
      return this.entryIndex === 0 ? "This is the first item. Click 'Next' to see more information." : (t = this.tooltipEntry[this.entryIndex - 1]) == null ? void 0 : t.title;
    },
    nextLabel: function() {
      var t;
      return this.entryIndex === this.tooltipEntry.length - 1 ? "This is the last item. Click 'Previous' to see more information." : (t = this.tooltipEntry[this.entryIndex + 1]) == null ? void 0 : t.title;
    },
    provSpeciesDescription: function() {
      let t = "Studied in";
      return this.entry.provenanceTaxonomyLabel.forEach((e) => {
        t += ` ${e},`;
      }), t = t.slice(0, -1), t += " species", t;
    },
    origins: function() {
      return this.entry.origins;
    },
    components: function() {
      return this.entry.components;
    },
    destinations: function() {
      return this.entry.destinations;
    },
    originsWithDatasets: function() {
      return this.entry.originsWithDatasets;
    },
    componentsWithDatasets: function() {
      return this.entry.componentsWithDatasets;
    },
    destinationsWithDatasets: function() {
      return this.entry.destinationsWithDatasets;
    },
    resources: function() {
      return this.entry.hyperlinks || [];
    }
  },
  watch: {
    tooltipEntry: {
      deep: !0,
      immediate: !0,
      handler: function(t, e) {
        t !== e && (this.entryIndex = 0);
      }
    }
  },
  mounted: function() {
    this.loadAvailableAnatomyFacets();
  },
  methods: {
    previous: function() {
      this.entryIndex !== 0 && (this.entryIndex = this.entryIndex - 1);
    },
    next: function() {
      this.entryIndex !== this.tooltipEntry.length - 1 && (this.entryIndex = this.entryIndex + 1);
    },
    titleCase: function(t) {
      return EK(t);
    },
    capitalise: function(t) {
      return F_(t);
    },
    onConnectivityActionClick: function(t) {
      CT.emit("onActionClick", t);
    },
    // Load available anatomy facets from the local storage if available.
    // The data is from Algolia in Sidebar.
    loadAvailableAnatomyFacets: function() {
      const t = localStorage.getItem(
        "available-anatomy-facets"
      );
      t && (this.availableAnatomyFacets = JSON.parse(t));
    }
  }
}, ZG = (t) => (Ba("data-v-dc8d1ad3"), t = t(), $a(), t), XG = {
  key: 0,
  class: "main"
}, JG = {
  key: 0,
  class: "toggle-button"
}, QG = {
  key: 1,
  class: "block"
}, e7 = { class: "title" }, t7 = {
  key: 0,
  class: "subtitle"
}, r7 = {
  key: 2,
  class: "block"
}, n7 = { class: "title" }, a7 = {
  key: 3,
  class: "attribute-title-container"
}, i7 = /* @__PURE__ */ ZG(() => /* @__PURE__ */ ae("span", { class: "attribute-title" }, "Alert", -1)), o7 = { style: { "word-break": "keep-all" } }, s7 = { class: "content-container scrollbar" };
function l7(t, e, r, n, a, i) {
  const o = mr, s = Li, u = bl, l = Ft, c = Up, d = Vo, f = M_, h = wT, v = Eg;
  return i.entry ? Ye((q(), ie("div", XG, [
    r.tooltipEntry.length > 1 ? (q(), ie("div", JG, [
      J(s, {
        width: "auto",
        trigger: "hover",
        teleported: !1
      }, {
        reference: U(() => [
          J(o, {
            class: "button",
            onClick: i.previous,
            disabled: this.entryIndex === 0
          }, {
            default: U(() => [
              Be(" Previous ")
            ]),
            _: 1
          }, 8, ["onClick", "disabled"])
        ]),
        default: U(() => [
          ae("span", null, ke(i.previousLabel), 1)
        ]),
        _: 1
      }),
      J(s, {
        width: "auto",
        trigger: "hover",
        teleported: !1
      }, {
        reference: U(() => [
          J(o, {
            class: "button",
            onClick: i.next,
            disabled: this.entryIndex === this.tooltipEntry.length - 1
          }, {
            default: U(() => [
              Be(" Next ")
            ]),
            _: 1
          }, 8, ["onClick", "disabled"])
        ]),
        default: U(() => [
          ae("span", null, ke(i.nextLabel), 1)
        ]),
        _: 1
      })
    ])) : pe("", !0),
    i.entry.title ? (q(), ie("div", QG, [
      ae("div", e7, ke(i.capitalise(i.entry.title)), 1),
      i.entry.provenanceTaxonomyLabel && i.entry.provenanceTaxonomyLabel.length > 0 ? (q(), ie("div", t7, ke(i.provSpeciesDescription), 1)) : pe("", !0)
    ])) : (q(), ie("div", r7, [
      ae("div", n7, ke(i.entry.featureId), 1)
    ])),
    i.entry.featuresAlert ? (q(), ie("div", a7, [
      i7,
      J(s, {
        width: "250",
        trigger: "hover",
        teleported: !1,
        "popper-class": "popover-origin-help"
      }, {
        reference: U(() => [
          J(l, { class: "info" }, {
            default: U(() => [
              J(u)
            ]),
            _: 1
          })
        ]),
        default: U(() => [
          ae("span", o7, ke(i.entry.featuresAlert), 1)
        ]),
        _: 1
      })
    ])) : pe("", !0),
    Ye(ae("div", {
      class: "hide",
      id: "hide-path-info",
      onClick: e[0] || (e[0] = (p) => t.showDetails = !1)
    }, [
      Be(" Hide path information "),
      J(l, null, {
        default: U(() => [
          J(c)
        ]),
        _: 1
      })
    ], 512), [
      [dt, t.showDetails]
    ]),
    Ye(ae("div", {
      class: "hide",
      id: "show-path-info",
      onClick: e[1] || (e[1] = (p) => t.showDetails = !0)
    }, [
      Be(" Show path information "),
      J(l, null, {
        default: U(() => [
          J(d)
        ]),
        _: 1
      })
    ], 512), [
      [dt, !t.showDetails]
    ]),
    J(Ai, { name: "slide-fade" }, {
      default: U(() => [
        Ye(ae("div", s7, [
          (q(), me(f, {
            key: i.entry.featureId[0],
            entry: i.entry,
            origins: i.origins,
            components: i.components,
            destinations: i.destinations,
            originsWithDatasets: i.originsWithDatasets,
            componentsWithDatasets: i.componentsWithDatasets,
            destinationsWithDatasets: i.destinationsWithDatasets,
            availableAnatomyFacets: t.availableAnatomyFacets,
            connectivityError: t.connectivityError,
            onConnectivityActionClick: i.onConnectivityActionClick
          }, null, 8, ["entry", "origins", "components", "destinations", "originsWithDatasets", "componentsWithDatasets", "destinationsWithDatasets", "availableAnatomyFacets", "connectivityError", "onConnectivityActionClick"])),
          i.resources.length ? (q(), me(h, {
            key: 0,
            resources: i.resources
          }, null, 8, ["resources"])) : pe("", !0)
        ], 512), [
          [dt, t.showDetails]
        ])
      ]),
      _: 1
    })
  ])), [
    [v, t.loading]
  ]) : pe("", !0);
}
const u7 = /* @__PURE__ */ Er(YG, [["render", l7], ["__scopeId", "data-v-dc8d1ad3"]]), c7 = {
  name: "Tooltip",
  props: {
    tooltipEntry: {
      type: Array
    },
    annotationDisplay: {
      type: Boolean,
      default: !1
    },
    annotationEntry: {
      type: Array
    }
  },
  mounted: function() {
    CT.on("onActionClick", (t) => {
      this.$emit("onActionClick", t);
    });
  }
}, d7 = {
  class: "tooltip-container",
  id: "tooltip-container"
};
function f7(t, e, r, n, a, i) {
  const o = j5, s = u7;
  return q(), ie("div", d7, [
    r.annotationDisplay ? (q(), me(o, {
      key: 0,
      annotationEntry: r.annotationEntry,
      onAnnotation: e[0] || (e[0] = (u) => t.$emit("annotation", u))
    }, null, 8, ["annotationEntry"])) : (q(), me(s, {
      key: 1,
      tooltipEntry: r.tooltipEntry
    }, null, 8, ["tooltipEntry"]))
  ]);
}
const z7 = /* @__PURE__ */ Er(c7, [["render", f7], ["__scopeId", "data-v-d1e37cc2"]]), v7 = {
  name: "TreeControls",
  props: {
    /**
     * The type of map that the TreeControls is used. Either "flatmap" or "scaffold".
     */
    mapType: {
      type: String,
      required: !0
    },
    isReady: {
      type: Boolean,
      default: !0
    },
    /**
     * The title of the TreeControls.
     */
    title: {
      type: String
    },
    /**
     * The data of the tree.
     */
    treeData: {
      type: Array,
      default: function() {
        return [];
      }
    },
    showColourPicker: {
      type: Boolean,
      default: !1
    },
    /**
     * The active node of the tree.
     */
    active: {
      type: [String, Array],
      required: !0
    },
    /**
     * The hover node of the tree.
     */
    hover: {
      type: [String, Array],
      required: !0
    },
    enableFilter: {
      type: Boolean,
      default: !0
    }
  },
  data: function() {
    return {
      defaultExpandedKeys: ["All"],
      filterText: "",
      tooltipVisible: !1,
      tooltipLabel: "",
      tooltipAtBottom: !1
    };
  },
  computed: {
    isFlatmap: function() {
      return this.mapType === "flatmap";
    },
    isScaffold: function() {
      return this.mapType === "scaffold";
    },
    nodeKey: function() {
      if (this.isFlatmap)
        return "key";
      if (this.isScaffold)
        return "id";
    },
    expandedKeys: function() {
      if (this.isFlatmap)
        return this.defaultExpandedKeys;
      if (this.isScaffold)
        return [];
    }
  },
  watch: {
    filterText: {
      handler: function(t) {
        this.$refs.regionTree && this.$refs.regionTree.filter(t);
      }
    }
  },
  methods: {
    filterNode: function(t, e) {
      return t ? e.label ? e.label.toLowerCase().includes(t.toLowerCase()) : !1 : !0;
    },
    setColour: function(t, e) {
      this.$emit("setColour", t, e);
    },
    getBackgroundStyles: function(t) {
      return "colour" in t ? { background: t.colour } : {};
    },
    nodeIsActive: function(t) {
      return this.active === t.models;
    },
    nodeIsHover: function(t) {
      return this.hover === t.models;
    },
    changeActiveByNode: function(t, e = !1) {
      this.isFlatmap ? t.models && this.$emit("changeActive", t.models) : this.isScaffold && (t.isPrimitives || t.isRegion) && this.$emit("changeActive", t, e);
    },
    changeHoverByNode: function(t, e = !1) {
      this.isFlatmap ? t.models && this.$emit("changeHover", t.models) : this.isScaffold && t.isPrimitives && this.$emit("changeHover", t, e);
    },
    checkChanged: function(t, e) {
      if (this.isFlatmap) {
        const r = e.checkedKeys.includes(t.key);
        t.key === "All" ? this.$emit("checkAll", r) : this.$emit("checkChanged", { key: t.key, value: r });
      } else this.isScaffold && this.$emit("checkChanged", t, e);
    },
    displayTooltip: function(t, e, r) {
      const a = r.target.closest(".el-tree-node__content"), i = a.clientWidth, o = a.getBoundingClientRect().x, s = a.querySelector(".lastChildInItem");
      let u = 0;
      if (s) {
        const c = s.getBoundingClientRect();
        u = c.x + c.width - o;
      }
      const l = u > i;
      this.tooltipVisible = l && e, this.tooltipLabel = t, this.tooltipAtBottom = 0.5 > r.layerY / this.$refs.treeContainer.clientHeight;
    }
  },
  unmounted: function() {
    this.sortedPrimitiveGroups = void 0;
  },
  mounted: function() {
    this.$refs.regionTree && this.$refs.regionTree.filter(this.filterText);
  }
}, h7 = { class: "selections-container" }, p7 = { class: "title-text" }, g7 = {
  class: "tree-container",
  ref: "treeContainer"
}, y7 = { class: "tooltip-text" }, m7 = ["onClick", "onMouseover", "onMouseenter"], b7 = ["onClick", "onMouseover", "onMouseenter"], w7 = { class: "lastChildInItem" }, C7 = {
  key: 0,
  class: "node-options"
};
function x7(t, e, r, n, a, i) {
  const o = Qo, s = Xo, u = Dl, l = Li, c = pN, d = b5, f = Eg;
  return q(), ie("div", h7, [
    r.title ? (q(), me(u, { key: 0 }, {
      default: U(() => [
        J(o, { span: 12 }, {
          default: U(() => [
            ae("div", p7, ke(r.title), 1)
          ]),
          _: 1
        }),
        r.enableFilter ? (q(), me(o, {
          key: 0,
          span: 12
        }, {
          default: U(() => [
            ae("div", null, [
              J(s, {
                class: "tree-filter-input",
                modelValue: t.filterText,
                "onUpdate:modelValue": e[0] || (e[0] = (h) => t.filterText = h),
                placeholder: "Filter " + r.title
              }, null, 8, ["modelValue", "placeholder"])
            ])
          ]),
          _: 1
        })) : pe("", !0)
      ]),
      _: 1
    })) : pe("", !0),
    ae("div", g7, [
      ae("div", {
        class: le(["tree-tooltip", t.tooltipAtBottom ? "bottom" : ""])
      }, [
        J(l, {
          ref: "tooltip",
          visible: t.tooltipVisible && t.tooltipLabel !== "",
          placement: "top",
          "show-arrow": !1,
          teleported: !1,
          trigger: "manual",
          "popper-class": "tree-tooltip-popper",
          "virtual-triggering": "",
          width: 260
        }, {
          default: U(() => [
            ae("div", y7, ke(t.tooltipLabel), 1)
          ]),
          _: 1
        }, 8, ["visible"])
      ], 2),
      Ye((q(), me(d, {
        ref: "regionTree",
        "element-loading-background": "rgba(0, 0, 0, 0.3)",
        "show-checkbox": "",
        "node-key": i.nodeKey,
        data: r.treeData,
        "check-strictly": !1,
        "expand-on-click-node": !1,
        "render-after-expand": !1,
        "default-expanded-keys": i.expandedKeys,
        onCheck: i.checkChanged,
        indent: 8,
        "filter-node-method": i.filterNode,
        class: le([r.mapType === "flatmap" ? "hide_grandchildren_checkbox" : ""])
      }, {
        default: U(({ node: h, data: v }) => [
          r.mapType === "flatmap" ? (q(), ie("span", {
            key: 0,
            class: le(["region-tree-node", {
              activeItem: i.nodeIsActive(v),
              hoverItem: i.nodeIsHover(v)
            }]),
            onClick: (p) => i.changeActiveByNode(v),
            onMouseover: (p) => i.changeHoverByNode(v, !1),
            onMouseenter: (p) => i.displayTooltip(h.label, !0, p),
            onMouseleave: e[1] || (e[1] = (p) => i.displayTooltip("", !1, p))
          }, [
            ae("div", {
              style: st(i.getBackgroundStyles(v)),
              class: "lastChildInItem"
            }, ke(h.label), 5)
          ], 42, m7)) : r.mapType === "scaffold" ? (q(), ie("span", {
            key: 1,
            class: le(["region-tree-node", {
              activeItem: r.active.includes(v.id),
              hoverItem: r.hover.includes(v.id)
            }]),
            onClick: (p) => i.changeActiveByNode(v, !0),
            onMouseover: (p) => i.changeHoverByNode(v, !0, p),
            onMouseenter: (p) => i.displayTooltip(h.label, !0, p),
            onMouseleave: e[2] || (e[2] = (p) => i.displayTooltip("", !1, p))
          }, [
            v.isPrimitives ? (q(), me(c, {
              key: 0,
              class: le({ "show-picker": r.showColourPicker }),
              modelValue: v.activeColour,
              "onUpdate:modelValue": (p) => v.activeColour = p,
              size: "small",
              onChange: (p) => i.setColour(v, p)
            }, null, 8, ["class", "modelValue", "onUpdate:modelValue", "onChange"])) : pe("", !0),
            ae("div", w7, [
              ae("span", null, ke(h.label), 1),
              v.isTextureSlides ? (q(), ie("span", C7, " (Texture) ")) : pe("", !0)
            ])
          ], 42, b7)) : pe("", !0)
        ]),
        _: 1
      }, 8, ["node-key", "data", "default-expanded-keys", "onCheck", "filter-node-method", "class"])), [
        [f, !r.isReady]
      ])
    ], 512)
  ]);
}
const V7 = /* @__PURE__ */ Er(v7, [["render", x7], ["__scopeId", "data-v-e1dbd1e9"]]);
async function E7(t, e) {
  try {
    const r = await fetch(t, {
      method: "POST",
      headers: {
        "Content-Type": "application/json"
      },
      body: JSON.stringify(e)
    });
    if (!r.ok)
      throw new Error(`API Error: ${r.status} ${r.statusText}`);
    return await r.json();
  } catch (r) {
    throw console.error("Request failed:", r), r;
  }
}
async function Na(t) {
  const { flatmapAPI: e, knowledgeSource: r, queryId: n, parameters: a, orderId: i } = t, o = `${e}competency/query`, s = Array.isArray(a) ? [...a] : [];
  s.push({
    column: "source_id",
    value: r
  });
  let u;
  if (typeof n == "number")
    u = n.toString();
  else if (typeof n == "string")
    u = n;
  else
    throw new TypeError("queryId must be a string or a number convertible to string.");
  const l = {
    query_id: u,
    parameters: s
  };
  return i && (l.order = [i]), E7(o, l);
}
async function H7(t, e, r) {
  var h, v;
  const n = Array.isArray(r) ? r : [r], a = n[0].startsWith("ilxtr:"), i = a ? 23 : 1, o = a ? "path_id" : "feature_id", s = a ? n : [], u = await Na({
    flatmapAPI: t,
    knowledgeSource: e,
    queryId: i,
    parameters: [
      {
        column: o,
        value: n
      }
    ]
  }), l = ((v = (h = u == null ? void 0 : u.results) == null ? void 0 : h.values) == null ? void 0 : v.map((p) => p[1])) || [], c = [.../* @__PURE__ */ new Set([...s, ...l])];
  let d = [];
  return c.length && (d = await xT(t, e, c)), [.../* @__PURE__ */ new Set([...c, ...d])];
}
async function K7(t, e, r) {
  var a;
  const n = await Na({
    flatmapAPI: t,
    knowledgeSource: e,
    queryId: 1,
    // TODO: to update to a specific query ID for origins
    parameters: [
      {
        column: "feature_id",
        value: r
      }
    ]
  });
  if ((a = n == null ? void 0 : n.results) != null && a.values) {
    const i = n.results.values.map((o) => o[1]);
    return [...new Set(i)];
  }
  return [];
}
async function G7(t, e, r) {
  var a;
  const n = await Na({
    flatmapAPI: t,
    knowledgeSource: e,
    queryId: 1,
    // TODO: to update to a specific query ID for via
    parameters: [
      {
        column: "feature_id",
        value: r
      }
    ]
  });
  if ((a = n == null ? void 0 : n.results) != null && a.values) {
    const i = n.results.values.map((o) => o[1]);
    return [...new Set(i)];
  }
  return [];
}
async function U7(t, e, r) {
  var a;
  const n = await Na({
    flatmapAPI: t,
    knowledgeSource: e,
    queryId: 2,
    parameters: [
      {
        column: "feature_id",
        value: r
      }
    ]
  });
  if ((a = n == null ? void 0 : n.results) != null && a.values) {
    const i = n.results.values.map((o) => o[1]);
    return [...new Set(i)];
  }
  return [];
}
function lp(t) {
  const e = [];
  for (const r of t) {
    const n = JSON.parse(r);
    Array.isArray(n) && n.length >= 2 && Array.isArray(n[1]) && n[1].length === 0 && e.push(n[0]);
  }
  return e;
}
async function xT(t, e, r) {
  var a;
  const n = await Na({
    flatmapAPI: t,
    knowledgeSource: e,
    queryId: 26,
    parameters: [
      {
        column: "path_id",
        value: r
      }
    ]
  });
  if ((a = n == null ? void 0 : n.results) != null && a.values) {
    const i = n.results.values.map((o) => o[2]);
    return [...new Set(i)];
  }
  return [];
}
async function W7({ flatmapAPI: t, knowledgeSource: e, origins: r, destinations: n, vias: a }) {
  var b, w, x, E;
  const i = lp(r), o = lp(n), s = lp(a), u = [
    {
      column: "source_feature_id",
      value: i
    },
    {
      column: "via_feature_id",
      value: s
    },
    {
      column: "dest_feature_id",
      value: o
    }
  ], l = [
    {
      column: "source_node_id",
      value: r
    },
    {
      column: "via_node_id",
      value: a
    },
    {
      column: "dest_node_id",
      value: n
    }
  ], c = u.some((C) => Array.isArray(C.value) && C.value.length > 0), d = [
    Na({
      flatmapAPI: t,
      knowledgeSource: e,
      queryId: 24,
      parameters: l
    })
  ];
  c && d.push(
    Na({
      flatmapAPI: t,
      knowledgeSource: e,
      queryId: 25,
      parameters: u
    })
  );
  const f = await Promise.all(d);
  let h = [], v;
  if (c) {
    const C = f[0];
    v = f[1], h = ((w = (b = C == null ? void 0 : C.results) == null ? void 0 : b.values) == null ? void 0 : w.map((k) => k[1])) || [];
  } else
    v = f[0];
  const p = ((E = (x = v == null ? void 0 : v.results) == null ? void 0 : x.values) == null ? void 0 : E.map((C) => C[1])) || [], g = [.../* @__PURE__ */ new Set([...h, ...p])];
  let y = [];
  return g.length && (y = await xT(t, e, g)), [.../* @__PURE__ */ new Set([...g, ...y])];
}
const up = [];
async function S7(t, e) {
  const r = e.filter(
    (i) => up.some((o) => o.taxon === i)
  ), n = up.filter(
    (i) => r.includes(i.taxon)
  ), a = e.filter(
    (i) => !r.includes(i)
  );
  if (a.length) {
    const i = await t.queryLabels(a);
    if (i.length)
      return i.forEach((o) => {
        let { entity: s, label: u } = o;
        u === "Mammalia" && (u = "Mammalia not otherwise specified");
        const l = { taxon: s, label: u };
        n.push(l), up.push(l);
      }), n;
  } else
    return n;
}
async function k7(t, e, r) {
  const n = `${t}knowledge/query/`, a = { sql: e, params: r };
  try {
    const i = await fetch(n, {
      method: "POST",
      headers: {
        Accept: "application/json; charset=utf-8",
        "Content-Type": "application/json"
      },
      body: JSON.stringify(a)
    });
    if (!i.ok)
      throw new Error(`Cannot access ${n}`);
    return await i.json();
  } catch {
    return {
      values: []
    };
  }
}
async function _7(t, e) {
  return e.length ? await (await k7(
    t,
    `select entity, knowledge from knowledge
      where entity in (?${", ?".repeat(e.length - 1)})
      order by source desc`,
    [...e]
  )).values : [];
}
function j7(t) {
  var r;
  const e = (r = t["node-phenotypes"]) == null ? void 0 : r["ilxtr:hasSomaLocatedIn"];
  return Array.isArray(t.connectivity) && t.connectivity.length > 0 && Array.isArray(e) && e.length > 0;
}
function Y7(t) {
  var a, i;
  const e = (a = t["node-phenotypes"]) == null ? void 0 : a["ilxtr:hasAxonPresynapticElementIn"], r = (i = t["node-phenotypes"]) == null ? void 0 : i["ilxtr:hasAxonSensorySubcellularElementIn"], n = Array.isArray(e) && e.length > 0 || Array.isArray(r) && r.length > 0;
  return Array.isArray(t.connectivity) && t.connectivity.length > 0 && n;
}
function Z7(t) {
  var n, a, i;
  if (!Array.isArray(t.connectivity) || t.connectivity.length === 0) return !1;
  const e = new Set(
    (((n = t["node-phenotypes"]) == null ? void 0 : n["ilxtr:hasSomaLocatedIn"]) || []).map((o) => o[0])
  ), r = /* @__PURE__ */ new Set([
    ...(((a = t["node-phenotypes"]) == null ? void 0 : a["ilxtr:hasAxonPresynapticElementIn"]) || []).map((o) => o[0]),
    ...(((i = t["node-phenotypes"]) == null ? void 0 : i["ilxtr:hasAxonSensorySubcellularElementIn"]) || []).map((o) => o[0])
  ]);
  return t.connectivity.some((o) => {
    const [s, u] = o, l = s[0], c = u[0];
    return !e.has(l) && !r.has(c);
  });
}
function py(t) {
  if (!Array.isArray(t.connectivity)) return [];
  const e = /* @__PURE__ */ new Set();
  return t.connectivity.forEach((r) => {
    Array.isArray(r) && r.length && r.forEach((n) => {
      if (Array.isArray(n) && typeof n[0] == "string") {
        const a = JSON.stringify(n);
        e.add(a);
      }
    });
  }), Array.from(e);
}
function cn(t, e) {
  var n;
  const r = (n = t["node-phenotypes"]) == null ? void 0 : n[e];
  return Array.isArray(r) ? r : [];
}
async function gy(t, e, r) {
  const n = Array.from(
    new Map(r.map((d) => [JSON.stringify(d), d])).values()
  ), a = n.flat(1 / 0), i = [...new Set(a)], s = (await _7(t, i)).reduce((d, f) => {
    const h = f[0], v = JSON.parse(f[1]);
    return d.push({ id: h, label: v.label, source: v.source }), d;
  }, []);
  s.sort((d, f) => d.id === f.id ? d.source === e && f.source !== e ? -1 : d.source !== e && f.source === e ? 1 : 0 : d.id.localeCompare(f.id));
  const u = [];
  return [...n.map((d) => {
    const f = d.flat(), h = [];
    for (let v = 0; v < f.length; v++) {
      const p = s.find((g) => g.id === f[v]);
      p && (h.push(p.label), v > 0 && u.push({
        key: [f[v], []],
        label: p.label
      }));
    }
    return {
      key: d,
      label: h.join(", ")
    };
  }), ...u].filter(
    (d, f, h) => f === h.findIndex((v) => v.label === d.label)
  );
}
async function T7(t, e, r) {
  const n = [];
  return r.forEach((a) => {
    if (!Array.isArray(a.connectivity) || a.connectivity.length === 0) return;
    const i = new Set(py(a));
    cn(a, "ilxtr:hasSomaLocatedIn").forEach((o) => {
      const s = JSON.stringify(o);
      i.has(s) && n.push(o);
    });
  }), await gy(t, e, n);
}
async function I7(t, e, r) {
  const n = [];
  return r.forEach((a) => {
    if (!Array.isArray(a.connectivity) || a.connectivity.length === 0) return;
    const i = new Set(py(a));
    [
      ...cn(a, "ilxtr:hasAxonPresynapticElementIn"),
      ...cn(a, "ilxtr:hasAxonSensorySubcellularElementIn")
    ].forEach((o) => {
      const s = JSON.stringify(o);
      i.has(s) && n.push(o);
    });
  }), await gy(t, e, n);
}
async function O7(t, e, r) {
  const n = [];
  return r.forEach((a) => {
    if (!Array.isArray(a.connectivity) || a.connectivity.length === 0) return;
    const i = new Set(py(a));
    [
      ...cn(a, "ilxtr:hasAxonLeadingToSensorySubcellularElementIn"),
      ...cn(a, "ilxtr:hasAxonLocatedIn")
    ].forEach((o) => {
      const s = JSON.stringify(o);
      i.has(s) && n.push(o);
    });
  }), await gy(t, e, n);
}
function A7(t, e) {
  return t.filter((r) => !Array.isArray(r.connectivity) || r.connectivity.length === 0 ? !1 : cn(r, "ilxtr:hasSomaLocatedIn").some((a) => e.map((i) => JSON.stringify(i)).includes(JSON.stringify(a))));
}
function P7(t, e) {
  return t.filter((r) => !Array.isArray(r.connectivity) || r.connectivity.length === 0 ? !1 : [
    ...cn(r, "ilxtr:hasAxonPresynapticElementIn"),
    ...cn(r, "ilxtr:hasAxonSensorySubcellularElementIn")
  ].some((a) => e.map((i) => JSON.stringify(i)).includes(JSON.stringify(a))));
}
function D7(t, e) {
  return t.filter((r) => !Array.isArray(r.connectivity) || r.connectivity.length === 0 ? !1 : [
    ...cn(r, "ilxtr:hasAxonLeadingToSensorySubcellularElementIn"),
    ...cn(r, "ilxtr:hasAxonLocatedIn")
  ].some((a) => e.map((i) => JSON.stringify(i)).includes(JSON.stringify(a))));
}
async function X7({ knowledge: t, origins: e, destinations: r, vias: n }) {
  let a = t;
  return e.length && (a = A7(a, e)), r.length && (a = P7(a, r)), n.length && (a = D7(a, n)), a;
}
async function J7(t, e, r, n) {
  let a = [];
  const i = [];
  if (e) {
    if (e && typeof e.featureFilterRanges == "function") {
      const h = e.featureFilterRanges();
      for (const [v, p] of Object.entries(h)) {
        let g = {
          key: `flatmap.connectivity.${v}`,
          label: "",
          children: []
        }, y = [];
        if (v === "kind") {
          g.label = "Pathways";
          for (const m of p) {
            const b = n.find((w) => w.type === m);
            b && y.push({
              key: `${g.key}.${m}`,
              label: b.label,
              colour: b.colour,
              colourStyle: "line",
              dashed: b.dashed
            });
          }
        } else if (v === "taxons") {
          g.label = "Studied in";
          const m = await S7(e, e.taxonIdentifiers);
          if (m.length)
            for (const b of p) {
              const w = m.find((x) => x.taxon === b);
              w && y.push({
                key: `${g.key}.${b}`,
                // space added at the end of label to make sure the display name will not be updated
                // prevent sidebar searchfilter convertReadableLabel
                label: `${w.label} `
              });
            }
        } else if (v === "alert") {
          g.label = "Alert";
          for (const m of ["with", "without"])
            y.push({
              key: `${g.key}.${m}`,
              label: `${m} alerts`
            });
        }
        g.children = y.sort((m, b) => m.label.localeCompare(b.label)), g.label && g.children.length && a.push(g);
      }
    }
    const o = e.pathways.paths, s = [];
    for (const h of r) {
      const v = h.id;
      if (v) {
        const p = o[v];
        if (p && p.connectivity && p["node-phenotypes"]) {
          const g = p.connectivity, y = p["node-phenotypes"], m = {};
          for (let b in h["node-phenotypes"])
            y[b] && (m[b] = [...y[b]]);
          s.push({
            ...h,
            connectivity: [...g],
            "node-phenotypes": m
          });
        }
      }
    }
    const u = e.knowledgeSource, l = await T7(t, u, s), c = await O7(t, u, s), d = await I7(t, u, s), f = (h, v) => {
      const p = JSON.stringify(v.key);
      return {
        key: `flatmap.connectivity.source.${h}.${p}`,
        label: v.label || p
      };
    };
    for (const h of ["origin", "via", "destination", "all"]) {
      let v = [];
      if (h === "origin")
        v = l.map((p) => f(h, p));
      else if (h === "via")
        v = c.map((p) => f(h, p));
      else if (h === "destination")
        v = d.map((p) => f(h, p));
      else {
        const p = [
          ...l.map((y) => f(h, y)),
          ...c.map((y) => f(h, y)),
          ...d.map((y) => f(h, y))
        ], g = /* @__PURE__ */ new Set();
        v = p.filter((y) => g.has(y.key) ? !1 : (g.add(y.key), !0));
      }
      v = v.sort((p, g) => {
        const y = (w) => /^[a-zA-Z]/.test(w), m = y(p.label), b = y(g.label);
        return m && !b ? -1 : !m && b ? 1 : p.label.localeCompare(g.label);
      }), v.length && i.push({
        key: `flatmap.connectivity.source.${h}`,
        label: h,
        children: v
      });
    }
    i.length && a.push(...i);
  }
  return a;
}
export {
  j5 as AnnotationPopup,
  B7 as ConnectivityGraph,
  M_ as ConnectivityList,
  Sg as CopyToClipboard,
  M7 as CreateTooltipContent,
  $7 as DrawToolbar,
  wT as ExternalResourceCard,
  q7 as HelpModeDialog,
  z7 as Tooltip,
  V7 as TreeControls,
  Na as competencyQuery,
  I7 as extractDestinationItems,
  T7 as extractOriginItems,
  O7 as extractViaItems,
  _7 as fetchLabels,
  Y7 as filterDestinations,
  j7 as filterOrigins,
  Z7 as filterViaLocations,
  P7 as findPathsByDestinationItem,
  A7 as findPathsByOriginItem,
  D7 as findPathsByViaItem,
  J7 as getFlatmapFilterOptions,
  H7 as queryAllConnectedPaths,
  xT as queryForwardBackwardConnections,
  U7 as queryPathsByDestination,
  K7 as queryPathsByOrigin,
  W7 as queryPathsByRoute,
  X7 as queryPathsByRouteFromKnowledge,
  G7 as queryPathsByViaLocation
};
