import { Comment, Fragment, Teleport, Text, Transition, cloneVNode, computed, createApp, createBaseVNode, createBlock, createCommentVNode, createElementBlock, createStaticVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, getCurrentScope, h, inject, isRef, mergeProps, nextTick, normalizeClass, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onDeactivated, onMounted, onScopeDispose, onUnmounted, onUpdated, openBlock, popScopeId, provide, pushScopeId, reactive, readonly, ref, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, shallowRef, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, unref, useAttrs, useSlots, vModelCheckbox, vModelText, vShow, warn, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "./chunk-6UGCK2MK.js"; import "./chunk-DC5AMYBS.js"; // node_modules/@abi-software/map-utilities/dist/map-utilities.js var p0 = Object.defineProperty; var g0 = (t13, e, r) => e in t13 ? p0(t13, e, { enumerable: true, configurable: true, writable: true, value: r }) : t13[e] = r; var Ir = (t13, e, r) => g0(t13, typeof e != "symbol" ? e + "" : e, r); var cn = (t13, e, { checkForDefaultPrevented: r = true } = {}) => (a) => { const i = t13 == null ? void 0 : t13(a); if (r === false || !i) return e == null ? void 0 : e(a); }; var Ac; var _t = typeof window < "u"; var M0 = (t13) => typeof t13 == "string"; var wv = () => { }; var Gl = _t && ((Ac = window == null ? void 0 : window.navigator) == null ? void 0 : Ac.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent); function Cv(t13) { return typeof t13 == "function" ? t13() : unref(t13); } function B0(t13) { return t13; } function Rs(t13) { return getCurrentScope() ? (onScopeDispose(t13), true) : false; } function N0(t13, e = true) { getCurrentInstance() ? onMounted(t13) : e ? t13() : nextTick(t13); } function vn(t13) { var e; const r = Cv(t13); return (e = r == null ? void 0 : r.$el) != null ? e : r; } var zs = _t ? window : void 0; function kr(...t13) { let e, r, n, a; if (M0(t13[0]) || Array.isArray(t13[0]) ? ([r, n, a] = t13, e = zs) : [e, r, n, a] = t13, !e) return wv; Array.isArray(r) || (r = [r]), Array.isArray(n) || (n = [n]); const i = [], o = () => { i.forEach((c) => c()), i.length = 0; }, s = (c, d, v, h6) => (c.addEventListener(d, v, h6), () => c.removeEventListener(d, v, h6)), u = watch(() => [vn(e), Cv(a)], ([c, d]) => { o(), c && i.push(...r.flatMap((v) => n.map((h6) => s(c, v, h6, d)))); }, { immediate: true, flush: "post" }), l = () => { u(), o(); }; return Rs(l), l; } var Mc = false; function $0(t13, e, r = {}) { const { window: n = zs, ignore: a = [], capture: i = true, detectIframe: o = false } = r; if (!n) return; Gl && !Mc && (Mc = true, Array.from(n.document.body.children).forEach((v) => v.addEventListener("click", wv))); let s = true; const u = (v) => a.some((h6) => { if (typeof h6 == "string") return Array.from(n.document.querySelectorAll(h6)).some((f) => f === v.target || v.composedPath().includes(f)); { const f = vn(h6); return f && (v.target === f || v.composedPath().includes(f)); } }), c = [ kr(n, "click", (v) => { const h6 = vn(t13); if (!(!h6 || h6 === v.target || v.composedPath().includes(h6))) { if (v.detail === 0 && (s = !u(v)), !s) { s = true; return; } e(v); } }, { passive: true, capture: i }), kr(n, "pointerdown", (v) => { const h6 = vn(t13); h6 && (s = !v.composedPath().includes(h6) && !u(v)); }, { passive: true }), o && kr(n, "blur", (v) => { var h6; const f = vn(t13); ((h6 = n.document.activeElement) == null ? void 0 : h6.tagName) === "IFRAME" && !(f != null && f.contains(n.document.activeElement)) && e(v); }) ].filter(Boolean); return () => c.forEach((v) => v()); } function xv(t13, e = false) { const r = ref(), n = () => r.value = !!t13(); return n(), N0(n, e), r; } var Bc = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; var Nc = "__vueuse_ssr_handlers__"; Bc[Nc] = Bc[Nc] || {}; var $c = Object.getOwnPropertySymbols; var R0 = Object.prototype.hasOwnProperty; var z0 = Object.prototype.propertyIsEnumerable; var V0 = (t13, e) => { var r = {}; for (var n in t13) R0.call(t13, n) && e.indexOf(n) < 0 && (r[n] = t13[n]); if (t13 != null && $c) for (var n of $c(t13)) e.indexOf(n) < 0 && z0.call(t13, n) && (r[n] = t13[n]); return r; }; function dn(t13, e, r = {}) { const n = r, { window: a = zs } = n, i = V0(n, ["window"]); let o; const s = xv(() => a && "ResizeObserver" in a), u = () => { o && (o.disconnect(), o = void 0); }, l = watch(() => vn(t13), (d) => { u(), s.value && a && d && (o = new ResizeObserver(e), o.observe(d, i)); }, { immediate: true, flush: "post" }), c = () => { u(), l(); }; return Rs(c), { isSupported: s, stop: c }; } var Rc = Object.getOwnPropertySymbols; var H0 = Object.prototype.hasOwnProperty; var q0 = Object.prototype.propertyIsEnumerable; var K0 = (t13, e) => { var r = {}; for (var n in t13) H0.call(t13, n) && e.indexOf(n) < 0 && (r[n] = t13[n]); if (t13 != null && Rc) for (var n of Rc(t13)) e.indexOf(n) < 0 && q0.call(t13, n) && (r[n] = t13[n]); return r; }; function U0(t13, e, r = {}) { const n = r, { window: a = zs } = n, i = K0(n, ["window"]); let o; const s = xv(() => a && "MutationObserver" in a), u = () => { o && (o.disconnect(), o = void 0); }, l = watch(() => vn(t13), (d) => { u(), s.value && a && d && (o = new MutationObserver(e), o.observe(d, i)); }, { immediate: true }), c = () => { u(), l(); }; return Rs(c), { isSupported: s, stop: c }; } var zc; (function(t13) { t13.UP = "UP", t13.RIGHT = "RIGHT", t13.DOWN = "DOWN", t13.LEFT = "LEFT", t13.NONE = "NONE"; })(zc || (zc = {})); var G0 = Object.defineProperty; var Vc = Object.getOwnPropertySymbols; var W0 = Object.prototype.hasOwnProperty; var Y0 = Object.prototype.propertyIsEnumerable; var Hc = (t13, e, r) => e in t13 ? G0(t13, e, { enumerable: true, configurable: true, writable: true, value: r }) : t13[e] = r; var Z0 = (t13, e) => { for (var r in e || (e = {})) W0.call(e, r) && Hc(t13, r, e[r]); if (Vc) for (var r of Vc(e)) Y0.call(e, r) && Hc(t13, r, e[r]); return t13; }; var X0 = { 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] }; Z0({ linear: B0 }, X0); var j0 = () => _t && /firefox/i.test(window.navigator.userAgent); var Tu = (t13) => { let e, r; return t13.type === "touchend" ? (r = t13.changedTouches[0].clientY, e = t13.changedTouches[0].clientX) : t13.type.startsWith("touch") ? (r = t13.touches[0].clientY, e = t13.touches[0].clientX) : (r = t13.clientY, e = t13.clientX), { clientX: e, clientY: r }; }; Object.freeze({}); Object.freeze([]); var Wi = () => { }; var Q0 = Object.prototype.hasOwnProperty; var va = (t13, e) => Q0.call(t13, e); var fr = Array.isArray; var lr = (t13) => typeof t13 == "function"; var tr = (t13) => typeof t13 == "string"; var Ht = (t13) => t13 !== null && typeof t13 == "object"; var J0 = Object.prototype.toString; var em = (t13) => J0.call(t13); var bl = (t13) => em(t13).slice(8, -1); var Ev = (t13) => { const e = /* @__PURE__ */ Object.create(null); return (r) => e[r] || (e[r] = t13(r)); }; var tm = /-(\w)/g; var rm = Ev((t13) => t13.replace(tm, (e, r) => r ? r.toUpperCase() : "")); var nm = /\B([A-Z])/g; var am = Ev( (t13) => t13.replace(nm, "-$1").toLowerCase() ); var kv = typeof global == "object" && global && global.Object === Object && global; var im = typeof self == "object" && self && self.Object === Object && self; var nn = kv || im || Function("return this")(); var en = nn.Symbol; var Sv = Object.prototype; var om = Sv.hasOwnProperty; var sm = Sv.toString; var Si = en ? en.toStringTag : void 0; function lm(t13) { var e = om.call(t13, Si), r = t13[Si]; try { t13[Si] = void 0; var n = true; } catch { } var a = sm.call(t13); return n && (e ? t13[Si] = r : delete t13[Si]), a; } var um = Object.prototype; var cm = um.toString; function dm(t13) { return cm.call(t13); } var fm = "[object Null]"; var vm = "[object Undefined]"; var qc = en ? en.toStringTag : void 0; function ci(t13) { return t13 == null ? t13 === void 0 ? vm : fm : qc && qc in Object(t13) ? lm(t13) : dm(t13); } function ja(t13) { return t13 != null && typeof t13 == "object"; } var hm = "[object Symbol]"; function Vs(t13) { return typeof t13 == "symbol" || ja(t13) && ci(t13) == hm; } function pm(t13, e) { for (var r = -1, n = t13 == null ? 0 : t13.length, a = Array(n); ++r < n; ) a[r] = e(t13[r], r, t13); return a; } var Vr = Array.isArray; var gm = 1 / 0; var Kc = en ? en.prototype : void 0; var Uc = Kc ? Kc.toString : void 0; function Tv(t13) { if (typeof t13 == "string") return t13; if (Vr(t13)) return pm(t13, Tv) + ""; if (Vs(t13)) return Uc ? Uc.call(t13) : ""; var e = t13 + ""; return e == "0" && 1 / t13 == -gm ? "-0" : e; } var mm = /\s/; function ym(t13) { for (var e = t13.length; e-- && mm.test(t13.charAt(e)); ) ; return e; } var bm = /^\s+/; function wm(t13) { return t13 && t13.slice(0, ym(t13) + 1).replace(bm, ""); } function Vn(t13) { var e = typeof t13; return t13 != null && (e == "object" || e == "function"); } var Gc = NaN; var Cm = /^[-+]0x[0-9a-f]+$/i; var xm = /^0b[01]+$/i; var Em = /^0o[0-7]+$/i; var km = parseInt; function Wc(t13) { if (typeof t13 == "number") return t13; if (Vs(t13)) return Gc; if (Vn(t13)) { var e = typeof t13.valueOf == "function" ? t13.valueOf() : t13; t13 = Vn(e) ? e + "" : e; } if (typeof t13 != "string") return t13 === 0 ? t13 : +t13; t13 = wm(t13); var r = xm.test(t13); return r || Em.test(t13) ? km(t13.slice(2), r ? 2 : 8) : Cm.test(t13) ? Gc : +t13; } function _v(t13) { return t13; } var Sm = "[object AsyncFunction]"; var Tm = "[object Function]"; var _m = "[object GeneratorFunction]"; var Dm = "[object Proxy]"; function Dv(t13) { if (!Vn(t13)) return false; var e = ci(t13); return e == Tm || e == _m || e == Sm || e == Dm; } var wl = nn["__core-js_shared__"]; var Yc = function() { var t13 = /[^.]+$/.exec(wl && wl.keys && wl.keys.IE_PROTO || ""); return t13 ? "Symbol(src)_1." + t13 : ""; }(); function Pm(t13) { return !!Yc && Yc in t13; } var Om = Function.prototype; var Lm = Om.toString; function ka(t13) { if (t13 != null) { try { return Lm.call(t13); } catch { } try { return t13 + ""; } catch { } } return ""; } var Im = /[\\^$.*+?()[\]{}|]/g; var Fm = /^\[object .+?Constructor\]$/; var Am = Function.prototype; var Mm = Object.prototype; var Bm = Am.toString; var Nm = Mm.hasOwnProperty; var $m = RegExp( "^" + Bm.call(Nm).replace(Im, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function Rm(t13) { if (!Vn(t13) || Pm(t13)) return false; var e = Dv(t13) ? $m : Fm; return e.test(ka(t13)); } function zm(t13, e) { return t13 == null ? void 0 : t13[e]; } function Sa(t13, e) { var r = zm(t13, e); return Rm(r) ? r : void 0; } var Wl = Sa(nn, "WeakMap"); function Vm(t13, e, r) { switch (r.length) { case 0: return t13.call(e); case 1: return t13.call(e, r[0]); case 2: return t13.call(e, r[0], r[1]); case 3: return t13.call(e, r[0], r[1], r[2]); } return t13.apply(e, r); } var Hm = 800; var qm = 16; var Km = Date.now; function Um(t13) { var e = 0, r = 0; return function() { var n = Km(), a = qm - (n - r); if (r = n, a > 0) { if (++e >= Hm) return arguments[0]; } else e = 0; return t13.apply(void 0, arguments); }; } function Gm(t13) { return function() { return t13; }; } var ws = function() { try { var t13 = Sa(Object, "defineProperty"); return t13({}, "", {}), t13; } catch { } }(); var Wm = ws ? function(t13, e) { return ws(t13, "toString", { configurable: true, enumerable: false, value: Gm(e), writable: true }); } : _v; var Ym = Um(Wm); function Zm(t13, e, r, n) { t13.length; for (var a = r + 1; a--; ) if (e(t13[a], a, t13)) return a; return -1; } var Xm = 9007199254740991; var jm = /^(?:0|[1-9]\d*)$/; function _u(t13, e) { var r = typeof t13; return e = e ?? Xm, !!e && (r == "number" || r != "symbol" && jm.test(t13)) && t13 > -1 && t13 % 1 == 0 && t13 < e; } function Qm(t13, e, r) { e == "__proto__" && ws ? ws(t13, e, { configurable: true, enumerable: true, value: r, writable: true }) : t13[e] = r; } function Du(t13, e) { return t13 === e || t13 !== t13 && e !== e; } var Jm = Object.prototype; var ey = Jm.hasOwnProperty; function ty(t13, e, r) { var n = t13[e]; (!(ey.call(t13, e) && Du(n, r)) || r === void 0 && !(e in t13)) && Qm(t13, e, r); } var Zc = Math.max; function ry(t13, e, r) { return e = Zc(e === void 0 ? t13.length - 1 : e, 0), function() { for (var n = arguments, a = -1, i = Zc(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), Vm(t13, this, s); }; } var ny = 9007199254740991; function Pu(t13) { return typeof t13 == "number" && t13 > -1 && t13 % 1 == 0 && t13 <= ny; } function ay(t13) { return t13 != null && Pu(t13.length) && !Dv(t13); } var iy = Object.prototype; function oy(t13) { var e = t13 && t13.constructor, r = typeof e == "function" && e.prototype || iy; return t13 === r; } function sy(t13, e) { for (var r = -1, n = Array(t13); ++r < t13; ) n[r] = e(r); return n; } var ly = "[object Arguments]"; function Xc(t13) { return ja(t13) && ci(t13) == ly; } var Pv = Object.prototype; var uy = Pv.hasOwnProperty; var cy = Pv.propertyIsEnumerable; var Ou = Xc(/* @__PURE__ */ function() { return arguments; }()) ? Xc : function(t13) { return ja(t13) && uy.call(t13, "callee") && !cy.call(t13, "callee"); }; function dy() { return false; } var Ov = typeof exports == "object" && exports && !exports.nodeType && exports; var jc = Ov && typeof module == "object" && module && !module.nodeType && module; var fy = jc && jc.exports === Ov; var Qc = fy ? nn.Buffer : void 0; var vy = Qc ? Qc.isBuffer : void 0; var Yl = vy || dy; var hy = "[object Arguments]"; var py = "[object Array]"; var gy = "[object Boolean]"; var my = "[object Date]"; var yy = "[object Error]"; var by = "[object Function]"; var wy = "[object Map]"; var Cy = "[object Number]"; var xy = "[object Object]"; var Ey = "[object RegExp]"; var ky = "[object Set]"; var Sy = "[object String]"; var Ty = "[object WeakMap]"; var _y = "[object ArrayBuffer]"; var Dy = "[object DataView]"; var Py = "[object Float32Array]"; var Oy = "[object Float64Array]"; var Ly = "[object Int8Array]"; var Iy = "[object Int16Array]"; var Fy = "[object Int32Array]"; var Ay = "[object Uint8Array]"; var My = "[object Uint8ClampedArray]"; var By = "[object Uint16Array]"; var Ny = "[object Uint32Array]"; var ft = {}; ft[Py] = ft[Oy] = ft[Ly] = ft[Iy] = ft[Fy] = ft[Ay] = ft[My] = ft[By] = ft[Ny] = true; ft[hy] = ft[py] = ft[_y] = ft[gy] = ft[Dy] = ft[my] = ft[yy] = ft[by] = ft[wy] = ft[Cy] = ft[xy] = ft[Ey] = ft[ky] = ft[Sy] = ft[Ty] = false; function $y(t13) { return ja(t13) && Pu(t13.length) && !!ft[ci(t13)]; } function Ry(t13) { return function(e) { return t13(e); }; } var Lv = typeof exports == "object" && exports && !exports.nodeType && exports; var zi = Lv && typeof module == "object" && module && !module.nodeType && module; var zy = zi && zi.exports === Lv; var Cl = zy && kv.process; var Jc = function() { try { var t13 = zi && zi.require && zi.require("util").types; return t13 || Cl && Cl.binding && Cl.binding("util"); } catch { } }(); var ed = Jc && Jc.isTypedArray; var Iv = ed ? Ry(ed) : $y; var Vy = Object.prototype; var Hy = Vy.hasOwnProperty; function qy(t13, e) { var r = Vr(t13), n = !r && Ou(t13), a = !r && !n && Yl(t13), i = !r && !n && !a && Iv(t13), o = r || n || a || i, s = o ? sy(t13.length, String) : [], u = s.length; for (var l in t13) Hy.call(t13, 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. _u(l, u))) && s.push(l); return s; } function Ky(t13, e) { return function(r) { return t13(e(r)); }; } var Uy = Ky(Object.keys, Object); var Gy = Object.prototype; var Wy = Gy.hasOwnProperty; function Yy(t13) { if (!oy(t13)) return Uy(t13); var e = []; for (var r in Object(t13)) Wy.call(t13, r) && r != "constructor" && e.push(r); return e; } function Fv(t13) { return ay(t13) ? qy(t13) : Yy(t13); } var Zy = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; var Xy = /^\w*$/; function Lu(t13, e) { if (Vr(t13)) return false; var r = typeof t13; return r == "number" || r == "symbol" || r == "boolean" || t13 == null || Vs(t13) ? true : Xy.test(t13) || !Zy.test(t13) || e != null && t13 in Object(e); } var Yi = Sa(Object, "create"); function jy() { this.__data__ = Yi ? Yi(null) : {}, this.size = 0; } function Qy(t13) { var e = this.has(t13) && delete this.__data__[t13]; return this.size -= e ? 1 : 0, e; } var Jy = "__lodash_hash_undefined__"; var e1 = Object.prototype; var t1 = e1.hasOwnProperty; function r1(t13) { var e = this.__data__; if (Yi) { var r = e[t13]; return r === Jy ? void 0 : r; } return t1.call(e, t13) ? e[t13] : void 0; } var n1 = Object.prototype; var a1 = n1.hasOwnProperty; function i1(t13) { var e = this.__data__; return Yi ? e[t13] !== void 0 : a1.call(e, t13); } var o1 = "__lodash_hash_undefined__"; function s1(t13, e) { var r = this.__data__; return this.size += this.has(t13) ? 0 : 1, r[t13] = Yi && e === void 0 ? o1 : e, this; } function ha(t13) { var e = -1, r = t13 == null ? 0 : t13.length; for (this.clear(); ++e < r; ) { var n = t13[e]; this.set(n[0], n[1]); } } ha.prototype.clear = jy; ha.prototype.delete = Qy; ha.prototype.get = r1; ha.prototype.has = i1; ha.prototype.set = s1; function l1() { this.__data__ = [], this.size = 0; } function Hs(t13, e) { for (var r = t13.length; r--; ) if (Du(t13[r][0], e)) return r; return -1; } var u1 = Array.prototype; var c1 = u1.splice; function d1(t13) { var e = this.__data__, r = Hs(e, t13); if (r < 0) return false; var n = e.length - 1; return r == n ? e.pop() : c1.call(e, r, 1), --this.size, true; } function f1(t13) { var e = this.__data__, r = Hs(e, t13); return r < 0 ? void 0 : e[r][1]; } function v1(t13) { return Hs(this.__data__, t13) > -1; } function h1(t13, e) { var r = this.__data__, n = Hs(r, t13); return n < 0 ? (++this.size, r.push([t13, e])) : r[n][1] = e, this; } function bn(t13) { var e = -1, r = t13 == null ? 0 : t13.length; for (this.clear(); ++e < r; ) { var n = t13[e]; this.set(n[0], n[1]); } } bn.prototype.clear = l1; bn.prototype.delete = d1; bn.prototype.get = f1; bn.prototype.has = v1; bn.prototype.set = h1; var Zi = Sa(nn, "Map"); function p1() { this.size = 0, this.__data__ = { hash: new ha(), map: new (Zi || bn)(), string: new ha() }; } function g1(t13) { var e = typeof t13; return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t13 !== "__proto__" : t13 === null; } function qs(t13, e) { var r = t13.__data__; return g1(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map; } function m1(t13) { var e = qs(this, t13).delete(t13); return this.size -= e ? 1 : 0, e; } function y1(t13) { return qs(this, t13).get(t13); } function b1(t13) { return qs(this, t13).has(t13); } function w1(t13, e) { var r = qs(this, t13), n = r.size; return r.set(t13, e), this.size += r.size == n ? 0 : 1, this; } function wn(t13) { var e = -1, r = t13 == null ? 0 : t13.length; for (this.clear(); ++e < r; ) { var n = t13[e]; this.set(n[0], n[1]); } } wn.prototype.clear = p1; wn.prototype.delete = m1; wn.prototype.get = y1; wn.prototype.has = b1; wn.prototype.set = w1; var C1 = "Expected a function"; function Iu(t13, e) { if (typeof t13 != "function" || e != null && typeof e != "function") throw new TypeError(C1); 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 = t13.apply(this, n); return r.cache = i.set(a, o) || i, o; }; return r.cache = new (Iu.Cache || wn)(), r; } Iu.Cache = wn; var x1 = 500; function E1(t13) { var e = Iu(t13, function(n) { return r.size === x1 && r.clear(), n; }), r = e.cache; return e; } var k1 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; var S1 = /\\(\\)?/g; var T1 = E1(function(t13) { var e = []; return t13.charCodeAt(0) === 46 && e.push(""), t13.replace(k1, function(r, n, a, i) { e.push(a ? i.replace(S1, "$1") : n || r); }), e; }); function _1(t13) { return t13 == null ? "" : Tv(t13); } function Ks(t13, e) { return Vr(t13) ? t13 : Lu(t13, e) ? [t13] : T1(_1(t13)); } var D1 = 1 / 0; function mo(t13) { if (typeof t13 == "string" || Vs(t13)) return t13; var e = t13 + ""; return e == "0" && 1 / t13 == -D1 ? "-0" : e; } function Fu(t13, e) { e = Ks(e, t13); for (var r = 0, n = e.length; t13 != null && r < n; ) t13 = t13[mo(e[r++])]; return r && r == n ? t13 : void 0; } function fn(t13, e, r) { var n = t13 == null ? void 0 : Fu(t13, e); return n === void 0 ? r : n; } function Av(t13, e) { for (var r = -1, n = e.length, a = t13.length; ++r < n; ) t13[a + r] = e[r]; return t13; } var td = en ? en.isConcatSpreadable : void 0; function P1(t13) { return Vr(t13) || Ou(t13) || !!(td && t13 && t13[td]); } function O1(t13, e, r, n, a) { var i = -1, o = t13.length; for (r || (r = P1), a || (a = []); ++i < o; ) { var s = t13[i]; r(s) ? Av(a, s) : a[a.length] = s; } return a; } function L1(t13) { var e = t13 == null ? 0 : t13.length; return e ? O1(t13) : []; } function I1(t13) { return Ym(ry(t13, void 0, L1), t13 + ""); } function Fn() { if (!arguments.length) return []; var t13 = arguments[0]; return Vr(t13) ? t13 : [t13]; } function F1() { this.__data__ = new bn(), this.size = 0; } function A1(t13) { var e = this.__data__, r = e.delete(t13); return this.size = e.size, r; } function M1(t13) { return this.__data__.get(t13); } function B1(t13) { return this.__data__.has(t13); } var N1 = 200; function $1(t13, e) { var r = this.__data__; if (r instanceof bn) { var n = r.__data__; if (!Zi || n.length < N1 - 1) return n.push([t13, e]), this.size = ++r.size, this; r = this.__data__ = new wn(n); } return r.set(t13, e), this.size = r.size, this; } function hn(t13) { var e = this.__data__ = new bn(t13); this.size = e.size; } hn.prototype.clear = F1; hn.prototype.delete = A1; hn.prototype.get = M1; hn.prototype.has = B1; hn.prototype.set = $1; function R1(t13, e) { for (var r = -1, n = t13 == null ? 0 : t13.length, a = 0, i = []; ++r < n; ) { var o = t13[r]; e(o, r, t13) && (i[a++] = o); } return i; } function z1() { return []; } var V1 = Object.prototype; var H1 = V1.propertyIsEnumerable; var rd = Object.getOwnPropertySymbols; var q1 = rd ? function(t13) { return t13 == null ? [] : (t13 = Object(t13), R1(rd(t13), function(e) { return H1.call(t13, e); })); } : z1; function K1(t13, e, r) { var n = e(t13); return Vr(t13) ? n : Av(n, r(t13)); } function nd(t13) { return K1(t13, Fv, q1); } var Zl = Sa(nn, "DataView"); var Xl = Sa(nn, "Promise"); var jl = Sa(nn, "Set"); var ad = "[object Map]"; var U1 = "[object Object]"; var id = "[object Promise]"; var od = "[object Set]"; var sd = "[object WeakMap]"; var ld = "[object DataView]"; var G1 = ka(Zl); var W1 = ka(Zi); var Y1 = ka(Xl); var Z1 = ka(jl); var X1 = ka(Wl); var In = ci; (Zl && In(new Zl(new ArrayBuffer(1))) != ld || Zi && In(new Zi()) != ad || Xl && In(Xl.resolve()) != id || jl && In(new jl()) != od || Wl && In(new Wl()) != sd) && (In = function(t13) { var e = ci(t13), r = e == U1 ? t13.constructor : void 0, n = r ? ka(r) : ""; if (n) switch (n) { case G1: return ld; case W1: return ad; case Y1: return id; case Z1: return od; case X1: return sd; } return e; }); var ud = nn.Uint8Array; var j1 = "__lodash_hash_undefined__"; function Q1(t13) { return this.__data__.set(t13, j1), this; } function J1(t13) { return this.__data__.has(t13); } function Cs(t13) { var e = -1, r = t13 == null ? 0 : t13.length; for (this.__data__ = new wn(); ++e < r; ) this.add(t13[e]); } Cs.prototype.add = Cs.prototype.push = Q1; Cs.prototype.has = J1; function eb(t13, e) { for (var r = -1, n = t13 == null ? 0 : t13.length; ++r < n; ) if (e(t13[r], r, t13)) return true; return false; } function tb(t13, e) { return t13.has(e); } var rb = 1; var nb = 2; function Mv(t13, e, r, n, a, i) { var o = r & rb, s = t13.length, u = e.length; if (s != u && !(o && u > s)) return false; var l = i.get(t13), c = i.get(e); if (l && c) return l == e && c == t13; var d = -1, v = true, h6 = r & nb ? new Cs() : void 0; for (i.set(t13, e), i.set(e, t13); ++d < s; ) { var f = t13[d], p = e[d]; if (n) var m = o ? n(p, f, d, e, t13, i) : n(f, p, d, t13, e, i); if (m !== void 0) { if (m) continue; v = false; break; } if (h6) { if (!eb(e, function(g, y) { if (!tb(h6, y) && (f === g || a(f, g, r, n, i))) return h6.push(y); })) { v = false; break; } } else if (!(f === p || a(f, p, r, n, i))) { v = false; break; } } return i.delete(t13), i.delete(e), v; } function ab(t13) { var e = -1, r = Array(t13.size); return t13.forEach(function(n, a) { r[++e] = [a, n]; }), r; } function ib(t13) { var e = -1, r = Array(t13.size); return t13.forEach(function(n) { r[++e] = n; }), r; } var ob = 1; var sb = 2; var lb = "[object Boolean]"; var ub = "[object Date]"; var cb = "[object Error]"; var db = "[object Map]"; var fb = "[object Number]"; var vb = "[object RegExp]"; var hb = "[object Set]"; var pb = "[object String]"; var gb = "[object Symbol]"; var mb = "[object ArrayBuffer]"; var yb = "[object DataView]"; var cd = en ? en.prototype : void 0; var xl = cd ? cd.valueOf : void 0; function bb(t13, e, r, n, a, i, o) { switch (r) { case yb: if (t13.byteLength != e.byteLength || t13.byteOffset != e.byteOffset) return false; t13 = t13.buffer, e = e.buffer; case mb: return !(t13.byteLength != e.byteLength || !i(new ud(t13), new ud(e))); case lb: case ub: case fb: return Du(+t13, +e); case cb: return t13.name == e.name && t13.message == e.message; case vb: case pb: return t13 == e + ""; case db: var s = ab; case hb: var u = n & ob; if (s || (s = ib), t13.size != e.size && !u) return false; var l = o.get(t13); if (l) return l == e; n |= sb, o.set(t13, e); var c = Mv(s(t13), s(e), n, a, i, o); return o.delete(t13), c; case gb: if (xl) return xl.call(t13) == xl.call(e); } return false; } var wb = 1; var Cb = Object.prototype; var xb = Cb.hasOwnProperty; function Eb(t13, e, r, n, a, i) { var o = r & wb, s = nd(t13), u = s.length, l = nd(e), c = l.length; if (u != c && !o) return false; for (var d = u; d--; ) { var v = s[d]; if (!(o ? v in e : xb.call(e, v))) return false; } var h6 = i.get(t13), f = i.get(e); if (h6 && f) return h6 == e && f == t13; var p = true; i.set(t13, e), i.set(e, t13); for (var m = o; ++d < u; ) { v = s[d]; var g = t13[v], y = e[v]; if (n) var b = o ? n(y, g, v, e, t13, i) : n(g, y, v, t13, e, i); if (!(b === void 0 ? g === y || a(g, y, r, n, i) : b)) { p = false; break; } m || (m = v == "constructor"); } if (p && !m) { var w = t13.constructor, x = e.constructor; w != x && "constructor" in t13 && "constructor" in e && !(typeof w == "function" && w instanceof w && typeof x == "function" && x instanceof x) && (p = false); } return i.delete(t13), i.delete(e), p; } var kb = 1; var dd = "[object Arguments]"; var fd = "[object Array]"; var No = "[object Object]"; var Sb = Object.prototype; var vd = Sb.hasOwnProperty; function Tb(t13, e, r, n, a, i) { var o = Vr(t13), s = Vr(e), u = o ? fd : In(t13), l = s ? fd : In(e); u = u == dd ? No : u, l = l == dd ? No : l; var c = u == No, d = l == No, v = u == l; if (v && Yl(t13)) { if (!Yl(e)) return false; o = true, c = false; } if (v && !c) return i || (i = new hn()), o || Iv(t13) ? Mv(t13, e, r, n, a, i) : bb(t13, e, u, r, n, a, i); if (!(r & kb)) { var h6 = c && vd.call(t13, "__wrapped__"), f = d && vd.call(e, "__wrapped__"); if (h6 || f) { var p = h6 ? t13.value() : t13, m = f ? e.value() : e; return i || (i = new hn()), a(p, m, r, n, i); } } return v ? (i || (i = new hn()), Eb(t13, e, r, n, a, i)) : false; } function Us(t13, e, r, n, a) { return t13 === e ? true : t13 == null || e == null || !ja(t13) && !ja(e) ? t13 !== t13 && e !== e : Tb(t13, e, r, n, Us, a); } var _b = 1; var Db = 2; function Pb(t13, e, r, n) { var a = r.length, i = a; if (t13 == null) return !i; for (t13 = Object(t13); a--; ) { var o = r[a]; if (o[2] ? o[1] !== t13[o[0]] : !(o[0] in t13)) return false; } for (; ++a < i; ) { o = r[a]; var s = o[0], u = t13[s], l = o[1]; if (o[2]) { if (u === void 0 && !(s in t13)) return false; } else { var c = new hn(), d; if (!(d === void 0 ? Us(l, u, _b | Db, n, c) : d)) return false; } } return true; } function Bv(t13) { return t13 === t13 && !Vn(t13); } function Ob(t13) { for (var e = Fv(t13), r = e.length; r--; ) { var n = e[r], a = t13[n]; e[r] = [n, a, Bv(a)]; } return e; } function Nv(t13, e) { return function(r) { return r == null ? false : r[t13] === e && (e !== void 0 || t13 in Object(r)); }; } function Lb(t13) { var e = Ob(t13); return e.length == 1 && e[0][2] ? Nv(e[0][0], e[0][1]) : function(r) { return r === t13 || Pb(r, t13, e); }; } function Ib(t13, e) { return t13 != null && e in Object(t13); } function Fb(t13, e, r) { e = Ks(e, t13); for (var n = -1, a = e.length, i = false; ++n < a; ) { var o = mo(e[n]); if (!(i = t13 != null && r(t13, o))) break; t13 = t13[o]; } return i || ++n != a ? i : (a = t13 == null ? 0 : t13.length, !!a && Pu(a) && _u(o, a) && (Vr(t13) || Ou(t13))); } function $v(t13, e) { return t13 != null && Fb(t13, e, Ib); } var Ab = 1; var Mb = 2; function Bb(t13, e) { return Lu(t13) && Bv(e) ? Nv(mo(t13), e) : function(r) { var n = fn(r, t13); return n === void 0 && n === e ? $v(r, t13) : Us(e, n, Ab | Mb); }; } function Nb(t13) { return function(e) { return e == null ? void 0 : e[t13]; }; } function $b(t13) { return function(e) { return Fu(e, t13); }; } function Rb(t13) { return Lu(t13) ? Nb(mo(t13)) : $b(t13); } function zb(t13) { return typeof t13 == "function" ? t13 : t13 == null ? _v : typeof t13 == "object" ? Vr(t13) ? Bb(t13[0], t13[1]) : Lb(t13) : Rb(t13); } var El = function() { return nn.Date.now(); }; var Vb = "Expected a function"; var Hb = Math.max; var qb = Math.min; function Rv(t13, e, r) { var n, a, i, o, s, u, l = 0, c = false, d = false, v = true; if (typeof t13 != "function") throw new TypeError(Vb); e = Wc(e) || 0, Vn(r) && (c = !!r.leading, d = "maxWait" in r, i = d ? Hb(Wc(r.maxWait) || 0, e) : i, v = "trailing" in r ? !!r.trailing : v); function h6(E) { var C = n, T = a; return n = a = void 0, l = E, o = t13.apply(T, C), o; } function f(E) { return l = E, s = setTimeout(g, e), c ? h6(E) : o; } function p(E) { var C = E - u, T = E - l, k = e - C; return d ? qb(k, i - T) : k; } function m(E) { var C = E - u, T = E - l; return u === void 0 || C >= e || C < 0 || d && T >= i; } function g() { var E = El(); if (m(E)) return y(E); s = setTimeout(g, p(E)); } function y(E) { return s = void 0, v && n ? h6(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 : y(El()); } function x() { var E = El(), C = m(E); if (n = arguments, a = this, u = E, C) { if (s === void 0) return f(u); if (d) return clearTimeout(s), s = setTimeout(g, e), h6(u); } return s === void 0 && (s = setTimeout(g, e)), o; } return x.cancel = b, x.flush = w, x; } function Kb(t13, e, r) { var n = t13 == null ? 0 : t13.length; if (!n) return -1; var a = n - 1; return Zm(t13, zb(e), a); } function xs(t13) { for (var e = -1, r = t13 == null ? 0 : t13.length, n = {}; ++e < r; ) { var a = t13[e]; n[a[0]] = a[1]; } return n; } function Es(t13, e) { return Us(t13, e); } function $n(t13) { return t13 == null; } function Ub(t13) { return t13 === void 0; } function Gb(t13, e, r, n) { if (!Vn(t13)) return t13; e = Ks(e, t13); for (var a = -1, i = e.length, o = i - 1, s = t13; s != null && ++a < i; ) { var u = mo(e[a]), l = r; if (u === "__proto__" || u === "constructor" || u === "prototype") return t13; if (a != o) { var c = s[u]; l = void 0, l === void 0 && (l = Vn(c) ? c : _u(e[a + 1]) ? [] : {}); } ty(s, u, l), s = s[u]; } return t13; } function Wb(t13, e, r) { for (var n = -1, a = e.length, i = {}; ++n < a; ) { var o = e[n], s = Fu(t13, o); r(s, o) && Gb(i, Ks(o, t13), s); } return i; } function Yb(t13, e) { return Wb(t13, e, function(r, n) { return $v(t13, n); }); } var zv = I1(function(t13, e) { return t13 == null ? {} : Yb(t13, e); }); var Mn = (t13) => t13 === void 0; var Qa = (t13) => typeof t13 == "boolean"; var qt = (t13) => typeof t13 == "number"; var ua = (t13) => typeof Element > "u" ? false : t13 instanceof Element; var ks = (t13) => $n(t13); var Zb = (t13) => tr(t13) ? !Number.isNaN(Number(t13)) : false; var Xb = (t13 = "") => t13.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); var hd = (t13) => Object.keys(t13); var Vv = class extends Error { constructor(e) { super(e), this.name = "ElementPlusError"; } }; function jb(t13, e) { throw new Vv(`[${t13}] ${e}`); } function Dt(t13, e) { if (true) { const r = tr(t13) ? new Vv(`[${t13}] ${e}`) : t13; console.warn(r); } } var Qb = "utils/dom/style"; var Hv = (t13 = "") => t13.split(" ").filter((e) => !!e.trim()); var Ql = (t13, e) => { !t13 || !e.trim() || t13.classList.add(...Hv(e)); }; var ca = (t13, e) => { !t13 || !e.trim() || t13.classList.remove(...Hv(e)); }; var Ti = (t13, e) => { var r; if (!_t || !t13 || !e) return ""; let n = rm(e); n === "float" && (n = "cssFloat"); try { const a = t13.style[n]; if (a) return a; const i = (r = document.defaultView) == null ? void 0 : r.getComputedStyle(t13, ""); return i ? i[n] : ""; } catch { return t13.style[n]; } }; function Ja(t13, e = "px") { if (!t13) return ""; if (qt(t13) || Zb(t13)) return `${t13}${e}`; if (tr(t13)) return t13; Dt(Qb, "binding value must be a string or number"); } function Jb(t13, e) { if (!_t) return; if (!e) { t13.scrollTop = 0; return; } const r = []; let n = e.offsetParent; for (; n !== null && t13 !== n && t13.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 = t13.scrollTop, s = o + t13.clientHeight; a < o ? t13.scrollTop = a : i > s && (t13.scrollTop = i - t13.clientHeight); } var e2 = defineComponent({ name: "Aim", __name: "aim", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }), createBaseVNode("path", { fill: "currentColor", d: "M512 96a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V128a32 32 0 0 1 32-32m0 576a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V704a32 32 0 0 1 32-32M96 512a32 32 0 0 1 32-32h192a32 32 0 0 1 0 64H128a32 32 0 0 1-32-32m576 0a32 32 0 0 1 32-32h192a32 32 0 1 1 0 64H704a32 32 0 0 1-32-32" }) ])); } }); var t2 = e2; var r2 = defineComponent({ name: "ArrowDown", __name: "arrow-down", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z" }) ])); } }); var Gs = r2; var n2 = defineComponent({ name: "ArrowUp", __name: "arrow-up", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0" }) ])); } }); var qv = n2; var a2 = defineComponent({ name: "CaretRight", __name: "caret-right", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M384 192v640l384-320.064z" }) ])); } }); var i2 = a2; var o2 = defineComponent({ name: "CircleCheck", __name: "circle-check", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }), createBaseVNode("path", { fill: "currentColor", d: "M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z" }) ])); } }); var s2 = o2; var l2 = defineComponent({ name: "CircleClose", __name: "circle-close", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z" }), createBaseVNode("path", { fill: "currentColor", d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896" }) ])); } }); var Au = l2; var u2 = defineComponent({ name: "Close", __name: "close", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z" }) ])); } }); var Ss = u2; var c2 = defineComponent({ name: "CopyDocument", __name: "copy-document", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M768 832a128 128 0 0 1-128 128H192A128 128 0 0 1 64 832V384a128 128 0 0 1 128-128v64a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64z" }), createBaseVNode("path", { fill: "currentColor", d: "M384 128a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64zm0-64h448a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H384a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64" }) ])); } }); var d2 = c2; var f2 = defineComponent({ name: "Delete", __name: "delete", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32" }) ])); } }); var v2 = f2; var h2 = defineComponent({ name: "Edit", __name: "edit", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z" }), createBaseVNode("path", { fill: "currentColor", d: "m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z" }) ])); } }); var p2 = h2; var g2 = defineComponent({ name: "Finished", __name: "finished", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M280.768 753.728 691.456 167.04a32 32 0 1 1 52.416 36.672L314.24 817.472a32 32 0 0 1-45.44 7.296l-230.4-172.8a32 32 0 0 1 38.4-51.2l203.968 152.96zM736 448a32 32 0 1 1 0-64h192a32 32 0 1 1 0 64zM608 640a32 32 0 0 1 0-64h319.936a32 32 0 1 1 0 64zM480 832a32 32 0 1 1 0-64h447.936a32 32 0 1 1 0 64z" }) ])); } }); var m2 = g2; var y2 = defineComponent({ name: "Hide", __name: "hide", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z" }), createBaseVNode("path", { fill: "currentColor", d: "M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z" }) ])); } }); var b2 = y2; var w2 = defineComponent({ name: "Loading", __name: "loading", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z" }) ])); } }); var Mu = w2; var C2 = defineComponent({ name: "Lock", __name: "lock", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96" }), createBaseVNode("path", { fill: "currentColor", d: "M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m192-160v-64a192 192 0 1 0-384 0v64zM512 64a256 256 0 0 1 256 256v128H256V320A256 256 0 0 1 512 64" }) ])); } }); var x2 = C2; var E2 = defineComponent({ name: "Notebook", __name: "notebook", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M192 128v768h640V128zm-32-64h704a32 32 0 0 1 32 32v832a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32" }), createBaseVNode("path", { fill: "currentColor", d: "M672 128h64v768h-64zM96 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32" }) ])); } }); var k2 = E2; var S2 = defineComponent({ name: "Unlock", __name: "unlock", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96" }), createBaseVNode("path", { fill: "currentColor", d: "M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m178.304-295.296A192.064 192.064 0 0 0 320 320v64h352l96 38.4V448H256V320a256 256 0 0 1 493.76-95.104z" }) ])); } }); var T2 = S2; var _2 = defineComponent({ name: "View", __name: "view", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160" }) ])); } }); var D2 = _2; var P2 = defineComponent({ name: "Warning", __name: "warning", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0m-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32" }) ])); } }); var O2 = P2; var L2 = defineComponent({ name: "ZoomIn", __name: "zoom-in", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z" }) ])); } }); var I2 = L2; var F2 = defineComponent({ name: "ZoomOut", __name: "zoom-out", setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, [ createBaseVNode("path", { fill: "currentColor", d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64" }) ])); } }); var A2 = F2; var Kv = "__epPropKey"; var $e = (t13) => t13; var M2 = (t13) => Ht(t13) && !!t13[Kv]; var Ws = (t13, e) => { if (!Ht(t13) || M2(t13)) return t13; const { values: r, required: n, default: a, type: i, validator: o } = t13, u = { type: i, required: !!n, validator: r || o ? (l) => { let c = false, d = []; if (r && (d = Array.from(r), va(t13, "default") && d.push(a), c || (c = d.includes(l))), o && (c || (c = o(l))), !c && d.length > 0) { const v = [...new Set(d)].map((h6) => JSON.stringify(h6)).join(", "); warn(`Invalid prop: validation failed${e ? ` for prop "${e}"` : ""}. Expected one of [${v}], got value ${JSON.stringify(l)}.`); } return c; } : void 0, [Kv]: true }; return va(t13, "default") && (u.default = a), u; }; var rt = (t13) => xs(Object.entries(t13).map(([e, r]) => [ e, Ws(r, e) ])); var Hn = $e([ String, Object, Function ]); var Uv = { validating: Mu, success: s2, error: Au }; var $t = (t13, e) => { if (t13.install = (r) => { for (const n of [t13, ...Object.values(e ?? {})]) r.component(n.name, n); }, e) for (const [r, n] of Object.entries(e)) t13[r] = n; return t13; }; var B2 = (t13, e) => (t13.install = (r) => { r.directive(e, t13); }, t13); var Cn = (t13) => (t13.install = Wi, t13); var Lt = { tab: "Tab", enter: "Enter", space: "Space", left: "ArrowLeft", up: "ArrowUp", right: "ArrowRight", down: "ArrowDown", esc: "Escape", delete: "Delete", backspace: "Backspace", numpadEnter: "NumpadEnter", pageUp: "PageUp", pageDown: "PageDown", home: "Home", end: "End" }; var zt = "update:modelValue"; var Bu = "change"; var Gv = ["", "default", "small", "large"]; var N2 = (t13) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(t13); var Ra = (t13) => t13; var $2 = ["class", "style"]; var R2 = /^on[A-Z]/; var z2 = (t13 = {}) => { const { excludeListeners: e = false, excludeKeys: r } = t13, n = computed(() => ((r == null ? void 0 : r.value) || []).concat($2)), a = getCurrentInstance(); return a ? computed(() => { var i; return xs(Object.entries((i = a.proxy) == null ? void 0 : i.$attrs).filter(([o]) => !n.value.includes(o) && !(e && R2.test(o)))); }) : (Dt("use-attrs", "getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"), computed(() => ({}))); }; var as = ({ from: t13, replacement: e, scope: r, version: n, ref: a, type: i = "API" }, o) => { watch(() => unref(o), (s) => { s && Dt(r, `[${i}] ${t13} is about to be deprecated in version ${n}, please use ${e} instead. For more detail, please visit: ${a} `); }, { immediate: true }); }; var V2 = { name: "en", el: { breadcrumb: { label: "Breadcrumb" }, colorpicker: { confirm: "OK", clear: "Clear", defaultLabel: "color picker", description: "current color is {color}. press enter to select a new color.", alphaLabel: "pick alpha value" }, datepicker: { now: "Now", today: "Today", cancel: "Cancel", clear: "Clear", confirm: "OK", dateTablePrompt: "Use the arrow keys and enter to select the day of the month", monthTablePrompt: "Use the arrow keys and enter to select the month", yearTablePrompt: "Use the arrow keys and enter to select the year", selectedDate: "Selected date", selectDate: "Select date", selectTime: "Select time", startDate: "Start Date", startTime: "Start Time", endDate: "End Date", endTime: "End Time", prevYear: "Previous Year", nextYear: "Next Year", prevMonth: "Previous Month", nextMonth: "Next Month", year: "", month1: "January", month2: "February", month3: "March", month4: "April", month5: "May", month6: "June", month7: "July", month8: "August", month9: "September", month10: "October", month11: "November", month12: "December", week: "week", weeks: { sun: "Sun", mon: "Mon", tue: "Tue", wed: "Wed", thu: "Thu", fri: "Fri", sat: "Sat" }, weeksFull: { sun: "Sunday", mon: "Monday", tue: "Tuesday", wed: "Wednesday", thu: "Thursday", fri: "Friday", sat: "Saturday" }, months: { jan: "Jan", feb: "Feb", mar: "Mar", apr: "Apr", may: "May", jun: "Jun", jul: "Jul", aug: "Aug", sep: "Sep", oct: "Oct", nov: "Nov", dec: "Dec" } }, inputNumber: { decrease: "decrease number", increase: "increase number" }, select: { loading: "Loading", noMatch: "No matching data", noData: "No data", placeholder: "Select" }, mention: { loading: "Loading" }, dropdown: { toggleDropdown: "Toggle Dropdown" }, cascader: { noMatch: "No matching data", loading: "Loading", placeholder: "Select", noData: "No data" }, pagination: { goto: "Go to", pagesize: "/page", total: "Total {total}", pageClassifier: "", page: "Page", prev: "Go to previous page", next: "Go to next page", currentPage: "page {pager}", prevPages: "Previous {pager} pages", nextPages: "Next {pager} pages", deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details" }, dialog: { close: "Close this dialog" }, drawer: { close: "Close this dialog" }, messagebox: { title: "Message", confirm: "OK", cancel: "Cancel", error: "Illegal input", close: "Close this dialog" }, upload: { deleteTip: "press delete to remove", delete: "Delete", preview: "Preview", continue: "Continue" }, slider: { defaultLabel: "slider between {min} and {max}", defaultRangeStartLabel: "pick start value", defaultRangeEndLabel: "pick end value" }, table: { emptyText: "No Data", confirmFilter: "Confirm", resetFilter: "Reset", clearFilter: "All", sumText: "Sum" }, tour: { next: "Next", previous: "Previous", finish: "Finish" }, tree: { emptyText: "No Data" }, transfer: { noMatch: "No matching data", noData: "No data", titles: ["List 1", "List 2"], filterPlaceholder: "Enter keyword", noCheckedFormat: "{total} items", hasCheckedFormat: "{checked}/{total} checked" }, image: { error: "FAILED" }, pageHeader: { title: "Back" }, popconfirm: { confirmButtonText: "Yes", cancelButtonText: "No" }, carousel: { leftArrow: "Carousel arrow left", rightArrow: "Carousel arrow right", indicator: "Carousel switch to index {index}" } } }; var H2 = (t13) => (e, r) => q2(e, r, unref(t13)); var q2 = (t13, e, r) => fn(r, t13, t13).replace(/\{(\w+)\}/g, (n, a) => { var i; return `${(i = e == null ? void 0 : e[a]) != null ? i : `{${a}}`}`; }); var K2 = (t13) => { const e = computed(() => unref(t13).name), r = isRef(t13) ? t13 : ref(t13); return { lang: e, locale: r, t: H2(t13) }; }; var Wv = Symbol("localeContextKey"); var yo = (t13) => { const e = t13 || inject(Wv, ref()); return K2(computed(() => e.value || V2)); }; var is = "el"; var U2 = "is-"; var Qn = (t13, e, r, n, a) => { let i = `${t13}-${e}`; return r && (i += `-${r}`), n && (i += `__${n}`), a && (i += `--${a}`), i; }; var Yv = Symbol("namespaceContextKey"); var Nu = (t13) => { const e = t13 || (getCurrentInstance() ? inject(Yv, ref(is)) : ref(is)); return computed(() => unref(e) || is); }; var He = (t13, e) => { const r = Nu(e); return { namespace: r, b: (p = "") => Qn(r.value, t13, p, "", ""), e: (p) => p ? Qn(r.value, t13, "", p, "") : "", m: (p) => p ? Qn(r.value, t13, "", "", p) : "", be: (p, m) => p && m ? Qn(r.value, t13, p, m, "") : "", em: (p, m) => p && m ? Qn(r.value, t13, "", p, m) : "", bm: (p, m) => p && m ? Qn(r.value, t13, p, "", m) : "", bem: (p, m, g) => p && m && g ? Qn(r.value, t13, p, m, g) : "", is: (p, ...m) => { const g = m.length >= 1 ? m[0] : true; return p && g ? `${U2}${p}` : ""; }, cssVar: (p) => { const m = {}; for (const g in p) p[g] && (m[`--${r.value}-${g}`] = p[g]); return m; }, cssVarName: (p) => `--${r.value}-${p}`, cssVarBlock: (p) => { const m = {}; for (const g in p) p[g] && (m[`--${r.value}-${t13}-${g}`] = p[g]); return m; }, cssVarBlockName: (p) => `--${r.value}-${t13}-${p}` }; }; var G2 = Ws({ type: $e(Boolean), default: null }); var W2 = Ws({ type: $e(Function) }); var Y2 = (t13) => { const e = `update:${t13}`, r = `onUpdate:${t13}`, n = [e], a = { [t13]: G2, [r]: W2 }; return { useModelToggle: ({ indicator: o, toggleReason: s, shouldHideWhenRouteChanges: u, shouldProceed: l, onShow: c, onHide: d }) => { const v = getCurrentInstance(), { emit: h6 } = v, f = v.props, p = computed(() => lr(f[r])), m = computed(() => f[t13] === null), g = (C) => { o.value !== true && (o.value = true, s && (s.value = C), lr(c) && c(C)); }, y = (C) => { o.value !== false && (o.value = false, s && (s.value = C), lr(d) && d(C)); }, b = (C) => { if (f.disabled === true || lr(l) && !l()) return; const T = p.value && _t; T && h6(e, true), (m.value || !T) && g(C); }, w = (C) => { if (f.disabled === true || !_t) return; const T = p.value && _t; T && h6(e, false), (m.value || !T) && y(C); }, x = (C) => { Qa(C) && (f.disabled && C ? p.value && h6(e, false) : o.value !== C && (C ? g() : y())); }, E = () => { o.value ? w() : b(); }; return watch(() => f[t13], x), u && v.appContext.config.globalProperties.$route !== void 0 && watch(() => ({ ...v.proxy.$route }), () => { u.value && o.value && w(); }), onMounted(() => { x(f[t13]); }), { hide: w, show: b, toggle: E, hasUpdateHandler: p }; }, useModelToggleProps: a, useModelToggleEmits: n }; }; var Zv = (t13) => { const e = getCurrentInstance(); return computed(() => { var r, n; return (n = (r = e == null ? void 0 : e.proxy) == null ? void 0 : r.$props) == null ? void 0 : n[t13]; }); }; var vr = "top"; var _r = "bottom"; var Dr = "right"; var hr = "left"; var $u = "auto"; var bo = [vr, _r, Dr, hr]; var ei = "start"; var Xi = "end"; var Z2 = "clippingParents"; var Xv = "viewport"; var _i = "popper"; var X2 = "reference"; var pd = bo.reduce(function(t13, e) { return t13.concat([e + "-" + ei, e + "-" + Xi]); }, []); var Ys = [].concat(bo, [$u]).reduce(function(t13, e) { return t13.concat([e, e + "-" + ei, e + "-" + Xi]); }, []); var j2 = "beforeRead"; var Q2 = "read"; var J2 = "afterRead"; var ew = "beforeMain"; var tw = "main"; var rw = "afterMain"; var nw = "beforeWrite"; var aw = "write"; var iw = "afterWrite"; var ow = [j2, Q2, J2, ew, tw, rw, nw, aw, iw]; function tn(t13) { return t13 ? (t13.nodeName || "").toLowerCase() : null; } function Kr(t13) { if (t13 == null) return window; if (t13.toString() !== "[object Window]") { var e = t13.ownerDocument; return e && e.defaultView || window; } return t13; } function ti(t13) { var e = Kr(t13).Element; return t13 instanceof e || t13 instanceof Element; } function Tr(t13) { var e = Kr(t13).HTMLElement; return t13 instanceof e || t13 instanceof HTMLElement; } function Ru(t13) { if (typeof ShadowRoot > "u") return false; var e = Kr(t13).ShadowRoot; return t13 instanceof e || t13 instanceof ShadowRoot; } function sw(t13) { var e = t13.state; Object.keys(e.elements).forEach(function(r) { var n = e.styles[r] || {}, a = e.attributes[r] || {}, i = e.elements[r]; !Tr(i) || !tn(i) || (Object.assign(i.style, n), Object.keys(a).forEach(function(o) { var s = a[o]; s === false ? i.removeAttribute(o) : i.setAttribute(o, s === true ? "" : s); })); }); } function lw(t13) { var e = t13.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; }, {}); !Tr(a) || !tn(a) || (Object.assign(a.style, s), Object.keys(i).forEach(function(u) { a.removeAttribute(u); })); }); }; } var jv = { name: "applyStyles", enabled: true, phase: "write", fn: sw, effect: lw, requires: ["computeStyles"] }; function Qr(t13) { return t13.split("-")[0]; } var da = Math.max; var Ts = Math.min; var ri = Math.round; function ni(t13, e) { e === void 0 && (e = false); var r = t13.getBoundingClientRect(), n = 1, a = 1; if (Tr(t13) && e) { var i = t13.offsetHeight, o = t13.offsetWidth; o > 0 && (n = ri(r.width) / o || 1), i > 0 && (a = ri(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 zu(t13) { var e = ni(t13), r = t13.offsetWidth, n = t13.offsetHeight; return Math.abs(e.width - r) <= 1 && (r = e.width), Math.abs(e.height - n) <= 1 && (n = e.height), { x: t13.offsetLeft, y: t13.offsetTop, width: r, height: n }; } function Qv(t13, e) { var r = e.getRootNode && e.getRootNode(); if (t13.contains(e)) return true; if (r && Ru(r)) { var n = e; do { if (n && t13.isSameNode(n)) return true; n = n.parentNode || n.host; } while (n); } return false; } function pn(t13) { return Kr(t13).getComputedStyle(t13); } function uw(t13) { return ["table", "td", "th"].indexOf(tn(t13)) >= 0; } function Yn(t13) { return ((ti(t13) ? t13.ownerDocument : t13.document) || window.document).documentElement; } function Zs(t13) { return tn(t13) === "html" ? t13 : t13.assignedSlot || t13.parentNode || (Ru(t13) ? t13.host : null) || Yn(t13); } function gd(t13) { return !Tr(t13) || pn(t13).position === "fixed" ? null : t13.offsetParent; } function cw(t13) { var e = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1, r = navigator.userAgent.indexOf("Trident") !== -1; if (r && Tr(t13)) { var n = pn(t13); if (n.position === "fixed") return null; } var a = Zs(t13); for (Ru(a) && (a = a.host); Tr(a) && ["html", "body"].indexOf(tn(a)) < 0; ) { var i = pn(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 wo(t13) { for (var e = Kr(t13), r = gd(t13); r && uw(r) && pn(r).position === "static"; ) r = gd(r); return r && (tn(r) === "html" || tn(r) === "body" && pn(r).position === "static") ? e : r || cw(t13) || e; } function Vu(t13) { return ["top", "bottom"].indexOf(t13) >= 0 ? "x" : "y"; } function Vi(t13, e, r) { return da(t13, Ts(e, r)); } function dw(t13, e, r) { var n = Vi(t13, e, r); return n > r ? r : n; } function Jv() { return { top: 0, right: 0, bottom: 0, left: 0 }; } function eh(t13) { return Object.assign({}, Jv(), t13); } function th(t13, e) { return e.reduce(function(r, n) { return r[n] = t13, r; }, {}); } var fw = function(t13, e) { return t13 = typeof t13 == "function" ? t13(Object.assign({}, e.rects, { placement: e.placement })) : t13, eh(typeof t13 != "number" ? t13 : th(t13, bo)); }; function vw(t13) { var e, r = t13.state, n = t13.name, a = t13.options, i = r.elements.arrow, o = r.modifiersData.popperOffsets, s = Qr(r.placement), u = Vu(s), l = [hr, Dr].indexOf(s) >= 0, c = l ? "height" : "width"; if (!(!i || !o)) { var d = fw(a.padding, r), v = zu(i), h6 = u === "y" ? vr : hr, f = u === "y" ? _r : Dr, p = r.rects.reference[c] + r.rects.reference[u] - o[u] - r.rects.popper[c], m = o[u] - r.rects.reference[u], g = wo(i), y = g ? u === "y" ? g.clientHeight || 0 : g.clientWidth || 0 : 0, b = p / 2 - m / 2, w = d[h6], x = y - v[c] - d[f], E = y / 2 - v[c] / 2 + b, C = Vi(w, E, x), T = u; r.modifiersData[n] = (e = {}, e[T] = C, e.centerOffset = C - E, e); } } function hw(t13) { var e = t13.state, r = t13.options, n = r.element, a = n === void 0 ? "[data-popper-arrow]" : n; a != null && (typeof a == "string" && (a = e.elements.popper.querySelector(a), !a) || !Qv(e.elements.popper, a) || (e.elements.arrow = a)); } var pw = { name: "arrow", enabled: true, phase: "main", fn: vw, effect: hw, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] }; function ai(t13) { return t13.split("-")[1]; } var gw = { top: "auto", right: "auto", bottom: "auto", left: "auto" }; function mw(t13) { var e = t13.x, r = t13.y, n = window, a = n.devicePixelRatio || 1; return { x: ri(e * a) / a || 0, y: ri(r * a) / a || 0 }; } function md(t13) { var e, r = t13.popper, n = t13.popperRect, a = t13.placement, i = t13.variation, o = t13.offsets, s = t13.position, u = t13.gpuAcceleration, l = t13.adaptive, c = t13.roundOffsets, d = t13.isFixed, v = o.x, h6 = v === void 0 ? 0 : v, f = o.y, p = f === void 0 ? 0 : f, m = typeof c == "function" ? c({ x: h6, y: p }) : { x: h6, y: p }; h6 = m.x, p = m.y; var g = o.hasOwnProperty("x"), y = o.hasOwnProperty("y"), b = hr, w = vr, x = window; if (l) { var E = wo(r), C = "clientHeight", T = "clientWidth"; if (E === Kr(r) && (E = Yn(r), pn(E).position !== "static" && s === "absolute" && (C = "scrollHeight", T = "scrollWidth")), E = E, a === vr || (a === hr || a === Dr) && i === Xi) { w = _r; var k = d && E === x && x.visualViewport ? x.visualViewport.height : E[C]; p -= k - n.height, p *= u ? 1 : -1; } if (a === hr || (a === vr || a === _r) && i === Xi) { b = Dr; var _ = d && E === x && x.visualViewport ? x.visualViewport.width : E[T]; h6 -= _ - n.width, h6 *= u ? 1 : -1; } } var D = Object.assign({ position: s }, l && gw), O = c === true ? mw({ x: h6, y: p }) : { x: h6, y: p }; if (h6 = O.x, p = O.y, u) { var F; return Object.assign({}, D, (F = {}, F[w] = y ? "0" : "", F[b] = g ? "0" : "", F.transform = (x.devicePixelRatio || 1) <= 1 ? "translate(" + h6 + "px, " + p + "px)" : "translate3d(" + h6 + "px, " + p + "px, 0)", F)); } return Object.assign({}, D, (e = {}, e[w] = y ? p + "px" : "", e[b] = g ? h6 + "px" : "", e.transform = "", e)); } function yw(t13) { var e = t13.state, r = t13.options, n = r.gpuAcceleration, a = n === void 0 ? true : n, i = r.adaptive, o = i === void 0 ? true : i, s = r.roundOffsets, u = s === void 0 ? true : s, l = { placement: Qr(e.placement), variation: ai(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, md(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, md(Object.assign({}, l, { offsets: e.modifiersData.arrow, position: "absolute", adaptive: false, roundOffsets: u })))), e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-placement": e.placement }); } var rh = { name: "computeStyles", enabled: true, phase: "beforeWrite", fn: yw, data: {} }; var $o = { passive: true }; function bw(t13) { var e = t13.state, r = t13.instance, n = t13.options, a = n.scroll, i = a === void 0 ? true : a, o = n.resize, s = o === void 0 ? true : o, u = Kr(e.elements.popper), l = [].concat(e.scrollParents.reference, e.scrollParents.popper); return i && l.forEach(function(c) { c.addEventListener("scroll", r.update, $o); }), s && u.addEventListener("resize", r.update, $o), function() { i && l.forEach(function(c) { c.removeEventListener("scroll", r.update, $o); }), s && u.removeEventListener("resize", r.update, $o); }; } var nh = { name: "eventListeners", enabled: true, phase: "write", fn: function() { }, effect: bw, data: {} }; var ww = { left: "right", right: "left", bottom: "top", top: "bottom" }; function os(t13) { return t13.replace(/left|right|bottom|top/g, function(e) { return ww[e]; }); } var Cw = { start: "end", end: "start" }; function yd(t13) { return t13.replace(/start|end/g, function(e) { return Cw[e]; }); } function Hu(t13) { var e = Kr(t13), r = e.pageXOffset, n = e.pageYOffset; return { scrollLeft: r, scrollTop: n }; } function qu(t13) { return ni(Yn(t13)).left + Hu(t13).scrollLeft; } function xw(t13) { var e = Kr(t13), r = Yn(t13), 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 + qu(t13), y: s }; } function Ew(t13) { var e, r = Yn(t13), n = Hu(t13), a = (e = t13.ownerDocument) == null ? void 0 : e.body, i = da(r.scrollWidth, r.clientWidth, a ? a.scrollWidth : 0, a ? a.clientWidth : 0), o = da(r.scrollHeight, r.clientHeight, a ? a.scrollHeight : 0, a ? a.clientHeight : 0), s = -n.scrollLeft + qu(t13), u = -n.scrollTop; return pn(a || r).direction === "rtl" && (s += da(r.clientWidth, a ? a.clientWidth : 0) - i), { width: i, height: o, x: s, y: u }; } function Ku(t13) { var e = pn(t13), r = e.overflow, n = e.overflowX, a = e.overflowY; return /auto|scroll|overlay|hidden/.test(r + a + n); } function ah(t13) { return ["html", "body", "#document"].indexOf(tn(t13)) >= 0 ? t13.ownerDocument.body : Tr(t13) && Ku(t13) ? t13 : ah(Zs(t13)); } function Hi(t13, e) { var r; e === void 0 && (e = []); var n = ah(t13), a = n === ((r = t13.ownerDocument) == null ? void 0 : r.body), i = Kr(n), o = a ? [i].concat(i.visualViewport || [], Ku(n) ? n : []) : n, s = e.concat(o); return a ? s : s.concat(Hi(Zs(o))); } function Jl(t13) { return Object.assign({}, t13, { left: t13.x, top: t13.y, right: t13.x + t13.width, bottom: t13.y + t13.height }); } function kw(t13) { var e = ni(t13); return e.top = e.top + t13.clientTop, e.left = e.left + t13.clientLeft, e.bottom = e.top + t13.clientHeight, e.right = e.left + t13.clientWidth, e.width = t13.clientWidth, e.height = t13.clientHeight, e.x = e.left, e.y = e.top, e; } function bd(t13, e) { return e === Xv ? Jl(xw(t13)) : ti(e) ? kw(e) : Jl(Ew(Yn(t13))); } function Sw(t13) { var e = Hi(Zs(t13)), r = ["absolute", "fixed"].indexOf(pn(t13).position) >= 0, n = r && Tr(t13) ? wo(t13) : t13; return ti(n) ? e.filter(function(a) { return ti(a) && Qv(a, n) && tn(a) !== "body"; }) : []; } function Tw(t13, e, r) { var n = e === "clippingParents" ? Sw(t13) : [].concat(e), a = [].concat(n, [r]), i = a[0], o = a.reduce(function(s, u) { var l = bd(t13, u); return s.top = da(l.top, s.top), s.right = Ts(l.right, s.right), s.bottom = Ts(l.bottom, s.bottom), s.left = da(l.left, s.left), s; }, bd(t13, i)); return o.width = o.right - o.left, o.height = o.bottom - o.top, o.x = o.left, o.y = o.top, o; } function ih(t13) { var e = t13.reference, r = t13.element, n = t13.placement, a = n ? Qr(n) : null, i = n ? ai(n) : null, o = e.x + e.width / 2 - r.width / 2, s = e.y + e.height / 2 - r.height / 2, u; switch (a) { case vr: u = { x: o, y: e.y - r.height }; break; case _r: u = { x: o, y: e.y + e.height }; break; case Dr: u = { x: e.x + e.width, y: s }; break; case hr: u = { x: e.x - r.width, y: s }; break; default: u = { x: e.x, y: e.y }; } var l = a ? Vu(a) : null; if (l != null) { var c = l === "y" ? "height" : "width"; switch (i) { case ei: u[l] = u[l] - (e[c] / 2 - r[c] / 2); break; case Xi: u[l] = u[l] + (e[c] / 2 - r[c] / 2); break; } } return u; } function ji(t13, e) { e === void 0 && (e = {}); var r = e, n = r.placement, a = n === void 0 ? t13.placement : n, i = r.boundary, o = i === void 0 ? Z2 : i, s = r.rootBoundary, u = s === void 0 ? Xv : s, l = r.elementContext, c = l === void 0 ? _i : l, d = r.altBoundary, v = d === void 0 ? false : d, h6 = r.padding, f = h6 === void 0 ? 0 : h6, p = eh(typeof f != "number" ? f : th(f, bo)), m = c === _i ? X2 : _i, g = t13.rects.popper, y = t13.elements[v ? m : c], b = Tw(ti(y) ? y : y.contextElement || Yn(t13.elements.popper), o, u), w = ni(t13.elements.reference), x = ih({ reference: w, element: g, strategy: "absolute", placement: a }), E = Jl(Object.assign({}, g, x)), C = c === _i ? E : w, T = { 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 }, k = t13.modifiersData.offset; if (c === _i && k) { var _ = k[a]; Object.keys(T).forEach(function(D) { var O = [Dr, _r].indexOf(D) >= 0 ? 1 : -1, F = [vr, _r].indexOf(D) >= 0 ? "y" : "x"; T[D] += _[F] * O; }); } return T; } function _w(t13, 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 ? Ys : u, c = ai(n), d = c ? s ? pd : pd.filter(function(f) { return ai(f) === c; }) : bo, v = d.filter(function(f) { return l.indexOf(f) >= 0; }); v.length === 0 && (v = d); var h6 = v.reduce(function(f, p) { return f[p] = ji(t13, { placement: p, boundary: a, rootBoundary: i, padding: o })[Qr(p)], f; }, {}); return Object.keys(h6).sort(function(f, p) { return h6[f] - h6[p]; }); } function Dw(t13) { if (Qr(t13) === $u) return []; var e = os(t13); return [yd(t13), e, yd(e)]; } function Pw(t13) { var e = t13.state, r = t13.options, n = t13.name; if (!e.modifiersData[n]._skip) { for (var a = r.mainAxis, i = a === void 0 ? true : a, o = r.altAxis, s = o === void 0 ? true : o, u = r.fallbackPlacements, l = r.padding, c = r.boundary, d = r.rootBoundary, v = r.altBoundary, h6 = r.flipVariations, f = h6 === void 0 ? true : h6, p = r.allowedAutoPlacements, m = e.options.placement, g = Qr(m), y = g === m, b = u || (y || !f ? [os(m)] : Dw(m)), w = [m].concat(b).reduce(function(se, oe) { return se.concat(Qr(oe) === $u ? _w(e, { placement: oe, boundary: c, rootBoundary: d, padding: l, flipVariations: f, allowedAutoPlacements: p }) : oe); }, []), x = e.rects.reference, E = e.rects.popper, C = /* @__PURE__ */ new Map(), T = true, k = w[0], _ = 0; _ < w.length; _++) { var D = w[_], O = Qr(D), F = ai(D) === ei, L = [vr, _r].indexOf(O) >= 0, B = L ? "width" : "height", I = ji(e, { placement: D, boundary: c, rootBoundary: d, altBoundary: v, padding: l }), M = L ? F ? Dr : hr : F ? _r : vr; x[B] > E[B] && (M = os(M)); var A = os(M), R = []; if (i && R.push(I[O] <= 0), s && R.push(I[M] <= 0, I[A] <= 0), R.every(function(se) { return se; })) { k = D, T = false; break; } C.set(D, R); } if (T) for (var K = f ? 3 : 1, H = function(se) { var oe = w.find(function(ae) { var ue = C.get(ae); if (ue) return ue.slice(0, se).every(function(te) { return te; }); }); if (oe) return k = oe, "break"; }, q = K; q > 0; q--) { var ee = H(q); if (ee === "break") break; } e.placement !== k && (e.modifiersData[n]._skip = true, e.placement = k, e.reset = true); } } var Ow = { name: "flip", enabled: true, phase: "main", fn: Pw, requiresIfExists: ["offset"], data: { _skip: false } }; function wd(t13, e, r) { return r === void 0 && (r = { x: 0, y: 0 }), { top: t13.top - e.height - r.y, right: t13.right - e.width + r.x, bottom: t13.bottom - e.height + r.y, left: t13.left - e.width - r.x }; } function Cd(t13) { return [vr, Dr, _r, hr].some(function(e) { return t13[e] >= 0; }); } function Lw(t13) { var e = t13.state, r = t13.name, n = e.rects.reference, a = e.rects.popper, i = e.modifiersData.preventOverflow, o = ji(e, { elementContext: "reference" }), s = ji(e, { altBoundary: true }), u = wd(o, n), l = wd(s, a, i), c = Cd(u), d = Cd(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 Iw = { name: "hide", enabled: true, phase: "main", requiresIfExists: ["preventOverflow"], fn: Lw }; function Fw(t13, e, r) { var n = Qr(t13), a = [hr, vr].indexOf(n) >= 0 ? -1 : 1, i = typeof r == "function" ? r(Object.assign({}, e, { placement: t13 })) : r, o = i[0], s = i[1]; return o = o || 0, s = (s || 0) * a, [hr, Dr].indexOf(n) >= 0 ? { x: s, y: o } : { x: o, y: s }; } function Aw(t13) { var e = t13.state, r = t13.options, n = t13.name, a = r.offset, i = a === void 0 ? [0, 0] : a, o = Ys.reduce(function(c, d) { return c[d] = Fw(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 Mw = { name: "offset", enabled: true, phase: "main", requires: ["popperOffsets"], fn: Aw }; function Bw(t13) { var e = t13.state, r = t13.name; e.modifiersData[r] = ih({ reference: e.rects.reference, element: e.rects.popper, strategy: "absolute", placement: e.placement }); } var oh = { name: "popperOffsets", enabled: true, phase: "read", fn: Bw, data: {} }; function Nw(t13) { return t13 === "x" ? "y" : "x"; } function $w(t13) { var e = t13.state, r = t13.options, n = t13.name, a = r.mainAxis, i = a === void 0 ? true : a, o = r.altAxis, s = o === void 0 ? false : o, u = r.boundary, l = r.rootBoundary, c = r.altBoundary, d = r.padding, v = r.tether, h6 = v === void 0 ? true : v, f = r.tetherOffset, p = f === void 0 ? 0 : f, m = ji(e, { boundary: u, rootBoundary: l, padding: d, altBoundary: c }), g = Qr(e.placement), y = ai(e.placement), b = !y, w = Vu(g), x = Nw(w), E = e.modifiersData.popperOffsets, C = e.rects.reference, T = e.rects.popper, k = typeof p == "function" ? p(Object.assign({}, e.rects, { placement: e.placement })) : p, _ = typeof k == "number" ? { mainAxis: k, altAxis: k } : Object.assign({ mainAxis: 0, altAxis: 0 }, k), D = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, O = { x: 0, y: 0 }; if (E) { if (i) { var F, L = w === "y" ? vr : hr, B = w === "y" ? _r : Dr, I = w === "y" ? "height" : "width", M = E[w], A = M + m[L], R = M - m[B], K = h6 ? -T[I] / 2 : 0, H = y === ei ? C[I] : T[I], q = y === ei ? -T[I] : -C[I], ee = e.elements.arrow, se = h6 && ee ? zu(ee) : { width: 0, height: 0 }, oe = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : Jv(), ae = oe[L], ue = oe[B], te = Vi(0, C[I], se[I]), $ = b ? C[I] / 2 - K - te - ae - _.mainAxis : H - te - ae - _.mainAxis, G = b ? -C[I] / 2 + K + te + ue + _.mainAxis : q + te + ue + _.mainAxis, Q = e.elements.arrow && wo(e.elements.arrow), ge = Q ? w === "y" ? Q.clientTop || 0 : Q.clientLeft || 0 : 0, Ee = (F = D == null ? void 0 : D[w]) != null ? F : 0, fe = M + $ - Ee - ge, me = M + G - Ee, Ce = Vi(h6 ? Ts(A, fe) : A, M, h6 ? da(R, me) : R); E[w] = Ce, O[w] = Ce - M; } if (s) { var ke, xe = w === "x" ? vr : hr, De = w === "x" ? _r : Dr, qe = E[x], Ke = x === "y" ? "height" : "width", Be = qe + m[xe], Ge = qe - m[De], le = [vr, hr].indexOf(g) !== -1, S = (ke = D == null ? void 0 : D[x]) != null ? ke : 0, z = le ? Be : qe - C[Ke] - T[Ke] - S + _.altAxis, ie = le ? qe + C[Ke] + T[Ke] - S - _.altAxis : Ge, j = h6 && le ? dw(z, qe, ie) : Vi(h6 ? z : Be, qe, h6 ? ie : Ge); E[x] = j, O[x] = j - qe; } e.modifiersData[n] = O; } } var Rw = { name: "preventOverflow", enabled: true, phase: "main", fn: $w, requiresIfExists: ["offset"] }; function zw(t13) { return { scrollLeft: t13.scrollLeft, scrollTop: t13.scrollTop }; } function Vw(t13) { return t13 === Kr(t13) || !Tr(t13) ? Hu(t13) : zw(t13); } function Hw(t13) { var e = t13.getBoundingClientRect(), r = ri(e.width) / t13.offsetWidth || 1, n = ri(e.height) / t13.offsetHeight || 1; return r !== 1 || n !== 1; } function qw(t13, e, r) { r === void 0 && (r = false); var n = Tr(e), a = Tr(e) && Hw(e), i = Yn(e), o = ni(t13, a), s = { scrollLeft: 0, scrollTop: 0 }, u = { x: 0, y: 0 }; return (n || !n && !r) && ((tn(e) !== "body" || Ku(i)) && (s = Vw(e)), Tr(e) ? (u = ni(e, true), u.x += e.clientLeft, u.y += e.clientTop) : i && (u.x = qu(i))), { x: o.left + s.scrollLeft - u.x, y: o.top + s.scrollTop - u.y, width: o.width, height: o.height }; } function Kw(t13) { var e = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), n = []; t13.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 t13.forEach(function(i) { r.has(i.name) || a(i); }), n; } function Uw(t13) { var e = Kw(t13); return ow.reduce(function(r, n) { return r.concat(e.filter(function(a) { return a.phase === n; })); }, []); } function Gw(t13) { var e; return function() { return e || (e = new Promise(function(r) { Promise.resolve().then(function() { e = void 0, r(t13()); }); })), e; }; } function Ww(t13) { var e = t13.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 xd = { placement: "bottom", modifiers: [], strategy: "absolute" }; function Ed() { for (var t13 = arguments.length, e = new Array(t13), r = 0; r < t13; r++) e[r] = arguments[r]; return !e.some(function(n) { return !(n && typeof n.getBoundingClientRect == "function"); }); } function Uu(t13) { t13 === void 0 && (t13 = {}); var e = t13, r = e.defaultModifiers, n = r === void 0 ? [] : r, a = e.defaultOptions, i = a === void 0 ? xd : a; return function(o, s, u) { u === void 0 && (u = i); var l = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, xd, i), modifiersData: {}, elements: { reference: o, popper: s }, attributes: {}, styles: {} }, c = [], d = false, v = { state: l, setOptions: function(p) { var m = typeof p == "function" ? p(l.options) : p; f(), l.options = Object.assign({}, i, l.options, m), l.scrollParents = { reference: ti(o) ? Hi(o) : o.contextElement ? Hi(o.contextElement) : [], popper: Hi(s) }; var g = Uw(Ww([].concat(n, l.options.modifiers))); return l.orderedModifiers = g.filter(function(y) { return y.enabled; }), h6(), v.update(); }, forceUpdate: function() { if (!d) { var p = l.elements, m = p.reference, g = p.popper; if (Ed(m, g)) { l.rects = { reference: qw(m, wo(g), l.options.strategy === "fixed"), popper: zu(g) }, l.reset = false, l.placement = l.options.placement, l.orderedModifiers.forEach(function(T) { return l.modifiersData[T.name] = Object.assign({}, T.data); }); for (var y = 0; y < l.orderedModifiers.length; y++) { if (l.reset === true) { l.reset = false, y = -1; continue; } var b = l.orderedModifiers[y], 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: v }) || l); } } } }, update: Gw(function() { return new Promise(function(p) { v.forceUpdate(), p(l); }); }), destroy: function() { f(), d = true; } }; if (!Ed(o, s)) return v; v.setOptions(u).then(function(p) { !d && u.onFirstUpdate && u.onFirstUpdate(p); }); function h6() { l.orderedModifiers.forEach(function(p) { var m = p.name, g = p.options, y = g === void 0 ? {} : g, b = p.effect; if (typeof b == "function") { var w = b({ state: l, name: m, instance: v, options: y }), x = function() { }; c.push(w || x); } }); } function f() { c.forEach(function(p) { return p(); }), c = []; } return v; }; } Uu(); var Yw = [nh, oh, rh, jv]; Uu({ defaultModifiers: Yw }); var Zw = [nh, oh, rh, jv, Mw, Ow, Rw, pw, Iw]; var Xw = Uu({ defaultModifiers: Zw }); var jw = (t13, e, r = {}) => { const n = { name: "updateState", enabled: true, phase: "write", fn: ({ state: u }) => { const l = Qw(u); Object.assign(o.value, l); }, requires: ["computeStyles"] }, a = computed(() => { const { onFirstUpdate: u, placement: l, strategy: c, modifiers: d } = unref(r); return { onFirstUpdate: u, placement: l || "bottom", strategy: c || "absolute", modifiers: [ ...d || [], n, { name: "applyStyles", enabled: false } ] }; }), i = shallowRef(), o = ref({ styles: { popper: { position: unref(a).strategy, left: "0", top: "0" }, arrow: { position: "absolute" } }, attributes: {} }), s = () => { i.value && (i.value.destroy(), i.value = void 0); }; return watch(a, (u) => { const l = unref(i); l && l.setOptions(u); }, { deep: true }), watch([t13, e], ([u, l]) => { s(), !(!u || !l) && (i.value = Xw(u, l, unref(a))); }), onBeforeUnmount(() => { s(); }), { state: computed(() => { var u; return { ...((u = unref(i)) == null ? void 0 : u.state) || {} }; }), styles: computed(() => unref(o).styles), attributes: computed(() => unref(o).attributes), update: () => { var u; return (u = unref(i)) == null ? void 0 : u.update(); }, forceUpdate: () => { var u; return (u = unref(i)) == null ? void 0 : u.forceUpdate(); }, instanceRef: computed(() => unref(i)) }; }; function Qw(t13) { const e = Object.keys(t13.elements), r = xs(e.map((a) => [a, t13.styles[a] || {}])), n = xs(e.map((a) => [a, t13.attributes[a]])); return { styles: r, attributes: n }; } function kd() { let t13; const e = (n, a) => { r(), t13 = window.setTimeout(n, a); }, r = () => window.clearTimeout(t13); return Rs(() => r()), { registerTimeout: e, cancelTimeout: r }; } var eu = { prefix: Math.floor(Math.random() * 1e4), current: 0 }; var Jw = Symbol("elIdInjection"); var sh = () => getCurrentInstance() ? inject(Jw, eu) : eu; var Xs = (t13) => { const e = sh(); !_t && e === eu && Dt("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 = Nu(); return computed(() => unref(t13) || `${r.value}-id-${e.prefix}-${e.current++}`); }; var za = []; var Sd = (t13) => { const e = t13; e.key === Lt.esc && za.forEach((r) => r(e)); }; var eC = (t13) => { onMounted(() => { za.length === 0 && document.addEventListener("keydown", Sd), _t && za.push(t13); }), onBeforeUnmount(() => { za = za.filter((e) => e !== t13), za.length === 0 && _t && document.removeEventListener("keydown", Sd); }); }; var Td; var lh = () => { const t13 = Nu(), e = sh(), r = computed(() => `${t13.value}-popper-container-${e.prefix}`), n = computed(() => `#${r.value}`); return { id: r, selector: n }; }; var tC = (t13) => { const e = document.createElement("div"); return e.id = t13, document.body.appendChild(e), e; }; var rC = () => { const { id: t13, selector: e } = lh(); return onBeforeMount(() => { _t && (!Td || !document.body.querySelector(e.value)) && (Td = tC(t13.value)); }), { id: t13, selector: e }; }; var nC = rt({ showAfter: { type: Number, default: 0 }, hideAfter: { type: Number, default: 200 }, autoClose: { type: Number, default: 0 } }); var aC = ({ showAfter: t13, hideAfter: e, autoClose: r, open: n, close: a }) => { const { registerTimeout: i } = kd(), { registerTimeout: o, cancelTimeout: s } = kd(); return { onOpen: (c) => { i(() => { n(c); const d = unref(r); qt(d) && d > 0 && o(() => { a(c); }, d); }, unref(t13)); }, onClose: (c) => { s(), i(() => { a(c); }, unref(e)); } }; }; var uh = Symbol("elForwardRef"); var iC = (t13) => { provide(uh, { setForwardRef: (r) => { t13.value = r; } }); }; var oC = (t13) => ({ mounted(e) { t13(e); }, updated(e) { t13(e); }, unmounted() { t13(null); } }); var _d = { current: 0 }; var Dd = ref(0); var ch = 2e3; var Pd = Symbol("elZIndexContextKey"); var dh = Symbol("zIndexContextKey"); var fh = (t13) => { const e = getCurrentInstance() ? inject(Pd, _d) : _d, r = t13 || (getCurrentInstance() ? inject(dh, void 0) : void 0), n = computed(() => { const o = unref(r); return qt(o) ? o : ch; }), a = computed(() => n.value + Dd.value), i = () => (e.current++, Dd.value = e.current, a.value); return !_t && !inject(Pd) && Dt("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 sC(t13) { let e; function r() { if (t13.value == null) return; const { selectionStart: a, selectionEnd: i, value: o } = t13.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 (t13.value == null || e == null) return; const { value: a } = t13.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); } t13.value.setSelectionRange(u, u); } return [r, n]; } var di = Ws({ type: String, values: Gv, required: false }); var vh = Symbol("size"); var lC = () => { const t13 = inject(vh, {}); return computed(() => unref(t13.size) || ""); }; function Gu(t13, { beforeFocus: e, afterFocus: r, beforeBlur: n, afterBlur: a } = {}) { const i = getCurrentInstance(), { emit: o } = i, s = shallowRef(), u = ref(false), l = (v) => { lr(e) && e(v) || u.value || (u.value = true, o("focus", v), r == null || r()); }, c = (v) => { var h6; lr(n) && n(v) || v.relatedTarget && ((h6 = s.value) != null && h6.contains(v.relatedTarget)) || (u.value = false, o("blur", v), a == null || a()); }, d = () => { var v, h6; (v = s.value) != null && v.contains(document.activeElement) && s.value !== document.activeElement || (h6 = t13.value) == null || h6.focus(); }; return watch(s, (v) => { v && v.setAttribute("tabindex", "-1"); }), kr(s, "focus", l, true), kr(s, "blur", c, true), kr(s, "click", d, true), false, { isFocused: u, wrapperRef: s, handleFocus: l, handleBlur: c }; } function hh({ afterComposition: t13, emit: e }) { const r = ref(false), n = (s) => { e == null || e("compositionstart", s), r.value = true; }, 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 = !N2(c); }, i = (s) => { e == null || e("compositionend", s), r.value && (r.value = false, nextTick(() => t13(s))); }; return { isComposing: r, handleComposition: (s) => { s.type === "compositionend" ? i(s) : a(s); }, handleCompositionStart: n, handleCompositionUpdate: a, handleCompositionEnd: i }; } var ph = Symbol("emptyValuesContextKey"); var uC = "use-empty-values"; var cC = ["", void 0, null]; var dC = void 0; var fC = rt({ emptyValues: Array, valueOnClear: { type: [String, Number, Boolean, Function], default: void 0, validator: (t13) => lr(t13) ? !t13() : !t13 } }); var vC = (t13, e) => { const r = getCurrentInstance() ? inject(ph, ref({})) : ref({}), n = computed(() => t13.emptyValues || r.value.emptyValues || cC), a = computed(() => lr(t13.valueOnClear) ? t13.valueOnClear() : t13.valueOnClear !== void 0 ? t13.valueOnClear : lr(r.value.valueOnClear) ? r.value.valueOnClear() : r.value.valueOnClear !== void 0 ? r.value.valueOnClear : dC), i = (o) => n.value.includes(o); return n.value.includes(a.value) || Dt(uC, "value-on-clear should be a value of empty-values"), { emptyValues: n, valueOnClear: a, isEmptyValue: i }; }; var hC = rt({ ariaLabel: String, ariaOrientation: { type: String, values: ["horizontal", "vertical", "undefined"] }, ariaControls: String }); var Zn = (t13) => zv(hC, t13); var gh = Symbol(); var _s = ref(); function Wu(t13, e = void 0) { const r = getCurrentInstance() ? inject(gh, _s) : _s; return t13 ? computed(() => { var n, a; return (a = (n = r.value) == null ? void 0 : n[t13]) != null ? a : e; }) : r; } function pC(t13, e) { const r = Wu(), n = He(t13, computed(() => { var s; return ((s = r.value) == null ? void 0 : s.namespace) || is; })), a = yo(computed(() => { var s; return (s = r.value) == null ? void 0 : s.locale; })), i = fh(computed(() => { var s; return ((s = r.value) == null ? void 0 : s.zIndex) || ch; })), o = computed(() => { var s; return unref(e) || ((s = r.value) == null ? void 0 : s.size) || ""; }); return gC(computed(() => unref(r) || {})), { ns: n, locale: a, zIndex: i, size: o }; } var gC = (t13, e, r = false) => { var n; const a = !!getCurrentInstance(), i = a ? Wu() : void 0, o = (n = void 0) != null ? n : a ? provide : void 0; if (!o) { Dt("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup()."); return; } const s = computed(() => { const u = unref(t13); return i != null && i.value ? mC(i.value, u) : u; }); return o(gh, s), o(Wv, computed(() => s.value.locale)), o(Yv, computed(() => s.value.namespace)), o(dh, computed(() => s.value.zIndex)), o(vh, { size: computed(() => s.value.size || "") }), o(ph, computed(() => ({ emptyValues: s.value.emptyValues, valueOnClear: s.value.valueOnClear }))), (r || !_s.value) && (_s.value = s.value), s; }; var mC = (t13, e) => { const r = [.../* @__PURE__ */ new Set([...hd(t13), ...hd(e)])], n = {}; for (const a of r) n[a] = e[a] !== void 0 ? e[a] : t13[a]; return n; }; var Ve = (t13, e) => { const r = t13.__vccOpts || t13; for (const [n, a] of e) r[n] = a; return r; }; var yC = rt({ size: { type: $e([Number, String]) }, color: { type: String } }); var bC = defineComponent({ name: "ElIcon", inheritAttrs: false }); var wC = defineComponent({ ...bC, props: yC, setup(t13) { const e = t13, r = He("icon"), n = computed(() => { const { size: a, color: i } = e; return !a && !i ? {} : { fontSize: Mn(a) ? void 0 : Ja(a), "--color": i }; }); return (a, i) => (openBlock(), createElementBlock("i", mergeProps({ class: unref(r).b(), style: unref(n) }, a.$attrs), [ renderSlot(a.$slots, "default") ], 16)); } }); var CC = Ve(wC, [["__file", "icon.vue"]]); var Vt = $t(CC); var Yu = Symbol("formContextKey"); var Qi = Symbol("formItemContextKey"); var pa = (t13, e = {}) => { const r = ref(void 0), n = e.prop ? r : Zv("size"), a = e.global ? r : lC(), i = e.form ? { size: void 0 } : inject(Yu, void 0), o = e.formItem ? { size: void 0 } : inject(Qi, void 0); return computed(() => n.value || unref(t13) || (o == null ? void 0 : o.size) || (i == null ? void 0 : i.size) || a.value || ""); }; var Co = (t13) => { const e = Zv("disabled"), r = inject(Yu, void 0); return computed(() => e.value || unref(t13) || (r == null ? void 0 : r.disabled) || false); }; var Ta = () => { const t13 = inject(Yu, void 0), e = inject(Qi, void 0); return { form: t13, formItem: e }; }; var xo = (t13, { formItemContext: e, disableIdGeneration: r, disableIdManagement: n }) => { r || (r = ref(false)), n || (n = ref(false)); const a = ref(); let i; const o = computed(() => { var s; return !!(!(t13.label || t13.ariaLabel) && e && e.inputIds && ((s = e.inputIds) == null ? void 0 : s.length) <= 1); }); return onMounted(() => { i = watch([toRef(t13, "id"), r], ([s, u]) => { const l = s ?? (u ? void 0 : Xs().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: true }); }), onUnmounted(() => { i && i(), e != null && e.removeInputId && a.value && e.removeInputId(a.value); }), { isLabeledByFormItem: o, inputId: a }; }; var Fr; var xC = ` height:0 !important; visibility:hidden !important; ${j0() ? "" : "overflow:hidden !important;"} position:absolute !important; z-index:-1000 !important; top:0 !important; right:0 !important; `; var EC = [ "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 kC(t13) { const e = window.getComputedStyle(t13), 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: EC.map((o) => `${o}:${e.getPropertyValue(o)}`).join(";"), paddingSize: n, borderSize: a, boxSizing: r }; } function Od(t13, e = 1, r) { var n; Fr || (Fr = document.createElement("textarea"), document.body.appendChild(Fr)); const { paddingSize: a, borderSize: i, boxSizing: o, contextStyle: s } = kC(t13); Fr.setAttribute("style", `${s};${xC}`), Fr.value = t13.value || t13.placeholder || ""; let u = Fr.scrollHeight; const l = {}; o === "border-box" ? u = u + i : o === "content-box" && (u = u - a), Fr.value = ""; const c = Fr.scrollHeight - a; if (qt(e)) { let d = c * e; o === "border-box" && (d = d + a + i), u = Math.max(d, u), l.minHeight = `${d}px`; } if (qt(r)) { let d = c * r; o === "border-box" && (d = d + a + i), u = Math.min(d, u); } return l.height = `${u}px`, (n = Fr.parentNode) == null || n.removeChild(Fr), Fr = void 0, l; } var SC = rt({ id: { type: String, default: void 0 }, size: di, disabled: Boolean, modelValue: { type: $e([ 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: $e([Boolean, Object]), default: false }, 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: Hn }, prefixIcon: { type: Hn }, containerRole: { type: String, default: void 0 }, tabindex: { type: [String, Number], default: 0 }, validateEvent: { type: Boolean, default: true }, inputStyle: { type: $e([Object, Array, String]), default: () => Ra({}) }, autofocus: Boolean, rows: { type: Number, default: 2 }, ...Zn(["ariaLabel"]) }); var TC = { [zt]: (t13) => tr(t13), input: (t13) => tr(t13), change: (t13) => tr(t13), focus: (t13) => t13 instanceof FocusEvent, blur: (t13) => t13 instanceof FocusEvent, clear: () => true, mouseleave: (t13) => t13 instanceof MouseEvent, mouseenter: (t13) => t13 instanceof MouseEvent, keydown: (t13) => t13 instanceof Event, compositionstart: (t13) => t13 instanceof CompositionEvent, compositionupdate: (t13) => t13 instanceof CompositionEvent, compositionend: (t13) => t13 instanceof CompositionEvent }; var _C = defineComponent({ name: "ElInput", inheritAttrs: false }); var DC = defineComponent({ ..._C, props: SC, emits: TC, setup(t13, { expose: e, emit: r }) { const n = t13, a = useAttrs(), i = useSlots(), o = computed(() => { const S = {}; return n.containerRole === "combobox" && (S["aria-haspopup"] = a["aria-haspopup"], S["aria-owns"] = a["aria-owns"], S["aria-expanded"] = a["aria-expanded"]), S; }), s = computed(() => [ n.type === "textarea" ? m.b() : p.b(), p.m(h6.value), p.is("disabled", f.value), p.is("exceed", ee.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")]: R.value && K.value, [p.b("hidden")]: n.type === "hidden" }, a.class ]), u = computed(() => [ p.e("wrapper"), p.is("focus", k.value) ]), l = z2({ excludeKeys: computed(() => Object.keys(o.value)) }), { form: c, formItem: d } = Ta(), { inputId: v } = xo(n, { formItemContext: d }), h6 = pa(), f = Co(), p = He("input"), m = He("textarea"), g = shallowRef(), y = shallowRef(), b = ref(false), w = ref(false), x = ref(), E = shallowRef(n.inputStyle), C = computed(() => g.value || y.value), { wrapperRef: T, isFocused: k, handleFocus: _, handleBlur: D } = Gu(C, { beforeFocus() { return f.value; }, afterBlur() { var S; n.validateEvent && ((S = d == null ? void 0 : d.validate) == null || S.call(d, "blur").catch((z) => Dt(z))); } }), O = computed(() => { var S; return (S = c == null ? void 0 : c.statusIcon) != null ? S : false; }), F = computed(() => (d == null ? void 0 : d.validateState) || ""), L = computed(() => F.value && Uv[F.value]), B = computed(() => w.value ? D2 : b2), I = computed(() => [ a.style ]), M = computed(() => [ n.inputStyle, E.value, { resize: n.resize } ]), A = computed(() => $n(n.modelValue) ? "" : String(n.modelValue)), R = computed(() => n.clearable && !f.value && !n.readonly && !!A.value && (k.value || b.value)), K = computed(() => n.showPassword && !f.value && !n.readonly && !!A.value && (!!A.value || k.value)), H = computed(() => n.showWordLimit && !!n.maxlength && (n.type === "text" || n.type === "textarea") && !f.value && !n.readonly && !n.showPassword), q = computed(() => A.value.length), ee = computed(() => !!H.value && q.value > Number(n.maxlength)), se = computed(() => !!i.suffix || !!n.suffixIcon || R.value || n.showPassword || H.value || !!F.value && O.value), [oe, ae] = sC(g); dn(y, (S) => { if ($(), !H.value || n.resize !== "both") return; const z = S[0], { width: ie } = z.contentRect; x.value = { right: `calc(100% - ${ie + 15 + 6}px)` }; }); const ue = () => { const { type: S, autosize: z } = n; if (!(!_t || S !== "textarea" || !y.value)) if (z) { const ie = Ht(z) ? z.minRows : void 0, j = Ht(z) ? z.maxRows : void 0, Y = Od(y.value, ie, j); E.value = { overflowY: "hidden", ...Y }, nextTick(() => { y.value.offsetHeight, E.value = Y; }); } else E.value = { minHeight: Od(y.value).minHeight }; }, $ = /* @__PURE__ */ ((S) => { let z = false; return () => { var ie; if (z || !n.autosize) return; ((ie = y.value) == null ? void 0 : ie.offsetParent) === null || (S(), z = true); }; })(ue), G = () => { const S = C.value, z = n.formatter ? n.formatter(A.value) : A.value; !S || S.value === z || (S.value = z); }, Q = async (S) => { oe(); let { value: z } = S.target; if (n.formatter && (z = n.parser ? n.parser(z) : z), !Ee.value) { if (z === A.value) { G(); return; } r(zt, z), r("input", z), await nextTick(), G(), ae(); } }, ge = (S) => { r("change", S.target.value); }, { isComposing: Ee, handleCompositionStart: fe, handleCompositionUpdate: me, handleCompositionEnd: Ce } = hh({ emit: r, afterComposition: Q }), ke = () => { w.value = !w.value, xe(); }, xe = async () => { var S; await nextTick(), (S = C.value) == null || S.focus(); }, De = () => { var S; return (S = C.value) == null ? void 0 : S.blur(); }, qe = (S) => { b.value = false, r("mouseleave", S); }, Ke = (S) => { b.value = true, r("mouseenter", S); }, Be = (S) => { r("keydown", S); }, Ge = () => { var S; (S = C.value) == null || S.select(); }, le = () => { r(zt, ""), r("change", ""), r("clear"), r("input", ""); }; return watch(() => n.modelValue, () => { var S; nextTick(() => ue()), n.validateEvent && ((S = d == null ? void 0 : d.validate) == null || S.call(d, "change").catch((z) => Dt(z))); }), watch(A, () => G()), watch(() => n.type, async () => { await nextTick(), G(), ue(); }), onMounted(() => { !n.formatter && n.parser && Dt("ElInput", "If you set the parser, you also need to set the formatter."), G(), nextTick(ue); }), e({ input: g, textarea: y, ref: C, textareaStyle: M, autosize: toRef(n, "autosize"), isComposing: Ee, focus: xe, blur: De, select: Ge, clear: le, resizeTextarea: ue }), (S, z) => (openBlock(), createElementBlock("div", mergeProps(unref(o), { class: [ unref(s), { [unref(p).bm("group", "append")]: S.$slots.append, [unref(p).bm("group", "prepend")]: S.$slots.prepend } ], style: unref(I), role: S.containerRole, onMouseenter: Ke, onMouseleave: qe }), [ createCommentVNode(" input "), S.type !== "textarea" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ createCommentVNode(" prepend slot "), S.$slots.prepend ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(p).be("group", "prepend")) }, [ renderSlot(S.$slots, "prepend") ], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { ref_key: "wrapperRef", ref: T, class: normalizeClass(unref(u)) }, [ createCommentVNode(" prefix slot "), S.$slots.prefix || S.prefixIcon ? (openBlock(), createElementBlock("span", { key: 0, class: normalizeClass(unref(p).e("prefix")) }, [ createBaseVNode("span", { class: normalizeClass(unref(p).e("prefix-inner")) }, [ renderSlot(S.$slots, "prefix"), S.prefixIcon ? (openBlock(), createBlock(unref(Vt), { key: 0, class: normalizeClass(unref(p).e("icon")) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(S.prefixIcon))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 2) ], 2)) : createCommentVNode("v-if", true), createBaseVNode("input", mergeProps({ id: unref(v), ref_key: "input", ref: g, class: unref(p).e("inner") }, unref(l), { minlength: S.minlength, maxlength: S.maxlength, type: S.showPassword ? w.value ? "text" : "password" : S.type, disabled: unref(f), readonly: S.readonly, autocomplete: S.autocomplete, tabindex: S.tabindex, "aria-label": S.ariaLabel, placeholder: S.placeholder, style: S.inputStyle, form: S.form, autofocus: S.autofocus, onCompositionstart: unref(fe), onCompositionupdate: unref(me), onCompositionend: unref(Ce), onInput: Q, onChange: ge, onKeydown: Be }), null, 16, ["id", "minlength", "maxlength", "type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus", "onCompositionstart", "onCompositionupdate", "onCompositionend"]), createCommentVNode(" suffix slot "), unref(se) ? (openBlock(), createElementBlock("span", { key: 1, class: normalizeClass(unref(p).e("suffix")) }, [ createBaseVNode("span", { class: normalizeClass(unref(p).e("suffix-inner")) }, [ !unref(R) || !unref(K) || !unref(H) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ renderSlot(S.$slots, "suffix"), S.suffixIcon ? (openBlock(), createBlock(unref(Vt), { key: 0, class: normalizeClass(unref(p).e("icon")) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(S.suffixIcon))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 64)) : createCommentVNode("v-if", true), unref(R) ? (openBlock(), createBlock(unref(Vt), { key: 1, class: normalizeClass([unref(p).e("icon"), unref(p).e("clear")]), onMousedown: withModifiers(unref(Wi), ["prevent"]), onClick: le }, { default: withCtx(() => [ createVNode(unref(Au)) ]), _: 1 }, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true), unref(K) ? (openBlock(), createBlock(unref(Vt), { key: 2, class: normalizeClass([unref(p).e("icon"), unref(p).e("password")]), onClick: ke }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(unref(B)))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true), unref(H) ? (openBlock(), createElementBlock("span", { key: 3, class: normalizeClass(unref(p).e("count")) }, [ createBaseVNode("span", { class: normalizeClass(unref(p).e("count-inner")) }, toDisplayString(unref(q)) + " / " + toDisplayString(S.maxlength), 3) ], 2)) : createCommentVNode("v-if", true), unref(F) && unref(L) && unref(O) ? (openBlock(), createBlock(unref(Vt), { key: 4, class: normalizeClass([ unref(p).e("icon"), unref(p).e("validateIcon"), unref(p).is("loading", unref(F) === "validating") ]) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(unref(L)))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 2) ], 2)) : createCommentVNode("v-if", true) ], 2), createCommentVNode(" append slot "), S.$slots.append ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(unref(p).be("group", "append")) }, [ renderSlot(S.$slots, "append") ], 2)) : createCommentVNode("v-if", true) ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [ createCommentVNode(" textarea "), createBaseVNode("textarea", mergeProps({ id: unref(v), ref_key: "textarea", ref: y, class: [unref(m).e("inner"), unref(p).is("focus", unref(k))] }, unref(l), { minlength: S.minlength, maxlength: S.maxlength, tabindex: S.tabindex, disabled: unref(f), readonly: S.readonly, autocomplete: S.autocomplete, style: unref(M), "aria-label": S.ariaLabel, placeholder: S.placeholder, form: S.form, autofocus: S.autofocus, rows: S.rows, onCompositionstart: unref(fe), onCompositionupdate: unref(me), onCompositionend: unref(Ce), onInput: Q, onFocus: unref(_), onBlur: unref(D), onChange: ge, onKeydown: Be }), null, 16, ["id", "minlength", "maxlength", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus", "rows", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onFocus", "onBlur"]), unref(H) ? (openBlock(), createElementBlock("span", { key: 0, style: normalizeStyle(x.value), class: normalizeClass(unref(p).e("count")) }, toDisplayString(unref(q)) + " / " + toDisplayString(S.maxlength), 7)) : createCommentVNode("v-if", true) ], 64)) ], 16, ["role"])); } }); var PC = Ve(DC, [["__file", "input.vue"]]); var Eo = $t(PC); var La = 4; var OC = { vertical: { offset: "offsetHeight", scroll: "scrollTop", scrollSize: "scrollHeight", size: "height", key: "vertical", axis: "Y", client: "clientY", direction: "top" }, horizontal: { offset: "offsetWidth", scroll: "scrollLeft", scrollSize: "scrollWidth", size: "width", key: "horizontal", axis: "X", client: "clientX", direction: "left" } }; var LC = ({ move: t13, size: e, bar: r }) => ({ [r.size]: e, transform: `translate${r.axis}(${t13}%)` }); var Zu = Symbol("scrollbarContextKey"); var IC = rt({ vertical: Boolean, size: String, move: Number, ratio: { type: Number, required: true }, always: Boolean }); var FC = "Thumb"; var AC = defineComponent({ __name: "thumb", props: IC, setup(t13) { const e = t13, r = inject(Zu), n = He("scrollbar"); r || jb(FC, "can not inject scrollbar context"); const a = ref(), i = ref(), o = ref({}), s = ref(false); let u = false, l = false, c = _t ? document.onselectstart : null; const d = computed(() => OC[e.vertical ? "vertical" : "horizontal"]), v = computed(() => LC({ size: e.size, move: e.move, bar: d.value })), h6 = computed(() => a.value[d.value.offset] ** 2 / r.wrapElement[d.value.scrollSize] / e.ratio / i.value[d.value.offset]), f = (E) => { var C; if (E.stopPropagation(), E.ctrlKey || [1, 2].includes(E.button)) return; (C = window.getSelection()) == null || C.removeAllRanges(), m(E); const T = E.currentTarget; T && (o.value[d.value.axis] = T[d.value.offset] - (E[d.value.client] - T.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]), T = i.value[d.value.offset] / 2, k = (C - T) * 100 * h6.value / a.value[d.value.offset]; r.wrapElement[d.value.scroll] = k * r.wrapElement[d.value.scrollSize] / 100; }, m = (E) => { E.stopImmediatePropagation(), u = true, document.addEventListener("mousemove", g), document.addEventListener("mouseup", y), c = document.onselectstart, document.onselectstart = () => false; }, g = (E) => { if (!a.value || !i.value || u === false) return; const C = o.value[d.value.axis]; if (!C) return; const T = (a.value.getBoundingClientRect()[d.value.direction] - E[d.value.client]) * -1, k = i.value[d.value.offset] - C, _ = (T - k) * 100 * h6.value / a.value[d.value.offset]; r.wrapElement[d.value.scroll] = _ * r.wrapElement[d.value.scrollSize] / 100; }, y = () => { u = false, o.value[d.value.axis] = 0, document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", y), x(), l && (s.value = false); }, b = () => { l = false, s.value = !!e.size; }, w = () => { l = true, s.value = u; }; onBeforeUnmount(() => { x(), document.removeEventListener("mouseup", y); }); const x = () => { document.onselectstart !== c && (document.onselectstart = c); }; return kr(toRef(r, "scrollbarElement"), "mousemove", b), kr(toRef(r, "scrollbarElement"), "mouseleave", w), (E, C) => (openBlock(), createBlock(Transition, { name: unref(n).b("fade"), persisted: "" }, { default: withCtx(() => [ withDirectives(createBaseVNode("div", { ref_key: "instance", ref: a, class: normalizeClass([unref(n).e("bar"), unref(n).is(unref(d).key)]), onMousedown: p }, [ createBaseVNode("div", { ref_key: "thumb", ref: i, class: normalizeClass(unref(n).e("thumb")), style: normalizeStyle(unref(v)), onMousedown: f }, null, 38) ], 34), [ [vShow, E.always || s.value] ]) ]), _: 1 }, 8, ["name"])); } }); var Ld = Ve(AC, [["__file", "thumb.vue"]]); var MC = rt({ always: { type: Boolean, default: true }, minSize: { type: Number, required: true } }); var BC = defineComponent({ __name: "bar", props: MC, setup(t13, { expose: e }) { const r = t13, n = inject(Zu), a = ref(0), i = ref(0), o = ref(""), s = ref(""), u = ref(1), l = ref(1); return e({ handleScroll: (v) => { if (v) { const h6 = v.offsetHeight - La, f = v.offsetWidth - La; i.value = v.scrollTop * 100 / h6 * u.value, a.value = v.scrollLeft * 100 / f * l.value; } }, update: () => { const v = n == null ? void 0 : n.wrapElement; if (!v) return; const h6 = v.offsetHeight - La, f = v.offsetWidth - La, p = h6 ** 2 / v.scrollHeight, m = f ** 2 / v.scrollWidth, g = Math.max(p, r.minSize), y = Math.max(m, r.minSize); u.value = p / (h6 - p) / (g / (h6 - g)), l.value = m / (f - m) / (y / (f - y)), s.value = g + La < h6 ? `${g}px` : "", o.value = y + La < f ? `${y}px` : ""; } }), (v, h6) => (openBlock(), createElementBlock(Fragment, null, [ createVNode(Ld, { move: a.value, ratio: l.value, size: o.value, always: v.always }, null, 8, ["move", "ratio", "size", "always"]), createVNode(Ld, { move: i.value, ratio: u.value, size: s.value, vertical: "", always: v.always }, null, 8, ["move", "ratio", "size", "always"]) ], 64)); } }); var NC = Ve(BC, [["__file", "bar.vue"]]); var $C = rt({ height: { type: [String, Number], default: "" }, maxHeight: { type: [String, Number], default: "" }, native: { type: Boolean, default: false }, wrapStyle: { type: $e([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, ...Zn(["ariaLabel", "ariaOrientation"]) }); var RC = { scroll: ({ scrollTop: t13, scrollLeft: e }) => [t13, e].every(qt) }; var tu = "ElScrollbar"; var zC = defineComponent({ name: tu }); var VC = defineComponent({ ...zC, props: $C, emits: RC, setup(t13, { expose: e, emit: r }) { const n = t13, a = He("scrollbar"); let i, o, s = 0, u = 0; const l = ref(), c = ref(), d = ref(), v = ref(), h6 = computed(() => { const x = {}; return n.height && (x.height = Ja(n.height)), n.maxHeight && (x.maxHeight = Ja(n.maxHeight)), [n.wrapStyle, x]; }), f = computed(() => [ n.wrapClass, a.e("wrap"), { [a.em("wrap", "hidden-default")]: !n.native } ]), p = computed(() => [a.e("view"), n.viewClass]), m = () => { var x; c.value && ((x = v.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 g(x, E) { Ht(x) ? c.value.scrollTo(x) : qt(x) && qt(E) && c.value.scrollTo(x, E); } const y = (x) => { if (!qt(x)) { Dt(tu, "value must be a number"); return; } c.value.scrollTop = x; }, b = (x) => { if (!qt(x)) { Dt(tu, "value must be a number"); return; } c.value.scrollLeft = x; }, w = () => { var x; (x = v.value) == null || x.update(); }; return watch(() => n.noresize, (x) => { x ? (i == null || i(), o == null || o()) : ({ stop: i } = dn(d, w), o = kr("resize", w)); }, { immediate: true }), watch(() => [n.maxHeight, n.height], () => { n.native || nextTick(() => { var x; w(), c.value && ((x = v.value) == null || x.handleScroll(c.value)); }); }), provide(Zu, reactive({ scrollbarElement: l, wrapElement: c })), onActivated(() => { c.value && (c.value.scrollTop = s, c.value.scrollLeft = u); }), onMounted(() => { n.native || nextTick(() => { w(); }); }), onUpdated(() => w()), e({ wrapRef: c, update: w, scrollTo: g, setScrollTop: y, setScrollLeft: b, handleScroll: m }), (x, E) => (openBlock(), createElementBlock("div", { ref_key: "scrollbarRef", ref: l, class: normalizeClass(unref(a).b()) }, [ createBaseVNode("div", { ref_key: "wrapRef", ref: c, class: normalizeClass(unref(f)), style: normalizeStyle(unref(h6)), tabindex: x.tabindex, onScroll: m }, [ (openBlock(), createBlock(resolveDynamicComponent(x.tag), { id: x.id, ref_key: "resizeRef", ref: d, class: normalizeClass(unref(p)), style: normalizeStyle(x.viewStyle), role: x.role, "aria-label": x.ariaLabel, "aria-orientation": x.ariaOrientation }, { default: withCtx(() => [ renderSlot(x.$slots, "default") ]), _: 3 }, 8, ["id", "class", "style", "role", "aria-label", "aria-orientation"])) ], 46, ["tabindex"]), x.native ? createCommentVNode("v-if", true) : (openBlock(), createBlock(NC, { key: 0, ref_key: "barRef", ref: v, always: x.always, "min-size": x.minSize }, null, 8, ["always", "min-size"])) ], 2)); } }); var HC = Ve(VC, [["__file", "scrollbar.vue"]]); var qC = $t(HC); var Xu = Symbol("popper"); var mh = Symbol("popperContent"); var KC = [ "dialog", "grid", "group", "listbox", "menu", "navigation", "tooltip", "tree" ]; var yh = rt({ role: { type: String, values: KC, default: "tooltip" } }); var UC = defineComponent({ name: "ElPopper", inheritAttrs: false }); var GC = defineComponent({ ...UC, props: yh, setup(t13, { expose: e }) { const r = t13, n = ref(), a = ref(), i = ref(), o = ref(), s = computed(() => r.role), u = { triggerRef: n, popperInstanceRef: a, contentRef: i, referenceRef: o, role: s }; return e(u), provide(Xu, u), (l, c) => renderSlot(l.$slots, "default"); } }); var WC = Ve(GC, [["__file", "popper.vue"]]); var bh = rt({ arrowOffset: { type: Number, default: 5 } }); var YC = defineComponent({ name: "ElPopperArrow", inheritAttrs: false }); var ZC = defineComponent({ ...YC, props: bh, setup(t13, { expose: e }) { const r = t13, n = He("popper"), { arrowOffset: a, arrowRef: i, arrowStyle: o } = inject(mh, void 0); return watch(() => r.arrowOffset, (s) => { a.value = s; }), onBeforeUnmount(() => { i.value = void 0; }), e({ arrowRef: i }), (s, u) => (openBlock(), createElementBlock("span", { ref_key: "arrowRef", ref: i, class: normalizeClass(unref(n).e("arrow")), style: normalizeStyle(unref(o)), "data-popper-arrow": "" }, null, 6)); } }); var XC = Ve(ZC, [["__file", "arrow.vue"]]); var kl = "ElOnlyChild"; var jC = defineComponent({ name: kl, setup(t13, { slots: e, attrs: r }) { var n; const a = inject(uh), i = oC((n = a == null ? void 0 : a.setForwardRef) != null ? n : Wi); return () => { var o; const s = (o = e.default) == null ? void 0 : o.call(e, r); if (!s) return null; if (s.length > 1) return Dt(kl, "requires exact only one valid child."), null; const u = wh(s); return u ? withDirectives(cloneVNode(u, r), [[i]]) : (Dt(kl, "no valid child node found"), null); }; } }); function wh(t13) { if (!t13) return null; const e = t13; for (const r of e) { if (Ht(r)) switch (r.type) { case Comment: continue; case Text: case "svg": return Id(r); case Fragment: return wh(r.children); default: return r; } return Id(r); } return null; } function Id(t13) { const e = He("only-child"); return createVNode("span", { class: e.e("content") }, [t13]); } var Ch = rt({ virtualRef: { type: $e(Object) }, virtualTriggering: Boolean, onMouseenter: { type: $e(Function) }, onMouseleave: { type: $e(Function) }, onClick: { type: $e(Function) }, onKeydown: { type: $e(Function) }, onFocus: { type: $e(Function) }, onBlur: { type: $e(Function) }, onContextmenu: { type: $e(Function) }, id: String, open: Boolean }); var QC = defineComponent({ name: "ElPopperTrigger", inheritAttrs: false }); var JC = defineComponent({ ...QC, props: Ch, setup(t13, { expose: e }) { const r = t13, { role: n, triggerRef: a } = inject(Xu, void 0); iC(a); const i = computed(() => s.value ? r.id : void 0), o = computed(() => { if (n && n.value === "tooltip") return r.open && r.id ? r.id : void 0; }), s = computed(() => { if (n && n.value !== "tooltip") return n.value; }), u = computed(() => s.value ? `${r.open}` : void 0); let l; const c = [ "onMouseenter", "onMouseleave", "onClick", "onKeydown", "onFocus", "onBlur", "onContextmenu" ]; return onMounted(() => { watch(() => r.virtualRef, (d) => { d && (a.value = vn(d)); }, { immediate: true }), watch(a, (d, v) => { l == null || l(), l = void 0, ua(d) && (c.forEach((h6) => { var f; const p = r[h6]; p && (d.addEventListener(h6.slice(2).toLowerCase(), p), (f = v == null ? void 0 : v.removeEventListener) == null || f.call(v, h6.slice(2).toLowerCase(), p)); }), l = watch([i, o, s, u], (h6) => { [ "aria-controls", "aria-describedby", "aria-haspopup", "aria-expanded" ].forEach((f, p) => { $n(h6[p]) ? d.removeAttribute(f) : d.setAttribute(f, h6[p]); }); }, { immediate: true })), ua(v) && [ "aria-controls", "aria-describedby", "aria-haspopup", "aria-expanded" ].forEach((h6) => v.removeAttribute(h6)); }, { immediate: true }); }), onBeforeUnmount(() => { if (l == null || l(), l = void 0, a.value && ua(a.value)) { const d = a.value; c.forEach((v) => { const h6 = r[v]; h6 && d.removeEventListener(v.slice(2).toLowerCase(), h6); }), a.value = void 0; } }), e({ triggerRef: a }), (d, v) => d.virtualTriggering ? createCommentVNode("v-if", true) : (openBlock(), createBlock(unref(jC), mergeProps({ key: 0 }, d.$attrs, { "aria-controls": unref(i), "aria-describedby": unref(o), "aria-expanded": unref(u), "aria-haspopup": unref(s) }), { default: withCtx(() => [ renderSlot(d.$slots, "default") ]), _: 3 }, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"])); } }); var ex = Ve(JC, [["__file", "trigger.vue"]]); var Sl = "focus-trap.focus-after-trapped"; var Tl = "focus-trap.focus-after-released"; var tx = "focus-trap.focusout-prevented"; var Fd = { cancelable: true, bubbles: false }; var rx = { cancelable: true, bubbles: false }; var Ad = "focusAfterTrapped"; var Md = "focusAfterReleased"; var nx = Symbol("elFocusTrap"); var ju = ref(); var js = ref(0); var Qu = ref(0); var Ro = 0; var xh = (t13) => { const e = [], r = document.createTreeWalker(t13, 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; }; var Bd = (t13, e) => { for (const r of t13) if (!ax(r, e)) return r; }; var ax = (t13, e) => { if (false) return false; if (getComputedStyle(t13).visibility === "hidden") return true; for (; t13; ) { if (e && t13 === e) return false; if (getComputedStyle(t13).display === "none") return true; t13 = t13.parentElement; } return false; }; var ix = (t13) => { const e = xh(t13), r = Bd(e, t13), n = Bd(e.reverse(), t13); return [r, n]; }; var ox = (t13) => t13 instanceof HTMLInputElement && "select" in t13; var On = (t13, e) => { if (t13 && t13.focus) { const r = document.activeElement; t13.focus({ preventScroll: true }), Qu.value = window.performance.now(), t13 !== r && ox(t13) && e && t13.select(); } }; function Nd(t13, e) { const r = [...t13], n = t13.indexOf(e); return n !== -1 && r.splice(n, 1), r; } var sx = () => { let t13 = []; return { push: (n) => { const a = t13[0]; a && n !== a && a.pause(), t13 = Nd(t13, n), t13.unshift(n); }, remove: (n) => { var a, i; t13 = Nd(t13, n), (i = (a = t13[0]) == null ? void 0 : a.resume) == null || i.call(a); } }; }; var lx = (t13, e = false) => { const r = document.activeElement; for (const n of t13) if (On(n, e), document.activeElement !== r) return; }; var $d = sx(); var ux = () => js.value > Qu.value; var zo = () => { ju.value = "pointer", js.value = window.performance.now(); }; var Rd = () => { ju.value = "keyboard", js.value = window.performance.now(); }; var cx = () => (onMounted(() => { Ro === 0 && (document.addEventListener("mousedown", zo), document.addEventListener("touchstart", zo), document.addEventListener("keydown", Rd)), Ro++; }), onBeforeUnmount(() => { Ro--, Ro <= 0 && (document.removeEventListener("mousedown", zo), document.removeEventListener("touchstart", zo), document.removeEventListener("keydown", Rd)); }), { focusReason: ju, lastUserFocusTimestamp: js, lastAutomatedFocusTimestamp: Qu }); var Vo = (t13) => new CustomEvent(tx, { ...rx, detail: t13 }); var dx = defineComponent({ name: "ElFocusTrap", inheritAttrs: false, props: { loop: Boolean, trapped: Boolean, focusTrapEl: Object, focusStartEl: { type: [Object, String], default: "first" } }, emits: [ Ad, Md, "focusin", "focusout", "focusout-prevented", "release-requested" ], setup(t13, { emit: e }) { const r = ref(); let n, a; const { focusReason: i } = cx(); eC((f) => { t13.trapped && !o.paused && e("release-requested", f); }); const o = { paused: false, pause() { this.paused = true; }, resume() { this.paused = false; } }, s = (f) => { if (!t13.loop && !t13.trapped || o.paused) return; const { key: p, altKey: m, ctrlKey: g, metaKey: y, currentTarget: b, shiftKey: w } = f, { loop: x } = t13, E = p === Lt.tab && !m && !g && !y, C = document.activeElement; if (E && C) { const T = b, [k, _] = ix(T); if (k && _) { if (!w && C === _) { const O = Vo({ focusReason: i.value }); e("focusout-prevented", O), O.defaultPrevented || (f.preventDefault(), x && On(k, true)); } else if (w && [k, T].includes(C)) { const O = Vo({ focusReason: i.value }); e("focusout-prevented", O), O.defaultPrevented || (f.preventDefault(), x && On(_, true)); } } else if (C === T) { const O = Vo({ focusReason: i.value }); e("focusout-prevented", O), O.defaultPrevented || f.preventDefault(); } } }; provide(nx, { focusTrapRef: r, onKeydown: s }), watch(() => t13.focusTrapEl, (f) => { f && (r.value = f); }, { immediate: true }), watch([r], ([f], [p]) => { f && (f.addEventListener("keydown", s), f.addEventListener("focusin", c), f.addEventListener("focusout", d)), p && (p.removeEventListener("keydown", s), p.removeEventListener("focusin", c), p.removeEventListener("focusout", d)); }); const u = (f) => { e(Ad, f); }, l = (f) => e(Md, f), c = (f) => { const p = unref(r); if (!p) return; const m = f.target, g = f.relatedTarget, y = m && p.contains(m); t13.trapped || g && p.contains(g) || (n = g), y && e("focusin", f), !o.paused && t13.trapped && (y ? a = m : On(a, true)); }, d = (f) => { const p = unref(r); if (!(o.paused || !p)) if (t13.trapped) { const m = f.relatedTarget; !$n(m) && !p.contains(m) && setTimeout(() => { if (!o.paused && t13.trapped) { const g = Vo({ focusReason: i.value }); e("focusout-prevented", g), g.defaultPrevented || On(a, true); } }, 0); } else { const m = f.target; m && p.contains(m) || e("focusout", f); } }; async function v() { await nextTick(); const f = unref(r); if (f) { $d.push(o); const p = f.contains(document.activeElement) ? n : document.activeElement; if (n = p, !f.contains(p)) { const g = new Event(Sl, Fd); f.addEventListener(Sl, u), f.dispatchEvent(g), g.defaultPrevented || nextTick(() => { let y = t13.focusStartEl; tr(y) || (On(y), document.activeElement !== y && (y = "first")), y === "first" && lx(xh(f), true), (document.activeElement === p || y === "container") && On(f); }); } } } function h6() { const f = unref(r); if (f) { f.removeEventListener(Sl, u); const p = new CustomEvent(Tl, { ...Fd, detail: { focusReason: i.value } }); f.addEventListener(Tl, l), f.dispatchEvent(p), !p.defaultPrevented && (i.value == "keyboard" || !ux() || f.contains(document.activeElement)) && On(n ?? document.body), f.removeEventListener(Tl, l), $d.remove(o); } } return onMounted(() => { t13.trapped && v(), watch(() => t13.trapped, (f) => { f ? v() : h6(); }); }), onBeforeUnmount(() => { t13.trapped && h6(), r.value && (r.value.removeEventListener("keydown", s), r.value.removeEventListener("focusin", c), r.value.removeEventListener("focusout", d), r.value = void 0); }), { onKeydown: s }; } }); function fx(t13, e, r, n, a, i) { return renderSlot(t13.$slots, "default", { handleKeydown: t13.onKeydown }); } var vx = Ve(dx, [["render", fx], ["__file", "focus-trap.vue"]]); var hx = ["fixed", "absolute"]; var px = rt({ boundariesPadding: { type: Number, default: 0 }, fallbackPlacements: { type: $e(Array), default: void 0 }, gpuAcceleration: { type: Boolean, default: true }, offset: { type: Number, default: 12 }, placement: { type: String, values: Ys, default: "bottom" }, popperOptions: { type: $e(Object), default: () => ({}) }, strategy: { type: String, values: hx, default: "absolute" } }); var Eh = rt({ ...px, id: String, style: { type: $e([String, Array, Object]) }, className: { type: $e([String, Array, Object]) }, effect: { type: $e(String), default: "dark" }, visible: Boolean, enterable: { type: Boolean, default: true }, pure: Boolean, focusOnShow: { type: Boolean, default: false }, trapping: { type: Boolean, default: false }, popperClass: { type: $e([String, Array, Object]) }, popperStyle: { type: $e([String, Array, Object]) }, referenceEl: { type: $e(Object) }, triggerTargetEl: { type: $e(Object) }, stopPopperMouseEvent: { type: Boolean, default: true }, virtualTriggering: Boolean, zIndex: Number, ...Zn(["ariaLabel"]) }); var gx = { mouseenter: (t13) => t13 instanceof MouseEvent, mouseleave: (t13) => t13 instanceof MouseEvent, focus: () => true, blur: () => true, close: () => true }; var mx = (t13, e = []) => { const { placement: r, strategy: n, popperOptions: a } = t13, i = { placement: r, strategy: n, ...a, modifiers: [...bx(t13), ...e] }; return wx(i, a == null ? void 0 : a.modifiers), i; }; var yx = (t13) => { if (_t) return vn(t13); }; function bx(t13) { const { offset: e, gpuAcceleration: r, fallbackPlacements: n } = t13; 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 wx(t13, e) { e && (t13.modifiers = [...t13.modifiers, ...e ?? []]); } var Cx = 0; var xx = (t13) => { const { popperInstanceRef: e, contentRef: r, triggerRef: n, role: a } = inject(Xu, void 0), i = ref(), o = ref(), s = computed(() => ({ name: "eventListeners", enabled: !!t13.visible })), u = computed(() => { var g; const y = unref(i), b = (g = unref(o)) != null ? g : Cx; return { name: "arrow", enabled: !Ub(y), options: { element: y, padding: b } }; }), l = computed(() => ({ onFirstUpdate: () => { f(); }, ...mx(t13, [ unref(u), unref(s) ]) })), c = computed(() => yx(t13.referenceEl) || unref(n)), { attributes: d, state: v, styles: h6, update: f, forceUpdate: p, instanceRef: m } = jw(c, r, l); return watch(m, (g) => e.value = g), onMounted(() => { watch(() => { var g; return (g = unref(c)) == null ? void 0 : g.getBoundingClientRect(); }, () => { f(); }); }), { attributes: d, arrowRef: i, contentRef: r, instanceRef: m, state: v, styles: h6, role: a, forceUpdate: p, update: f }; }; var Ex = (t13, { attributes: e, styles: r, role: n }) => { const { nextZIndex: a } = fh(), i = He("popper"), o = computed(() => unref(e).popper), s = ref(qt(t13.zIndex) ? t13.zIndex : a()), u = computed(() => [ i.b(), i.is("pure", t13.pure), i.is(t13.effect), t13.popperClass ]), l = computed(() => [ { zIndex: unref(s) }, unref(r).popper, t13.popperStyle || {} ]), c = computed(() => n.value === "dialog" ? "false" : void 0), d = computed(() => unref(r).arrow || {}); return { ariaModal: c, arrowStyle: d, contentAttrs: o, contentClass: u, contentStyle: l, contentZIndex: s, updateZIndex: () => { s.value = qt(t13.zIndex) ? t13.zIndex : a(); } }; }; var kx = (t13, e) => { const r = ref(false), n = ref(); 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) => { t13.visible && !r.value && (l.target && (n.value = l.target), r.value = true); }, onFocusoutPrevented: (l) => { t13.trapping || (l.detail.focusReason === "pointer" && l.preventDefault(), r.value = false); }, onReleaseRequested: () => { r.value = false, e("close"); } }; }; var Sx = defineComponent({ name: "ElPopperContent" }); var Tx = defineComponent({ ...Sx, props: Eh, emits: gx, setup(t13, { expose: e, emit: r }) { const n = t13, { focusStartRef: a, trapped: i, onFocusAfterReleased: o, onFocusAfterTrapped: s, onFocusInTrap: u, onFocusoutPrevented: l, onReleaseRequested: c } = kx(n, r), { attributes: d, arrowRef: v, contentRef: h6, styles: f, instanceRef: p, role: m, update: g } = xx(n), { ariaModal: y, arrowStyle: b, contentAttrs: w, contentClass: x, contentStyle: E, updateZIndex: C } = Ex(n, { styles: f, attributes: d, role: m }), T = inject(Qi, void 0), k = ref(); provide(mh, { arrowStyle: b, arrowRef: v, arrowOffset: k }), T && provide(Qi, { ...T, addInputId: Wi, removeInputId: Wi }); let _; const D = (F = true) => { g(), F && C(); }, O = () => { D(false), n.visible && n.focusOnShow ? i.value = true : n.visible === false && (i.value = false); }; return onMounted(() => { watch(() => n.triggerTargetEl, (F, L) => { _ == null || _(), _ = void 0; const B = unref(F || h6.value), I = unref(L || h6.value); ua(B) && (_ = watch([m, () => n.ariaLabel, y, () => n.id], (M) => { ["role", "aria-label", "aria-modal", "id"].forEach((A, R) => { $n(M[R]) ? B.removeAttribute(A) : B.setAttribute(A, M[R]); }); }, { immediate: true })), I !== B && ua(I) && ["role", "aria-label", "aria-modal", "id"].forEach((M) => { I.removeAttribute(M); }); }, { immediate: true }), watch(() => n.visible, O, { immediate: true }); }), onBeforeUnmount(() => { _ == null || _(), _ = void 0; }), e({ popperContentRef: h6, popperInstanceRef: p, updatePopper: D, contentStyle: E }), (F, L) => (openBlock(), createElementBlock("div", mergeProps({ ref_key: "contentRef", ref: h6 }, unref(w), { style: unref(E), class: unref(x), tabindex: "-1", onMouseenter: (B) => F.$emit("mouseenter", B), onMouseleave: (B) => F.$emit("mouseleave", B) }), [ createVNode(unref(vx), { trapped: unref(i), "trap-on-focus-in": true, "focus-trap-el": unref(h6), "focus-start-el": unref(a), onFocusAfterTrapped: unref(s), onFocusAfterReleased: unref(o), onFocusin: unref(u), onFocusoutPrevented: unref(l), onReleaseRequested: unref(c) }, { default: withCtx(() => [ renderSlot(F.$slots, "default") ]), _: 3 }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"]) ], 16, ["onMouseenter", "onMouseleave"])); } }); var _x = Ve(Tx, [["__file", "content.vue"]]); var Dx = $t(WC); var Ju = Symbol("elTooltip"); var cr = rt({ ...nC, ...Eh, appendTo: { type: $e([String, Object]) }, content: { type: String, default: "" }, rawContent: Boolean, persistent: Boolean, visible: { type: $e(Boolean), default: null }, transition: String, teleported: { type: Boolean, default: true }, disabled: Boolean, ...Zn(["ariaLabel"]) }); var Ji = rt({ ...Ch, disabled: Boolean, trigger: { type: $e([String, Array]), default: "hover" }, triggerKeys: { type: $e(Array), default: () => [Lt.enter, Lt.space] } }); var { useModelToggleProps: Px, useModelToggleEmits: Ox, useModelToggle: Lx } = Y2("visible"); var Ix = rt({ ...yh, ...Px, ...cr, ...Ji, ...bh, showArrow: { type: Boolean, default: true } }); var Fx = [ ...Ox, "before-show", "before-hide", "show", "hide", "open", "close" ]; var Ax = (t13, e) => fr(t13) ? t13.includes(e) : t13 === e; var Ia = (t13, e, r) => (n) => { Ax(unref(t13), e) && r(n); }; var Mx = defineComponent({ name: "ElTooltipTrigger" }); var Bx = defineComponent({ ...Mx, props: Ji, setup(t13, { expose: e }) { const r = t13, n = He("tooltip"), { controlled: a, id: i, open: o, onOpen: s, onClose: u, onToggle: l } = inject(Ju, void 0), c = ref(null), d = () => { if (unref(a) || r.disabled) return true; }, v = toRef(r, "trigger"), h6 = cn(d, Ia(v, "hover", s)), f = cn(d, Ia(v, "hover", u)), p = cn(d, Ia(v, "click", (w) => { w.button === 0 && l(w); })), m = cn(d, Ia(v, "focus", s)), g = cn(d, Ia(v, "focus", u)), y = cn(d, Ia(v, "contextmenu", (w) => { w.preventDefault(), l(w); })), b = cn(d, (w) => { const { code: x } = w; r.triggerKeys.includes(x) && (w.preventDefault(), l(w)); }); return e({ triggerRef: c }), (w, x) => (openBlock(), createBlock(unref(ex), { id: unref(i), "virtual-ref": w.virtualRef, open: unref(o), "virtual-triggering": w.virtualTriggering, class: normalizeClass(unref(n).e("trigger")), onBlur: unref(g), onClick: unref(p), onContextmenu: unref(y), onFocus: unref(m), onMouseenter: unref(h6), onMouseleave: unref(f), onKeydown: unref(b) }, { default: withCtx(() => [ renderSlot(w.$slots, "default") ]), _: 3 }, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"])); } }); var Nx = Ve(Bx, [["__file", "trigger.vue"]]); var $x = rt({ to: { type: $e([String, Object]), required: true }, disabled: Boolean }); var Rx = defineComponent({ __name: "teleport", props: $x, setup(t13) { return (e, r) => e.disabled ? renderSlot(e.$slots, "default", { key: 0 }) : (openBlock(), createBlock(Teleport, { key: 1, to: e.to }, [ renderSlot(e.$slots, "default") ], 8, ["to"])); } }); var zx = Ve(Rx, [["__file", "teleport.vue"]]); var Vx = $t(zx); var Hx = defineComponent({ name: "ElTooltipContent", inheritAttrs: false }); var qx = defineComponent({ ...Hx, props: cr, setup(t13, { expose: e }) { const r = t13, { selector: n } = lh(), a = He("tooltip"), i = ref(null); let o; const { controlled: s, id: u, open: l, trigger: c, onClose: d, onOpen: v, onShow: h6, onHide: f, onBeforeShow: p, onBeforeHide: m } = inject(Ju, void 0), g = computed(() => r.transition || `${a.namespace.value}-fade-in-linear`), y = computed(() => false ? true : r.persistent); onBeforeUnmount(() => { o == null || o(); }); const b = computed(() => unref(y) ? true : unref(l)), w = computed(() => r.disabled ? false : unref(l)), x = computed(() => r.appendTo || n.value), E = computed(() => { var I; return (I = r.style) != null ? I : {}; }), C = ref(true), T = () => { f(), C.value = true; }, k = () => { if (unref(s)) return true; }, _ = cn(k, () => { r.enterable && unref(c) === "hover" && v(); }), D = cn(k, () => { unref(c) === "hover" && d(); }), O = () => { var I, M; (M = (I = i.value) == null ? void 0 : I.updatePopper) == null || M.call(I), p == null || p(); }, F = () => { m == null || m(); }, L = () => { h6(), o = $0(computed(() => { var I; return (I = i.value) == null ? void 0 : I.popperContentRef; }), () => { if (unref(s)) return; unref(c) !== "hover" && d(); }); }, B = () => { r.virtualTriggering || d(); }; return watch(() => unref(l), (I) => { I ? C.value = false : o == null || o(); }, { flush: "post" }), watch(() => r.content, () => { var I, M; (M = (I = i.value) == null ? void 0 : I.updatePopper) == null || M.call(I); }), e({ contentRef: i }), (I, M) => (openBlock(), createBlock(unref(Vx), { disabled: !I.teleported, to: unref(x) }, { default: withCtx(() => [ createVNode(Transition, { name: unref(g), onAfterLeave: T, onBeforeEnter: O, onAfterEnter: L, onBeforeLeave: F }, { default: withCtx(() => [ unref(b) ? withDirectives((openBlock(), createBlock(unref(_x), mergeProps({ key: 0, id: unref(u), ref_key: "contentRef", ref: i }, I.$attrs, { "aria-label": I.ariaLabel, "aria-hidden": C.value, "boundaries-padding": I.boundariesPadding, "fallback-placements": I.fallbackPlacements, "gpu-acceleration": I.gpuAcceleration, offset: I.offset, placement: I.placement, "popper-options": I.popperOptions, strategy: I.strategy, effect: I.effect, enterable: I.enterable, pure: I.pure, "popper-class": I.popperClass, "popper-style": [I.popperStyle, unref(E)], "reference-el": I.referenceEl, "trigger-target-el": I.triggerTargetEl, visible: unref(w), "z-index": I.zIndex, onMouseenter: unref(_), onMouseleave: unref(D), onBlur: B, onClose: unref(d) }), { default: withCtx(() => [ renderSlot(I.$slots, "default") ]), _: 3 }, 16, ["id", "aria-label", "aria-hidden", "boundaries-padding", "fallback-placements", "gpu-acceleration", "offset", "placement", "popper-options", "strategy", "effect", "enterable", "pure", "popper-class", "popper-style", "reference-el", "trigger-target-el", "visible", "z-index", "onMouseenter", "onMouseleave", "onClose"])), [ [vShow, unref(w)] ]) : createCommentVNode("v-if", true) ]), _: 3 }, 8, ["name"]) ]), _: 3 }, 8, ["disabled", "to"])); } }); var Kx = Ve(qx, [["__file", "content.vue"]]); var Ux = defineComponent({ name: "ElTooltip" }); var Gx = defineComponent({ ...Ux, props: Ix, emits: Fx, setup(t13, { expose: e, emit: r }) { const n = t13; rC(); const a = Xs(), i = ref(), o = ref(), s = () => { var g; const y = unref(i); y && ((g = y.popperInstanceRef) == null || g.update()); }, u = ref(false), l = ref(), { show: c, hide: d, hasUpdateHandler: v } = Lx({ indicator: u, toggleReason: l }), { onOpen: h6, onClose: f } = aC({ showAfter: toRef(n, "showAfter"), hideAfter: toRef(n, "hideAfter"), autoClose: toRef(n, "autoClose"), open: c, close: d }), p = computed(() => Qa(n.visible) && !v.value); provide(Ju, { controlled: p, id: a, open: readonly(u), trigger: toRef(n, "trigger"), onOpen: (g) => { h6(g); }, onClose: (g) => { f(g); }, onToggle: (g) => { unref(u) ? f(g) : h6(g); }, onShow: () => { r("show", l.value); }, onHide: () => { r("hide", l.value); }, onBeforeShow: () => { r("before-show", l.value); }, onBeforeHide: () => { r("before-hide", l.value); }, updatePopper: s }), watch(() => n.disabled, (g) => { g && u.value && (u.value = false); }); const m = (g) => { var y, b; const w = (b = (y = o.value) == null ? void 0 : y.contentRef) == null ? void 0 : b.popperContentRef, x = (g == null ? void 0 : g.relatedTarget) || document.activeElement; return w && w.contains(x); }; return onDeactivated(() => u.value && d()), e({ popperRef: i, contentRef: o, isFocusInsideContent: m, updatePopper: s, onOpen: h6, onClose: f, hide: d }), (g, y) => (openBlock(), createBlock(unref(Dx), { ref_key: "popperRef", ref: i, role: g.role }, { default: withCtx(() => [ createVNode(Nx, { disabled: g.disabled, trigger: g.trigger, "trigger-keys": g.triggerKeys, "virtual-ref": g.virtualRef, "virtual-triggering": g.virtualTriggering }, { default: withCtx(() => [ g.$slots.default ? renderSlot(g.$slots, "default", { key: 0 }) : createCommentVNode("v-if", true) ]), _: 3 }, 8, ["disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering"]), createVNode(Kx, { ref_key: "contentRef", ref: o, "aria-label": g.ariaLabel, "boundaries-padding": g.boundariesPadding, content: g.content, disabled: g.disabled, effect: g.effect, enterable: g.enterable, "fallback-placements": g.fallbackPlacements, "hide-after": g.hideAfter, "gpu-acceleration": g.gpuAcceleration, offset: g.offset, persistent: g.persistent, "popper-class": g.popperClass, "popper-style": g.popperStyle, placement: g.placement, "popper-options": g.popperOptions, pure: g.pure, "raw-content": g.rawContent, "reference-el": g.referenceEl, "trigger-target-el": g.triggerTargetEl, "show-after": g.showAfter, strategy: g.strategy, teleported: g.teleported, transition: g.transition, "virtual-triggering": g.virtualTriggering, "z-index": g.zIndex, "append-to": g.appendTo }, { default: withCtx(() => [ renderSlot(g.$slots, "content", {}, () => [ g.rawContent ? (openBlock(), createElementBlock("span", { key: 0, innerHTML: g.content }, null, 8, ["innerHTML"])) : (openBlock(), createElementBlock("span", { key: 1 }, toDisplayString(g.content), 1)) ]), g.showArrow ? (openBlock(), createBlock(unref(XC), { key: 0, "arrow-offset": g.arrowOffset }, null, 8, ["arrow-offset"])) : createCommentVNode("v-if", true) ]), _: 3 }, 8, ["aria-label", "boundaries-padding", "content", "disabled", "effect", "enterable", "fallback-placements", "hide-after", "gpu-acceleration", "offset", "persistent", "popper-class", "popper-style", "placement", "popper-options", "pure", "raw-content", "reference-el", "trigger-target-el", "show-after", "strategy", "teleported", "transition", "virtual-triggering", "z-index", "append-to"]) ]), _: 3 }, 8, ["role"])); } }); var Wx = Ve(Gx, [["__file", "tooltip.vue"]]); var ko = $t(Wx); var kh = Symbol("buttonGroupContextKey"); var Yx = (t13, e) => { as({ from: "type.text", replacement: "link", version: "3.0.0", scope: "props", ref: "https://element-plus.org/en-US/component/button.html#button-attributes" }, computed(() => t13.type === "text")); const r = inject(kh, void 0), n = Wu("button"), { form: a } = Ta(), i = pa(computed(() => r == null ? void 0 : r.size)), o = Co(), s = ref(), u = useSlots(), l = computed(() => t13.type || (r == null ? void 0 : r.type) || ""), c = computed(() => { var f, p, m; return (m = (p = t13.autoInsertSpace) != null ? p : (f = n.value) == null ? void 0 : f.autoInsertSpace) != null ? m : false; }), d = computed(() => t13.tag === "button" ? { ariaDisabled: o.value || t13.loading, disabled: o.value || t13.loading, autofocus: t13.autofocus, type: t13.nativeType } : {}), v = computed(() => { var f; const p = (f = u.default) == null ? void 0 : f.call(u); if (c.value && (p == null ? void 0 : p.length) === 1) { const m = p[0]; if ((m == null ? void 0 : m.type) === Text) { const g = m.children; return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(g.trim()); } } return false; }); return { _disabled: o, _size: i, _type: l, _ref: s, _props: d, shouldAddSpace: v, handleClick: (f) => { if (o.value || t13.loading) { f.stopPropagation(); return; } t13.nativeType === "reset" && (a == null || a.resetFields()), e("click", f); } }; }; var Zx = [ "default", "primary", "success", "warning", "info", "danger", "text", "" ]; var Xx = ["button", "submit", "reset"]; var ru = rt({ size: di, disabled: Boolean, type: { type: String, values: Zx, default: "" }, icon: { type: Hn }, nativeType: { type: String, values: Xx, default: "button" }, loading: Boolean, loadingIcon: { type: Hn, default: () => Mu }, 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: $e([String, Object]), default: "button" } }); var jx = { click: (t13) => t13 instanceof MouseEvent }; function Kt(t13, e) { Qx(t13) && (t13 = "100%"); var r = Jx(t13); return t13 = e === 360 ? t13 : Math.min(e, Math.max(0, parseFloat(t13))), r && (t13 = parseInt(String(t13 * e), 10) / 100), Math.abs(t13 - e) < 1e-6 ? 1 : (e === 360 ? t13 = (t13 < 0 ? t13 % e + e : t13 % e) / parseFloat(String(e)) : t13 = t13 % e / parseFloat(String(e)), t13); } function Ho(t13) { return Math.min(1, Math.max(0, t13)); } function Qx(t13) { return typeof t13 == "string" && t13.indexOf(".") !== -1 && parseFloat(t13) === 1; } function Jx(t13) { return typeof t13 == "string" && t13.indexOf("%") !== -1; } function Sh(t13) { return t13 = parseFloat(t13), (isNaN(t13) || t13 < 0 || t13 > 1) && (t13 = 1), t13; } function qo(t13) { return t13 <= 1 ? "".concat(Number(t13) * 100, "%") : t13; } function sa(t13) { return t13.length === 1 ? "0" + t13 : String(t13); } function eE(t13, e, r) { return { r: Kt(t13, 255) * 255, g: Kt(e, 255) * 255, b: Kt(r, 255) * 255 }; } function zd(t13, e, r) { t13 = Kt(t13, 255), e = Kt(e, 255), r = Kt(r, 255); var n = Math.max(t13, e, r), a = Math.min(t13, 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 t13: i = (e - r) / u + (e < r ? 6 : 0); break; case e: i = (r - t13) / u + 2; break; case r: i = (t13 - e) / u + 4; break; } i /= 6; } return { h: i, s: o, l: s }; } function _l(t13, e, r) { return r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? t13 + (e - t13) * (6 * r) : r < 1 / 2 ? e : r < 2 / 3 ? t13 + (e - t13) * (2 / 3 - r) * 6 : t13; } function tE(t13, e, r) { var n, a, i; if (t13 = Kt(t13, 360), e = Kt(e, 100), r = Kt(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 = _l(s, o, t13 + 1 / 3), a = _l(s, o, t13), i = _l(s, o, t13 - 1 / 3); } return { r: n * 255, g: a * 255, b: i * 255 }; } function Vd(t13, e, r) { t13 = Kt(t13, 255), e = Kt(e, 255), r = Kt(r, 255); var n = Math.max(t13, e, r), a = Math.min(t13, e, r), i = 0, o = n, s = n - a, u = n === 0 ? 0 : s / n; if (n === a) i = 0; else { switch (n) { case t13: i = (e - r) / s + (e < r ? 6 : 0); break; case e: i = (r - t13) / s + 2; break; case r: i = (t13 - e) / s + 4; break; } i /= 6; } return { h: i, s: u, v: o }; } function rE(t13, e, r) { t13 = Kt(t13, 360) * 6, e = Kt(e, 100), r = Kt(r, 100); var n = Math.floor(t13), a = t13 - 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 Hd(t13, e, r, n) { var a = [ sa(Math.round(t13).toString(16)), sa(Math.round(e).toString(16)), sa(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 nE(t13, e, r, n, a) { var i = [ sa(Math.round(t13).toString(16)), sa(Math.round(e).toString(16)), sa(Math.round(r).toString(16)), sa(aE(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 aE(t13) { return Math.round(parseFloat(t13) * 255).toString(16); } function qd(t13) { return mr(t13) / 255; } function mr(t13) { return parseInt(t13, 16); } function iE(t13) { return { r: t13 >> 16, g: (t13 & 65280) >> 8, b: t13 & 255 }; } var nu = { 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 oE(t13) { var e = { r: 0, g: 0, b: 0 }, r = 1, n = null, a = null, i = null, o = false, s = false; return typeof t13 == "string" && (t13 = uE(t13)), typeof t13 == "object" && (ln(t13.r) && ln(t13.g) && ln(t13.b) ? (e = eE(t13.r, t13.g, t13.b), o = true, s = String(t13.r).substr(-1) === "%" ? "prgb" : "rgb") : ln(t13.h) && ln(t13.s) && ln(t13.v) ? (n = qo(t13.s), a = qo(t13.v), e = rE(t13.h, n, a), o = true, s = "hsv") : ln(t13.h) && ln(t13.s) && ln(t13.l) && (n = qo(t13.s), i = qo(t13.l), e = tE(t13.h, n, i), o = true, s = "hsl"), Object.prototype.hasOwnProperty.call(t13, "a") && (r = t13.a)), r = Sh(r), { ok: o, format: t13.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 sE = "[-\\+]?\\d+%?"; var lE = "[-\\+]?\\d*\\.\\d+%?"; var Bn = "(?:".concat(lE, ")|(?:").concat(sE, ")"); var Dl = "[\\s|\\(]+(".concat(Bn, ")[,|\\s]+(").concat(Bn, ")[,|\\s]+(").concat(Bn, ")\\s*\\)?"); var Pl = "[\\s|\\(]+(".concat(Bn, ")[,|\\s]+(").concat(Bn, ")[,|\\s]+(").concat(Bn, ")[,|\\s]+(").concat(Bn, ")\\s*\\)?"); var Ar = { CSS_UNIT: new RegExp(Bn), rgb: new RegExp("rgb" + Dl), rgba: new RegExp("rgba" + Pl), hsl: new RegExp("hsl" + Dl), hsla: new RegExp("hsla" + Pl), hsv: new RegExp("hsv" + Dl), hsva: new RegExp("hsva" + Pl), 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 uE(t13) { if (t13 = t13.trim().toLowerCase(), t13.length === 0) return false; var e = false; if (nu[t13]) t13 = nu[t13], e = true; else if (t13 === "transparent") return { r: 0, g: 0, b: 0, a: 0, format: "name" }; var r = Ar.rgb.exec(t13); return r ? { r: r[1], g: r[2], b: r[3] } : (r = Ar.rgba.exec(t13), r ? { r: r[1], g: r[2], b: r[3], a: r[4] } : (r = Ar.hsl.exec(t13), r ? { h: r[1], s: r[2], l: r[3] } : (r = Ar.hsla.exec(t13), r ? { h: r[1], s: r[2], l: r[3], a: r[4] } : (r = Ar.hsv.exec(t13), r ? { h: r[1], s: r[2], v: r[3] } : (r = Ar.hsva.exec(t13), r ? { h: r[1], s: r[2], v: r[3], a: r[4] } : (r = Ar.hex8.exec(t13), r ? { r: mr(r[1]), g: mr(r[2]), b: mr(r[3]), a: qd(r[4]), format: e ? "name" : "hex8" } : (r = Ar.hex6.exec(t13), r ? { r: mr(r[1]), g: mr(r[2]), b: mr(r[3]), format: e ? "name" : "hex" } : (r = Ar.hex4.exec(t13), r ? { r: mr(r[1] + r[1]), g: mr(r[2] + r[2]), b: mr(r[3] + r[3]), a: qd(r[4] + r[4]), format: e ? "name" : "hex8" } : (r = Ar.hex3.exec(t13), r ? { r: mr(r[1] + r[1]), g: mr(r[2] + r[2]), b: mr(r[3] + r[3]), format: e ? "name" : "hex" } : false))))))))); } function ln(t13) { return !!Ar.CSS_UNIT.exec(String(t13)); } var cE = ( /** @class */ function() { function t13(e, r) { e === void 0 && (e = ""), r === void 0 && (r = {}); var n; if (e instanceof t13) return e; typeof e == "number" && (e = iE(e)), this.originalInput = e; var a = oE(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 t13.prototype.isDark = function() { return this.getBrightness() < 128; }, t13.prototype.isLight = function() { return !this.isDark(); }, t13.prototype.getBrightness = function() { var e = this.toRgb(); return (e.r * 299 + e.g * 587 + e.b * 114) / 1e3; }, t13.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; }, t13.prototype.getAlpha = function() { return this.a; }, t13.prototype.setAlpha = function(e) { return this.a = Sh(e), this.roundA = Math.round(100 * this.a) / 100, this; }, t13.prototype.isMonochrome = function() { var e = this.toHsl().s; return e === 0; }, t13.prototype.toHsv = function() { var e = Vd(this.r, this.g, this.b); return { h: e.h * 360, s: e.s, v: e.v, a: this.a }; }, t13.prototype.toHsvString = function() { var e = Vd(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, ")"); }, t13.prototype.toHsl = function() { var e = zd(this.r, this.g, this.b); return { h: e.h * 360, s: e.s, l: e.l, a: this.a }; }, t13.prototype.toHslString = function() { var e = zd(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, ")"); }, t13.prototype.toHex = function(e) { return e === void 0 && (e = false), Hd(this.r, this.g, this.b, e); }, t13.prototype.toHexString = function(e) { return e === void 0 && (e = false), "#" + this.toHex(e); }, t13.prototype.toHex8 = function(e) { return e === void 0 && (e = false), nE(this.r, this.g, this.b, this.a, e); }, t13.prototype.toHex8String = function(e) { return e === void 0 && (e = false), "#" + this.toHex8(e); }, t13.prototype.toHexShortString = function(e) { return e === void 0 && (e = false), this.a === 1 ? this.toHexString(e) : this.toHex8String(e); }, t13.prototype.toRgb = function() { return { r: Math.round(this.r), g: Math.round(this.g), b: Math.round(this.b), a: this.a }; }, t13.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, ")"); }, t13.prototype.toPercentageRgb = function() { var e = function(r) { return "".concat(Math.round(Kt(r, 255) * 100), "%"); }; return { r: e(this.r), g: e(this.g), b: e(this.b), a: this.a }; }, t13.prototype.toPercentageRgbString = function() { var e = function(r) { return Math.round(Kt(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, ")"); }, t13.prototype.toName = function() { if (this.a === 0) return "transparent"; if (this.a < 1) return false; for (var e = "#" + Hd(this.r, this.g, this.b, false), r = 0, n = Object.entries(nu); r < n.length; r++) { var a = n[r], i = a[0], o = a[1]; if (e === o) return i; } return false; }, t13.prototype.toString = function(e) { var r = !!e; e = e ?? this.format; var n = false, 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(true)), e === "hex4" && (n = this.toHex8String(true)), e === "hex8" && (n = this.toHex8String()), e === "name" && (n = this.toName()), e === "hsl" && (n = this.toHslString()), e === "hsv" && (n = this.toHsvString()), n || this.toHexString()); }, t13.prototype.toNumber = function() { return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b); }, t13.prototype.clone = function() { return new t13(this.toString()); }, t13.prototype.lighten = function(e) { e === void 0 && (e = 10); var r = this.toHsl(); return r.l += e / 100, r.l = Ho(r.l), new t13(r); }, t13.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 t13(r); }, t13.prototype.darken = function(e) { e === void 0 && (e = 10); var r = this.toHsl(); return r.l -= e / 100, r.l = Ho(r.l), new t13(r); }, t13.prototype.tint = function(e) { return e === void 0 && (e = 10), this.mix("white", e); }, t13.prototype.shade = function(e) { return e === void 0 && (e = 10), this.mix("black", e); }, t13.prototype.desaturate = function(e) { e === void 0 && (e = 10); var r = this.toHsl(); return r.s -= e / 100, r.s = Ho(r.s), new t13(r); }, t13.prototype.saturate = function(e) { e === void 0 && (e = 10); var r = this.toHsl(); return r.s += e / 100, r.s = Ho(r.s), new t13(r); }, t13.prototype.greyscale = function() { return this.desaturate(100); }, t13.prototype.spin = function(e) { var r = this.toHsl(), n = (r.h + e) % 360; return r.h = n < 0 ? 360 + n : n, new t13(r); }, t13.prototype.mix = function(e, r) { r === void 0 && (r = 50); var n = this.toRgb(), a = new t13(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 t13(o); }, t13.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 t13(n)); return i; }, t13.prototype.complement = function() { var e = this.toHsl(); return e.h = (e.h + 180) % 360, new t13(e); }, t13.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 t13({ h: n, s: a, v: i })), i = (i + s) % 1; return o; }, t13.prototype.splitcomplement = function() { var e = this.toHsl(), r = e.h; return [ this, new t13({ h: (r + 72) % 360, s: e.s, l: e.l }), new t13({ h: (r + 216) % 360, s: e.s, l: e.l }) ]; }, t13.prototype.onBackground = function(e) { var r = this.toRgb(), n = new t13(e).toRgb(), a = r.a + n.a * (1 - r.a); return new t13({ 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 }); }, t13.prototype.triad = function() { return this.polyad(3); }, t13.prototype.tetrad = function() { return this.polyad(4); }, t13.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 t13({ h: (n + o * i) % 360, s: r.s, l: r.l })); return a; }, t13.prototype.equals = function(e) { return this.toRgbString() === new t13(e).toRgbString(); }, t13; }() ); function _n(t13, e = 20) { return t13.mix("#141414", e).toString(); } function dE(t13) { const e = Co(), r = He("button"); return computed(() => { let n = {}, a = t13.color; if (a) { const i = a.match(/var\((.*?)\)/); i && (a = window.getComputedStyle(window.document.documentElement).getPropertyValue(i[1])); const o = new cE(a), s = t13.dark ? o.tint(20).toString() : _n(o, 20); if (t13.plain) n = r.cssVarBlock({ "bg-color": t13.dark ? _n(o, 90) : o.tint(90).toString(), "text-color": a, "border-color": t13.dark ? _n(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")] = t13.dark ? _n(o, 90) : o.tint(90).toString(), n[r.cssVarBlockName("disabled-text-color")] = t13.dark ? _n(o, 50) : o.tint(50).toString(), n[r.cssVarBlockName("disabled-border-color")] = t13.dark ? _n(o, 80) : o.tint(80).toString()); else { const u = t13.dark ? _n(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 = t13.dark ? _n(o, 50) : o.tint(50).toString(); n[r.cssVarBlockName("disabled-bg-color")] = c, n[r.cssVarBlockName("disabled-text-color")] = t13.dark ? "rgba(255, 255, 255, 0.5)" : `var(${r.cssVarName("color-white")})`, n[r.cssVarBlockName("disabled-border-color")] = c; } } } return n; }); } var fE = defineComponent({ name: "ElButton" }); var vE = defineComponent({ ...fE, props: ru, emits: jx, setup(t13, { expose: e, emit: r }) { const n = t13, a = dE(n), i = He("button"), { _ref: o, _size: s, _type: u, _disabled: l, _props: c, shouldAddSpace: d, handleClick: v } = Yx(n, r), h6 = computed(() => [ 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 }), (f, p) => (openBlock(), createBlock(resolveDynamicComponent(f.tag), mergeProps({ ref_key: "_ref", ref: o }, unref(c), { class: unref(h6), style: unref(a), onClick: unref(v) }), { default: withCtx(() => [ f.loading ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ f.$slots.loading ? renderSlot(f.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(unref(Vt), { key: 1, class: normalizeClass(unref(i).is("loading")) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(f.loadingIcon))) ]), _: 1 }, 8, ["class"])) ], 64)) : f.icon || f.$slots.icon ? (openBlock(), createBlock(unref(Vt), { key: 1 }, { default: withCtx(() => [ f.icon ? (openBlock(), createBlock(resolveDynamicComponent(f.icon), { key: 0 })) : renderSlot(f.$slots, "icon", { key: 1 }) ]), _: 3 })) : createCommentVNode("v-if", true), f.$slots.default ? (openBlock(), createElementBlock("span", { key: 2, class: normalizeClass({ [unref(i).em("text", "expand")]: unref(d) }) }, [ renderSlot(f.$slots, "default") ], 2)) : createCommentVNode("v-if", true) ]), _: 3 }, 16, ["class", "style", "onClick"])); } }); var hE = Ve(vE, [["__file", "button.vue"]]); var pE = { size: ru.size, type: ru.type }; var gE = defineComponent({ name: "ElButtonGroup" }); var mE = defineComponent({ ...gE, props: pE, setup(t13) { const e = t13; provide(kh, reactive({ size: toRef(e, "size"), type: toRef(e, "type") })); const r = He("button"); return (n, a) => (openBlock(), createElementBlock("div", { class: normalizeClass(unref(r).b("group")) }, [ renderSlot(n.$slots, "default") ], 2)); } }); var Th = Ve(mE, [["__file", "button-group.vue"]]); var Hr = $t(hE, { ButtonGroup: Th }); var yE = Cn(Th); var Ln = /* @__PURE__ */ new Map(); if (_t) { let t13; document.addEventListener("mousedown", (e) => t13 = e), document.addEventListener("mouseup", (e) => { if (t13) { for (const r of Ln.values()) for (const { documentHandler: n } of r) n(e, t13); t13 = void 0; } }); } function Kd(t13, e) { let r = []; return Array.isArray(e.arg) ? r = e.arg : ua(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 = t13.contains(o) || t13.contains(s), d = t13 === o, v = r.length && r.some((f) => f == null ? void 0 : f.contains(o)) || r.length && r.includes(s), h6 = i && (i.contains(o) || i.contains(s)); u || l || c || d || v || h6 || e.value(n, a); }; } var _h = { beforeMount(t13, e) { Ln.has(t13) || Ln.set(t13, []), Ln.get(t13).push({ documentHandler: Kd(t13, e), bindingFn: e.value }); }, updated(t13, e) { Ln.has(t13) || Ln.set(t13, []); const r = Ln.get(t13), n = r.findIndex((i) => i.bindingFn === e.oldValue), a = { documentHandler: Kd(t13, e), bindingFn: e.value }; n >= 0 ? r.splice(n, 1, a) : r.push(a); }, unmounted(t13) { Ln.delete(t13); } }; var bE = rt({ header: { type: String, default: "" }, footer: { type: String, default: "" }, bodyStyle: { type: $e([String, Object, Array]), default: "" }, bodyClass: String, shadow: { type: String, values: ["always", "hover", "never"], default: "always" } }); var wE = defineComponent({ name: "ElCard" }); var CE = defineComponent({ ...wE, props: bE, setup(t13) { const e = He("card"); return (r, n) => (openBlock(), createElementBlock("div", { class: normalizeClass([unref(e).b(), unref(e).is(`${r.shadow}-shadow`)]) }, [ r.$slots.header || r.header ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(e).e("header")) }, [ renderSlot(r.$slots, "header", {}, () => [ createTextVNode(toDisplayString(r.header), 1) ]) ], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass([unref(e).e("body"), r.bodyClass]), style: normalizeStyle(r.bodyStyle) }, [ renderSlot(r.$slots, "default") ], 6), r.$slots.footer || r.footer ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(unref(e).e("footer")) }, [ renderSlot(r.$slots, "footer", {}, () => [ createTextVNode(toDisplayString(r.footer), 1) ]) ], 2)) : createCommentVNode("v-if", true) ], 2)); } }); var xE = Ve(CE, [["__file", "card.vue"]]); var EE = $t(xE); var Dh = { 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: true }, ...Zn(["ariaControls"]) }; var Ph = { [zt]: (t13) => tr(t13) || qt(t13) || Qa(t13), change: (t13) => tr(t13) || qt(t13) || Qa(t13) }; var fi = Symbol("checkboxGroupContextKey"); var kE = ({ model: t13, isChecked: e }) => { const r = inject(fi, void 0), n = computed(() => { 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 !Mn(s) && t13.value.length >= s && !e.value || !Mn(u) && t13.value.length <= u && e.value; }); return { isDisabled: Co(computed(() => (r == null ? void 0 : r.disabled.value) || n.value)), isLimitDisabled: n }; }; var SE = (t13, { model: e, isLimitExceeded: r, hasOwnLabel: n, isDisabled: a, isLabeledByFormItem: i }) => { const o = inject(fi, void 0), { formItem: s } = Ta(), { emit: u } = getCurrentInstance(); function l(f) { var p, m, g, y; return [true, t13.trueValue, t13.trueLabel].includes(f) ? (m = (p = t13.trueValue) != null ? p : t13.trueLabel) != null ? m : true : (y = (g = t13.falseValue) != null ? g : t13.falseLabel) != null ? y : false; } function c(f, p) { u("change", l(f), p); } function d(f) { if (r.value) return; const p = f.target; u("change", l(p.checked), f); } async function v(f) { r.value || !n.value && !a.value && i.value && (f.composedPath().some((g) => g.tagName === "LABEL") || (e.value = l([false, t13.falseValue, t13.falseLabel].includes(e.value)), await nextTick(), c(e.value, f))); } const h6 = computed(() => (o == null ? void 0 : o.validateEvent) || t13.validateEvent); return watch(() => t13.modelValue, () => { h6.value && (s == null || s.validate("change").catch((f) => Dt(f))); }), { handleChange: d, onClickRoot: v }; }; var TE = (t13) => { const e = ref(false), { emit: r } = getCurrentInstance(), n = inject(fi, void 0), a = computed(() => Mn(n) === false), i = ref(false), o = computed({ get() { var s, u; return a.value ? (s = n == null ? void 0 : n.modelValue) == null ? void 0 : s.value : (u = t13.modelValue) != null ? u : e.value; }, set(s) { var u, l; a.value && fr(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 === false && ((l = n == null ? void 0 : n.changeEvent) == null || l.call(n, s))) : (r(zt, s), e.value = s); } }); return { model: o, isGroup: a, isLimitExceeded: i }; }; var _E = (t13, e, { model: r }) => { const n = inject(fi, void 0), a = ref(false), i = computed(() => ks(t13.value) ? t13.label : t13.value), o = computed(() => { const c = r.value; return Qa(c) ? c : fr(c) ? Ht(i.value) ? c.map(toRaw).some((d) => Es(d, i.value)) : c.map(toRaw).includes(i.value) : c != null ? c === t13.trueValue || c === t13.trueLabel : !!c; }), s = pa(computed(() => { var c; return (c = n == null ? void 0 : n.size) == null ? void 0 : c.value; }), { prop: true }), u = pa(computed(() => { var c; return (c = n == null ? void 0 : n.size) == null ? void 0 : c.value; })), l = computed(() => !!e.default || !ks(i.value)); return { checkboxButtonSize: s, isChecked: o, isFocused: a, checkboxSize: u, hasOwnLabel: l, actualValue: i }; }; var Oh = (t13, e) => { const { formItem: r } = Ta(), { model: n, isGroup: a, isLimitExceeded: i } = TE(t13), { isFocused: o, isChecked: s, checkboxButtonSize: u, checkboxSize: l, hasOwnLabel: c, actualValue: d } = _E(t13, e, { model: n }), { isDisabled: v } = kE({ model: n, isChecked: s }), { inputId: h6, isLabeledByFormItem: f } = xo(t13, { formItemContext: r, disableIdGeneration: c, disableIdManagement: a }), { handleChange: p, onClickRoot: m } = SE(t13, { model: n, isLimitExceeded: i, hasOwnLabel: c, isDisabled: v, isLabeledByFormItem: f }); return (() => { function y() { var b, w; fr(n.value) && !n.value.includes(d.value) ? n.value.push(d.value) : n.value = (w = (b = t13.trueValue) != null ? b : t13.trueLabel) != null ? w : true; } t13.checked && y(); })(), as({ from: "label act as value", replacement: "value", version: "3.0.0", scope: "el-checkbox", ref: "https://element-plus.org/en-US/component/checkbox.html" }, computed(() => a.value && ks(t13.value))), as({ from: "true-label", replacement: "true-value", version: "3.0.0", scope: "el-checkbox", ref: "https://element-plus.org/en-US/component/checkbox.html" }, computed(() => !!t13.trueLabel)), as({ from: "false-label", replacement: "false-value", version: "3.0.0", scope: "el-checkbox", ref: "https://element-plus.org/en-US/component/checkbox.html" }, computed(() => !!t13.falseLabel)), { inputId: h6, isLabeledByFormItem: f, isChecked: s, isDisabled: v, isFocused: o, checkboxButtonSize: u, checkboxSize: l, hasOwnLabel: c, model: n, actualValue: d, handleChange: p, onClickRoot: m }; }; var DE = defineComponent({ name: "ElCheckbox" }); var PE = defineComponent({ ...DE, props: Dh, emits: Ph, setup(t13) { const e = t13, r = useSlots(), { inputId: n, isLabeledByFormItem: a, isChecked: i, isDisabled: o, isFocused: s, checkboxSize: u, hasOwnLabel: l, model: c, actualValue: d, handleChange: v, onClickRoot: h6 } = Oh(e, r), f = He("checkbox"), p = computed(() => [ f.b(), f.m(u.value), f.is("disabled", o.value), f.is("bordered", e.border), f.is("checked", i.value) ]), m = computed(() => [ f.e("input"), f.is("disabled", o.value), f.is("checked", i.value), f.is("indeterminate", e.indeterminate), f.is("focus", s.value) ]); return (g, y) => (openBlock(), createBlock(resolveDynamicComponent(!unref(l) && unref(a) ? "span" : "label"), { class: normalizeClass(unref(p)), "aria-controls": g.indeterminate ? g.ariaControls : null, onClick: unref(h6) }, { default: withCtx(() => { var b, w, x, E; return [ createBaseVNode("span", { class: normalizeClass(unref(m)) }, [ g.trueValue || g.falseValue || g.trueLabel || g.falseLabel ? withDirectives((openBlock(), createElementBlock("input", { key: 0, id: unref(n), "onUpdate:modelValue": (C) => isRef(c) ? c.value = C : null, class: normalizeClass(unref(f).e("original")), type: "checkbox", indeterminate: g.indeterminate, name: g.name, tabindex: g.tabindex, disabled: unref(o), "true-value": (w = (b = g.trueValue) != null ? b : g.trueLabel) != null ? w : true, "false-value": (E = (x = g.falseValue) != null ? x : g.falseLabel) != null ? E : false, onChange: unref(v), onFocus: (C) => s.value = true, onBlur: (C) => s.value = false, onClick: withModifiers(() => { }, ["stop"]) }, null, 42, ["id", "onUpdate:modelValue", "indeterminate", "name", "tabindex", "disabled", "true-value", "false-value", "onChange", "onFocus", "onBlur", "onClick"])), [ [vModelCheckbox, unref(c)] ]) : withDirectives((openBlock(), createElementBlock("input", { key: 1, id: unref(n), "onUpdate:modelValue": (C) => isRef(c) ? c.value = C : null, class: normalizeClass(unref(f).e("original")), type: "checkbox", indeterminate: g.indeterminate, disabled: unref(o), value: unref(d), name: g.name, tabindex: g.tabindex, onChange: unref(v), onFocus: (C) => s.value = true, onBlur: (C) => s.value = false, onClick: withModifiers(() => { }, ["stop"]) }, null, 42, ["id", "onUpdate:modelValue", "indeterminate", "disabled", "value", "name", "tabindex", "onChange", "onFocus", "onBlur", "onClick"])), [ [vModelCheckbox, unref(c)] ]), createBaseVNode("span", { class: normalizeClass(unref(f).e("inner")) }, null, 2) ], 2), unref(l) ? (openBlock(), createElementBlock("span", { key: 0, class: normalizeClass(unref(f).e("label")) }, [ renderSlot(g.$slots, "default"), g.$slots.default ? createCommentVNode("v-if", true) : (openBlock(), createElementBlock(Fragment, { key: 0 }, [ createTextVNode(toDisplayString(g.label), 1) ], 64)) ], 2)) : createCommentVNode("v-if", true) ]; }), _: 3 }, 8, ["class", "aria-controls", "onClick"])); } }); var OE = Ve(PE, [["__file", "checkbox.vue"]]); var LE = defineComponent({ name: "ElCheckboxButton" }); var IE = defineComponent({ ...LE, props: Dh, emits: Ph, setup(t13) { const e = t13, r = useSlots(), { isFocused: n, isChecked: a, isDisabled: i, checkboxButtonSize: o, model: s, actualValue: u, handleChange: l } = Oh(e, r), c = inject(fi, void 0), d = He("checkbox"), v = computed(() => { var f, p, m, g; const y = (p = (f = c == null ? void 0 : c.fill) == null ? void 0 : f.value) != null ? p : ""; return { backgroundColor: y, borderColor: y, color: (g = (m = c == null ? void 0 : c.textColor) == null ? void 0 : m.value) != null ? g : "", boxShadow: y ? `-1px 0 0 0 ${y}` : void 0 }; }), h6 = computed(() => [ d.b("button"), d.bm("button", o.value), d.is("disabled", i.value), d.is("checked", a.value), d.is("focus", n.value) ]); return (f, p) => { var m, g, y, b; return openBlock(), createElementBlock("label", { class: normalizeClass(unref(h6)) }, [ f.trueValue || f.falseValue || f.trueLabel || f.falseLabel ? withDirectives((openBlock(), createElementBlock("input", { key: 0, "onUpdate:modelValue": (w) => isRef(s) ? s.value = w : null, class: normalizeClass(unref(d).be("button", "original")), type: "checkbox", name: f.name, tabindex: f.tabindex, disabled: unref(i), "true-value": (g = (m = f.trueValue) != null ? m : f.trueLabel) != null ? g : true, "false-value": (b = (y = f.falseValue) != null ? y : f.falseLabel) != null ? b : false, onChange: unref(l), onFocus: (w) => n.value = true, onBlur: (w) => n.value = false, onClick: withModifiers(() => { }, ["stop"]) }, null, 42, ["onUpdate:modelValue", "name", "tabindex", "disabled", "true-value", "false-value", "onChange", "onFocus", "onBlur", "onClick"])), [ [vModelCheckbox, unref(s)] ]) : withDirectives((openBlock(), createElementBlock("input", { key: 1, "onUpdate:modelValue": (w) => isRef(s) ? s.value = w : null, class: normalizeClass(unref(d).be("button", "original")), type: "checkbox", name: f.name, tabindex: f.tabindex, disabled: unref(i), value: unref(u), onChange: unref(l), onFocus: (w) => n.value = true, onBlur: (w) => n.value = false, onClick: withModifiers(() => { }, ["stop"]) }, null, 42, ["onUpdate:modelValue", "name", "tabindex", "disabled", "value", "onChange", "onFocus", "onBlur", "onClick"])), [ [vModelCheckbox, unref(s)] ]), f.$slots.default || f.label ? (openBlock(), createElementBlock("span", { key: 2, class: normalizeClass(unref(d).be("button", "inner")), style: normalizeStyle(unref(a) ? unref(v) : void 0) }, [ renderSlot(f.$slots, "default", {}, () => [ createTextVNode(toDisplayString(f.label), 1) ]) ], 6)) : createCommentVNode("v-if", true) ], 2); }; } }); var Lh = Ve(IE, [["__file", "checkbox-button.vue"]]); var FE = rt({ modelValue: { type: $e(Array), default: () => [] }, disabled: Boolean, min: Number, max: Number, size: di, fill: String, textColor: String, tag: { type: String, default: "div" }, validateEvent: { type: Boolean, default: true }, ...Zn(["ariaLabel"]) }); var AE = { [zt]: (t13) => fr(t13), change: (t13) => fr(t13) }; var ME = defineComponent({ name: "ElCheckboxGroup" }); var BE = defineComponent({ ...ME, props: FE, emits: AE, setup(t13, { emit: e }) { const r = t13, n = He("checkbox"), { formItem: a } = Ta(), { inputId: i, isLabeledByFormItem: o } = xo(r, { formItemContext: a }), s = async (l) => { e(zt, l), await nextTick(), e("change", l); }, u = computed({ get() { return r.modelValue; }, set(l) { s(l); } }); return provide(fi, { ...zv(toRefs(r), [ "size", "min", "max", "disabled", "validateEvent", "fill", "textColor" ]), modelValue: u, changeEvent: s }), watch(() => r.modelValue, () => { r.validateEvent && (a == null || a.validate("change").catch((l) => Dt(l))); }), (l, c) => { var d; return openBlock(), createBlock(resolveDynamicComponent(l.tag), { id: unref(i), class: normalizeClass(unref(n).b("group")), role: "group", "aria-label": unref(o) ? void 0 : l.ariaLabel || "checkbox-group", "aria-labelledby": unref(o) ? (d = unref(a)) == null ? void 0 : d.labelId : void 0 }, { default: withCtx(() => [ renderSlot(l.$slots, "default") ]), _: 3 }, 8, ["id", "class", "aria-label", "aria-labelledby"]); }; } }); var Ih = Ve(BE, [["__file", "checkbox-group.vue"]]); var NE = $t(OE, { CheckboxButton: Lh, CheckboxGroup: Ih }); Cn(Lh); Cn(Ih); var au = rt({ type: { type: String, values: ["primary", "success", "info", "warning", "danger"], default: "primary" }, closable: Boolean, disableTransitions: Boolean, hit: Boolean, color: String, size: { type: String, values: Gv }, effect: { type: String, values: ["dark", "light", "plain"], default: "light" }, round: Boolean }); var $E = { close: (t13) => t13 instanceof MouseEvent, click: (t13) => t13 instanceof MouseEvent }; var RE = defineComponent({ name: "ElTag" }); var zE = defineComponent({ ...RE, props: au, emits: $E, setup(t13, { emit: e }) { const r = t13, n = pa(), a = He("tag"), i = computed(() => { const { type: l, hit: c, effect: d, closable: v, round: h6 } = r; return [ a.b(), a.is("closable", v), a.m(l || "primary"), a.m(n.value), a.m(d), a.is("hit", c), a.is("round", h6) ]; }), o = (l) => { e("close", l); }, s = (l) => { e("click", l); }, u = (l) => { l.component.subTree.component.bum = null; }; return (l, c) => l.disableTransitions ? (openBlock(), createElementBlock("span", { key: 0, class: normalizeClass(unref(i)), style: normalizeStyle({ backgroundColor: l.color }), onClick: s }, [ createBaseVNode("span", { class: normalizeClass(unref(a).e("content")) }, [ renderSlot(l.$slots, "default") ], 2), l.closable ? (openBlock(), createBlock(unref(Vt), { key: 0, class: normalizeClass(unref(a).e("close")), onClick: withModifiers(o, ["stop"]) }, { default: withCtx(() => [ createVNode(unref(Ss)) ]), _: 1 }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true) ], 6)) : (openBlock(), createBlock(Transition, { key: 1, name: `${unref(a).namespace.value}-zoom-in-center`, appear: "", onVnodeMounted: u }, { default: withCtx(() => [ createBaseVNode("span", { class: normalizeClass(unref(i)), style: normalizeStyle({ backgroundColor: l.color }), onClick: s }, [ createBaseVNode("span", { class: normalizeClass(unref(a).e("content")) }, [ renderSlot(l.$slots, "default") ], 2), l.closable ? (openBlock(), createBlock(unref(Vt), { key: 0, class: normalizeClass(unref(a).e("close")), onClick: withModifiers(o, ["stop"]) }, { default: withCtx(() => [ createVNode(unref(Ss)) ]), _: 1 }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true) ], 6) ]), _: 3 }, 8, ["name"])); } }); var VE = Ve(zE, [["__file", "tag.vue"]]); var HE = $t(VE); var Fh = Symbol("rowContextKey"); var qE = [ "start", "center", "end", "space-around", "space-between", "space-evenly" ]; var KE = ["top", "middle", "bottom"]; var UE = rt({ tag: { type: String, default: "div" }, gutter: { type: Number, default: 0 }, justify: { type: String, values: qE, default: "start" }, align: { type: String, values: KE } }); var GE = defineComponent({ name: "ElRow" }); var WE = defineComponent({ ...GE, props: UE, setup(t13) { const e = t13, r = He("row"), n = computed(() => e.gutter); provide(Fh, { gutter: n }); const a = computed(() => { const o = {}; return e.gutter && (o.marginRight = o.marginLeft = `-${e.gutter / 2}px`), o; }), i = computed(() => [ r.b(), r.is(`justify-${e.justify}`, e.justify !== "start"), r.is(`align-${e.align}`, !!e.align) ]); return (o, s) => (openBlock(), createBlock(resolveDynamicComponent(o.tag), { class: normalizeClass(unref(i)), style: normalizeStyle(unref(a)) }, { default: withCtx(() => [ renderSlot(o.$slots, "default") ]), _: 3 }, 8, ["class", "style"])); } }); var YE = Ve(WE, [["__file", "row.vue"]]); var Qs = $t(YE); var ZE = 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: $e([Number, Object]), default: () => Ra({}) }, sm: { type: $e([Number, Object]), default: () => Ra({}) }, md: { type: $e([Number, Object]), default: () => Ra({}) }, lg: { type: $e([Number, Object]), default: () => Ra({}) }, xl: { type: $e([Number, Object]), default: () => Ra({}) } }); var XE = defineComponent({ name: "ElCol" }); var jE = defineComponent({ ...XE, props: ZE, setup(t13) { const e = t13, { gutter: r } = inject(Fh, { gutter: computed(() => 0) }), n = He("col"), a = computed(() => { const o = {}; return r.value && (o.paddingLeft = o.paddingRight = `${r.value / 2}px`), o; }), i = computed(() => { const o = []; return ["span", "offset", "pull", "push"].forEach((l) => { const c = e[l]; qt(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) => { qt(e[l]) ? o.push(n.b(`${l}-${e[l]}`)) : Ht(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) => (openBlock(), createBlock(resolveDynamicComponent(o.tag), { class: normalizeClass(unref(i)), style: normalizeStyle(unref(a)) }, { default: withCtx(() => [ renderSlot(o.$slots, "default") ]), _: 3 }, 8, ["class", "style"])); } }); var QE = Ve(jE, [["__file", "col.vue"]]); var So = $t(QE); var JE = defineComponent({ name: "ElCollapseTransition" }); var ek = defineComponent({ ...JE, setup(t13) { const e = He("collapse-transition"), r = (a) => { a.style.maxHeight = "", a.style.overflow = a.dataset.oldOverflow, a.style.paddingTop = a.dataset.oldPaddingTop, a.style.paddingBottom = a.dataset.oldPaddingBottom; }, n = { beforeEnter(a) { a.dataset || (a.dataset = {}), a.dataset.oldPaddingTop = a.style.paddingTop, a.dataset.oldPaddingBottom = a.style.paddingBottom, a.style.height && (a.dataset.elExistsHeight = a.style.height), a.style.maxHeight = 0, a.style.paddingTop = 0, a.style.paddingBottom = 0; }, enter(a) { requestAnimationFrame(() => { a.dataset.oldOverflow = a.style.overflow, a.dataset.elExistsHeight ? a.style.maxHeight = a.dataset.elExistsHeight : a.scrollHeight !== 0 ? a.style.maxHeight = `${a.scrollHeight}px` : a.style.maxHeight = 0, a.style.paddingTop = a.dataset.oldPaddingTop, a.style.paddingBottom = a.dataset.oldPaddingBottom, a.style.overflow = "hidden"; }); }, afterEnter(a) { a.style.maxHeight = "", a.style.overflow = a.dataset.oldOverflow; }, enterCancelled(a) { r(a); }, beforeLeave(a) { a.dataset || (a.dataset = {}), a.dataset.oldPaddingTop = a.style.paddingTop, a.dataset.oldPaddingBottom = a.style.paddingBottom, a.dataset.oldOverflow = a.style.overflow, a.style.maxHeight = `${a.scrollHeight}px`, a.style.overflow = "hidden"; }, leave(a) { a.scrollHeight !== 0 && (a.style.maxHeight = 0, a.style.paddingTop = 0, a.style.paddingBottom = 0); }, afterLeave(a) { r(a); }, leaveCancelled(a) { r(a); } }; return (a, i) => (openBlock(), createBlock(Transition, mergeProps({ name: unref(e).b() }, toHandlers(n)), { default: withCtx(() => [ renderSlot(a.$slots, "default") ]), _: 3 }, 16, ["name"])); } }); var tk = Ve(ek, [["__file", "collapse-transition.vue"]]); var rk = $t(tk); var nk = rt({ color: { type: $e(Object), required: true }, vertical: { type: Boolean, default: false } }); var Ol = false; function eo(t13, e) { if (!_t) 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, Ol = false, (o = e.end) == null || o.call(e, i); }, a = function(i) { var o; Ol || (i.preventDefault(), document.onselectstart = () => false, document.ondragstart = () => false, document.addEventListener("mousemove", r), document.addEventListener("mouseup", n), document.addEventListener("touchmove", r), document.addEventListener("touchend", n), Ol = true, (o = e.start) == null || o.call(e, i)); }; t13.addEventListener("mousedown", a), t13.addEventListener("touchstart", a, { passive: false }); } var ak = (t13) => { const e = getCurrentInstance(), { t: r } = yo(), n = shallowRef(), a = shallowRef(), i = computed(() => t13.color.get("alpha")), o = computed(() => r("el.colorpicker.alphaLabel")); function s(d) { var v; d.target !== n.value && u(d), (v = n.value) == null || v.focus(); } function u(d) { if (!a.value || !n.value) return; const h6 = e.vnode.el.getBoundingClientRect(), { clientX: f, clientY: p } = Tu(d); if (t13.vertical) { let m = p - h6.top; m = Math.max(n.value.offsetHeight / 2, m), m = Math.min(m, h6.height - n.value.offsetHeight / 2), t13.color.set("alpha", Math.round((m - n.value.offsetHeight / 2) / (h6.height - n.value.offsetHeight) * 100)); } else { let m = f - h6.left; m = Math.max(n.value.offsetWidth / 2, m), m = Math.min(m, h6.width - n.value.offsetWidth / 2), t13.color.set("alpha", Math.round((m - n.value.offsetWidth / 2) / (h6.width - n.value.offsetWidth) * 100)); } } function l(d) { const { code: v, shiftKey: h6 } = d, f = h6 ? 10 : 1; switch (v) { case Lt.left: case Lt.down: d.preventDefault(), d.stopPropagation(), c(-f); break; case Lt.right: case Lt.up: d.preventDefault(), d.stopPropagation(), c(f); break; } } function c(d) { let v = i.value + d; v = v < 0 ? 0 : v > 100 ? 100 : v, t13.color.set("alpha", v); } return { thumb: n, bar: a, alpha: i, alphaLabel: o, handleDrag: u, handleClick: s, handleKeydown: l }; }; var ik = (t13, { bar: e, thumb: r, handleDrag: n }) => { const a = getCurrentInstance(), i = He("color-alpha-slider"), o = ref(0), s = ref(0), u = ref(); function l() { if (!r.value || t13.vertical) return 0; const y = a.vnode.el, b = t13.color.get("alpha"); return y ? Math.round(b * (y.offsetWidth - r.value.offsetWidth / 2) / 100) : 0; } function c() { if (!r.value) return 0; const y = a.vnode.el; if (!t13.vertical) return 0; const b = t13.color.get("alpha"); return y ? Math.round(b * (y.offsetHeight - r.value.offsetHeight / 2) / 100) : 0; } function d() { if (t13.color && t13.color.value) { const { r: y, g: b, b: w } = t13.color.toRgb(); return `linear-gradient(to right, rgba(${y}, ${b}, ${w}, 0) 0%, rgba(${y}, ${b}, ${w}, 1) 100%)`; } return ""; } function v() { o.value = l(), s.value = c(), u.value = d(); } onMounted(() => { if (!e.value || !r.value) return; const y = { drag: (b) => { n(b); }, end: (b) => { n(b); } }; eo(e.value, y), eo(r.value, y), v(); }), watch(() => t13.color.get("alpha"), () => v()), watch(() => t13.color.value, () => v()); const h6 = computed(() => [i.b(), i.is("vertical", t13.vertical)]), f = computed(() => i.e("bar")), p = computed(() => i.e("thumb")), m = computed(() => ({ background: u.value })), g = computed(() => ({ left: Ja(o.value), top: Ja(s.value) })); return { rootKls: h6, barKls: f, barStyle: m, thumbKls: p, thumbStyle: g, update: v }; }; var ok = "ElColorAlphaSlider"; var sk = defineComponent({ name: ok }); var lk = defineComponent({ ...sk, props: nk, setup(t13, { expose: e }) { const r = t13, { alpha: n, alphaLabel: a, bar: i, thumb: o, handleDrag: s, handleClick: u, handleKeydown: l } = ak(r), { rootKls: c, barKls: d, barStyle: v, thumbKls: h6, thumbStyle: f, update: p } = ik(r, { bar: i, thumb: o, handleDrag: s }); return e({ update: p, bar: i, thumb: o }), (m, g) => (openBlock(), createElementBlock("div", { class: normalizeClass(unref(c)) }, [ createBaseVNode("div", { ref_key: "bar", ref: i, class: normalizeClass(unref(d)), style: normalizeStyle(unref(v)), onClick: unref(u) }, null, 14, ["onClick"]), createBaseVNode("div", { ref_key: "thumb", ref: o, class: normalizeClass(unref(h6)), style: normalizeStyle(unref(f)), "aria-label": unref(a), "aria-valuenow": unref(n), "aria-orientation": m.vertical ? "vertical" : "horizontal", "aria-valuemin": "0", "aria-valuemax": "100", role: "slider", tabindex: "0", onKeydown: unref(l) }, null, 46, ["aria-label", "aria-valuenow", "aria-orientation", "onKeydown"]) ], 2)); } }); var uk = Ve(lk, [["__file", "alpha-slider.vue"]]); var ck = defineComponent({ name: "ElColorHueSlider", props: { color: { type: Object, required: true }, vertical: Boolean }, setup(t13) { const e = He("color-hue-slider"), r = getCurrentInstance(), n = ref(), a = ref(), i = ref(0), o = ref(0), s = computed(() => t13.color.get("hue")); watch(() => s.value, () => { v(); }); function u(h6) { h6.target !== n.value && l(h6); } function l(h6) { if (!a.value || !n.value) return; const p = r.vnode.el.getBoundingClientRect(), { clientX: m, clientY: g } = Tu(h6); let y; if (t13.vertical) { let b = g - p.top; b = Math.min(b, p.height - n.value.offsetHeight / 2), b = Math.max(n.value.offsetHeight / 2, b), y = Math.round((b - n.value.offsetHeight / 2) / (p.height - n.value.offsetHeight) * 360); } else { let b = m - p.left; b = Math.min(b, p.width - n.value.offsetWidth / 2), b = Math.max(n.value.offsetWidth / 2, b), y = Math.round((b - n.value.offsetWidth / 2) / (p.width - n.value.offsetWidth) * 360); } t13.color.set("hue", y); } function c() { if (!n.value) return 0; const h6 = r.vnode.el; if (t13.vertical) return 0; const f = t13.color.get("hue"); return h6 ? Math.round(f * (h6.offsetWidth - n.value.offsetWidth / 2) / 360) : 0; } function d() { if (!n.value) return 0; const h6 = r.vnode.el; if (!t13.vertical) return 0; const f = t13.color.get("hue"); return h6 ? Math.round(f * (h6.offsetHeight - n.value.offsetHeight / 2) / 360) : 0; } function v() { i.value = c(), o.value = d(); } return onMounted(() => { if (!a.value || !n.value) return; const h6 = { drag: (f) => { l(f); }, end: (f) => { l(f); } }; eo(a.value, h6), eo(n.value, h6), v(); }), { bar: a, thumb: n, thumbLeft: i, thumbTop: o, hueValue: s, handleClick: u, update: v, ns: e }; } }); function dk(t13, e, r, n, a, i) { return openBlock(), createElementBlock("div", { class: normalizeClass([t13.ns.b(), t13.ns.is("vertical", t13.vertical)]) }, [ createBaseVNode("div", { ref: "bar", class: normalizeClass(t13.ns.e("bar")), onClick: t13.handleClick }, null, 10, ["onClick"]), createBaseVNode("div", { ref: "thumb", class: normalizeClass(t13.ns.e("thumb")), style: normalizeStyle({ left: t13.thumbLeft + "px", top: t13.thumbTop + "px" }) }, null, 6) ], 2); } var fk = Ve(ck, [["render", dk], ["__file", "hue-slider.vue"]]); var vk = rt({ modelValue: String, id: String, showAlpha: Boolean, colorFormat: String, disabled: Boolean, size: di, popperClass: { type: String, default: "" }, tabindex: { type: [String, Number], default: 0 }, teleported: cr.teleported, predefine: { type: $e(Array) }, validateEvent: { type: Boolean, default: true }, ...Zn(["ariaLabel"]) }); var hk = { [zt]: (t13) => tr(t13) || $n(t13), [Bu]: (t13) => tr(t13) || $n(t13), activeChange: (t13) => tr(t13) || $n(t13), focus: (t13) => t13 instanceof FocusEvent, blur: (t13) => t13 instanceof FocusEvent }; var Ah = Symbol("colorPickerContextKey"); var Ud = function(t13, e, r) { return [ t13, e * r / ((t13 = (2 - e) * r) < 1 ? t13 : 2 - t13) || 0, t13 / 2 ]; }; var pk = function(t13) { return typeof t13 == "string" && t13.includes(".") && Number.parseFloat(t13) === 1; }; var gk = function(t13) { return typeof t13 == "string" && t13.includes("%"); }; var Ka = function(t13, e) { pk(t13) && (t13 = "100%"); const r = gk(t13); return t13 = Math.min(e, Math.max(0, Number.parseFloat(`${t13}`))), r && (t13 = Number.parseInt(`${t13 * e}`, 10) / 100), Math.abs(t13 - e) < 1e-6 ? 1 : t13 % e / Number.parseFloat(e); }; var Gd = { 10: "A", 11: "B", 12: "C", 13: "D", 14: "E", 15: "F" }; var ss = (t13) => { t13 = Math.min(Math.round(t13), 255); const e = Math.floor(t13 / 16), r = t13 % 16; return `${Gd[e] || e}${Gd[r] || r}`; }; var Wd = function({ r: t13, g: e, b: r }) { return Number.isNaN(+t13) || Number.isNaN(+e) || Number.isNaN(+r) ? "" : `#${ss(t13)}${ss(e)}${ss(r)}`; }; var Ll = { A: 10, B: 11, C: 12, D: 13, E: 14, F: 15 }; var Jn = function(t13) { return t13.length === 2 ? (Ll[t13[0].toUpperCase()] || +t13[0]) * 16 + (Ll[t13[1].toUpperCase()] || +t13[1]) : Ll[t13[1].toUpperCase()] || +t13[1]; }; var mk = function(t13, 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: t13, s: o * 100, v: i * 100 }; }; var Yd = (t13, e, r) => { t13 = Ka(t13, 255), e = Ka(e, 255), r = Ka(r, 255); const n = Math.max(t13, e, r), a = Math.min(t13, 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 t13: { i = (e - r) / s + (e < r ? 6 : 0); break; } case e: { i = (r - t13) / s + 2; break; } case r: { i = (t13 - e) / s + 4; break; } } i /= 6; } return { h: i * 360, s: u * 100, v: o * 100 }; }; var Di = function(t13, e, r) { t13 = Ka(t13, 360) * 6, e = Ka(e, 100), r = Ka(r, 100); const n = Math.floor(t13), a = t13 - 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) }; }; var qi = class { constructor(e = {}) { this._hue = 0, this._saturation = 100, this._value = 100, this._alpha = 100, this.enableAlpha = false, this.format = "hex", this.value = ""; for (const r in e) va(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) va(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 Di(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 } = mk(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 } = Yd(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 = Jn(n[0] + n[0]), i = Jn(n[1] + n[1]), o = Jn(n[2] + n[2])) : (n.length === 6 || n.length === 8) && (a = Jn(n.slice(0, 2)), i = Jn(n.slice(2, 4)), o = Jn(n.slice(4, 6))), n.length === 8 ? this._alpha = Jn(n.slice(6)) / 255 * 100 : (n.length === 3 || n.length === 6) && (this._alpha = 100); const { h: s, s: u, v: l } = Yd(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 = Ud(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 = `${Wd(Di(e, r, n))}${ss(a * 255 / 100)}`; break; } default: { const { r: o, g: s, b: u } = Di(e, r, n); this.value = `rgba(${o}, ${s}, ${u}, ${this.get("alpha") / 100})`; } } else switch (i) { case "hsl": { const o = Ud(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 } = Di(e, r, n); this.value = `rgb(${o}, ${s}, ${u})`; break; } default: this.value = Wd(Di(e, r, n)); } } }; var yk = defineComponent({ props: { colors: { type: Array, required: true }, color: { type: Object, required: true }, enableAlpha: { type: Boolean, required: true } }, setup(t13) { const e = He("color-predefine"), { currentColor: r } = inject(Ah), n = ref(i(t13.colors, t13.color)); watch(() => r.value, (o) => { const s = new qi(); s.fromString(o), n.value.forEach((u) => { u.selected = s.compare(u); }); }), watchEffect(() => { n.value = i(t13.colors, t13.color); }); function a(o) { t13.color.fromString(t13.colors[o]); } function i(o, s) { return o.map((u) => { const l = new qi(); return l.enableAlpha = t13.enableAlpha, l.format = "rgba", l.fromString(u), l.selected = l.value === s.value, l; }); } return { rgbaColors: n, handleSelect: a, ns: e }; } }); function bk(t13, e, r, n, a, i) { return openBlock(), createElementBlock("div", { class: normalizeClass(t13.ns.b()) }, [ createBaseVNode("div", { class: normalizeClass(t13.ns.e("colors")) }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(t13.rgbaColors, (o, s) => (openBlock(), createElementBlock("div", { key: t13.colors[s], class: normalizeClass([ t13.ns.e("color-selector"), t13.ns.is("alpha", o._alpha < 100), { selected: o.selected } ]), onClick: (u) => t13.handleSelect(s) }, [ createBaseVNode("div", { style: normalizeStyle({ backgroundColor: o.value }) }, null, 4) ], 10, ["onClick"]))), 128)) ], 2) ], 2); } var wk = Ve(yk, [["render", bk], ["__file", "predefine.vue"]]); var Ck = defineComponent({ name: "ElSlPanel", props: { color: { type: Object, required: true } }, setup(t13) { const e = He("color-svpanel"), r = getCurrentInstance(), n = ref(0), a = ref(0), i = ref("hsl(0, 100%, 50%)"), o = computed(() => { const l = t13.color.get("hue"), c = t13.color.get("value"); return { hue: l, value: c }; }); function s() { const l = t13.color.get("saturation"), c = t13.color.get("value"), d = r.vnode.el, { clientWidth: v, clientHeight: h6 } = d; a.value = l * v / 100, n.value = (100 - c) * h6 / 100, i.value = `hsl(${t13.color.get("hue")}, 100%, 50%)`; } function u(l) { const d = r.vnode.el.getBoundingClientRect(), { clientX: v, clientY: h6 } = Tu(l); let f = v - d.left, p = h6 - d.top; f = Math.max(0, f), f = Math.min(f, d.width), p = Math.max(0, p), p = Math.min(p, d.height), a.value = f, n.value = p, t13.color.set({ saturation: f / d.width * 100, value: 100 - p / d.height * 100 }); } return watch(() => o.value, () => { s(); }), onMounted(() => { eo(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 xk(t13, e, r, n, a, i) { return openBlock(), createElementBlock("div", { class: normalizeClass(t13.ns.b()), style: normalizeStyle({ backgroundColor: t13.background }) }, [ createBaseVNode("div", { class: normalizeClass(t13.ns.e("white")) }, null, 2), createBaseVNode("div", { class: normalizeClass(t13.ns.e("black")) }, null, 2), createBaseVNode("div", { class: normalizeClass(t13.ns.e("cursor")), style: normalizeStyle({ top: t13.cursorTop + "px", left: t13.cursorLeft + "px" }) }, [ createBaseVNode("div") ], 6) ], 6); } var Ek = Ve(Ck, [["render", xk], ["__file", "sv-panel.vue"]]); var kk = defineComponent({ name: "ElColorPicker" }); var Sk = defineComponent({ ...kk, props: vk, emits: hk, setup(t13, { expose: e, emit: r }) { const n = t13, { t: a } = yo(), i = He("color"), { formItem: o } = Ta(), s = pa(), u = Co(), { inputId: l, isLabeledByFormItem: c } = xo(n, { formItemContext: o }), d = ref(), v = ref(), h6 = ref(), f = ref(), p = ref(), m = ref(), { isFocused: g, handleFocus: y, handleBlur: b } = Gu(p, { beforeFocus() { return u.value; }, beforeBlur($) { var G; return (G = f.value) == null ? void 0 : G.isFocusInsideContent($); }, afterBlur() { B(false), R(); } }); let w = true; const x = reactive(new qi({ enableAlpha: n.showAlpha, format: n.colorFormat || "", value: n.modelValue })), E = ref(false), C = ref(false), T = ref(""), k = computed(() => !n.modelValue && !C.value ? "transparent" : L(x, n.showAlpha)), _ = computed(() => !n.modelValue && !C.value ? "" : x.value), D = computed(() => c.value ? void 0 : n.ariaLabel || a("el.colorpicker.defaultLabel")), O = computed(() => c.value ? o == null ? void 0 : o.labelId : void 0), F = computed(() => [ i.b("picker"), i.is("disabled", u.value), i.bm("picker", s.value), i.is("focused", g.value) ]); function L($, G) { if (!($ instanceof qi)) throw new TypeError("color should be instance of _color Class"); const { r: Q, g: ge, b: Ee } = $.toRgb(); return G ? `rgba(${Q}, ${ge}, ${Ee}, ${$.get("alpha") / 100})` : `rgb(${Q}, ${ge}, ${Ee})`; } function B($) { E.value = $; } const I = Rv(B, 100, { leading: true }); function M() { u.value || B(true); } function A() { I(false), R(); } function R() { nextTick(() => { n.modelValue ? x.fromString(n.modelValue) : (x.value = "", nextTick(() => { C.value = false; })); }); } function K() { u.value || I(!E.value); } function H() { x.fromString(T.value); } function q() { const $ = x.value; r(zt, $), r("change", $), n.validateEvent && (o == null || o.validate("change").catch((G) => Dt(G))), I(false), nextTick(() => { const G = new qi({ enableAlpha: n.showAlpha, format: n.colorFormat || "", value: n.modelValue }); x.compare(G) || R(); }); } function ee() { I(false), r(zt, null), r("change", null), n.modelValue !== null && n.validateEvent && (o == null || o.validate("change").catch(($) => Dt($))), R(); } function se() { E.value && (A(), g.value && ue()); } function oe($) { $.preventDefault(), $.stopPropagation(), B(false), R(); } function ae($) { switch ($.code) { case Lt.enter: case Lt.space: $.preventDefault(), $.stopPropagation(), M(), m.value.focus(); break; case Lt.esc: oe($); break; } } function ue() { p.value.focus(); } function te() { p.value.blur(); } return onMounted(() => { n.modelValue && (T.value = _.value); }), watch(() => n.modelValue, ($) => { $ ? $ && $ !== x.value && (w = false, x.fromString($)) : C.value = false; }), watch(() => [n.colorFormat, n.showAlpha], () => { x.enableAlpha = n.showAlpha, x.format = n.colorFormat || x.format, x.doOnChange(), r(zt, x.value); }), watch(() => _.value, ($) => { T.value = $, w && r("activeChange", $), w = true; }), watch(() => x.value, () => { !n.modelValue && !C.value && (C.value = true); }), watch(() => E.value, () => { nextTick(() => { var $, G, Q; ($ = d.value) == null || $.update(), (G = v.value) == null || G.update(), (Q = h6.value) == null || Q.update(); }); }), provide(Ah, { currentColor: _ }), e({ color: x, show: M, hide: A, focus: ue, blur: te }), ($, G) => (openBlock(), createBlock(unref(ko), { ref_key: "popper", ref: f, visible: E.value, "show-arrow": false, "fallback-placements": ["bottom", "top", "right", "left"], offset: 0, "gpu-acceleration": false, "popper-class": [unref(i).be("picker", "panel"), unref(i).b("dropdown"), $.popperClass], "stop-popper-mouse-event": false, effect: "light", trigger: "click", teleported: $.teleported, transition: `${unref(i).namespace.value}-zoom-in-top`, persistent: "", onHide: (Q) => B(false) }, { content: withCtx(() => [ withDirectives((openBlock(), createElementBlock("div", { onKeydown: withKeys(oe, ["esc"]) }, [ createBaseVNode("div", { class: normalizeClass(unref(i).be("dropdown", "main-wrapper")) }, [ createVNode(fk, { ref_key: "hue", ref: d, class: "hue-slider", color: unref(x), vertical: "" }, null, 8, ["color"]), createVNode(Ek, { ref_key: "sv", ref: v, color: unref(x) }, null, 8, ["color"]) ], 2), $.showAlpha ? (openBlock(), createBlock(uk, { key: 0, ref_key: "alpha", ref: h6, color: unref(x) }, null, 8, ["color"])) : createCommentVNode("v-if", true), $.predefine ? (openBlock(), createBlock(wk, { key: 1, ref: "predefine", "enable-alpha": $.showAlpha, color: unref(x), colors: $.predefine }, null, 8, ["enable-alpha", "color", "colors"])) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass(unref(i).be("dropdown", "btns")) }, [ createBaseVNode("span", { class: normalizeClass(unref(i).be("dropdown", "value")) }, [ createVNode(unref(Eo), { ref_key: "inputRef", ref: m, modelValue: T.value, "onUpdate:modelValue": (Q) => T.value = Q, "validate-event": false, size: "small", onKeyup: withKeys(H, ["enter"]), onBlur: H }, null, 8, ["modelValue", "onUpdate:modelValue", "onKeyup"]) ], 2), createVNode(unref(Hr), { class: normalizeClass(unref(i).be("dropdown", "link-btn")), text: "", size: "small", onClick: ee }, { default: withCtx(() => [ createTextVNode(toDisplayString(unref(a)("el.colorpicker.clear")), 1) ]), _: 1 }, 8, ["class"]), createVNode(unref(Hr), { plain: "", size: "small", class: normalizeClass(unref(i).be("dropdown", "btn")), onClick: q }, { default: withCtx(() => [ createTextVNode(toDisplayString(unref(a)("el.colorpicker.confirm")), 1) ]), _: 1 }, 8, ["class"]) ], 2) ], 40, ["onKeydown"])), [ [unref(_h), se] ]) ]), default: withCtx(() => [ createBaseVNode("div", mergeProps({ id: unref(l), ref_key: "triggerRef", ref: p }, $.$attrs, { class: unref(F), role: "button", "aria-label": unref(D), "aria-labelledby": unref(O), "aria-description": unref(a)("el.colorpicker.description", { color: $.modelValue || "" }), "aria-disabled": unref(u), tabindex: unref(u) ? -1 : $.tabindex, onKeydown: ae, onFocus: unref(y), onBlur: unref(b) }), [ unref(u) ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(i).be("picker", "mask")) }, null, 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass(unref(i).be("picker", "trigger")), onClick: K }, [ createBaseVNode("span", { class: normalizeClass([unref(i).be("picker", "color"), unref(i).is("alpha", $.showAlpha)]) }, [ createBaseVNode("span", { class: normalizeClass(unref(i).be("picker", "color-inner")), style: normalizeStyle({ backgroundColor: unref(k) }) }, [ withDirectives(createVNode(unref(Vt), { class: normalizeClass([unref(i).be("picker", "icon"), unref(i).is("icon-arrow-down")]) }, { default: withCtx(() => [ createVNode(unref(Gs)) ]), _: 1 }, 8, ["class"]), [ [vShow, $.modelValue || C.value] ]), withDirectives(createVNode(unref(Vt), { class: normalizeClass([unref(i).be("picker", "empty"), unref(i).is("icon-close")]) }, { default: withCtx(() => [ createVNode(unref(Ss)) ]), _: 1 }, 8, ["class"]), [ [vShow, !$.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 Tk = Ve(Sk, [["__file", "color-picker.vue"]]); var _k = $t(Tk); var Dk = defineComponent({ name: "ElContainer" }); var Pk = defineComponent({ ...Dk, props: { direction: { type: String } }, setup(t13) { const e = t13, r = useSlots(), n = He("container"), a = computed(() => e.direction === "vertical" ? true : e.direction === "horizontal" ? false : r && r.default ? r.default().some((o) => { const s = o.type.name; return s === "ElHeader" || s === "ElFooter"; }) : false); return (i, o) => (openBlock(), createElementBlock("section", { class: normalizeClass([unref(n).b(), unref(n).is("vertical", unref(a))]) }, [ renderSlot(i.$slots, "default") ], 2)); } }); var Ok = Ve(Pk, [["__file", "container.vue"]]); var Lk = defineComponent({ name: "ElAside" }); var Ik = defineComponent({ ...Lk, props: { width: { type: String, default: null } }, setup(t13) { const e = t13, r = He("aside"), n = computed(() => e.width ? r.cssVarBlock({ width: e.width }) : {}); return (a, i) => (openBlock(), createElementBlock("aside", { class: normalizeClass(unref(r).b()), style: normalizeStyle(unref(n)) }, [ renderSlot(a.$slots, "default") ], 6)); } }); var Mh = Ve(Ik, [["__file", "aside.vue"]]); var Fk = defineComponent({ name: "ElFooter" }); var Ak = defineComponent({ ...Fk, props: { height: { type: String, default: null } }, setup(t13) { const e = t13, r = He("footer"), n = computed(() => e.height ? r.cssVarBlock({ height: e.height }) : {}); return (a, i) => (openBlock(), createElementBlock("footer", { class: normalizeClass(unref(r).b()), style: normalizeStyle(unref(n)) }, [ renderSlot(a.$slots, "default") ], 6)); } }); var Bh = Ve(Ak, [["__file", "footer.vue"]]); var Mk = defineComponent({ name: "ElHeader" }); var Bk = defineComponent({ ...Mk, props: { height: { type: String, default: null } }, setup(t13) { const e = t13, r = He("header"), n = computed(() => e.height ? r.cssVarBlock({ height: e.height }) : {}); return (a, i) => (openBlock(), createElementBlock("header", { class: normalizeClass(unref(r).b()), style: normalizeStyle(unref(n)) }, [ renderSlot(a.$slots, "default") ], 6)); } }); var Nh = Ve(Bk, [["__file", "header.vue"]]); var Nk = defineComponent({ name: "ElMain" }); var $k = defineComponent({ ...Nk, setup(t13) { const e = He("main"); return (r, n) => (openBlock(), createElementBlock("main", { class: normalizeClass(unref(e).b()) }, [ renderSlot(r.$slots, "default") ], 2)); } }); var $h = Ve($k, [["__file", "main.vue"]]); var Rh = $t(Ok, { Aside: Mh, Footer: Bh, Header: Nh, Main: $h }); Cn(Mh); Cn(Bh); var zh = Cn(Nh); var ec = Cn($h); var Rk = defineComponent({ inheritAttrs: false }); function zk(t13, e, r, n, a, i) { return renderSlot(t13.$slots, "default"); } var Vk = Ve(Rk, [["render", zk], ["__file", "collection.vue"]]); var Hk = defineComponent({ name: "ElCollectionItem", inheritAttrs: false }); function qk(t13, e, r, n, a, i) { return renderSlot(t13.$slots, "default"); } var Kk = Ve(Hk, [["render", qk], ["__file", "collection-item.vue"]]); var Uk = "data-el-collection-item"; var Gk = (t13) => { const e = `El${t13}Collection`, r = `${e}Item`, n = Symbol(e), a = Symbol(r), i = { ...Vk, name: e, setup() { const s = ref(null), u = /* @__PURE__ */ new Map(); provide(n, { itemMap: u, getItems: () => { const c = unref(s); if (!c) return []; const d = Array.from(c.querySelectorAll(`[${Uk}]`)); return [...u.values()].sort((h6, f) => d.indexOf(h6.ref) - d.indexOf(f.ref)); }, collectionRef: s }); } }, o = { ...Kk, name: r, setup(s, { attrs: u }) { const l = ref(null), c = inject(n, void 0); provide(a, { collectionItemRef: l }), onMounted(() => { const d = unref(l); d && c.itemMap.set(d, { ref: d, ...u }); }), onBeforeUnmount(() => { const d = unref(l); c.itemMap.delete(d); }); } }; return { COLLECTION_INJECTION_KEY: n, COLLECTION_ITEM_INJECTION_KEY: a, ElCollection: i, ElCollectionItem: o }; }; var Il = rt({ trigger: Ji.trigger, effect: { ...cr.effect, default: "light" }, type: { type: $e(String) }, placement: { type: $e(String), default: "bottom" }, popperOptions: { type: $e(Object), default: () => ({}) }, id: String, size: { type: String, default: "" }, splitButton: Boolean, hideOnClick: { type: Boolean, default: true }, loop: { type: Boolean, default: true }, showTimeout: { type: Number, default: 150 }, hideTimeout: { type: Number, default: 150 }, tabindex: { type: $e([Number, String]), default: 0 }, maxHeight: { type: $e([Number, String]), default: "" }, popperClass: { type: String, default: "" }, disabled: Boolean, role: { type: String, default: "menu" }, buttonProps: { type: $e(Object) }, teleported: cr.teleported }); rt({ command: { type: [Object, String, Number], default: () => ({}) }, disabled: Boolean, divided: Boolean, textValue: String, icon: { type: Hn } }); rt({ onKeydown: { type: $e(Function) } }); Gk("Dropdown"); var Vh = Symbol("ElSelectGroup"); var To = Symbol("ElSelect"); function Wk(t13, e) { const r = inject(To), n = inject(Vh, { disabled: false }), a = computed(() => c(Fn(r.props.modelValue), t13.value)), i = computed(() => { var h6; if (r.props.multiple) { const f = Fn((h6 = r.props.modelValue) != null ? h6 : []); return !a.value && f.length >= r.props.multipleLimit && r.props.multipleLimit > 0; } else return false; }), o = computed(() => t13.label || (Ht(t13.value) ? "" : t13.value)), s = computed(() => t13.value || t13.label || ""), u = computed(() => t13.disabled || e.groupDisabled || i.value), l = getCurrentInstance(), c = (h6 = [], f) => { if (Ht(t13.value)) { const p = r.props.valueKey; return h6 && h6.some((m) => toRaw(fn(m, p)) === fn(f, p)); } else return h6 && h6.includes(f); }, d = () => { !t13.disabled && !n.disabled && (r.states.hoveringIndex = r.optionsArray.indexOf(l.proxy)); }, v = (h6) => { const f = new RegExp(Xb(h6), "i"); e.visible = f.test(o.value) || t13.created; }; return watch(() => o.value, () => { !t13.created && !r.props.remote && r.setSelected(); }), watch(() => t13.value, (h6, f) => { const { remote: p, valueKey: m } = r.props; if (h6 !== f && (r.onOptionDestroy(f, l.proxy), r.onOptionCreate(l.proxy)), !t13.created && !p) { if (m && Ht(h6) && Ht(f) && h6[m] === f[m]) return; r.setSelected(); } }), watch(() => n.disabled, () => { e.groupDisabled = n.disabled; }, { immediate: true }), { select: r, currentLabel: o, currentValue: s, itemSelected: a, isDisabled: u, hoverItem: d, updateOption: v }; } var Yk = defineComponent({ name: "ElOption", componentName: "ElOption", props: { value: { required: true, type: [String, Number, Boolean, Object] }, label: [String, Number], created: Boolean, disabled: Boolean }, setup(t13) { const e = He("select"), r = Xs(), n = computed(() => [ e.be("dropdown", "item"), e.is("disabled", unref(s)), e.is("selected", unref(o)), e.is("hovering", unref(v)) ]), a = reactive({ index: -1, groupDisabled: false, visible: true, hover: false }), { currentLabel: i, itemSelected: o, isDisabled: s, select: u, hoverItem: l, updateOption: c } = Wk(t13, a), { visible: d, hover: v } = toRefs(a), h6 = getCurrentInstance().proxy; u.onOptionCreate(h6), onBeforeUnmount(() => { const p = h6.value, { selected: m } = u.states, y = (u.props.multiple ? m : [m]).some((b) => b.value === h6.value); nextTick(() => { u.states.cachedOptions.get(p) === h6 && !y && u.states.cachedOptions.delete(p); }), u.onOptionDestroy(p, h6); }); function f() { s.value || u.handleOptionSelect(h6); } return { ns: e, id: r, containerKls: n, currentLabel: i, itemSelected: o, isDisabled: s, select: u, hoverItem: l, updateOption: c, visible: d, hover: v, selectOptionClick: f, states: a }; } }); function Zk(t13, e, r, n, a, i) { return withDirectives((openBlock(), createElementBlock("li", { id: t13.id, class: normalizeClass(t13.containerKls), role: "option", "aria-disabled": t13.isDisabled || void 0, "aria-selected": t13.itemSelected, onMouseenter: t13.hoverItem, onClick: withModifiers(t13.selectOptionClick, ["stop"]) }, [ renderSlot(t13.$slots, "default", {}, () => [ createBaseVNode("span", null, toDisplayString(t13.currentLabel), 1) ]) ], 42, ["id", "aria-disabled", "aria-selected", "onMouseenter", "onClick"])), [ [vShow, t13.visible] ]); } var tc = Ve(Yk, [["render", Zk], ["__file", "option.vue"]]); var Xk = defineComponent({ name: "ElSelectDropdown", componentName: "ElSelectDropdown", setup() { const t13 = inject(To), e = He("select"), r = computed(() => t13.props.popperClass), n = computed(() => t13.props.multiple), a = computed(() => t13.props.fitInputWidth), i = ref(""); function o() { var s; i.value = `${(s = t13.selectRef) == null ? void 0 : s.offsetWidth}px`; } return onMounted(() => { o(), dn(t13.selectRef, o); }), { ns: e, minWidth: i, popperClass: r, isMultiple: n, isFitInputWidth: a }; } }); function jk(t13, e, r, n, a, i) { return openBlock(), createElementBlock("div", { class: normalizeClass([t13.ns.b("dropdown"), t13.ns.is("multiple", t13.isMultiple), t13.popperClass]), style: normalizeStyle({ [t13.isFitInputWidth ? "width" : "minWidth"]: t13.minWidth }) }, [ t13.$slots.header ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(t13.ns.be("dropdown", "header")) }, [ renderSlot(t13.$slots, "header") ], 2)) : createCommentVNode("v-if", true), renderSlot(t13.$slots, "default"), t13.$slots.footer ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(t13.ns.be("dropdown", "footer")) }, [ renderSlot(t13.$slots, "footer") ], 2)) : createCommentVNode("v-if", true) ], 6); } var Qk = Ve(Xk, [["render", jk], ["__file", "select-dropdown.vue"]]); var Jk = 11; var eS = (t13, e) => { const { t: r } = yo(), n = Xs(), a = He("select"), i = He("input"), o = reactive({ inputValue: "", options: /* @__PURE__ */ new Map(), cachedOptions: /* @__PURE__ */ new Map(), disabledOptions: /* @__PURE__ */ new Map(), optionValues: [], selected: [], selectionWidth: 0, calculatorWidth: 0, collapseItemWidth: 0, selectedLabel: "", hoveringIndex: -1, previousQuery: null, inputHovering: false, menuVisibleOnFocus: false, isBeforeHide: false }), s = ref(null), u = ref(null), l = ref(null), c = ref(null), d = ref(null), v = ref(null), h6 = ref(null), f = ref(null), p = ref(null), m = ref(null), g = ref(null), y = ref(null), { isComposing: b, handleCompositionStart: w, handleCompositionUpdate: x, handleCompositionEnd: E } = hh({ afterComposition: (W) => ie(W) }), { wrapperRef: C, isFocused: T } = Gu(d, { beforeFocus() { return I.value; }, afterFocus() { t13.automaticDropdown && !k.value && (k.value = true, o.menuVisibleOnFocus = true); }, beforeBlur(W) { var we, We; return ((we = l.value) == null ? void 0 : we.isFocusInsideContent(W)) || ((We = c.value) == null ? void 0 : We.isFocusInsideContent(W)); }, afterBlur() { k.value = false, o.menuVisibleOnFocus = false; } }), k = ref(false), _ = ref(), { form: D, formItem: O } = Ta(), { inputId: F } = xo(t13, { formItemContext: O }), { valueOnClear: L, isEmptyValue: B } = vC(t13), I = computed(() => t13.disabled || (D == null ? void 0 : D.disabled)), M = computed(() => fr(t13.modelValue) ? t13.modelValue.length > 0 : !B(t13.modelValue)), A = computed(() => t13.clearable && !I.value && o.inputHovering && M.value), R = computed(() => t13.remote && t13.filterable && !t13.remoteShowSuffix ? "" : t13.suffixIcon), K = computed(() => a.is("reverse", R.value && k.value)), H = computed(() => (O == null ? void 0 : O.validateState) || ""), q = computed(() => Uv[H.value]), ee = computed(() => t13.remote ? 300 : 0), se = computed(() => t13.loading ? t13.loadingText || r("el.select.loading") : t13.remote && !o.inputValue && o.options.size === 0 ? false : t13.filterable && o.inputValue && o.options.size > 0 && oe.value === 0 ? t13.noMatchText || r("el.select.noMatch") : o.options.size === 0 ? t13.noDataText || r("el.select.noData") : null), oe = computed(() => ae.value.filter((W) => W.visible).length), ae = computed(() => { const W = Array.from(o.options.values()), we = []; return o.optionValues.forEach((We) => { const at = W.findIndex((Gr) => Gr.value === We); at > -1 && we.push(W[at]); }), we.length >= W.length ? we : W; }), ue = computed(() => Array.from(o.cachedOptions.values())), te = computed(() => { const W = ae.value.filter((we) => !we.created).some((we) => we.currentLabel === o.inputValue); return t13.filterable && t13.allowCreate && o.inputValue !== "" && !W; }), $ = () => { t13.filterable && lr(t13.filterMethod) || t13.filterable && t13.remote && lr(t13.remoteMethod) || ae.value.forEach((W) => { var we; (we = W.updateOption) == null || we.call(W, o.inputValue); }); }, G = pa(), Q = computed(() => ["small"].includes(G.value) ? "small" : "default"), ge = computed({ get() { return k.value && se.value !== false; }, set(W) { k.value = W; } }), Ee = computed(() => { if (t13.multiple && !Mn(t13.modelValue)) return Fn(t13.modelValue).length === 0 && !o.inputValue; const W = fr(t13.modelValue) ? t13.modelValue[0] : t13.modelValue; return t13.filterable || Mn(W) ? !o.inputValue : true; }), fe = computed(() => { var W; const we = (W = t13.placeholder) != null ? W : r("el.select.placeholder"); return t13.multiple || !M.value ? we : o.selectedLabel; }), me = computed(() => Gl ? null : "mouseenter"); watch(() => t13.modelValue, (W, we) => { t13.multiple && t13.filterable && !t13.reserveKeyword && (o.inputValue = "", Ce("")), xe(), !Es(W, we) && t13.validateEvent && (O == null || O.validate("change").catch((We) => Dt(We))); }, { flush: "post", deep: true }), watch(() => k.value, (W) => { W ? Ce(o.inputValue) : (o.inputValue = "", o.previousQuery = null, o.isBeforeHide = true), e("visible-change", W); }), watch(() => o.options.entries(), () => { var W; if (!_t) return; const we = ((W = s.value) == null ? void 0 : W.querySelectorAll("input")) || []; (!t13.filterable && !t13.defaultFirstOption && !Mn(t13.modelValue) || !Array.from(we).includes(document.activeElement)) && xe(), t13.defaultFirstOption && (t13.filterable || t13.remote) && oe.value && ke(); }, { flush: "post" }), watch(() => o.hoveringIndex, (W) => { qt(W) && W > -1 ? _.value = ae.value[W] || {} : _.value = {}, ae.value.forEach((we) => { we.hover = _.value === we; }); }), watchEffect(() => { o.isBeforeHide || $(); }); const Ce = (W) => { o.previousQuery === W || b.value || (o.previousQuery = W, t13.filterable && lr(t13.filterMethod) ? t13.filterMethod(W) : t13.filterable && t13.remote && lr(t13.remoteMethod) && t13.remoteMethod(W), t13.defaultFirstOption && (t13.filterable || t13.remote) && oe.value ? nextTick(ke) : nextTick(qe)); }, ke = () => { const W = ae.value.filter((at) => at.visible && !at.disabled && !at.states.groupDisabled), we = W.find((at) => at.created), We = W[0]; o.hoveringIndex = _e(ae.value, we || We); }, xe = () => { if (t13.multiple) o.selectedLabel = ""; else { const we = fr(t13.modelValue) ? t13.modelValue[0] : t13.modelValue, We = De(we); o.selectedLabel = We.currentLabel, o.selected = [We]; return; } const W = []; Mn(t13.modelValue) || Fn(t13.modelValue).forEach((we) => { W.push(De(we)); }), o.selected = W; }, De = (W) => { let we; const We = bl(W).toLowerCase() === "object", at = bl(W).toLowerCase() === "null", Gr = bl(W).toLowerCase() === "undefined"; for (let sn = o.cachedOptions.size - 1; sn >= 0; sn--) { const Cr = ue.value[sn]; if (We ? fn(Cr.value, t13.valueKey) === fn(W, t13.valueKey) : Cr.value === W) { we = { value: W, currentLabel: Cr.currentLabel, get isDisabled() { return Cr.isDisabled; } }; break; } } if (we) return we; const Sn = We ? W.label : !at && !Gr ? W : ""; return { value: W, currentLabel: Sn }; }, qe = () => { o.hoveringIndex = ae.value.findIndex((W) => o.selected.some((we) => Xt(we) === Xt(W))); }, Ke = () => { o.selectionWidth = u.value.getBoundingClientRect().width; }, Be = () => { o.calculatorWidth = v.value.getBoundingClientRect().width; }, Ge = () => { o.collapseItemWidth = g.value.getBoundingClientRect().width; }, le = () => { var W, we; (we = (W = l.value) == null ? void 0 : W.updatePopper) == null || we.call(W); }, S = () => { var W, we; (we = (W = c.value) == null ? void 0 : W.updatePopper) == null || we.call(W); }, z = () => { o.inputValue.length > 0 && !k.value && (k.value = true), Ce(o.inputValue); }, ie = (W) => { if (o.inputValue = W.target.value, t13.remote) j(); else return z(); }, j = Rv(() => { z(); }, ee.value), Y = (W) => { Es(t13.modelValue, W) || e(Bu, W); }, pe = (W) => Kb(W, (we) => !o.disabledOptions.has(we)), re = (W) => { if (t13.multiple && W.code !== Lt.delete && W.target.value.length <= 0) { const we = Fn(t13.modelValue).slice(), We = pe(we); if (We < 0) return; const at = we[We]; we.splice(We, 1), e(zt, we), Y(we), e("remove-tag", at); } }, ve = (W, we) => { const We = o.selected.indexOf(we); if (We > -1 && !I.value) { const at = Fn(t13.modelValue).slice(); at.splice(We, 1), e(zt, at), Y(at), e("remove-tag", we.value); } W.stopPropagation(), kt(); }, Ae = (W) => { W.stopPropagation(); const we = t13.multiple ? [] : L.value; if (t13.multiple) for (const We of o.selected) We.isDisabled && we.push(We.value); e(zt, we), Y(we), o.hoveringIndex = -1, k.value = false, e("clear"), kt(); }, Me = (W) => { var we; if (t13.multiple) { const We = Fn((we = t13.modelValue) != null ? we : []).slice(), at = _e(We, W.value); at > -1 ? We.splice(at, 1) : (t13.multipleLimit <= 0 || We.length < t13.multipleLimit) && We.push(W.value), e(zt, We), Y(We), W.created && Ce(""), t13.filterable && !t13.reserveKeyword && (o.inputValue = ""); } else e(zt, W.value), Y(W.value), k.value = false; kt(), !k.value && nextTick(() => { Ne(W); }); }, _e = (W = [], we) => { if (!Ht(we)) return W.indexOf(we); const We = t13.valueKey; let at = -1; return W.some((Gr, Sn) => toRaw(fn(Gr, We)) === fn(we, We) ? (at = Sn, true) : false), at; }, Ne = (W) => { var we, We, at, Gr, Sn; const Oa = fr(W) ? W[0] : W; let sn = null; if (Oa != null && Oa.value) { const Cr = ae.value.filter((Tn) => Tn.value === Oa.value); Cr.length > 0 && (sn = Cr[0].$el); } if (l.value && sn) { const Cr = (Gr = (at = (We = (we = l.value) == null ? void 0 : we.popperRef) == null ? void 0 : We.contentRef) == null ? void 0 : at.querySelector) == null ? void 0 : Gr.call(at, `.${a.be("dropdown", "wrap")}`); Cr && Jb(Cr, sn); } (Sn = y.value) == null || Sn.handleScroll(); }, Te = (W) => { o.options.set(W.value, W), o.cachedOptions.set(W.value, W), W.disabled && o.disabledOptions.set(W.value, W); }, Oe = (W, we) => { o.options.get(W) === we && o.options.delete(W); }, ut = computed(() => { var W, we; return (we = (W = l.value) == null ? void 0 : W.popperRef) == null ? void 0 : we.contentRef; }), nt = () => { o.isBeforeHide = false, nextTick(() => Ne(o.selected)); }, kt = () => { var W; (W = d.value) == null || W.focus(); }, St = () => { var W; (W = d.value) == null || W.blur(); }, wt = (W) => { Ae(W); }, Zt = () => { k.value = false, T.value && St(); }, Pt = () => { o.inputValue.length > 0 ? o.inputValue = "" : k.value = false; }, Mt = () => { I.value || (Gl && (o.inputHovering = true), o.menuVisibleOnFocus ? o.menuVisibleOnFocus = false : k.value = !k.value); }, gr = () => { k.value ? ae.value[o.hoveringIndex] && Me(ae.value[o.hoveringIndex]) : Mt(); }, Xt = (W) => Ht(W.value) ? fn(W.value, t13.valueKey) : W.value, jt = computed(() => ae.value.filter((W) => W.visible).every((W) => W.disabled)), wr = computed(() => t13.multiple ? t13.collapseTags ? o.selected.slice(0, t13.maxCollapseTags) : o.selected : []), Pr = computed(() => t13.multiple ? t13.collapseTags ? o.selected.slice(t13.maxCollapseTags) : [] : []), ur = (W) => { if (!k.value) { k.value = true; return; } if (!(o.options.size === 0 || o.filteredOptionsCount === 0 || b.value) && !jt.value) { W === "next" ? (o.hoveringIndex++, o.hoveringIndex === o.options.size && (o.hoveringIndex = 0)) : W === "prev" && (o.hoveringIndex--, o.hoveringIndex < 0 && (o.hoveringIndex = o.options.size - 1)); const we = ae.value[o.hoveringIndex]; (we.disabled === true || we.states.groupDisabled === true || !we.visible) && ur(W), nextTick(() => Ne(_.value)); } }, Ct = () => { if (!u.value) return 0; const W = window.getComputedStyle(u.value); return Number.parseFloat(W.gap || "6px"); }, Tt = computed(() => { const W = Ct(); return { maxWidth: `${g.value && t13.maxCollapseTags === 1 ? o.selectionWidth - o.collapseItemWidth - W : o.selectionWidth}px` }; }), Bt = computed(() => ({ maxWidth: `${o.selectionWidth}px` })), kn = computed(() => ({ width: `${Math.max(o.calculatorWidth, Jk)}px` })); return dn(u, Ke), dn(v, Be), dn(p, le), dn(C, le), dn(m, S), dn(g, Ge), onMounted(() => { xe(); }), { inputId: F, contentId: n, nsSelect: a, nsInput: i, states: o, isFocused: T, expanded: k, optionsArray: ae, hoverOption: _, selectSize: G, filteredOptionsCount: oe, resetCalculatorWidth: Be, updateTooltip: le, updateTagTooltip: S, debouncedOnInputChange: j, onInput: ie, deletePrevTag: re, deleteTag: ve, deleteSelected: Ae, handleOptionSelect: Me, scrollToOption: Ne, hasModelValue: M, shouldShowPlaceholder: Ee, currentPlaceholder: fe, mouseEnterEventName: me, showClose: A, iconComponent: R, iconReverse: K, validateState: H, validateIcon: q, showNewOption: te, updateOptions: $, collapseTagSize: Q, setSelected: xe, selectDisabled: I, emptyText: se, handleCompositionStart: w, handleCompositionUpdate: x, handleCompositionEnd: E, onOptionCreate: Te, onOptionDestroy: Oe, handleMenuEnter: nt, focus: kt, blur: St, handleClearClick: wt, handleClickOutside: Zt, handleEsc: Pt, toggleMenu: Mt, selectOption: gr, getValueKey: Xt, navigateOptions: ur, dropdownMenuVisible: ge, showTagList: wr, collapseTagList: Pr, tagStyle: Tt, collapseTagStyle: Bt, inputStyle: kn, popperRef: ut, inputRef: d, tooltipRef: l, tagTooltipRef: c, calculatorRef: v, prefixRef: h6, suffixRef: f, selectRef: s, wrapperRef: C, selectionRef: u, scrollbarRef: y, menuRef: p, tagMenuRef: m, collapseItemRef: g }; }; var tS = defineComponent({ name: "ElOptions", setup(t13, { slots: e }) { const r = inject(To); let n = []; return () => { var a, i; const o = (a = e.default) == null ? void 0 : a.call(e), s = []; function u(l) { fr(l) && l.forEach((c) => { var d, v, h6, f; const p = (d = (c == null ? void 0 : c.type) || {}) == null ? void 0 : d.name; p === "ElOptionGroup" ? u(!tr(c.children) && !fr(c.children) && lr((v = c.children) == null ? void 0 : v.default) ? (h6 = c.children) == null ? void 0 : h6.default() : c.children) : p === "ElOption" ? s.push((f = c.props) == null ? void 0 : f.value) : fr(c.children) && u(c.children); }); } return o.length && u((i = o[0]) == null ? void 0 : i.children), Es(s, n) || (n = s, r && (r.states.optionValues = s)), o; }; } }); var rS = 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: $e(String), default: "light" }, disabled: Boolean, clearable: Boolean, filterable: Boolean, allowCreate: Boolean, loading: Boolean, popperClass: { type: String, default: "" }, popperOptions: { type: $e(Object), default: () => ({}) }, remote: Boolean, loadingText: String, noMatchText: String, noDataText: String, remoteMethod: Function, filterMethod: Function, multiple: Boolean, multipleLimit: { type: Number, default: 0 }, placeholder: { type: String }, defaultFirstOption: Boolean, reserveKeyword: { type: Boolean, default: true }, valueKey: { type: String, default: "value" }, collapseTags: Boolean, collapseTagsTooltip: Boolean, maxCollapseTags: { type: Number, default: 1 }, teleported: cr.teleported, persistent: { type: Boolean, default: true }, clearIcon: { type: Hn, default: Au }, fitInputWidth: Boolean, suffixIcon: { type: Hn, default: Gs }, tagType: { ...au.type, default: "info" }, tagEffect: { ...au.effect, default: "light" }, validateEvent: { type: Boolean, default: true }, remoteShowSuffix: Boolean, placement: { type: $e(String), values: Ys, default: "bottom-start" }, fallbackPlacements: { type: $e(Array), default: ["bottom-start", "top-start", "right", "left"] }, appendTo: String, ...fC, ...Zn(["ariaLabel"]) }); var Zd = "ElSelect"; var nS = defineComponent({ name: Zd, componentName: Zd, components: { ElSelectMenu: Qk, ElOption: tc, ElOptions: tS, ElTag: HE, ElScrollbar: qC, ElTooltip: ko, ElIcon: Vt }, directives: { ClickOutside: _h }, props: rS, emits: [ zt, Bu, "remove-tag", "clear", "visible-change", "focus", "blur" ], setup(t13, { emit: e }) { const r = computed(() => { const { modelValue: i, multiple: o } = t13, s = o ? [] : void 0; return fr(i) ? o ? i : s : o ? s : i; }), n = reactive({ ...toRefs(t13), modelValue: r }), a = eS(n, e); return provide(To, reactive({ props: n, states: a.states, optionsArray: a.optionsArray, handleOptionSelect: a.handleOptionSelect, onOptionCreate: a.onOptionCreate, onOptionDestroy: a.onOptionDestroy, selectRef: a.selectRef, setSelected: a.setSelected })), { ...a, modelValue: r }; } }); function aS(t13, e, r, n, a, i) { const o = resolveComponent("el-tag"), s = resolveComponent("el-tooltip"), u = resolveComponent("el-icon"), l = resolveComponent("el-option"), c = resolveComponent("el-options"), d = resolveComponent("el-scrollbar"), v = resolveComponent("el-select-menu"), h6 = resolveDirective("click-outside"); return withDirectives((openBlock(), createElementBlock("div", { ref: "selectRef", class: normalizeClass([t13.nsSelect.b(), t13.nsSelect.m(t13.selectSize)]), [toHandlerKey(t13.mouseEnterEventName)]: (f) => t13.states.inputHovering = true, onMouseleave: (f) => t13.states.inputHovering = false }, [ createVNode(s, { ref: "tooltipRef", visible: t13.dropdownMenuVisible, placement: t13.placement, teleported: t13.teleported, "popper-class": [t13.nsSelect.e("popper"), t13.popperClass], "popper-options": t13.popperOptions, "fallback-placements": t13.fallbackPlacements, effect: t13.effect, pure: "", trigger: "click", transition: `${t13.nsSelect.namespace.value}-zoom-in-top`, "stop-popper-mouse-event": false, "gpu-acceleration": false, persistent: t13.persistent, "append-to": t13.appendTo, onBeforeShow: t13.handleMenuEnter, onHide: (f) => t13.states.isBeforeHide = false }, { default: withCtx(() => { var f; return [ createBaseVNode("div", { ref: "wrapperRef", class: normalizeClass([ t13.nsSelect.e("wrapper"), t13.nsSelect.is("focused", t13.isFocused), t13.nsSelect.is("hovering", t13.states.inputHovering), t13.nsSelect.is("filterable", t13.filterable), t13.nsSelect.is("disabled", t13.selectDisabled) ]), onClick: withModifiers(t13.toggleMenu, ["prevent"]) }, [ t13.$slots.prefix ? (openBlock(), createElementBlock("div", { key: 0, ref: "prefixRef", class: normalizeClass(t13.nsSelect.e("prefix")) }, [ renderSlot(t13.$slots, "prefix") ], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { ref: "selectionRef", class: normalizeClass([ t13.nsSelect.e("selection"), t13.nsSelect.is("near", t13.multiple && !t13.$slots.prefix && !!t13.states.selected.length) ]) }, [ t13.multiple ? renderSlot(t13.$slots, "tag", { key: 0 }, () => [ (openBlock(true), createElementBlock(Fragment, null, renderList(t13.showTagList, (p) => (openBlock(), createElementBlock("div", { key: t13.getValueKey(p), class: normalizeClass(t13.nsSelect.e("selected-item")) }, [ createVNode(o, { closable: !t13.selectDisabled && !p.isDisabled, size: t13.collapseTagSize, type: t13.tagType, effect: t13.tagEffect, "disable-transitions": "", style: normalizeStyle(t13.tagStyle), onClose: (m) => t13.deleteTag(m, p) }, { default: withCtx(() => [ createBaseVNode("span", { class: normalizeClass(t13.nsSelect.e("tags-text")) }, [ renderSlot(t13.$slots, "label", { label: p.currentLabel, value: p.value }, () => [ createTextVNode(toDisplayString(p.currentLabel), 1) ]) ], 2) ]), _: 2 }, 1032, ["closable", "size", "type", "effect", "style", "onClose"]) ], 2))), 128)), t13.collapseTags && t13.states.selected.length > t13.maxCollapseTags ? (openBlock(), createBlock(s, { key: 0, ref: "tagTooltipRef", disabled: t13.dropdownMenuVisible || !t13.collapseTagsTooltip, "fallback-placements": ["bottom", "top", "right", "left"], effect: t13.effect, placement: "bottom", teleported: t13.teleported }, { default: withCtx(() => [ createBaseVNode("div", { ref: "collapseItemRef", class: normalizeClass(t13.nsSelect.e("selected-item")) }, [ createVNode(o, { closable: false, size: t13.collapseTagSize, type: t13.tagType, effect: t13.tagEffect, "disable-transitions": "", style: normalizeStyle(t13.collapseTagStyle) }, { default: withCtx(() => [ createBaseVNode("span", { class: normalizeClass(t13.nsSelect.e("tags-text")) }, " + " + toDisplayString(t13.states.selected.length - t13.maxCollapseTags), 3) ]), _: 1 }, 8, ["size", "type", "effect", "style"]) ], 2) ]), content: withCtx(() => [ createBaseVNode("div", { ref: "tagMenuRef", class: normalizeClass(t13.nsSelect.e("selection")) }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(t13.collapseTagList, (p) => (openBlock(), createElementBlock("div", { key: t13.getValueKey(p), class: normalizeClass(t13.nsSelect.e("selected-item")) }, [ createVNode(o, { class: "in-tooltip", closable: !t13.selectDisabled && !p.isDisabled, size: t13.collapseTagSize, type: t13.tagType, effect: t13.tagEffect, "disable-transitions": "", onClose: (m) => t13.deleteTag(m, p) }, { default: withCtx(() => [ createBaseVNode("span", { class: normalizeClass(t13.nsSelect.e("tags-text")) }, [ renderSlot(t13.$slots, "label", { label: p.currentLabel, value: p.value }, () => [ createTextVNode(toDisplayString(p.currentLabel), 1) ]) ], 2) ]), _: 2 }, 1032, ["closable", "size", "type", "effect", "onClose"]) ], 2))), 128)) ], 2) ]), _: 3 }, 8, ["disabled", "effect", "teleported"])) : createCommentVNode("v-if", true) ]) : createCommentVNode("v-if", true), t13.selectDisabled ? createCommentVNode("v-if", true) : (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass([ t13.nsSelect.e("selected-item"), t13.nsSelect.e("input-wrapper"), t13.nsSelect.is("hidden", !t13.filterable) ]) }, [ withDirectives(createBaseVNode("input", { id: t13.inputId, ref: "inputRef", "onUpdate:modelValue": (p) => t13.states.inputValue = p, type: "text", name: t13.name, class: normalizeClass([t13.nsSelect.e("input"), t13.nsSelect.is(t13.selectSize)]), disabled: t13.selectDisabled, autocomplete: t13.autocomplete, style: normalizeStyle(t13.inputStyle), role: "combobox", readonly: !t13.filterable, spellcheck: "false", "aria-activedescendant": ((f = t13.hoverOption) == null ? void 0 : f.id) || "", "aria-controls": t13.contentId, "aria-expanded": t13.dropdownMenuVisible, "aria-label": t13.ariaLabel, "aria-autocomplete": "none", "aria-haspopup": "listbox", onKeydown: [ withKeys(withModifiers((p) => t13.navigateOptions("next"), ["stop", "prevent"]), ["down"]), withKeys(withModifiers((p) => t13.navigateOptions("prev"), ["stop", "prevent"]), ["up"]), withKeys(withModifiers(t13.handleEsc, ["stop", "prevent"]), ["esc"]), withKeys(withModifiers(t13.selectOption, ["stop", "prevent"]), ["enter"]), withKeys(withModifiers(t13.deletePrevTag, ["stop"]), ["delete"]) ], onCompositionstart: t13.handleCompositionStart, onCompositionupdate: t13.handleCompositionUpdate, onCompositionend: t13.handleCompositionEnd, onInput: t13.onInput, onClick: withModifiers(t13.toggleMenu, ["stop"]) }, null, 46, ["id", "onUpdate:modelValue", "name", "disabled", "autocomplete", "readonly", "aria-activedescendant", "aria-controls", "aria-expanded", "aria-label", "onKeydown", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onInput", "onClick"]), [ [vModelText, t13.states.inputValue] ]), t13.filterable ? (openBlock(), createElementBlock("span", { key: 0, ref: "calculatorRef", "aria-hidden": "true", class: normalizeClass(t13.nsSelect.e("input-calculator")), textContent: toDisplayString(t13.states.inputValue) }, null, 10, ["textContent"])) : createCommentVNode("v-if", true) ], 2)), t13.shouldShowPlaceholder ? (openBlock(), createElementBlock("div", { key: 2, class: normalizeClass([ t13.nsSelect.e("selected-item"), t13.nsSelect.e("placeholder"), t13.nsSelect.is("transparent", !t13.hasModelValue || t13.expanded && !t13.states.inputValue) ]) }, [ t13.hasModelValue ? renderSlot(t13.$slots, "label", { key: 0, label: t13.currentPlaceholder, value: t13.modelValue }, () => [ createBaseVNode("span", null, toDisplayString(t13.currentPlaceholder), 1) ]) : (openBlock(), createElementBlock("span", { key: 1 }, toDisplayString(t13.currentPlaceholder), 1)) ], 2)) : createCommentVNode("v-if", true) ], 2), createBaseVNode("div", { ref: "suffixRef", class: normalizeClass(t13.nsSelect.e("suffix")) }, [ t13.iconComponent && !t13.showClose ? (openBlock(), createBlock(u, { key: 0, class: normalizeClass([t13.nsSelect.e("caret"), t13.nsSelect.e("icon"), t13.iconReverse]) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(t13.iconComponent))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true), t13.showClose && t13.clearIcon ? (openBlock(), createBlock(u, { key: 1, class: normalizeClass([ t13.nsSelect.e("caret"), t13.nsSelect.e("icon"), t13.nsSelect.e("clear") ]), onClick: t13.handleClearClick }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(t13.clearIcon))) ]), _: 1 }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true), t13.validateState && t13.validateIcon ? (openBlock(), createBlock(u, { key: 2, class: normalizeClass([t13.nsInput.e("icon"), t13.nsInput.e("validateIcon")]) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(t13.validateIcon))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 2) ], 10, ["onClick"]) ]; }), content: withCtx(() => [ createVNode(v, { ref: "menuRef" }, { default: withCtx(() => [ t13.$slots.header ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(t13.nsSelect.be("dropdown", "header")), onClick: withModifiers(() => { }, ["stop"]) }, [ renderSlot(t13.$slots, "header") ], 10, ["onClick"])) : createCommentVNode("v-if", true), withDirectives(createVNode(d, { id: t13.contentId, ref: "scrollbarRef", tag: "ul", "wrap-class": t13.nsSelect.be("dropdown", "wrap"), "view-class": t13.nsSelect.be("dropdown", "list"), class: normalizeClass([t13.nsSelect.is("empty", t13.filteredOptionsCount === 0)]), role: "listbox", "aria-label": t13.ariaLabel, "aria-orientation": "vertical" }, { default: withCtx(() => [ t13.showNewOption ? (openBlock(), createBlock(l, { key: 0, value: t13.states.inputValue, created: true }, null, 8, ["value"])) : createCommentVNode("v-if", true), createVNode(c, null, { default: withCtx(() => [ renderSlot(t13.$slots, "default") ]), _: 3 }) ]), _: 3 }, 8, ["id", "wrap-class", "view-class", "class", "aria-label"]), [ [vShow, t13.states.options.size > 0 && !t13.loading] ]), t13.$slots.loading && t13.loading ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(t13.nsSelect.be("dropdown", "loading")) }, [ renderSlot(t13.$slots, "loading") ], 2)) : t13.loading || t13.filteredOptionsCount === 0 ? (openBlock(), createElementBlock("div", { key: 2, class: normalizeClass(t13.nsSelect.be("dropdown", "empty")) }, [ renderSlot(t13.$slots, "empty", {}, () => [ createBaseVNode("span", null, toDisplayString(t13.emptyText), 1) ]) ], 2)) : createCommentVNode("v-if", true), t13.$slots.footer ? (openBlock(), createElementBlock("div", { key: 3, class: normalizeClass(t13.nsSelect.be("dropdown", "footer")), onClick: withModifiers(() => { }, ["stop"]) }, [ renderSlot(t13.$slots, "footer") ], 10, ["onClick"])) : createCommentVNode("v-if", true) ]), _: 3 }, 512) ]), _: 3 }, 8, ["visible", "placement", "teleported", "popper-class", "popper-options", "fallback-placements", "effect", "transition", "persistent", "append-to", "onBeforeShow", "onHide"]) ], 16, ["onMouseleave"])), [ [h6, t13.handleClickOutside, t13.popperRef] ]); } var iS = Ve(nS, [["render", aS], ["__file", "select.vue"]]); var oS = defineComponent({ name: "ElOptionGroup", componentName: "ElOptionGroup", props: { label: String, disabled: Boolean }, setup(t13) { const e = He("select"), r = ref(null), n = getCurrentInstance(), a = ref([]); provide(Vh, reactive({ ...toRefs(t13) })); const i = computed(() => a.value.some((l) => l.visible === true)), 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 = Fn(l), d = []; return c.forEach((v) => { var h6, f; o(v) ? d.push(v.component.proxy) : (h6 = v.children) != null && h6.length ? d.push(...s(v.children)) : (f = v.component) != null && f.subTree && d.push(...s(v.component.subTree)); }), d; }, u = () => { a.value = s(n.subTree); }; return onMounted(() => { u(); }), U0(r, u, { attributes: true, subtree: true, childList: true }), { groupRef: r, visible: i, ns: e }; } }); function sS(t13, e, r, n, a, i) { return withDirectives((openBlock(), createElementBlock("ul", { ref: "groupRef", class: normalizeClass(t13.ns.be("group", "wrap")) }, [ createBaseVNode("li", { class: normalizeClass(t13.ns.be("group", "title")) }, toDisplayString(t13.label), 3), createBaseVNode("li", null, [ createBaseVNode("ul", { class: normalizeClass(t13.ns.b("group")) }, [ renderSlot(t13.$slots, "default") ], 2) ]) ], 2)), [ [vShow, t13.visible] ]); } var Hh = Ve(oS, [["render", sS], ["__file", "option-group.vue"]]); var lS = $t(iS, { Option: tc, OptionGroup: Hh }); var uS = Cn(tc); Cn(Hh); var cS = rt({ trigger: Ji.trigger, placement: Il.placement, disabled: Ji.disabled, visible: cr.visible, transition: cr.transition, popperOptions: Il.popperOptions, tabindex: Il.tabindex, content: cr.content, popperStyle: cr.popperStyle, popperClass: cr.popperClass, enterable: { ...cr.enterable, default: true }, effect: { ...cr.effect, default: "light" }, teleported: cr.teleported, title: String, width: { type: [String, Number], default: 150 }, offset: { type: Number, default: void 0 }, showAfter: { type: Number, default: 0 }, hideAfter: { type: Number, default: 200 }, autoClose: { type: Number, default: 0 }, showArrow: { type: Boolean, default: true }, persistent: { type: Boolean, default: true }, "onUpdate:visible": { type: Function } }); var dS = { "update:visible": (t13) => Qa(t13), "before-enter": () => true, "before-leave": () => true, "after-enter": () => true, "after-leave": () => true }; var fS = "onUpdate:visible"; var vS = defineComponent({ name: "ElPopover" }); var hS = defineComponent({ ...vS, props: cS, emits: dS, setup(t13, { expose: e, emit: r }) { const n = t13, a = computed(() => n[fS]), i = He("popover"), o = ref(), s = computed(() => { var m; return (m = unref(o)) == null ? void 0 : m.popperRef; }), u = computed(() => [ { width: Ja(n.width) }, n.popperStyle ]), l = computed(() => [i.b(), n.popperClass, { [i.m("plain")]: !!n.content }]), c = computed(() => n.transition === `${i.namespace.value}-fade-in-linear`), d = () => { var m; (m = o.value) == null || m.hide(); }, v = () => { r("before-enter"); }, h6 = () => { r("before-leave"); }, f = () => { r("after-enter"); }, p = () => { r("update:visible", false), r("after-leave"); }; return e({ popperRef: s, hide: d }), (m, g) => (openBlock(), createBlock(unref(ko), mergeProps({ ref_key: "tooltipRef", ref: o }, m.$attrs, { trigger: m.trigger, placement: m.placement, disabled: m.disabled, visible: m.visible, transition: m.transition, "popper-options": m.popperOptions, tabindex: m.tabindex, content: m.content, offset: m.offset, "show-after": m.showAfter, "hide-after": m.hideAfter, "auto-close": m.autoClose, "show-arrow": m.showArrow, "aria-label": m.title, effect: m.effect, enterable: m.enterable, "popper-class": unref(l), "popper-style": unref(u), teleported: m.teleported, persistent: m.persistent, "gpu-acceleration": unref(c), "onUpdate:visible": unref(a), onBeforeShow: v, onBeforeHide: h6, onShow: f, onHide: p }), { content: withCtx(() => [ m.title ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(i).e("title")), role: "title" }, toDisplayString(m.title), 3)) : createCommentVNode("v-if", true), renderSlot(m.$slots, "default", {}, () => [ createTextVNode(toDisplayString(m.content), 1) ]) ]), default: withCtx(() => [ m.$slots.reference ? renderSlot(m.$slots, "reference", { key: 0 }) : createCommentVNode("v-if", true) ]), _: 3 }, 16, ["trigger", "placement", "disabled", "visible", "transition", "popper-options", "tabindex", "content", "offset", "show-after", "hide-after", "auto-close", "show-arrow", "aria-label", "effect", "enterable", "popper-class", "popper-style", "teleported", "persistent", "gpu-acceleration", "onUpdate:visible"])); } }); var pS = Ve(hS, [["__file", "popover.vue"]]); var Xd = (t13, e) => { const r = e.arg || e.value, n = r == null ? void 0 : r.popperRef; n && (n.triggerRef = t13); }; var gS = { mounted(t13, e) { Xd(t13, e); }, updated(t13, e) { Xd(t13, e); } }; var mS = "popover"; var yS = B2(gS, mS); var rc = $t(pS, { directive: yS }); var Ua = "$treeNodeId"; var jd = function(t13, e) { !e || e[Ua] || Object.defineProperty(e, Ua, { value: t13.id, enumerable: false, configurable: false, writable: false }); }; var nc = function(t13, e) { return t13 ? e[t13] : e[Ua]; }; var iu = (t13, e, r) => { const n = t13.value.currentNode; r(); const a = t13.value.currentNode; n !== a && e("current-change", a ? a.data : null, a); }; var ou = (t13) => { let e = true, r = true, n = true; for (let a = 0, i = t13.length; a < i; a++) { const o = t13[a]; (o.checked !== true || o.indeterminate) && (e = false, o.disabled || (n = false)), (o.checked !== false || o.indeterminate) && (r = false); } return { all: e, none: r, allWithoutDisable: n, half: !e && !r }; }; var Ai = function(t13) { if (t13.childNodes.length === 0 || t13.loading) return; const { all: e, none: r, half: n } = ou(t13.childNodes); e ? (t13.checked = true, t13.indeterminate = false) : n ? (t13.checked = false, t13.indeterminate = true) : r && (t13.checked = false, t13.indeterminate = false); const a = t13.parent; !a || a.level === 0 || t13.store.checkStrictly || Ai(a); }; var Ko = function(t13, e) { const r = t13.store.props, n = t13.data || {}, a = r[e]; if (typeof a == "function") return a(n, t13); if (typeof a == "string") return n[a]; if (typeof a > "u") { const i = n[e]; return i === void 0 ? "" : i; } }; var bS = 0; var fa = class _fa { constructor(e) { this.id = bS++, this.text = null, this.checked = false, this.indeterminate = false, this.data = null, this.expanded = false, this.parent = null, this.visible = true, this.isCurrent = false, this.canFocus = false; for (const r in e) va(e, r) && (this[r] = e[r]); this.level = 0, this.loaded = false, this.childNodes = [], this.loading = false, 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 = Ko(this, "isLeaf"); typeof i == "boolean" && (this.isLeafByUser = i); } if (e.lazy !== true && this.data ? (this.setData(this.data), e.defaultExpandAll && (this.expanded = true, this.canFocus = true)) : this.level > 0 && e.lazy && e.defaultExpandAll && !this.isLeafByUser && this.expand(), Array.isArray(this.data) || jd(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 = true), e.lazy && e._initDefaultCheckedNode(this), this.updateLeafState(), this.parent && (this.level === 1 || this.parent.expanded === true) && (this.canFocus = true); } setData(e) { Array.isArray(e) || jd(this, e), this.data = e, this.childNodes = []; let r; this.level === 0 && Array.isArray(this.data) ? r = this.data : r = Ko(this, "children") || []; for (let n = 0, a = r.length; n < a; n++) this.insertChild({ data: r[n] }); } get label() { return Ko(this, "label"); } get key() { const e = this.store.key; return this.data ? this.data[e] : null; } get disabled() { return Ko(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 = true) { 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 _fa)) { if (!n) { const a = this.getChildren(true); 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 = reactive(new _fa(e)), e instanceof _fa && 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 = true, a = a.parent; } this.expanded = true, e && e(), this.childNodes.forEach((a) => { a.canFocus = true; }); }; this.shouldLoadData() ? this.loadData((a) => { Array.isArray(a) && (this.checked ? this.setChecked(true, true) : this.store.checkStrictly || Ai(this), n()); }) : n(); } doCreateChildren(e, r = {}) { e.forEach((n) => { this.insertChild(Object.assign({ data: n }, r), void 0, true); }); } collapse() { this.expanded = false, this.childNodes.forEach((e) => { e.canFocus = false; }); } shouldLoadData() { return this.store.lazy === true && this.store.load && !this.loaded; } updateLeafState() { if (this.store.lazy === true && this.loaded !== true && typeof this.isLeafByUser < "u") { this.isLeaf = this.isLeafByUser; return; } const e = this.childNodes; if (!this.store.lazy || this.store.lazy === true && this.loaded === true) { this.isLeaf = !e || e.length === 0; return; } this.isLeaf = false; } setChecked(e, r, n, a) { if (this.indeterminate = e === "half", this.checked = e === true, this.store.checkStrictly) return; if (!(this.shouldLoadData() && !this.store.checkDescendants)) { const { all: o, allWithoutDisable: s } = ou(this.childNodes); !this.isLeaf && !o && s && (this.checked = false, e = false); const u = () => { if (r) { const l = this.childNodes; for (let v = 0, h6 = l.length; v < h6; v++) { const f = l[v]; a = a || e !== false; const p = f.disabled ? f.checked : a; f.setChecked(p, r, true, a); } const { half: c, all: d } = ou(l); d || (this.checked = d, this.indeterminate = c); } }; if (this.shouldLoadData()) { this.loadData(() => { u(), Ai(this); }, { checked: e !== false }); return; } else u(); } const i = this.parent; !i || i.level === 0 || n || Ai(i); } getChildren(e = false) { 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[Ua]; !!s && r.findIndex((l) => l[Ua] === s) >= 0 ? n[s] = { index: o, data: i } : a.push({ index: o, data: i }); }), this.store.lazy || r.forEach((i) => { n[i[Ua]] || this.removeChildByData(i); }), a.forEach(({ index: i, data: o }) => { this.insertChild({ data: o }, i); }), this.updateLeafState(); } loadData(e, r = {}) { if (this.store.lazy === true && this.store.load && !this.loaded && (!this.loading || Object.keys(r).length)) { this.loading = true; const n = (i) => { this.childNodes = [], this.doCreateChildren(i, r), this.loaded = true, this.loading = false, this.updateLeafState(), e && e.call(this, i); }, a = () => { this.loading = false; }; 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 || Ai(this); } }; var wS = class { constructor(e) { this.currentNode = null, this.currentNodeKey = null; for (const r in e) va(e, r) && (this[r] = e[r]); this.nodesMap = {}; } initialize() { if (this.root = new fa({ 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 = true; s = !o.some((u) => u.visible), i.root ? i.root.visible = s === false : i.visible = s === false; } 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 fa) return e; const r = Ht(e) ? nc(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 = ks(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(true, !this.checkStrictly); }); } _initDefaultCheckedNode(e) { (this.defaultCheckedKeys || []).includes(e.key) && e.setChecked(true, !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 = false, r = false) { 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 = false) { 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) va(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 = false, 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(false, false)); const s = (u) => { u.childNodes.forEach((l) => { var c; i[l.data[e]] = true, (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(false, false); continue; } if (c.childNodes.length && s(c), c.isLeaf || this.checkStrictly) { c.setChecked(true, false); continue; } if (c.setChecked(true, true), r) { c.setChecked(false, false); const h6 = function(f) { f.childNodes.forEach((m) => { m.isLeaf || m.setChecked(false, false), h6(m); }); }; h6(c); } } } setCheckedNodes(e, r = false) { const n = this.key, a = {}; e.forEach((i) => { a[(i || {})[n]] = true; }), this._setCheckedKeys(n, r, a); } setCheckedKeys(e, r = false) { this.defaultCheckedKeys = e; const n = this.key, a = {}; e.forEach((i) => { a[i] = true; }), 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 = false), this.currentNode = e, this.currentNode.isCurrent = true; } setUserCurrentNode(e, r = true) { const n = e[this.key], a = this.nodesMap[n]; this.setCurrentNode(a), r && this.currentNode.level > 1 && this.currentNode.parent.expand(null, true); } setCurrentNodeKey(e, r = true) { if (e == null) { this.currentNode && (this.currentNode.isCurrent = false), this.currentNode = null; return; } const n = this.getNode(e); n && (this.setCurrentNode(n), r && this.currentNode.level > 1 && this.currentNode.parent.expand(null, true)); } }; var CS = defineComponent({ name: "ElTreeNodeContent", props: { node: { type: Object, required: true }, renderContent: Function }, setup(t13) { const e = He("tree"), r = inject("NodeInstance"), n = inject("RootTree"); return () => { const a = t13.node, { data: i, store: o } = a; return t13.renderContent ? t13.renderContent(h, { _self: r, node: a, data: i, store: o }) : renderSlot(n.ctx.slots, "default", { node: a, data: i }, () => [ h("span", { class: e.be("node", "label") }, [a.label]) ]); }; } }); var xS = Ve(CS, [["__file", "tree-node-content.vue"]]); function qh(t13) { const e = inject("TreeNodeMap", null), r = { treeNodeExpand: (n) => { t13.node !== n && t13.node.collapse(); }, children: [] }; return e && e.children.push(r), provide("TreeNodeMap", r), { broadcastExpanded: (n) => { if (t13.accordion) for (const a of r.children) a.treeNodeExpand(n); } }; } var Kh = Symbol("dragEvents"); function ES({ props: t13, ctx: e, el$: r, dropIndicator$: n, store: a }) { const i = He("tree"), o = ref({ showDropIndicator: false, draggingNode: null, dropNode: null, allowDrop: true, dropType: null }); return provide(Kh, { treeNodeDragStart: ({ event: c, treeNode: d }) => { if (typeof t13.allowDrag == "function" && !t13.allowDrag(d.node)) return c.preventDefault(), false; 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 v = d, h6 = o.value.dropNode; h6 && h6.node.id !== v.node.id && ca(h6.$el, i.is("drop-inner")); const f = o.value.draggingNode; if (!f || !v) return; let p = true, m = true, g = true, y = true; typeof t13.allowDrop == "function" && (p = t13.allowDrop(f.node, v.node, "prev"), y = m = t13.allowDrop(f.node, v.node, "inner"), g = t13.allowDrop(f.node, v.node, "next")), c.dataTransfer.dropEffect = m || p || g ? "move" : "none", (p || m || g) && (h6 == null ? void 0 : h6.node.id) !== v.node.id && (h6 && e.emit("node-drag-leave", f.node, h6.node, c), e.emit("node-drag-enter", f.node, v.node, c)), p || m || g ? o.value.dropNode = v : o.value.dropNode = null, v.node.nextSibling === f.node && (g = false), v.node.previousSibling === f.node && (p = false), v.node.contains(f.node, false) && (m = false), (f.node === v.node || f.node.contains(v.node)) && (p = false, m = false, g = false); const b = v.$el.querySelector(`.${i.be("node", "content")}`).getBoundingClientRect(), w = r.value.getBoundingClientRect(); let x; const E = p ? m ? 0.25 : g ? 0.45 : 1 : -1, C = g ? m ? 0.75 : p ? 0.55 : 0 : 1; let T = -9999; const k = c.clientY - b.top; k < b.height * E ? x = "before" : k > b.height * C ? x = "after" : m ? x = "inner" : x = "none"; const _ = v.$el.querySelector(`.${i.be("node", "expand-icon")}`).getBoundingClientRect(), D = n.value; x === "before" ? T = _.top - w.top : x === "after" && (T = _.bottom - w.top), D.style.top = `${T}px`, D.style.left = `${_.right - w.left}px`, x === "inner" ? Ql(v.$el, i.is("drop-inner")) : ca(v.$el, i.is("drop-inner")), o.value.showDropIndicator = x === "before" || x === "after", o.value.allowDrop = o.value.showDropIndicator || y, o.value.dropType = x, e.emit("node-drag-over", f.node, v.node, c); }, treeNodeDragEnd: (c) => { const { draggingNode: d, dropType: v, dropNode: h6 } = o.value; if (c.preventDefault(), c.dataTransfer && (c.dataTransfer.dropEffect = "move"), d && h6) { const f = { data: d.node.data }; v !== "none" && d.node.remove(), v === "before" ? h6.node.parent.insertBefore(f, h6.node) : v === "after" ? h6.node.parent.insertAfter(f, h6.node) : v === "inner" && h6.node.insertChild(f), v !== "none" && (a.value.registerNode(f), a.value.key && d.node.eachNode((p) => { var m; (m = a.value.nodesMap[p.data[a.value.key]]) == null || m.setChecked(p.checked, !a.value.checkStrictly); })), ca(h6.$el, i.is("drop-inner")), e.emit("node-drag-end", d.node, h6.node, v, c), v !== "none" && e.emit("node-drop", d.node, h6.node, v, c); } d && !h6 && e.emit("node-drag-end", d.node, null, v, c), o.value.showDropIndicator = false, o.value.draggingNode = null, o.value.dropNode = null, o.value.allowDrop = true; } }), { dragState: o }; } var kS = defineComponent({ name: "ElTreeNode", components: { ElCollapseTransition: rk, ElCheckbox: NE, NodeContent: xS, ElIcon: Vt, Loading: Mu }, props: { node: { type: fa, default: () => ({}) }, props: { type: Object, default: () => ({}) }, accordion: Boolean, renderContent: Function, renderAfterExpand: Boolean, showCheckbox: { type: Boolean, default: false } }, emits: ["node-expand"], setup(t13, e) { const r = He("tree"), { broadcastExpanded: n } = qh(t13), a = inject("RootTree"), i = ref(false), o = ref(false), s = ref(null), u = ref(null), l = ref(null), c = inject(Kh), d = getCurrentInstance(); provide("NodeInstance", d), a || Dt("Tree", "Can not find node's tree."), t13.node.expanded && (i.value = true, o.value = true); const v = a.props.props.children || "children"; watch(() => { const k = t13.node.data[v]; return k && [...k]; }, () => { t13.node.updateChildren(); }), watch(() => t13.node.indeterminate, (k) => { p(t13.node.checked, k); }), watch(() => t13.node.checked, (k) => { p(k, t13.node.indeterminate); }), watch(() => t13.node.childNodes.length, () => t13.node.reInitChecked()), watch(() => t13.node.expanded, (k) => { nextTick(() => i.value = k), k && (o.value = true); }); const h6 = (k) => nc(a.props.nodeKey, k.data), f = (k) => { const _ = t13.props.class; if (!_) return {}; let D; if (lr(_)) { const { data: O } = k; D = _(O, k); } else D = _; return tr(D) ? { [D]: true } : D; }, p = (k, _) => { (s.value !== k || u.value !== _) && a.ctx.emit("check-change", t13.node.data, k, _), s.value = k, u.value = _; }, m = (k) => { iu(a.store, a.ctx.emit, () => a.store.value.setCurrentNode(t13.node)), a.currentNode.value = t13.node, a.props.expandOnClickNode && y(), a.props.checkOnClickNode && !t13.node.disabled && b(null, { target: { checked: !t13.node.checked } }), a.ctx.emit("node-click", t13.node.data, t13.node, d, k); }, g = (k) => { a.instance.vnode.props.onNodeContextmenu && (k.stopPropagation(), k.preventDefault()), a.ctx.emit("node-contextmenu", k, t13.node.data, t13.node, d); }, y = () => { t13.node.isLeaf || (i.value ? (a.ctx.emit("node-collapse", t13.node.data, t13.node, d), t13.node.collapse()) : t13.node.expand(() => { e.emit("node-expand", t13.node.data, t13.node, d); })); }, b = (k, _) => { t13.node.setChecked(_.target.checked, !a.props.checkStrictly), nextTick(() => { const D = a.store.value; a.ctx.emit("check", t13.node.data, { checkedNodes: D.getCheckedNodes(), checkedKeys: D.getCheckedKeys(), halfCheckedNodes: D.getHalfCheckedNodes(), halfCheckedKeys: D.getHalfCheckedKeys() }); }); }; return { ns: r, node$: l, tree: a, expanded: i, childNodeRendered: o, oldChecked: s, oldIndeterminate: u, getNodeKey: h6, getNodeClass: f, handleSelectChange: p, handleClick: m, handleContextMenu: g, handleExpandIconClick: y, handleCheckChange: b, handleChildNodeExpand: (k, _, D) => { n(_), a.ctx.emit("node-expand", k, _, D); }, handleDragStart: (k) => { a.props.draggable && c.treeNodeDragStart({ event: k, treeNode: t13 }); }, handleDragOver: (k) => { k.preventDefault(), a.props.draggable && c.treeNodeDragOver({ event: k, treeNode: { $el: l.value, node: t13.node } }); }, handleDrop: (k) => { k.preventDefault(); }, handleDragEnd: (k) => { a.props.draggable && c.treeNodeDragEnd(k); }, CaretRight: i2 }; } }); function SS(t13, e, r, n, a, i) { const o = resolveComponent("el-icon"), s = resolveComponent("el-checkbox"), u = resolveComponent("loading"), l = resolveComponent("node-content"), c = resolveComponent("el-tree-node"), d = resolveComponent("el-collapse-transition"); return withDirectives((openBlock(), createElementBlock("div", { ref: "node$", class: normalizeClass([ t13.ns.b("node"), t13.ns.is("expanded", t13.expanded), t13.ns.is("current", t13.node.isCurrent), t13.ns.is("hidden", !t13.node.visible), t13.ns.is("focusable", !t13.node.disabled), t13.ns.is("checked", !t13.node.disabled && t13.node.checked), t13.getNodeClass(t13.node) ]), role: "treeitem", tabindex: "-1", "aria-expanded": t13.expanded, "aria-disabled": t13.node.disabled, "aria-checked": t13.node.checked, draggable: t13.tree.props.draggable, "data-key": t13.getNodeKey(t13.node), onClick: withModifiers(t13.handleClick, ["stop"]), onContextmenu: t13.handleContextMenu, onDragstart: withModifiers(t13.handleDragStart, ["stop"]), onDragover: withModifiers(t13.handleDragOver, ["stop"]), onDragend: withModifiers(t13.handleDragEnd, ["stop"]), onDrop: withModifiers(t13.handleDrop, ["stop"]) }, [ createBaseVNode("div", { class: normalizeClass(t13.ns.be("node", "content")), style: normalizeStyle({ paddingLeft: (t13.node.level - 1) * t13.tree.props.indent + "px" }) }, [ t13.tree.props.icon || t13.CaretRight ? (openBlock(), createBlock(o, { key: 0, class: normalizeClass([ t13.ns.be("node", "expand-icon"), t13.ns.is("leaf", t13.node.isLeaf), { expanded: !t13.node.isLeaf && t13.expanded } ]), onClick: withModifiers(t13.handleExpandIconClick, ["stop"]) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(t13.tree.props.icon || t13.CaretRight))) ]), _: 1 }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true), t13.showCheckbox ? (openBlock(), createBlock(s, { key: 1, "model-value": t13.node.checked, indeterminate: t13.node.indeterminate, disabled: !!t13.node.disabled, onClick: withModifiers(() => { }, ["stop"]), onChange: t13.handleCheckChange }, null, 8, ["model-value", "indeterminate", "disabled", "onClick", "onChange"])) : createCommentVNode("v-if", true), t13.node.loading ? (openBlock(), createBlock(o, { key: 2, class: normalizeClass([t13.ns.be("node", "loading-icon"), t13.ns.is("loading")]) }, { default: withCtx(() => [ createVNode(u) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true), createVNode(l, { node: t13.node, "render-content": t13.renderContent }, null, 8, ["node", "render-content"]) ], 6), createVNode(d, null, { default: withCtx(() => [ !t13.renderAfterExpand || t13.childNodeRendered ? withDirectives((openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(t13.ns.be("node", "children")), role: "group", "aria-expanded": t13.expanded }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(t13.node.childNodes, (v) => (openBlock(), createBlock(c, { key: t13.getNodeKey(v), "render-content": t13.renderContent, "render-after-expand": t13.renderAfterExpand, "show-checkbox": t13.showCheckbox, node: v, accordion: t13.accordion, props: t13.props, onNodeExpand: t13.handleChildNodeExpand }, null, 8, ["render-content", "render-after-expand", "show-checkbox", "node", "accordion", "props", "onNodeExpand"]))), 128)) ], 10, ["aria-expanded"])), [ [vShow, t13.expanded] ]) : createCommentVNode("v-if", true) ]), _: 1 }) ], 42, ["aria-expanded", "aria-disabled", "aria-checked", "draggable", "data-key", "onClick", "onContextmenu", "onDragstart", "onDragover", "onDragend", "onDrop"])), [ [vShow, t13.node.visible] ]); } var TS = Ve(kS, [["render", SS], ["__file", "tree-node.vue"]]); function _S({ el$: t13 }, e) { const r = He("tree"), n = shallowRef([]), a = shallowRef([]); onMounted(() => { o(); }), onUpdated(() => { n.value = Array.from(t13.value.querySelectorAll("[role=treeitem]")), a.value = Array.from(t13.value.querySelectorAll("input[type=checkbox]")); }), watch(a, (s) => { s.forEach((u) => { u.setAttribute("tabindex", "-1"); }); }), kr(t13, "keydown", (s) => { const u = s.target; if (!u.className.includes(r.b("node"))) return; const l = s.code; n.value = Array.from(t13.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)); const c = n.value.indexOf(u); let d; if ([Lt.up, Lt.down].includes(l)) { if (s.preventDefault(), l === Lt.up) { d = c === -1 ? 0 : c !== 0 ? c - 1 : n.value.length - 1; const h6 = d; for (; !e.value.getNode(n.value[d].dataset.key).canFocus; ) { if (d--, d === h6) { d = -1; break; } d < 0 && (d = n.value.length - 1); } } else { d = c === -1 ? 0 : c < n.value.length - 1 ? c + 1 : 0; const h6 = d; for (; !e.value.getNode(n.value[d].dataset.key).canFocus; ) { if (d++, d === h6) { d = -1; break; } d >= n.value.length && (d = 0); } } d !== -1 && n.value[d].focus(); } [Lt.left, Lt.right].includes(l) && (s.preventDefault(), u.click()); const v = u.querySelector('[type="checkbox"]'); [Lt.enter, Lt.space].includes(l) && v && (s.preventDefault(), v.click()); }); const o = () => { var s; n.value = Array.from(t13.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)), a.value = Array.from(t13.value.querySelectorAll("input[type=checkbox]")); const u = t13.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"); }; } var DS = defineComponent({ name: "ElTree", components: { ElTreeNode: TS }, props: { data: { type: Array, default: () => [] }, emptyText: { type: String }, renderAfterExpand: { type: Boolean, default: true }, nodeKey: String, checkStrictly: Boolean, defaultExpandAll: Boolean, expandOnClickNode: { type: Boolean, default: true }, checkOnClickNode: Boolean, checkDescendants: { type: Boolean, default: false }, autoExpandParent: { type: Boolean, default: true }, defaultCheckedKeys: Array, defaultExpandedKeys: Array, currentNodeKey: [String, Number], renderContent: Function, showCheckbox: { type: Boolean, default: false }, draggable: { type: Boolean, default: false }, allowDrag: Function, allowDrop: Function, props: { type: Object, default: () => ({ children: "children", label: "label", disabled: "disabled" }) }, lazy: { type: Boolean, default: false }, highlightCurrent: Boolean, load: Function, filterNodeMethod: Function, accordion: Boolean, indent: { type: Number, default: 18 }, icon: { type: Hn } }, 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(t13, e) { const { t: r } = yo(), n = He("tree"), a = inject(To, null), i = ref(new wS({ key: t13.nodeKey, data: t13.data, lazy: t13.lazy, props: t13.props, load: t13.load, currentNodeKey: t13.currentNodeKey, checkStrictly: t13.checkStrictly, checkDescendants: t13.checkDescendants, defaultCheckedKeys: t13.defaultCheckedKeys, defaultExpandedKeys: t13.defaultExpandedKeys, autoExpandParent: t13.autoExpandParent, defaultExpandAll: t13.defaultExpandAll, filterNodeMethod: t13.filterNodeMethod })); i.value.initialize(); const o = ref(i.value.root), s = ref(null), u = ref(null), l = ref(null), { broadcastExpanded: c } = qh(t13), { dragState: d } = ES({ props: t13, ctx: e, el$: u, dropIndicator$: l, store: i }); _S({ el$: u }, i); const v = computed(() => { const { childNodes: A } = o.value, R = a ? a.hasFilteredOptions !== 0 : false; return (!A || A.length === 0 || A.every(({ visible: K }) => !K)) && !R; }); watch(() => t13.currentNodeKey, (A) => { i.value.setCurrentNodeKey(A); }), watch(() => t13.defaultCheckedKeys, (A) => { i.value.setDefaultCheckedKey(A); }), watch(() => t13.defaultExpandedKeys, (A) => { i.value.setDefaultExpandedKeys(A); }), watch(() => t13.data, (A) => { i.value.setData(A); }, { deep: true }), watch(() => t13.checkStrictly, (A) => { i.value.checkStrictly = A; }); const h6 = (A) => { if (!t13.filterNodeMethod) throw new Error("[Tree] filterNodeMethod is required when filter"); i.value.filter(A); }, f = (A) => nc(t13.nodeKey, A.data), p = (A) => { if (!t13.nodeKey) throw new Error("[Tree] nodeKey is required in getNodePath"); const R = i.value.getNode(A); if (!R) return []; const K = [R.data]; let H = R.parent; for (; H && H !== o.value; ) K.push(H.data), H = H.parent; return K.reverse(); }, m = (A, R) => i.value.getCheckedNodes(A, R), g = (A) => i.value.getCheckedKeys(A), y = () => { const A = i.value.getCurrentNode(); return A ? A.data : null; }, b = () => { if (!t13.nodeKey) throw new Error("[Tree] nodeKey is required in getCurrentKey"); const A = y(); return A ? A[t13.nodeKey] : null; }, w = (A, R) => { if (!t13.nodeKey) throw new Error("[Tree] nodeKey is required in setCheckedNodes"); i.value.setCheckedNodes(A, R); }, x = (A, R) => { if (!t13.nodeKey) throw new Error("[Tree] nodeKey is required in setCheckedKeys"); i.value.setCheckedKeys(A, R); }, E = (A, R, K) => { i.value.setChecked(A, R, K); }, C = () => i.value.getHalfCheckedNodes(), T = () => i.value.getHalfCheckedKeys(), k = (A, R = true) => { if (!t13.nodeKey) throw new Error("[Tree] nodeKey is required in setCurrentNode"); iu(i, e.emit, () => { c(A), i.value.setUserCurrentNode(A, R); }); }, _ = (A, R = true) => { if (!t13.nodeKey) throw new Error("[Tree] nodeKey is required in setCurrentKey"); iu(i, e.emit, () => { c(), i.value.setCurrentNodeKey(A, R); }); }, D = (A) => i.value.getNode(A), O = (A) => { i.value.remove(A); }, F = (A, R) => { i.value.append(A, R); }, L = (A, R) => { i.value.insertBefore(A, R); }, B = (A, R) => { i.value.insertAfter(A, R); }, I = (A, R, K) => { c(R), e.emit("node-expand", A, R, K); }, M = (A, R) => { if (!t13.nodeKey) throw new Error("[Tree] nodeKey is required in updateKeyChild"); i.value.updateChildren(A, R); }; return provide("RootTree", { ctx: e, props: t13, store: i, root: o, currentNode: s, instance: getCurrentInstance() }), provide(Qi, void 0), { ns: n, store: i, root: o, currentNode: s, dragState: d, el$: u, dropIndicator$: l, isEmpty: v, filter: h6, getNodeKey: f, getNodePath: p, getCheckedNodes: m, getCheckedKeys: g, getCurrentNode: y, getCurrentKey: b, setCheckedNodes: w, setCheckedKeys: x, setChecked: E, getHalfCheckedNodes: C, getHalfCheckedKeys: T, setCurrentNode: k, setCurrentKey: _, t: r, getNode: D, remove: O, append: F, insertBefore: L, insertAfter: B, handleNodeExpand: I, updateKeyChildren: M }; } }); function PS(t13, e, r, n, a, i) { const o = resolveComponent("el-tree-node"); return openBlock(), createElementBlock("div", { ref: "el$", class: normalizeClass([ t13.ns.b(), t13.ns.is("dragging", !!t13.dragState.draggingNode), t13.ns.is("drop-not-allow", !t13.dragState.allowDrop), t13.ns.is("drop-inner", t13.dragState.dropType === "inner"), { [t13.ns.m("highlight-current")]: t13.highlightCurrent } ]), role: "tree" }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(t13.root.childNodes, (s) => (openBlock(), createBlock(o, { key: t13.getNodeKey(s), node: s, props: t13.props, accordion: t13.accordion, "render-after-expand": t13.renderAfterExpand, "show-checkbox": t13.showCheckbox, "render-content": t13.renderContent, onNodeExpand: t13.handleNodeExpand }, null, 8, ["node", "props", "accordion", "render-after-expand", "show-checkbox", "render-content", "onNodeExpand"]))), 128)), t13.isEmpty ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(t13.ns.e("empty-block")) }, [ renderSlot(t13.$slots, "empty", {}, () => { var s; return [ createBaseVNode("span", { class: normalizeClass(t13.ns.e("empty-text")) }, toDisplayString((s = t13.emptyText) != null ? s : t13.t("el.tree.emptyText")), 3) ]; }) ], 2)) : createCommentVNode("v-if", true), withDirectives(createBaseVNode("div", { ref: "dropIndicator$", class: normalizeClass(t13.ns.e("drop-indicator")) }, null, 2), [ [vShow, t13.dragState.showDropIndicator] ]) ], 2); } var OS = Ve(DS, [["render", PS], ["__file", "tree.vue"]]); var LS = $t(OS); function IS(t13) { let e; const r = ref(false), n = reactive({ ...t13, originalPosition: "", originalOverflow: "", visible: false }); function a(v) { n.text = v; } function i() { const v = n.parent, h6 = d.ns; if (!v.vLoadingAddClassList) { let f = v.getAttribute("loading-number"); f = Number.parseInt(f) - 1, f ? v.setAttribute("loading-number", f.toString()) : (ca(v, h6.bm("parent", "relative")), v.removeAttribute("loading-number")), ca(v, h6.bm("parent", "hidden")); } o(), c.unmount(); } function o() { var v, h6; (h6 = (v = d.$el) == null ? void 0 : v.parentNode) == null || h6.removeChild(d.$el); } function s() { var v; t13.beforeClose && !t13.beforeClose() || (r.value = true, clearTimeout(e), e = setTimeout(u, 400), n.visible = false, (v = t13.closed) == null || v.call(t13)); } function u() { if (!r.value) return; const v = n.parent; r.value = false, v.vLoadingAddClassList = void 0, i(); } const l = defineComponent({ name: "ElLoading", setup(v, { expose: h6 }) { const { ns: f, zIndex: p } = pC("loading"); return h6({ ns: f, zIndex: p }), () => { const m = n.spinner || n.svg, g = h("svg", { class: "circular", viewBox: n.svgViewBox ? n.svgViewBox : "0 0 50 50", ...m ? { innerHTML: m } : {} }, [ h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none" }) ]), y = n.text ? h("p", { class: f.b("text") }, [n.text]) : void 0; return h(Transition, { name: f.b("fade"), onAfterLeave: u }, { default: withCtx(() => [ withDirectives(createVNode("div", { style: { backgroundColor: n.background || "" }, class: [ f.b("mask"), n.customClass, n.fullscreen ? "is-fullscreen" : "" ] }, [ h("div", { class: f.b("spinner") }, [g, y]) ]), [[vShow, n.visible]]) ]) }); }; } }), c = createApp(l), d = c.mount(document.createElement("div")); return { ...toRefs(n), setText: a, removeElLoadingChild: o, close: s, handleAfterLeave: u, vm: d, get $el() { return d.$el; } }; } var Uo; var FS = function(t13 = {}) { if (!_t) return; const e = AS(t13); if (e.fullscreen && Uo) return Uo; const r = IS({ ...e, closed: () => { var a; (a = e.closed) == null || a.call(e), e.fullscreen && (Uo = void 0); } }); MS(e, e.parent, r), Qd(e, e.parent, r), e.parent.vLoadingAddClassList = () => Qd(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), nextTick(() => r.visible.value = e.visible), e.fullscreen && (Uo = r), r; }; var AS = (t13) => { var e, r, n, a; let i; return tr(t13.target) ? i = (e = document.querySelector(t13.target)) != null ? e : document.body : i = t13.target || document.body, { parent: i === document.body || t13.body ? document.body : i, background: t13.background || "", svg: t13.svg || "", svgViewBox: t13.svgViewBox || "", spinner: t13.spinner || false, text: t13.text || "", fullscreen: i === document.body && ((r = t13.fullscreen) != null ? r : true), lock: (n = t13.lock) != null ? n : false, customClass: t13.customClass || "", visible: (a = t13.visible) != null ? a : true, beforeClose: t13.beforeClose, closed: t13.closed, target: i }; }; var MS = async (t13, e, r) => { const { nextZIndex: n } = r.vm.zIndex || r.vm._.exposed.zIndex, a = {}; if (t13.fullscreen) r.originalPosition.value = Ti(document.body, "position"), r.originalOverflow.value = Ti(document.body, "overflow"), a.zIndex = n(); else if (t13.parent === document.body) { r.originalPosition.value = Ti(document.body, "position"), await nextTick(); for (const i of ["top", "left"]) { const o = i === "top" ? "scrollTop" : "scrollLeft"; a[i] = `${t13.target.getBoundingClientRect()[i] + document.body[o] + document.documentElement[o] - Number.parseInt(Ti(document.body, `margin-${i}`), 10)}px`; } for (const i of ["height", "width"]) a[i] = `${t13.target.getBoundingClientRect()[i]}px`; } else r.originalPosition.value = Ti(e, "position"); for (const [i, o] of Object.entries(a)) r.$el.style[i] = o; }; var Qd = (t13, e, r) => { const n = r.vm.ns || r.vm._.exposed.ns; ["absolute", "fixed", "sticky"].includes(r.originalPosition.value) ? ca(e, n.bm("parent", "relative")) : Ql(e, n.bm("parent", "relative")), t13.fullscreen && t13.lock ? Ql(e, n.bm("parent", "hidden")) : ca(e, n.bm("parent", "hidden")); }; var ls = Symbol("ElLoading"); var Jd = (t13, e) => { var r, n, a, i; const o = e.instance, s = (v) => Ht(e.value) ? e.value[v] : void 0, u = (v) => { const h6 = tr(v) && (o == null ? void 0 : o[v]) || v; return h6 && ref(h6); }, l = (v) => u(s(v) || t13.getAttribute(`element-loading-${am(v)}`)), 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 : t13, body: (a = s("body")) != null ? a : e.modifiers.body, lock: (i = s("lock")) != null ? i : e.modifiers.lock }; t13[ls] = { options: d, instance: FS(d) }; }; var BS = (t13, e) => { for (const r of Object.keys(e)) isRef(e[r]) && (e[r].value = t13[r]); }; var ac = { mounted(t13, e) { e.value && Jd(t13, e); }, updated(t13, e) { const r = t13[ls]; e.oldValue !== e.value && (e.value && !e.oldValue ? Jd(t13, e) : e.value && e.oldValue ? Ht(e.value) && BS(e.value, r.options) : r == null || r.instance.close()); }, unmounted(t13) { var e; (e = t13[ls]) == null || e.instance.close(), t13[ls] = null; } }; var Ur = (t13, e) => { const r = t13.__vccOpts || t13; for (const [n, a] of e) r[n] = a; return r; }; var NS = { name: "AnnotationPopup", props: { annotationEntry: { type: Object } }, inject: ["$annotator", "userApiKey"], data: function() { return { displayPair: { "Feature ID": "featureId", Tooltip: "label", Models: "models", Name: "name", Resource: "resourceId" }, editing: false, evidencePrefixes: ["", "DOI:", "PMID:"], evidencePrefix: "", evidence: [], authenticated: false, newEvidence: "", comment: "", prevSubs: [], showSubmissions: true, errorMessage: "", creator: void 0 }; }, computed: { isEditable: function() { return this.annotationEntry.resourceId && this.annotationEntry.featureId; }, isPositionUpdated: function() { return this.annotationEntry.resourceId && this.annotationEntry.type === "updated" && this.annotationEntry.positionUpdated; }, isDeleted: function() { return this.annotationEntry.resourceId && this.annotationEntry.type === "deleted"; } }, methods: { evidenceEntered: function(t13) { t13 && (this.evidence.push(this.evidencePrefix + t13), this.newEvidence = ""); }, formatTime: function(t13) { const e = { year: "numeric", month: "long", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }; return new Date(t13).toLocaleDateString(void 0, e); }, updatePrevSubmissions: function() { var t13; this.$annotator && this.authenticated && this.annotationEntry.resourceId && this.annotationEntry.featureId && ((t13 = this.$annotator) == null || t13.itemAnnotations( this.userApiKey, this.annotationEntry.resourceId, this.annotationEntry.featureId ).then((e) => { this.prevSubs = e; }).catch((e) => { console.log(e); })); }, submit: function() { var t13; if (this.annotationEntry.type === "updated" && this.annotationEntry.positionUpdated ? this.comment = this.comment ? `Position Updated: ${this.comment}` : "Position Updated" : this.annotationEntry.type === "deleted" && (this.comment = this.comment ? `Feature Deleted: ${this.comment}` : "Feature Deleted"), (this.evidence.length > 0 || this.comment) && this.annotationEntry.resourceId && this.annotationEntry.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.annotationEntry.resourceId, item: Object.assign( { id: this.annotationEntry.featureId }, Object.fromEntries( Object.entries(this.annotationEntry).filter( ([n]) => ["label", "models"].includes(n) ) ) ), body: { evidence: e, comment: this.comment }, feature: this.annotationEntry.feature }; Object.assign(r.body, this.annotationEntry.body), this.annotationEntry.type === "deleted" && (r.feature = void 0), this.creator && (r.creator = this.creator), (t13 = this.$annotator) == null || t13.addAnnotation(this.userApiKey, r).then(() => { this.$emit("annotation", r), this.errorMessage = "", this.resetSubmission(), this.updatePrevSubmissions(); }).catch(() => { this.errorMessage = "There is a problem with the submission, please try again later"; }); } }, removeEvidence: function(t13) { this.evidence.splice(t13, 1); }, resetSubmission: function() { this.editing = false, this.evidence = [], this.newFeature = "", this.comment = ""; } }, watch: { annotationEntry: { handler: function(t13, e) { t13 !== e && (this.resetSubmission(), this.updatePrevSubmissions()); }, immediate: false, deep: false } }, mounted: function() { var t13; (t13 = this.$annotator) == null || t13.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 = true, this.updatePrevSubmissions()) : this.errorMessage = ""; }); } }; var _a = (t13) => (pushScopeId("data-v-9930ef40"), t13 = t13(), popScopeId(), t13); var $S = { class: "block" }; var RS = _a(() => createBaseVNode("div", { class: "title" }, "Feature Annotations", -1)); var zS = _a(() => createBaseVNode("strong", { class: "sub-title" }, "Previous submissions:", -1)); var VS = _a(() => createBaseVNode("strong", null, "Evidence: ", -1)); var HS = ["href"]; var qS = _a(() => createBaseVNode("strong", null, "Comment: ", -1)); var KS = _a(() => createBaseVNode("strong", { class: "sub-title" }, "Suggest changes:", -1)); var US = _a(() => createBaseVNode("strong", null, "Evidence:", -1)); var GS = _a(() => createBaseVNode("strong", null, "Comment:", -1)); var WS = { class: "sub-title" }; function YS(t13, e, r, n, a, i) { const o = Qs, s = qv, u = Vt, l = Gs, c = p2, d = v2, v = m2, h6 = So, f = Ss, p = uS, m = lS, g = Eo, y = Hr, b = ec; return openBlock(), createBlock(b, { class: "main" }, { default: withCtx(() => [ createBaseVNode("div", $S, [ createVNode(o, { class: "info-field" }, { default: withCtx(() => [ RS ]), _: 1 }), r.annotationEntry ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(t13.displayPair, (w, x) => withDirectives((openBlock(), createBlock(o, { class: "dialog-text", key: w }, { default: withCtx(() => [ createBaseVNode("strong", null, toDisplayString(x) + ": ", 1), createTextVNode(" " + toDisplayString(r.annotationEntry[w]), 1) ]), _: 2 }, 1024)), [ [vShow, r.annotationEntry[w]] ])), 128)), t13.prevSubs.length > 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ withDirectives(createBaseVNode("div", { class: "hide", onClick: e[0] || (e[0] = (w) => t13.showSubmissions = false) }, [ createTextVNode(" Hide previous submissions "), createVNode(u, null, { default: withCtx(() => [ createVNode(s) ]), _: 1 }) ], 512), [ [vShow, t13.showSubmissions] ]), withDirectives(createBaseVNode("div", { class: "hide", onClick: e[1] || (e[1] = (w) => t13.showSubmissions = true) }, [ createTextVNode(" Show previous " + toDisplayString(t13.prevSubs.length) + " submission(s) ", 1), createVNode(u, null, { default: withCtx(() => [ createVNode(l) ]), _: 1 }) ], 512), [ [vShow, !t13.showSubmissions] ]), t13.showSubmissions ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ createVNode(o, { class: "dialog-spacer" }), createVNode(o, { class: "dialog-text" }, { default: withCtx(() => [ zS ]), _: 1 }), (openBlock(true), createElementBlock(Fragment, null, renderList(t13.prevSubs, (w, x) => (openBlock(), createElementBlock("div", { class: "entry", key: x }, [ createVNode(o, { class: "dialog-text" }, { default: withCtx(() => [ createBaseVNode("strong", null, toDisplayString(i.formatTime(w.created)), 1), createTextVNode(" " + toDisplayString(w.creator.name), 1) ]), _: 2 }, 1024), createVNode(o, { class: "dialog-text" }, { default: withCtx(() => [ VS, (openBlock(true), createElementBlock(Fragment, null, renderList(w.body.evidence, (E) => (openBlock(), createBlock(o, { key: E, class: "dialog-text" }, { default: withCtx(() => [ createBaseVNode("a", { href: E, target: "_blank" }, toDisplayString(E), 9, HS) ]), _: 2 }, 1024))), 128)) ]), _: 2 }, 1024), createVNode(o, { class: "dialog-text" }, { default: withCtx(() => [ qS, createTextVNode(" " + toDisplayString(w.body.comment), 1) ]), _: 2 }, 1024) ]))), 128)) ], 64)) : createCommentVNode("", true) ], 64)) : createCommentVNode("", true), t13.authenticated ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [ i.isEditable ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ createVNode(o, { class: "dialog-spacer" }), t13.editing ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [ createVNode(o, { class: "dialog-text" }, { default: withCtx(() => [ KS ]), _: 1 }), i.isDeleted ? createCommentVNode("", true) : (openBlock(), createElementBlock(Fragment, { key: 0 }, [ createVNode(o, { class: "dialog-text" }, { default: withCtx(() => [ US ]), _: 1 }), (openBlock(true), createElementBlock(Fragment, null, renderList(t13.evidence, (w, x) => (openBlock(), createBlock(o, { key: w }, { default: withCtx(() => [ createVNode(h6, { span: 20 }, { default: withCtx(() => [ createTextVNode(toDisplayString(t13.evidence[x]), 1) ]), _: 2 }, 1024), createVNode(h6, { span: 4 }, { default: withCtx(() => [ createVNode(u, { class: "standard-icon" }, { default: withCtx(() => [ createVNode(f, { onClick: (E) => i.removeEvidence(x) }, null, 8, ["onClick"]) ]), _: 2 }, 1024) ]), _: 2 }, 1024) ]), _: 2 }, 1024))), 128)), createVNode(o, null, { default: withCtx(() => [ createVNode(g, { size: "small", placeholder: "Enter", modelValue: t13.newEvidence, "onUpdate:modelValue": e[4] || (e[4] = (w) => t13.newEvidence = w), onChange: e[5] || (e[5] = (w) => i.evidenceEntered(w)) }, { prepend: withCtx(() => [ createVNode(m, { teleported: false, modelValue: t13.evidencePrefix, "onUpdate:modelValue": e[3] || (e[3] = (w) => t13.evidencePrefix = w), placeholder: "No Prefix", class: "select-box", "popper-class": "flatmap_dropdown" }, { default: withCtx(() => [ (openBlock(true), createElementBlock(Fragment, null, renderList(t13.evidencePrefixes, (w) => (openBlock(), createBlock(p, { key: w, label: w, value: w }, { default: withCtx(() => [ createVNode(o, null, { default: withCtx(() => [ createVNode(h6, { span: 12 }, { default: withCtx(() => [ createTextVNode(toDisplayString(w), 1) ]), _: 2 }, 1024) ]), _: 2 }, 1024) ]), _: 2 }, 1032, ["label", "value"]))), 128)) ]), _: 1 }, 8, ["modelValue"]) ]), _: 1 }, 8, ["modelValue"]) ]), _: 1 }) ], 64)), createVNode(o, null, { default: withCtx(() => [ GS ]), _: 1 }), createVNode(o, { class: "dialog-text" }, { default: withCtx(() => [ createVNode(g, { type: "textarea", autosize: { minRows: 2, maxRows: 4 }, placeholder: "Enter", modelValue: t13.comment, "onUpdate:modelValue": e[6] || (e[6] = (w) => t13.comment = w) }, null, 8, ["modelValue"]) ]), _: 1 }), createVNode(o, { class: "dialog-text" }, { default: withCtx(() => [ createVNode(y, { class: "button", type: "primary", plain: "", onClick: i.submit }, { default: withCtx(() => [ createTextVNode(" Submit ") ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }) ], 64)) : (openBlock(), createBlock(o, { key: 0 }, { default: withCtx(() => [ createVNode(u, { class: "standard-icon" }, { default: withCtx(() => [ createVNode(c, { onClick: e[2] || (e[2] = (w) => t13.editing = true) }) ]), _: 1 }), i.isDeleted ? (openBlock(), createBlock(u, { key: 0, class: "standard-icon" }, { default: withCtx(() => [ createVNode(d, { onClick: i.submit }, null, 8, ["onClick"]) ]), _: 1 })) : i.isPositionUpdated ? (openBlock(), createBlock(u, { key: 1, class: "standard-icon" }, { default: withCtx(() => [ createVNode(v, { onClick: i.submit }, null, 8, ["onClick"]) ]), _: 1 })) : createCommentVNode("", true) ]), _: 1 })), t13.errorMessage ? (openBlock(), createBlock(o, { key: 2, class: "dialog-text" }, { default: withCtx(() => [ createBaseVNode("strong", WS, toDisplayString(t13.errorMessage), 1) ]), _: 1 })) : createCommentVNode("", true) ], 64)) : createCommentVNode("", true) ], 64)) : createCommentVNode("", true) ], 64)) : createCommentVNode("", true) ]) ]), _: 1 }); } var ZS = Ur(NS, [["render", YS], ["__scopeId", "data-v-9930ef40"]]); var XS = { name: "CreateTooltipContent", components: { Button: Hr, Col: So, Container: Rh, Header: zh, Input: Eo, Main: ec }, props: { createData: { type: Object } }, watch: { "createData.shape": { handler: function(t13, e) { this.group = t13, e !== void 0 && this.$emit("cancel-create"); }, immediate: true } }, computed: { confirmText: function() { return this.createData.editingIndex > -1 ? "Edit" : "Confirm"; } }, data: function() { return { group: "default", region: "", showPoint: false }; }, 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"); } } }; var jS = (t13) => (pushScopeId("data-v-d61c5879"), t13 = t13(), popScopeId(), t13); var QS = jS(() => createBaseVNode("span", { class: "create-text" }, " Primitives will be created in the __annotation region ", -1)); function JS(t13, e, r, n, a, i) { const o = zh, s = So, u = Qs, l = Eo, c = Hr, d = ec, v = Rh; return openBlock(), createBlock(v, { class: "create-container" }, { default: withCtx(() => [ createVNode(o, { height: "30px", class: "header" }, { default: withCtx(() => [ createBaseVNode("div", null, "Create " + toDisplayString(r.createData.shape), 1) ]), _: 1 }), createVNode(d, { class: "slides-block" }, { default: withCtx(() => [ QS, withDirectives(createVNode(u, { class: "row" }, { default: withCtx(() => [ createVNode(s, { offset: 0, span: 8 }, { default: withCtx(() => [ createTextVNode(" Position: ") ]), _: 1 }), createVNode(s, { offset: 0, span: 16 }, { default: withCtx(() => [ (openBlock(true), createElementBlock(Fragment, null, renderList(r.createData.points, ({ value: h6, i: f }) => (openBlock(), createBlock(u, { key: f, class: "value" }, { default: withCtx(() => [ createTextVNode(toDisplayString(f), 1) ]), _: 2 }, 1024))), 128)) ]), _: 1 }) ]), _: 1 }, 512), [ [vShow, t13.showPoint] ]), createVNode(u, { class: "row" }, { default: withCtx(() => [ createVNode(s, { offset: 0, span: 8 }, { default: withCtx(() => [ createTextVNode(" Region: ") ]), _: 1 }), createVNode(s, { offset: 0, span: 16 }, { default: withCtx(() => [ createVNode(l, { modelValue: t13.region, "onUpdate:modelValue": e[0] || (e[0] = (h6) => t13.region = h6), placeholder: "__annotation", size: "small" }, null, 8, ["modelValue"]) ]), _: 1 }) ]), _: 1 }), createVNode(u, { class: "row" }, { default: withCtx(() => [ createVNode(s, { offset: 0, span: 8 }, { default: withCtx(() => [ createTextVNode(" Group: ") ]), _: 1 }), createVNode(s, { offset: 0, span: 16 }, { default: withCtx(() => [ createVNode(l, { modelValue: t13.group, "onUpdate:modelValue": e[1] || (e[1] = (h6) => t13.group = h6), placeholder: r.createData.shape, size: "small" }, null, 8, ["modelValue", "placeholder"]) ]), _: 1 }) ]), _: 1 }), createVNode(u, null, { default: withCtx(() => [ createVNode(s, { offset: 0, span: 12 }, { default: withCtx(() => [ createVNode(c, { type: "primary", plain: "", onClick: i.confirm }, { default: withCtx(() => [ createTextVNode(toDisplayString(i.confirmText), 1) ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }), createVNode(s, { offset: 0, span: 12 }, { default: withCtx(() => [ createVNode(c, { type: "primary", plain: "", onClick: i.cancel }, { default: withCtx(() => [ createTextVNode(" Cancel ") ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }); } var RI = Ur(XS, [["render", JS], ["__scopeId", "data-v-d61c5879"]]); function Ft(t13) { "@babel/helpers - typeof"; return Ft = 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; }, Ft(t13); } function ic(t13, e) { if (!(t13 instanceof e)) throw new TypeError("Cannot call a class as a function"); } function eT(t13, e) { for (var r = 0; r < e.length; r++) { var n = e[r]; n.enumerable = n.enumerable || false, n.configurable = true, "value" in n && (n.writable = true), Object.defineProperty(t13, n.key, n); } } function oc(t13, e, r) { return e && eT(t13.prototype, e), Object.defineProperty(t13, "prototype", { writable: false }), t13; } function Uh(t13, e, r) { return e in t13 ? Object.defineProperty(t13, e, { value: r, enumerable: true, configurable: true, writable: true }) : t13[e] = r, t13; } function Mr(t13, e) { return tT(t13) || rT(t13, e) || Gh(t13, e) || nT(); } function tT(t13) { if (Array.isArray(t13)) return t13; } function rT(t13, e) { var r = t13 == null ? null : typeof Symbol < "u" && t13[Symbol.iterator] || t13["@@iterator"]; if (r != null) { var n = [], a = true, i = false, o, s; try { for (r = r.call(t13); !(a = (o = r.next()).done) && (n.push(o.value), !(e && n.length === e)); a = true) ; } catch (u) { i = true, s = u; } finally { try { !a && r.return != null && r.return(); } finally { if (i) throw s; } } return n; } } function Gh(t13, e) { if (t13) { if (typeof t13 == "string") return ef(t13, e); var r = Object.prototype.toString.call(t13).slice(8, -1); if (r === "Object" && t13.constructor && (r = t13.constructor.name), r === "Map" || r === "Set") return Array.from(t13); if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return ef(t13, e); } } function ef(t13, e) { (e == null || e > t13.length) && (e = t13.length); for (var r = 0, n = new Array(e); r < e; r++) n[r] = t13[r]; return n; } function nT() { 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 Wh(t13, e) { var r = typeof Symbol < "u" && t13[Symbol.iterator] || t13["@@iterator"]; if (!r) { if (Array.isArray(t13) || (r = Gh(t13)) || e) { r && (t13 = r); var n = 0, a = function() { }; return { s: a, n: function() { return n >= t13.length ? { done: true } : { done: false, value: t13[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 = true, o = false, s; return { s: function() { r = r.call(t13); }, n: function() { var u = r.next(); return i = u.done, u; }, e: function(u) { o = true, s = u; }, f: function() { try { !i && r.return != null && r.return(); } finally { if (o) throw s; } } }; } var Ot = typeof window > "u" ? null : window; var tf = Ot ? Ot.navigator : null; Ot && Ot.document; var aT = Ft(""); var Yh = Ft({}); var iT = Ft(function() { }); var oT = typeof HTMLElement > "u" ? "undefined" : Ft(HTMLElement); var _o = function(e) { return e && e.instanceString && pt(e.instanceString) ? e.instanceString() : null; }; var Fe = function(e) { return e != null && Ft(e) == aT; }; var pt = function(e) { return e != null && Ft(e) === iT; }; var st = function(e) { return !yr(e) && (Array.isArray ? Array.isArray(e) : e != null && e instanceof Array); }; var Xe = function(e) { return e != null && Ft(e) === Yh && !st(e) && e.constructor === Object; }; var sT = function(e) { return e != null && Ft(e) === Yh; }; var be = function(e) { return e != null && Ft(e) === Ft(1) && !isNaN(e); }; var lT = function(e) { return be(e) && Math.floor(e) === e; }; var Ds = function(e) { if (oT !== "undefined") return e != null && e instanceof HTMLElement; }; var yr = function(e) { return Do(e) || Zh(e); }; var Do = function(e) { return _o(e) === "collection" && e._private.single; }; var Zh = function(e) { return _o(e) === "collection" && !e._private.single; }; var sc = function(e) { return _o(e) === "core"; }; var Xh = function(e) { return _o(e) === "stylesheet"; }; var uT = function(e) { return _o(e) === "event"; }; var qn = function(e) { return e == null ? true : !!(e === "" || e.match(/^\s+$/)); }; var cT = function(e) { return typeof HTMLElement > "u" ? false : e instanceof HTMLElement; }; var dT = function(e) { return Xe(e) && be(e.x1) && be(e.x2) && be(e.y1) && be(e.y2); }; var fT = function(e) { return sT(e) && pt(e.then); }; var vT = function() { return tf && tf.userAgent.match(/msie|trident|edge/i); }; var to = 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; }; var lc = to(function(t13) { return t13.replace(/([A-Z])/g, function(e) { return "-" + e.toLowerCase(); }); }); var Js = to(function(t13) { return t13.replace(/(-\w)/g, function(e) { return e[1].toUpperCase(); }); }); var jh = to(function(t13, e) { return t13 + e[0].toUpperCase() + e.substring(1); }, function(t13, e) { return t13 + "$" + e; }); var rf = function(e) { return qn(e) ? e : e.charAt(0).toUpperCase() + e.substring(1); }; var It = "(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))"; var hT = "rgb[a]?\\((" + It + "[%]?)\\s*,\\s*(" + It + "[%]?)\\s*,\\s*(" + It + "[%]?)(?:\\s*,\\s*(" + It + "))?\\)"; var pT = "rgb[a]?\\((?:" + It + "[%]?)\\s*,\\s*(?:" + It + "[%]?)\\s*,\\s*(?:" + It + "[%]?)(?:\\s*,\\s*(?:" + It + "))?\\)"; var gT = "hsl[a]?\\((" + It + ")\\s*,\\s*(" + It + "[%])\\s*,\\s*(" + It + "[%])(?:\\s*,\\s*(" + It + "))?\\)"; var mT = "hsl[a]?\\((?:" + It + ")\\s*,\\s*(?:" + It + "[%])\\s*,\\s*(?:" + It + "[%])(?:\\s*,\\s*(?:" + It + "))?\\)"; var yT = "\\#[0-9a-fA-F]{3}"; var bT = "\\#[0-9a-fA-F]{6}"; var Qh = function(e, r) { return e < r ? -1 : e > r ? 1 : 0; }; var wT = function(e, r) { return -1 * Qh(e, r); }; var Re = Object.assign != null ? Object.assign.bind(Object) : function(t13) { 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]; t13[o] = n[o]; } } return t13; }; var CT = 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]; } }; var xT = function(e) { var r, n, a, i, o, s, u, l; function c(f, p, m) { return m < 0 && (m += 1), m > 1 && (m -= 1), m < 1 / 6 ? f + (p - f) * 6 * m : m < 1 / 2 ? p : m < 2 / 3 ? f + (p - f) * (2 / 3 - m) * 6 : f; } var d = new RegExp("^" + gT + "$").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 v = i < 0.5 ? i * (1 + a) : i + a - i * a, h6 = 2 * i - v; s = Math.round(255 * c(h6, v, n + 1 / 3)), u = Math.round(255 * c(h6, v, n)), l = Math.round(255 * c(h6, v, n - 1 / 3)); } r = [s, u, l, o]; } return r; }; var ET = function(e) { var r, n = new RegExp("^" + hT + "$").exec(e); if (n) { r = []; for (var a = [], i = 1; i <= 3; i++) { var o = n[i]; if (o[o.length - 1] === "%" && (a[i] = true), 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; }; var kT = function(e) { return TT[e.toLowerCase()]; }; var ST = function(e) { return (st(e) ? e : null) || kT(e) || CT(e) || ET(e) || xT(e); }; var TT = { // 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] }; var Jh = 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; } }; var ep = 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 _T(t13) { var e = typeof t13; return t13 != null && (e == "object" || e == "function"); } var ga = _T; var Mi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function DT(t13, e) { return e = { exports: {} }, t13(e, e.exports), e.exports; } var PT = typeof Mi == "object" && Mi && Mi.Object === Object && Mi; var OT = PT; var LT = typeof self == "object" && self && self.Object === Object && self; var IT = OT || LT || Function("return this")(); var el = IT; var FT = function() { return el.Date.now(); }; var Fl = FT; var AT = /\s/; function MT(t13) { for (var e = t13.length; e-- && AT.test(t13.charAt(e)); ) ; return e; } var BT = MT; var NT = /^\s+/; function $T(t13) { return t13 && t13.slice(0, BT(t13) + 1).replace(NT, ""); } var RT = $T; var zT = el.Symbol; var ii = zT; var tp = Object.prototype; var VT = tp.hasOwnProperty; var HT = tp.toString; var Pi = ii ? ii.toStringTag : void 0; function qT(t13) { var e = VT.call(t13, Pi), r = t13[Pi]; try { t13[Pi] = void 0; var n = true; } catch { } var a = HT.call(t13); return n && (e ? t13[Pi] = r : delete t13[Pi]), a; } var KT = qT; var UT = Object.prototype; var GT = UT.toString; function WT(t13) { return GT.call(t13); } var YT = WT; var ZT = "[object Null]"; var XT = "[object Undefined]"; var nf = ii ? ii.toStringTag : void 0; function jT(t13) { return t13 == null ? t13 === void 0 ? XT : ZT : nf && nf in Object(t13) ? KT(t13) : YT(t13); } var rp = jT; function QT(t13) { return t13 != null && typeof t13 == "object"; } var JT = QT; var e5 = "[object Symbol]"; function t5(t13) { return typeof t13 == "symbol" || JT(t13) && rp(t13) == e5; } var Po = t5; var af = NaN; var r5 = /^[-+]0x[0-9a-f]+$/i; var n5 = /^0b[01]+$/i; var a5 = /^0o[0-7]+$/i; var i5 = parseInt; function o5(t13) { if (typeof t13 == "number") return t13; if (Po(t13)) return af; if (ga(t13)) { var e = typeof t13.valueOf == "function" ? t13.valueOf() : t13; t13 = ga(e) ? e + "" : e; } if (typeof t13 != "string") return t13 === 0 ? t13 : +t13; t13 = RT(t13); var r = n5.test(t13); return r || a5.test(t13) ? i5(t13.slice(2), r ? 2 : 8) : r5.test(t13) ? af : +t13; } var of = o5; var s5 = "Expected a function"; var l5 = Math.max; var u5 = Math.min; function c5(t13, e, r) { var n, a, i, o, s, u, l = 0, c = false, d = false, v = true; if (typeof t13 != "function") throw new TypeError(s5); e = of(e) || 0, ga(r) && (c = !!r.leading, d = "maxWait" in r, i = d ? l5(of(r.maxWait) || 0, e) : i, v = "trailing" in r ? !!r.trailing : v); function h6(E) { var C = n, T = a; return n = a = void 0, l = E, o = t13.apply(T, C), o; } function f(E) { return l = E, s = setTimeout(g, e), c ? h6(E) : o; } function p(E) { var C = E - u, T = E - l, k = e - C; return d ? u5(k, i - T) : k; } function m(E) { var C = E - u, T = E - l; return u === void 0 || C >= e || C < 0 || d && T >= i; } function g() { var E = Fl(); if (m(E)) return y(E); s = setTimeout(g, p(E)); } function y(E) { return s = void 0, v && n ? h6(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 : y(Fl()); } function x() { var E = Fl(), C = m(E); if (n = arguments, a = this, u = E, C) { if (s === void 0) return f(u); if (d) return clearTimeout(s), s = setTimeout(g, e), h6(u); } return s === void 0 && (s = setTimeout(g, e)), o; } return x.cancel = b, x.flush = w, x; } var tl = c5; var Al = Ot ? Ot.performance : null; var np = Al && Al.now ? function() { return Al.now(); } : function() { return Date.now(); }; var d5 = function() { if (Ot) { if (Ot.requestAnimationFrame) return function(t13) { Ot.requestAnimationFrame(t13); }; if (Ot.mozRequestAnimationFrame) return function(t13) { Ot.mozRequestAnimationFrame(t13); }; if (Ot.webkitRequestAnimationFrame) return function(t13) { Ot.webkitRequestAnimationFrame(t13); }; if (Ot.msRequestAnimationFrame) return function(t13) { Ot.msRequestAnimationFrame(t13); }; } return function(t13) { t13 && setTimeout(function() { t13(np()); }, 1e3 / 60); }; }(); var Ps = function(e) { return d5(e); }; var gn = np; var Va = 9261; var ap = 65599; var Bi = 5381; var ip = function(e) { for (var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Va, n = r, a; a = e.next(), !a.done; ) n = n * ap + a.value | 0; return n; }; var ro = function(e) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Va; return r * ap + e | 0; }; var no = function(e) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Bi; return (r << 5) + r + e | 0; }; var f5 = function(e, r) { return e * 2097152 + r; }; var Dn = function(e) { return e[0] * 2097152 + e[1]; }; var Go = function(e, r) { return [ro(e[0], r[0]), no(e[1], r[1])]; }; var v5 = function(e, r) { var n = { value: 0, done: false }, a = 0, i = e.length, o = { next: function() { return a < i ? n.value = e[a++] : n.done = true, n; } }; return ip(o, r); }; var ma = function(e, r) { var n = { value: 0, done: false }, a = 0, i = e.length, o = { next: function() { return a < i ? n.value = e.charCodeAt(a++) : n.done = true, n; } }; return ip(o, r); }; var op = function() { return h5(arguments); }; var h5 = function(e) { for (var r, n = 0; n < e.length; n++) { var a = e[n]; n === 0 ? r = ma(a) : r = ma(a, r); } return r; }; var sf = true; var p5 = console.warn != null; var g5 = console.trace != null; var uc = Number.MAX_SAFE_INTEGER || 9007199254740991; var sp = function() { return true; }; var Os = function() { return false; }; var lf = function() { return 0; }; var cc = function() { }; var yt = function(e) { throw new Error(e); }; var lp = function(e) { if (e !== void 0) sf = !!e; else return sf; }; var tt = function(e) { lp() && (p5 ? console.warn(e) : (console.log(e), g5 && console.trace())); }; var m5 = function(e) { return Re({}, e); }; var Zr = function(e) { return e == null ? e : st(e) ? e.slice() : Xe(e) ? m5(e) : e; }; var y5 = function(e) { return e.slice(); }; var up = 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; }; var b5 = {}; var cp = function() { return b5; }; var Wt = 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; }; }; var Kn = function(e, r, n) { for (var a = e.length - 1; a >= 0; a--) e[a] === r && e.splice(a, 1); }; var dc = function(e) { e.splice(0, e.length); }; var w5 = function(e, r) { for (var n = 0; n < r.length; n++) { var a = r[n]; e.push(a); } }; var Nr = function(e, r, n) { return n && (r = jh(n, r)), e[r]; }; var An = function(e, r, n, a) { n && (r = jh(n, r)), e[r] = a; }; var C5 = function() { function t13() { ic(this, t13), this._obj = {}; } return oc(t13, [{ 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]; } }]), t13; }(); var Xr = typeof Map < "u" ? Map : C5; var x5 = "undefined"; var E5 = function() { function t13(e) { if (ic(this, t13), 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 oc(t13, [{ 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); } }]), t13; }(); var vi = (typeof Set > "u" ? "undefined" : Ft(Set)) !== x5 ? Set : E5; var rl = function(e, r) { var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true; if (e === void 0 || r === void 0 || !sc(e)) { yt("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") { yt("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: true, // 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: false, // 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: true, // 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 ? true : !!r.selectable, // whether it's selectable locked: !!r.locked, // whether the element is locked (cannot be moved) grabbed: false, // whether the element is grabbed by the mouse; renderer sets this privately grabbable: r.grabbable === void 0 ? true : !!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: false, // whether the element is active from user interaction classes: new vi(), // 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: false, // 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 = []; st(r.classes) ? l = r.classes : Fe(r.classes) && (l = r.classes.split(/\s+/)); for (var c = 0, d = l.length; c < d; c++) { var v = l[c]; !v || v === "" || i.classes.add(v); } this.createEmitter(); var h6 = r.style || r.css; h6 && (tt("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."), this.style(h6)), (n === void 0 || n) && this.restore(); }; var uf = function(e) { return e = { bfs: e.bfs || !e.dfs, dfs: e.dfs || !e.bfs }, function(n, a, i) { var o; Xe(n) && !yr(n) && (o = n, n = o.roots || o.root, a = o.visit, i = o.directed), i = arguments.length === 2 && !pt(a) ? a : i, a = pt(a) ? a : function() { }; for (var s = this._private.cy, u = n = Fe(n) ? this.filter(n) : n, l = [], c = [], d = {}, v = {}, h6 = {}, f = 0, p, m = this.byGroup(), g = m.nodes, y = m.edges, b = 0; b < u.length; b++) { var w = u[b], x = w.id(); w.isNode() && (l.unshift(w), e.bfs && (h6[x] = true, c.push(w)), v[x] = 0); } for (var E = function() { var F = e.bfs ? l.shift() : l.pop(), L = F.id(); if (e.dfs) { if (h6[L]) return "continue"; h6[L] = true, c.push(F); } var B = v[L], I = d[L], M = I != null ? I.source() : null, A = I != null ? I.target() : null, R = I == null ? void 0 : F.same(M) ? A[0] : M[0], K = void 0; if (K = a(F, I, R, f++, B), K === true) return p = F, "break"; if (K === false) return "break"; for (var H = F.connectedEdges().filter(function(ae) { return (!i || ae.source().same(F)) && y.has(ae); }), q = 0; q < H.length; q++) { var ee = H[q], se = ee.connectedNodes().filter(function(ae) { return !ae.same(F) && g.has(ae); }), oe = se.id(); se.length !== 0 && !h6[oe] && (se = se[0], l.push(se), e.bfs && (h6[oe] = true, c.push(se)), d[oe] = ee, v[oe] = v[L] + 1); } }; l.length !== 0; ) { var C = E(); if (C !== "continue" && C === "break") break; } for (var T = s.collection(), k = 0; k < c.length; k++) { var _ = c[k], D = d[_.id()]; D != null && T.push(D), T.push(_); } return { path: s.collection(T), found: s.collection(p) }; }; }; var ao = { breadthFirstSearch: uf({ bfs: true }), depthFirstSearch: uf({ dfs: true }) }; ao.bfs = ao.breadthFirstSearch; ao.dfs = ao.depthFirstSearch; var k5 = DT(function(t13, e) { (function() { var r, n, a, i, o, s, u, l, c, d, v, h6, f, p, m; a = Math.floor, d = Math.min, n = function(g, y) { return g < y ? -1 : g > y ? 1 : 0; }, c = function(g, y, 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 = g.length); b < w; ) E = a((b + w) / 2), x(y, g[E]) < 0 ? w = E : b = E + 1; return [].splice.apply(g, [b, b - b].concat(y)), y; }, s = function(g, y, b) { return b == null && (b = n), g.push(y), p(g, 0, g.length - 1, b); }, o = function(g, y) { var b, w; return y == null && (y = n), b = g.pop(), g.length ? (w = g[0], g[0] = b, m(g, 0, y)) : w = b, w; }, l = function(g, y, b) { var w; return b == null && (b = n), w = g[0], g[0] = y, m(g, 0, b), w; }, u = function(g, y, b) { var w; return b == null && (b = n), g.length && b(g[0], y) < 0 && (w = [g[0], y], y = w[0], g[0] = w[1], m(g, 0, b)), y; }, i = function(g, y) { var b, w, x, E, C, T; for (y == null && (y = n), E = (function() { T = []; for (var k = 0, _ = a(g.length / 2); 0 <= _ ? k < _ : k > _; 0 <= _ ? k++ : k--) T.push(k); return T; }).apply(this).reverse(), C = [], w = 0, x = E.length; w < x; w++) b = E[w], C.push(m(g, b, y)); return C; }, f = function(g, y, b) { var w; if (b == null && (b = n), w = g.indexOf(y), w !== -1) return p(g, 0, w, b), m(g, w, b); }, v = function(g, y, b) { var w, x, E, C, T; if (b == null && (b = n), x = g.slice(0, y), !x.length) return x; for (i(x, b), T = g.slice(y), E = 0, C = T.length; E < C; E++) w = T[E], u(x, w, b); return x.sort(b).reverse(); }, h6 = function(g, y, b) { var w, x, E, C, T, k, _, D, O; if (b == null && (b = n), y * 10 <= g.length) { if (E = g.slice(0, y).sort(b), !E.length) return E; for (x = E[E.length - 1], _ = g.slice(y), C = 0, k = _.length; C < k; C++) w = _[C], b(w, x) < 0 && (c(E, w, 0, null, b), E.pop(), x = E[E.length - 1]); return E; } for (i(g, b), O = [], T = 0, D = d(y, g.length); 0 <= D ? T < D : T > D; 0 <= D ? ++T : --T) O.push(o(g, b)); return O; }, p = function(g, y, b, w) { var x, E, C; for (w == null && (w = n), x = g[b]; b > y; ) { if (C = b - 1 >> 1, E = g[C], w(x, E) < 0) { g[b] = E, b = C; continue; } break; } return g[b] = x; }, m = function(g, y, b) { var w, x, E, C, T; for (b == null && (b = n), x = g.length, T = y, E = g[y], w = 2 * y + 1; w < x; ) C = w + 1, C < x && !(b(g[w], g[C]) < 0) && (w = C), g[y] = g[w], y = w, w = 2 * y + 1; return g[y] = E, p(g, T, y, b); }, r = function() { g.push = s, g.pop = o, g.replace = l, g.pushpop = u, g.heapify = i, g.updateItem = f, g.nlargest = v, g.nsmallest = h6; function g(y) { this.cmp = y ?? n, this.nodes = []; } return g.prototype.push = function(y) { return s(this.nodes, y, this.cmp); }, g.prototype.pop = function() { return o(this.nodes, this.cmp); }, g.prototype.peek = function() { return this.nodes[0]; }, g.prototype.contains = function(y) { return this.nodes.indexOf(y) !== -1; }, g.prototype.replace = function(y) { return l(this.nodes, y, this.cmp); }, g.prototype.pushpop = function(y) { return u(this.nodes, y, this.cmp); }, g.prototype.heapify = function() { return i(this.nodes, this.cmp); }, g.prototype.updateItem = function(y) { return f(this.nodes, y, this.cmp); }, g.prototype.clear = function() { return this.nodes = []; }, g.prototype.empty = function() { return this.nodes.length === 0; }, g.prototype.size = function() { return this.nodes.length; }, g.prototype.clone = function() { var y; return y = new g(), y.nodes = this.nodes.slice(0), y; }, g.prototype.toArray = function() { return this.nodes.slice(0); }, g.prototype.insert = g.prototype.push, g.prototype.top = g.prototype.peek, g.prototype.front = g.prototype.peek, g.prototype.has = g.prototype.contains, g.prototype.copy = g.prototype.clone, g; }(), function(g, y) { return t13.exports = y(); }(this, function() { return r; }); }).call(Mi); }); var Oo = k5; var S5 = Wt({ root: null, weight: function(e) { return 1; }, directed: false }); var T5 = { dijkstra: function(e) { if (!Xe(e)) { var r = arguments; e = { root: r[0], weight: r[1], directed: r[2] }; } var n = S5(e), a = n.root, i = n.weight, o = n.directed, s = this, u = i, l = Fe(a) ? this.filter(a)[0] : a[0], c = {}, d = {}, v = {}, h6 = this.byGroup(), f = h6.nodes, p = h6.edges; p.unmergeBy(function(B) { return B.isLoop(); }); for (var m = function(I) { return c[I.id()]; }, g = function(I, M) { c[I.id()] = M, y.updateItem(I); }, y = new Oo(function(B, I) { return m(B) - m(I); }), b = 0; b < f.length; b++) { var w = f[b]; c[w.id()] = w.same(l) ? 0 : 1 / 0, y.push(w); } for (var x = function(I, M) { for (var A = (o ? I.edgesTo(M) : I.edgesWith(M)).intersect(p), R = 1 / 0, K, H = 0; H < A.length; H++) { var q = A[H], ee = u(q); (ee < R || !K) && (R = ee, K = q); } return { edge: K, dist: R }; }; y.size() > 0; ) { var E = y.pop(), C = m(E), T = E.id(); if (v[T] = C, C !== 1 / 0) for (var k = E.neighborhood().intersect(f), _ = 0; _ < k.length; _++) { var D = k[_], O = D.id(), F = x(E, D), L = C + F.dist; L < m(D) && (g(D, L), d[O] = { node: E, edge: F.edge }); } } return { distanceTo: function(I) { var M = Fe(I) ? f.filter(I)[0] : I[0]; return v[M.id()]; }, pathTo: function(I) { var M = Fe(I) ? f.filter(I)[0] : I[0], A = [], R = M, K = R.id(); if (M.length > 0) for (A.unshift(M); d[K]; ) { var H = d[K]; A.unshift(H.edge), A.unshift(H.node), R = H.node, K = R.id(); } return s.spawn(A); } }; } }; var _5 = { // 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 v = c[d], h6 = v.source()[0], f = v.target()[0], p = u(h6), m = u(f), g = o[p], y = o[m]; p !== m && (s.merge(v), g.merge(y), o.splice(m, 1)); } return s; } }; var D5 = Wt({ root: null, goal: null, weight: function(e) { return 1; }, heuristic: function(e) { return 0; }, directed: false }); var P5 = { // Implemented from pseudocode from wikipedia aStar: function(e) { var r = this.cy(), n = D5(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 = {}, v = {}, h6 = {}, f = new Oo(function(K, H) { return v[K.id()] - v[H.id()]; }), p = new vi(), m = {}, g = {}, y = function(H, q) { f.push(H), p.add(q); }, b, w, x = function() { b = f.pop(), w = b.id(), p.delete(w); }, E = function(H) { return p.has(H); }; y(a, l), d[l] = 0, v[l] = o(a); for (var C = 0; f.size() > 0; ) { if (x(), C++, w === c) { for (var T = [], k = i, _ = c, D = g[_]; T.unshift(k), D != null && T.unshift(D), k = m[_], k != null; ) _ = k.id(), D = g[_]; return { found: true, distance: d[w], path: this.spawn(T), steps: C }; } h6[w] = true; for (var O = b._private.edges, F = 0; F < O.length; F++) { var L = O[F]; if (this.hasElementWithId(L.id()) && !(s && L.data("source") !== w)) { var B = L.source(), I = L.target(), M = B.id() !== w ? B : I, A = M.id(); if (this.hasElementWithId(A) && !h6[A]) { var R = d[w] + u(L); if (!E(A)) { d[A] = R, v[A] = R + o(M), y(M, A), m[A] = b, g[A] = L; continue; } R < d[A] && (d[A] = R, v[A] = R + o(M), m[A] = b, g[A] = L); } } } } return { found: false, distance: void 0, path: void 0, steps: C }; } }; var O5 = Wt({ weight: function(e) { return 1; }, directed: false }); var L5 = { // Implemented from pseudocode from wikipedia floydWarshall: function(e) { for (var r = this.cy(), n = O5(e), a = n.weight, i = n.directed, o = a, s = this.byGroup(), u = s.nodes, l = s.edges, c = u.length, d = c * c, v = function(ee) { return u.indexOf(ee); }, h6 = function(ee) { return u[ee]; }, f = new Array(d), p = 0; p < d; p++) { var m = p % c, g = (p - m) / c; g === m ? f[p] = 0 : f[p] = 1 / 0; } for (var y = 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 T = v(E), k = v(C), _ = T * c + k, D = o(x); if (f[_] > D && (f[_] = D, y[_] = k, b[_] = x), !i) { var O = k * c + T; !i && f[O] > D && (f[O] = D, y[O] = T, b[O] = x); } } } for (var F = 0; F < c; F++) for (var L = 0; L < c; L++) for (var B = L * c + F, I = 0; I < c; I++) { var M = L * c + I, A = F * c + I; f[B] + f[A] < f[M] && (f[M] = f[B] + f[A], y[M] = y[B]); } var R = function(ee) { return (Fe(ee) ? r.filter(ee) : ee)[0]; }, K = function(ee) { return v(R(ee)); }, H = { distance: function(ee, se) { var oe = K(ee), ae = K(se); return f[oe * c + ae]; }, path: function(ee, se) { var oe = K(ee), ae = K(se), ue = h6(oe); if (oe === ae) return ue.collection(); if (y[oe * c + ae] == null) return r.collection(); var te = r.collection(), $ = oe, G; for (te.merge(ue); oe !== ae; ) $ = oe, oe = y[oe * c + ae], G = b[$ * c + oe], te.merge(G), te.merge(h6(oe)); return te; } }; return H; } // floydWarshall }; var I5 = Wt({ weight: function(e) { return 1; }, directed: false, root: null }); var F5 = { // Implemented from pseudocode from wikipedia bellmanFord: function(e) { var r = this, n = I5(e), a = n.weight, i = n.directed, o = n.root, s = a, u = this, l = this.cy(), c = this.byGroup(), d = c.edges, v = c.nodes, h6 = v.length, f = new Xr(), p = false, m = []; o = l.collection(o)[0], d.unmergeBy(function(ke) { return ke.isLoop(); }); for (var g = d.length, y = function(xe) { var De = f.get(xe.id()); return De || (De = {}, f.set(xe.id(), De)), De; }, b = function(xe) { return (Fe(xe) ? l.$(xe) : xe)[0]; }, w = function(xe) { return y(b(xe)).dist; }, x = function(xe) { for (var De = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : o, qe = b(xe), Ke = [], Be = qe; ; ) { if (Be == null) return r.spawn(); var Ge = y(Be), le = Ge.edge, S = Ge.pred; if (Ke.unshift(Be[0]), Be.same(De) && Ke.length > 0) break; le != null && Ke.unshift(le), Be = S; } return u.spawn(Ke); }, E = 0; E < h6; E++) { var C = v[E], T = y(C); C.same(o) ? T.dist = 0 : T.dist = 1 / 0, T.pred = null, T.edge = null; } for (var k = false, _ = function(xe, De, qe, Ke, Be, Ge) { var le = Ke.dist + Ge; le < Be.dist && !qe.same(Ke.edge) && (Be.dist = le, Be.pred = xe, Be.edge = qe, k = true); }, D = 1; D < h6; D++) { k = false; for (var O = 0; O < g; O++) { var F = d[O], L = F.source(), B = F.target(), I = s(F), M = y(L), A = y(B); _(L, B, F, M, A, I), i || _(B, L, F, A, M, I); } if (!k) break; } if (k) for (var R = [], K = 0; K < g; K++) { var H = d[K], q = H.source(), ee = H.target(), se = s(H), oe = y(q).dist, ae = y(ee).dist; if (oe + se < ae || !i && ae + se < oe) if (p || (tt("Graph contains a negative weight cycle for Bellman-Ford"), p = true), e.findNegativeWeightCycles !== false) { var ue = []; oe + se < ae && ue.push(q), !i && ae + se < oe && ue.push(ee); for (var te = ue.length, $ = 0; $ < te; $++) { var G = ue[$], Q = [G]; Q.push(y(G).edge); for (var ge = y(G).pred; Q.indexOf(ge) === -1; ) Q.push(ge), Q.push(y(ge).edge), ge = y(ge).pred; Q = Q.slice(Q.indexOf(ge)); for (var Ee = Q[0].id(), fe = 0, me = 2; me < Q.length; me += 2) Q[me].id() < Ee && (Ee = Q[me].id(), fe = me); Q = Q.slice(fe).concat(Q.slice(0, fe)), Q.push(Q[0]); var Ce = Q.map(function(ke) { return ke.id(); }).join(","); R.indexOf(Ce) === -1 && (m.push(u.spawn(Q)), R.push(Ce)); } } else break; } return { distanceTo: w, pathTo: x, hasNegativeWeightCycle: p, negativeWeightCycles: m }; } // bellmanFord }; var A5 = Math.sqrt(2); var M5 = function(e, r, n) { n.length === 0 && yt("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], v = d[1], h6 = d[2]; (r[v] === s && r[h6] === u || r[v] === u && r[h6] === s) && l.splice(c, 1); } for (var f = 0; f < l.length; f++) { var p = l[f]; p[1] === u ? (l[f] = p.slice(), l[f][1] = s) : p[2] === u && (l[f] = p.slice(), l[f][2] = s); } for (var m = 0; m < r.length; m++) r[m] === u && (r[m] = s); return l; }; var Ml = function(e, r, n, a) { for (; n > a; ) { var i = Math.floor(Math.random() * r.length); r = M5(i, e, r), n--; } return r; }; var B5 = { // 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(A) { return A.isLoop(); }); var i = n.length, o = a.length, s = Math.ceil(Math.pow(Math.log(i) / Math.LN2, 2)), u = Math.floor(i / A5); if (i < 2) { yt("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 v = 1 / 0, h6 = [], f = new Array(i), p = new Array(i), m = new Array(i), g = function(R, K) { for (var H = 0; H < i; H++) K[H] = R[H]; }, y = 0; y <= s; y++) { for (var b = 0; b < i; b++) p[b] = b; var w = Ml(p, l.slice(), i, u), x = w.slice(); g(p, m); var E = Ml(p, w, u, 2), C = Ml(m, x, u, 2); E.length <= C.length && E.length < v ? (v = E.length, h6 = E, g(p, f)) : C.length <= E.length && C.length < v && (v = C.length, h6 = C, g(m, f)); } for (var T = this.spawn(h6.map(function(A) { return a[A[0]]; })), k = this.spawn(), _ = this.spawn(), D = f[0], O = 0; O < f.length; O++) { var F = f[O], L = n[O]; F === D ? k.merge(L) : _.merge(L); } var B = function(R) { var K = e.spawn(); return R.forEach(function(H) { K.merge(H), H.connectedEdges().forEach(function(q) { e.contains(q) && !T.contains(q) && K.merge(q); }); }), K; }, I = [B(k), B(_)], M = { cut: T, components: I, // n.b. partitions are included to be compatible with the old api spec // (could be removed in a future major version) partition1: k, partition2: _ }; return M; } }; var N5 = function(e) { return { x: e.x, y: e.y }; }; var nl = function(e, r, n) { return { x: e.x * r + n.x, y: e.y * r + n.y }; }; var dp = function(e, r, n) { return { x: (e.x - n.x) / r, y: (e.y - n.y) / r }; }; var Ha = function(e) { return { x: e[0], y: e[1] }; }; var $5 = 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; }; var R5 = 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; }; var z5 = 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; }; var V5 = 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] : true, i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true, o = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true; 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(v, h6) { return v - h6; }); 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; }; var H5 = function(e) { return Math.PI * e / 180; }; var Wo = function(e, r) { return Math.atan2(r, e) - Math.PI / 2; }; var fc = Math.log2 || function(t13) { return Math.log(t13) / Math.log(2); }; var fp = function(e) { return e > 0 ? 1 : e < 0 ? -1 : 0; }; var ya = function(e, r) { return Math.sqrt(ta(e, r)); }; var ta = function(e, r) { var n = r.x - e.x, a = r.y - e.y; return n * n + a * a; }; var q5 = 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; }; var Nt = function(e, r, n, a) { return (1 - a) * (1 - a) * e + 2 * (1 - a) * a * r + a * a * n; }; var Ga = function(e, r, n, a) { return { x: Nt(e.x, r.x, n.x, a), y: Nt(e.y, r.y, n.y, a) }; }; var K5 = function(e, r, n, a) { var i = { x: r.x - e.x, y: r.y - e.y }, o = ya(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 }; }; var io = function(e, r, n) { return Math.max(e, Math.min(n, r)); }; var pr = 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 }; } }; var U5 = function(e) { return { x1: e.x1, x2: e.x2, w: e.w, y1: e.y1, y2: e.y2, h: e.h }; }; var G5 = function(e) { e.x1 = 1 / 0, e.y1 = 1 / 0, e.x2 = -1 / 0, e.y2 = -1 / 0, e.w = 0, e.h = 0; }; var W5 = 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 }; }; var vp = 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; }; var Y5 = 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; }; var us = 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; }; var cs = 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 = Mr(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; }; var cf = 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; }; var vc = 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); }; var oi = function(e, r, n) { return e.x1 <= r && r <= e.x2 && e.y1 <= n && n <= e.y2; }; var Z5 = function(e, r) { return oi(e, r.x, r.y); }; var hp = function(e, r) { return oi(e, r.x1, r.y1) && oi(e, r.x2, r.y2); }; var pp = function(e, r, n, a, i, o, s) { var u = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : "auto", l = u === "auto" ? ba(i, o) : u, c = i / 2, d = o / 2; l = Math.min(l, c, d); var v = l !== c, h6 = l !== d, f; if (v) { var p = n - c + l - s, m = a - d - s, g = n + c - l + s, y = m; if (f = Nn(e, r, n, a, p, m, g, y, false), f.length > 0) return f; } if (h6) { var b = n + c + s, w = a - d + l - s, x = b, E = a + d - l + s; if (f = Nn(e, r, n, a, b, w, x, E, false), f.length > 0) return f; } if (v) { var C = n - c + l - s, T = a + d + s, k = n + c - l + s, _ = T; if (f = Nn(e, r, n, a, C, T, k, _, false), f.length > 0) return f; } if (h6) { var D = n - c - s, O = a - d + l - s, F = D, L = a + d - l + s; if (f = Nn(e, r, n, a, D, O, F, L, false), f.length > 0) return f; } var B; { var I = n - c + l, M = a - d + l; if (B = Ni(e, r, n, a, I, M, l + s), B.length > 0 && B[0] <= I && B[1] <= M) return [B[0], B[1]]; } { var A = n + c - l, R = a - d + l; if (B = Ni(e, r, n, a, A, R, l + s), B.length > 0 && B[0] >= A && B[1] <= R) return [B[0], B[1]]; } { var K = n + c - l, H = a + d - l; if (B = Ni(e, r, n, a, K, H, l + s), B.length > 0 && B[0] >= K && B[1] >= H) return [B[0], B[1]]; } { var q = n - c + l, ee = a + d - l; if (B = Ni(e, r, n, a, q, ee, l + s), B.length > 0 && B[0] <= q && B[1] >= ee) return [B[0], B[1]]; } return []; }; var X5 = 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), v = Math.max(a, o); return l - u <= e && e <= c + u && d - u <= r && r <= v + u; }; var j5 = 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); }; var Q5 = 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]; }; var J5 = 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, v, h6, f; 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, h6 = r / 3, s > 0) { d = l + Math.sqrt(s), d = d < 0 ? -Math.pow(-d, 1 / 3) : Math.pow(d, 1 / 3), v = l - Math.sqrt(s), v = v < 0 ? -Math.pow(-v, 1 / 3) : Math.pow(v, 1 / 3), i[0] = -h6 + d + v, h6 += (d + v) / 2, i[4] = i[2] = -h6, h6 = Math.sqrt(3) * (-v + d) / 2, i[3] = h6, i[5] = -h6; return; } if (i[5] = i[3] = 0, s === 0) { f = l < 0 ? -Math.pow(-l, 1 / 3) : Math.pow(l, 1 / 3), i[0] = -h6 + 2 * f, i[4] = i[2] = -(f + h6); return; } u = -u, c = u * u * u, c = Math.acos(l / Math.sqrt(c)), f = 2 * Math.sqrt(u), i[0] = -h6 + f * Math.cos(c / 3), i[2] = -h6 + f * Math.cos((c + 2 * Math.PI) / 3), i[4] = -h6 + f * Math.cos((c + 4 * Math.PI) / 3); }; var e4 = 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, v = 1 * n * i - n * n + n * e - i * e + a * o - a * a + a * r - o * r, h6 = []; J5(l, c, d, v, h6); for (var f = 1e-7, p = [], m = 0; m < 6; m += 2) Math.abs(h6[m + 1]) < f && h6[m] >= 0 && h6[m] <= 1 && p.push(h6[m]); p.push(1), p.push(0); for (var g = -1, y, b, w, x = 0; x < p.length; x++) y = 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(y - e, 2) + Math.pow(b - r, 2), g >= 0 ? w < g && (g = w) : g = w; return g; }; var t4 = 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], v = d * d / l; return d < 0 ? c : v > l ? (e - i) * (e - i) + (r - o) * (r - o) : c - v; }; var dr = 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; }; var mn = 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 v = Math.cos(-d), h6 = Math.sin(-d), f = 0; f < c.length / 2; f++) c[f * 2] = o / 2 * (n[f * 2] * v - n[f * 2 + 1] * h6), c[f * 2 + 1] = s / 2 * (n[f * 2 + 1] * v + n[f * 2] * h6), c[f * 2] += a, c[f * 2 + 1] += i; var p; if (l > 0) { var m = Is(c, -l); p = Ls(m); } else p = c; return dr(e, r, p); }; var r4 = 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 v = Math.pow(d.cx - e, 2) + Math.pow(d.cy - r, 2); if (v <= Math.pow(d.radius, 2)) return true; } return dr(e, r, l); }; var Ls = 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 v = Nn(n, a, i, o, s, u, l, c, true); r[d * 2] = v[0], r[d * 2 + 1] = v[1]; } return r; }; var Is = 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), v = l / d, h6 = c / d; n[u * 4] = a + v * r, n[u * 4 + 1] = i + h6 * r, n[u * 4 + 2] = o + v * r, n[u * 4 + 3] = s + h6 * r; } return n; }; var n4 = 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]; }; var la = 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; }; var Ni = 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]), v = l[0] * l[0] + l[1] * l[1] - s * s, h6 = d * d - 4 * c * v; if (h6 < 0) return []; var f = (-d + Math.sqrt(h6)) / (2 * c), p = (-d - Math.sqrt(h6)) / (2 * c), m = Math.min(f, p), g = Math.max(f, p), y = []; if (m >= 0 && m <= 1 && y.push(m), g >= 0 && g <= 1 && y.push(g), y.length === 0) return []; var b = y[0] * u[0] + e, w = y[0] * u[1] + r; if (y.length > 1) { if (y[0] == y[1]) return [b, w]; var x = y[1] * u[0] + e, E = y[1] * u[1] + r; return [b, w, x, E]; } else return [b, w]; }; var Bl = function(e, r, n) { return r <= e && e <= n || n <= e && e <= r ? e : e <= r && r <= n || n <= r && r <= e ? r : n; }; var Nn = function(e, r, n, a, i, o, s, u, l) { var c = e - i, d = n - e, v = s - i, h6 = r - o, f = a - r, p = u - o, m = v * h6 - p * c, g = d * h6 - f * c, y = p * d - v * f; if (y !== 0) { var b = m / y, w = g / y, x = 1e-3, E = 0 - x, C = 1 + x; return E <= b && b <= C && E <= w && w <= C ? [e + b * d, r + b * f] : l ? [e + b * d, r + b * f] : []; } else return m === 0 || g === 0 ? Bl(e, n, s) === s ? [s, u] : Bl(e, n, i) === i ? [i, o] : Bl(i, s, n) === n ? [n, a] : [] : []; }; var oo = function(e, r, n, a, i, o, s, u) { var l = [], c, d = new Array(n.length), v = true; o == null && (v = false); var h6; if (v) { for (var f = 0; f < d.length / 2; f++) d[f * 2] = n[f * 2] * o + a, d[f * 2 + 1] = n[f * 2 + 1] * s + i; if (u > 0) { var p = Is(d, -u); h6 = Ls(p); } else h6 = d; } else h6 = n; for (var m, g, y, b, w = 0; w < h6.length / 2; w++) m = h6[w * 2], g = h6[w * 2 + 1], w < h6.length / 2 - 1 ? (y = h6[(w + 1) * 2], b = h6[(w + 1) * 2 + 1]) : (y = h6[0], b = h6[1]), c = Nn(e, r, a, i, m, g, y, b), c.length !== 0 && l.push(c[0], c[1]); return l; }; var a4 = function(e, r, n, a, i, o, s, u, l) { var c = [], d, v = new Array(n.length * 2); l.forEach(function(y, b) { b === 0 ? (v[v.length - 2] = y.startX, v[v.length - 1] = y.startY) : (v[b * 4 - 2] = y.startX, v[b * 4 - 1] = y.startY), v[b * 4] = y.stopX, v[b * 4 + 1] = y.stopY, d = Ni(e, r, a, i, y.cx, y.cy, y.radius), d.length !== 0 && c.push(d[0], d[1]); }); for (var h6 = 0; h6 < v.length / 4; h6++) d = Nn(e, r, a, i, v[h6 * 4], v[h6 * 4 + 1], v[h6 * 4 + 2], v[h6 * 4 + 3], false), d.length !== 0 && c.push(d[0], d[1]); if (c.length > 2) { for (var f = [c[0], c[1]], p = Math.pow(f[0] - e, 2) + Math.pow(f[1] - r, 2), m = 1; m < c.length / 2; m++) { var g = Math.pow(c[m * 2] - e, 2) + Math.pow(c[m * 2 + 1] - r, 2); g <= p && (f[0] = c[m * 2], f[1] = c[m * 2 + 1], p = g); } return f; } return c; }; var Yo = 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]]; }; var sr = function(e, r) { var n = su(e, r); return n = gp(n), n; }; var gp = 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), v = 0; v < a; v++) r = e[2 * v] = e[2 * v] * c, n = e[2 * v + 1] = e[2 * v + 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 h6 = 0; h6 < a; h6++) n = e[2 * h6 + 1] = e[2 * h6 + 1] + (-1 - o); return e; }; var su = 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; }; var ba = function(e, r) { return Math.min(e / 4, r / 4, 8); }; var mp = function(e, r) { return Math.min(e / 10, r / 10, 8); }; var hc = function() { return 8; }; var i4 = function(e, r, n) { return [e - 2 * r + n, 2 * (r - e), e]; }; var lu = function(e, r) { return { heightOffset: Math.min(15, 0.05 * r), widthOffset: Math.min(100, 0.25 * e), ctrlPtOffsetPct: 0.05 }; }; var o4 = Wt({ dampingFactor: 0.8, precision: 1e-6, iterations: 200, weight: function(e) { return 1; } }); var s4 = { pageRank: function(e) { for (var r = o4(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, v = d * d, h6 = c.length, f = new Array(v), p = new Array(d), m = (1 - n) / d, g = 0; g < d; g++) { for (var y = 0; y < d; y++) { var b = g * d + y; f[b] = 0; } p[g] = 0; } for (var w = 0; w < h6; w++) { var x = c[w], E = x.data("source"), C = x.data("target"); if (E !== C) { var T = l.indexOfId(E), k = l.indexOfId(C), _ = o(x), D = k * d + T; f[D] += _, p[T] += _; } } for (var O = 1 / d + m, F = 0; F < d; F++) if (p[F] === 0) for (var L = 0; L < d; L++) { var B = L * d + F; f[B] = O; } else for (var I = 0; I < d; I++) { var M = I * d + F; f[M] = f[M] / p[F] + m; } for (var A = new Array(d), R = new Array(d), K, H = 0; H < d; H++) A[H] = 1; for (var q = 0; q < i; q++) { for (var ee = 0; ee < d; ee++) R[ee] = 0; for (var se = 0; se < d; se++) for (var oe = 0; oe < d; oe++) { var ae = se * d + oe; R[se] += f[ae] * A[oe]; } q5(R), K = A, A = R, R = K; for (var ue = 0, te = 0; te < d; te++) { var $ = K[te] - A[te]; ue += $ * $; } if (ue < a) break; } var G = { rank: function(ge) { return ge = s.collection(ge)[0], A[l.indexOf(ge)]; } }; return G; } // pageRank }; var df = Wt({ root: null, weight: function(e) { return 1; }, directed: false, alpha: 0 }); var Wa = { degreeCentralityNormalized: function(e) { e = df(e); var r = this.cy(), n = this.nodes(), a = n.length; if (e.directed) { for (var c = {}, d = {}, v = 0, h6 = 0, f = 0; f < a; f++) { var p = n[f], m = p.id(); e.root = p; var g = this.degreeCentrality(e); v < g.indegree && (v = g.indegree), h6 < g.outdegree && (h6 = g.outdegree), c[m] = g.indegree, d[m] = g.outdegree; } return { indegree: function(b) { return v == 0 ? 0 : (Fe(b) && (b = r.filter(b)), c[b.id()] / v); }, outdegree: function(b) { return h6 === 0 ? 0 : (Fe(b) && (b = r.filter(b)), d[b.id()] / h6); } }; } 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 : (Fe(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 = df(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 h6 = i.connectedEdges(), f = h6.filter(function(E) { return E.target().same(i) && n.has(E); }), p = h6.filter(function(E) { return E.source().same(i) && n.has(E); }), m = f.length, g = p.length, y = 0, b = 0, w = 0; w < f.length; w++) y += o(f[w]); for (var x = 0; x < p.length; x++) b += o(p[x]); return { indegree: Math.pow(m, 1 - u) * Math.pow(y, u), outdegree: Math.pow(g, 1 - u) * Math.pow(b, u) }; } else { for (var l = i.connectedEdges().intersection(n), c = l.length, d = 0, v = 0; v < l.length; v++) d += o(l[v]); return { degree: Math.pow(c, 1 - u) * Math.pow(d, u) }; } } // degreeCentrality }; Wa.dc = Wa.degreeCentrality; Wa.dcn = Wa.degreeCentralityNormalised = Wa.degreeCentralityNormalized; var ff = Wt({ harmonic: true, weight: function() { return 1; }, directed: false, root: null }); var Ya = { closenessCentralityNormalized: function(e) { for (var r = ff(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 v = 0, h6 = l[d], f = 0; f < l.length; f++) if (d !== f) { var p = c.distance(h6, l[f]); n ? v += 1 / p : v += p; } n || (v = 1 / v), u < v && (u = v), s[h6.id()] = v; } return { closeness: function(g) { return u == 0 ? 0 : (Fe(g) ? g = o.filter(g)[0].id() : g = g.id(), s[g] / u); } }; }, // Implemented from pseudocode from wikipedia closenessCentrality: function(e) { var r = ff(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 v = s.distanceTo(d); o ? u += 1 / v : u += v; } } return o ? u : 1 / u; } // closenessCentrality }; Ya.cc = Ya.closenessCentrality; Ya.ccn = Ya.closenessCentralityNormalised = Ya.closenessCentralityNormalized; var l4 = Wt({ weight: null, directed: false }); var uu = { // 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 = l4(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]; } }, v = 0; v < s.length; v++) { var h6 = s[v], f = h6.id(); n ? u[f] = h6.outgoers().nodes() : u[f] = h6.openNeighborhood().nodes(), d.set(f, 0); } for (var p = function(b) { for (var w = s[b].id(), x = [], E = {}, C = {}, T = {}, k = new Oo(function(oe, ae) { return T[oe] - T[ae]; }), _ = 0; _ < s.length; _++) { var D = s[_].id(); E[D] = [], C[D] = 0, T[D] = 1 / 0; } for (C[w] = 1, T[w] = 0, k.push(w); !k.empty(); ) { var O = k.pop(); if (x.push(O), i) for (var F = 0; F < u[O].length; F++) { var L = u[O][F], B = o.getElementById(O), I = void 0; B.edgesTo(L).length > 0 ? I = B.edgesTo(L)[0] : I = L.edgesTo(B)[0]; var M = a(I); L = L.id(), T[L] > T[O] + M && (T[L] = T[O] + M, k.nodes.indexOf(L) < 0 ? k.push(L) : k.updateItem(L), C[L] = 0, E[L] = []), T[L] == T[O] + M && (C[L] = C[L] + C[O], E[L].push(O)); } else for (var A = 0; A < u[O].length; A++) { var R = u[O][A].id(); T[R] == 1 / 0 && (k.push(R), T[R] = T[O] + 1), T[R] == T[O] + 1 && (C[R] = C[R] + C[O], E[R].push(O)); } } for (var K = {}, H = 0; H < s.length; H++) K[s[H].id()] = 0; for (; x.length > 0; ) { for (var q = x.pop(), ee = 0; ee < E[q].length; ee++) { var se = E[q][ee]; K[se] = K[se] + C[se] / C[q] * (1 + K[q]); } q != s[b].id() && d.set(q, d.get(q) + K[q]); } }, m = 0; m < s.length; m++) p(m); var g = { 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 g.betweennessNormalised = g.betweennessNormalized, g; } // betweennessCentrality }; uu.bc = uu.betweennessCentrality; var u4 = Wt({ 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(t13) { return 1; } ] }); var c4 = function(e) { return u4(e); }; var d4 = function(e, r) { for (var n = 0, a = 0; a < r.length; a++) n += r[a](e); return n; }; var f4 = function(e, r, n) { for (var a = 0; a < r; a++) e[a * r + a] = n; }; var yp = 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; } }; var v4 = 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; }; var h4 = function(e, r, n) { for (var a = e.slice(0), i = 1; i < n; i++) e = v4(e, a, r); return e; }; var p4 = 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 yp(a, r), a; }; var g4 = 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 false; } return true; }; var m4 = 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; }; var y4 = function(e, r) { for (var n = 0; n < e.length; n++) if (!r[n] || e[n].id() !== r[n].id()) return false; return true; }; var b4 = function(e) { for (var r = 0; r < e.length; r++) for (var n = 0; n < e.length; n++) r != n && y4(e[r], e[n]) && e.splice(n, 1); return e; }; var vf = function(e) { for (var r = this.nodes(), n = this.edges(), a = this.cy(), i = c4(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, v = 0; v < l; v++) c[v] = 0; for (var h6 = 0; h6 < n.length; h6++) { var f = n[h6], p = o[f.source().id()], m = o[f.target().id()], g = d4(f, i.attributes); c[p * u + m] += g, c[m * u + p] += g; } f4(c, u, i.multFactor), yp(c, u); for (var y = true, b = 0; y && b < i.maxIterations; ) y = false, d = h4(c, u, i.expandFactor), c = p4(d, u, i.inflateFactor), g4(c, d, l, 4) || (y = true), b++; var w = m4(c, u, r, a); return w = b4(w), w; }; var w4 = { markovClustering: vf, mcl: vf }; var C4 = function(e) { return e; }; var bp = function(e, r) { return Math.abs(r - e); }; var hf = function(e, r, n) { return e + bp(r, n); }; var pf = function(e, r, n) { return e + Math.pow(n - r, 2); }; var x4 = function(e) { return Math.sqrt(e); }; var E4 = function(e, r, n) { return Math.max(e, bp(r, n)); }; var Oi = function(e, r, n, a, i) { for (var o = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : C4, s = a, u, l, c = 0; c < e; c++) u = r(c), l = n(c), s = i(s, u, l); return o(s); }; var si = { euclidean: function(e, r, n) { return e >= 2 ? Oi(e, r, n, 0, pf, x4) : Oi(e, r, n, 0, hf); }, squaredEuclidean: function(e, r, n) { return Oi(e, r, n, 0, pf); }, manhattan: function(e, r, n) { return Oi(e, r, n, 0, hf); }, max: function(e, r, n) { return Oi(e, r, n, -1 / 0, E4); } }; si["squared-euclidean"] = si.squaredEuclidean; si.squaredeuclidean = si.squaredEuclidean; function al(t13, e, r, n, a, i) { var o; return pt(t13) ? o = t13 : o = si[t13] || si.euclidean, e === 0 && pt(t13) ? o(a, i) : o(e, r, n, a, i); } var k4 = Wt({ k: 2, m: 2, sensitivityThreshold: 1e-4, distance: "euclidean", maxIterations: 10, attributes: [], testMode: false, testCentroids: null }); var pc = function(e) { return k4(e); }; var Fs = 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(v) { return a[v](r); }, l = n, c = r; return al(e, a.length, s, u, l, c); }; var Nl = 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; }; var wp = function(e, r, n, a, i) { for (var o = 1 / 0, s = 0, u = 0; u < r.length; u++) { var l = Fs(n, e, r[u], a, i); l < o && (o = l, s = u); } return s; }; var Cp = 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; }; var S4 = function(e, r, n) { return Math.abs(r - e) <= n; }; var T4 = 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 false; } return true; }; var _4 = function(e, r, n) { for (var a = 0; a < n; a++) if (e === r[a]) return true; return false; }; var gf = 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)]; _4(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; }; var mf = function(e, r, n) { for (var a = 0, i = 0; i < r.length; i++) a += Fs("manhattan", r[i], e, n, "kMedoids"); return a; }; var D4 = function(e) { var r = this.cy(), n = this.nodes(), a = null, i = pc(e), o = new Array(i.k), s = {}, u; i.testMode ? typeof i.testCentroids == "number" ? (i.testCentroids, u = Nl(n, i.k, i.attributes)) : Ft(i.testCentroids) === "object" ? u = i.testCentroids : u = Nl(n, i.k, i.attributes) : u = Nl(n, i.k, i.attributes); for (var l = true, c = 0; l && c < i.maxIterations; ) { for (var d = 0; d < n.length; d++) a = n[d], s[a.id()] = wp(a, u, i.distance, i.attributes, "kMeans"); l = false; for (var v = 0; v < i.k; v++) { var h6 = Cp(v, n, s); if (h6.length !== 0) { for (var f = i.attributes.length, p = u[v], m = new Array(f), g = new Array(f), y = 0; y < f; y++) { g[y] = 0; for (var b = 0; b < h6.length; b++) a = h6[b], g[y] += i.attributes[y](a); m[y] = g[y] / h6.length, S4(m[y], p[y], i.sensitivityThreshold) || (l = true); } u[v] = m, o[v] = r.collection(h6); } } c++; } return o; }; var P4 = function(e) { var r = this.cy(), n = this.nodes(), a = null, i = pc(e), o = new Array(i.k), s, u = {}, l, c = new Array(i.k); i.testMode ? typeof i.testCentroids == "number" || (Ft(i.testCentroids) === "object" ? s = i.testCentroids : s = gf(n, i.k)) : s = gf(n, i.k); for (var d = true, v = 0; d && v < i.maxIterations; ) { for (var h6 = 0; h6 < n.length; h6++) a = n[h6], u[a.id()] = wp(a, s, i.distance, i.attributes, "kMedoids"); d = false; for (var f = 0; f < s.length; f++) { var p = Cp(f, n, u); if (p.length !== 0) { c[f] = mf(s[f], p, i.attributes); for (var m = 0; m < p.length; m++) l = mf(p[m], p, i.attributes), l < c[f] && (c[f] = l, s[f] = p[m], d = true); o[f] = r.collection(p); } } v++; } return o; }; var O4 = 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 v = 0; v < r.length; v++) o += a[v][c] * i.attributes[d](r[v]), s += a[v][c]; e[c][d] = o / s; } }; var L4 = 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 v = 0; v < a.length; v++) { s = 0; for (var h6 = 0; h6 < n.length; h6++) u = Fs(i.distance, a[v], n[d], i.attributes, "cmeans"), l = Fs(i.distance, a[v], n[h6], i.attributes, "cmeans"), s += Math.pow(u / l, c); e[v][d] = 1 / s; } }; var I4 = 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; }; var yf = function(e) { var r = this.cy(), n = this.nodes(), a = pc(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 v = 0; v < n.length; v++) { for (var h6 = 0, f = 0; f < a.k; f++) s[v][f] = Math.random(), h6 += s[v][f]; for (var p = 0; p < a.k; p++) s[v][p] = s[v][p] / h6; } o = new Array(a.k); for (var m = 0; m < a.k; m++) o[m] = new Array(a.attributes.length); l = new Array(n.length); for (var g = 0; g < n.length; g++) l[g] = new Array(a.k); for (var y = true, b = 0; y && b < a.maxIterations; ) y = false, O4(o, n, s, l, a), L4(s, u, o, n, a), T4(s, u, a.sensitivityThreshold) || (y = true), b++; return i = I4(n, s, a, r), { clusters: i, degreeOfMembership: s }; }; var F4 = { kMeans: D4, kMedoids: P4, fuzzyCMeans: yf, fcm: yf }; var A4 = Wt({ 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: false, // 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 }); var M4 = { single: "min", complete: "max" }; var B4 = function(e) { var r = A4(e), n = M4[r.linkage]; return n != null && (r.linkage = n), r; }; var bf = function(e, r, n, a, i) { for (var o = 0, s = 1 / 0, u, l = i.attributes, c = function(k, _) { return al(i.distance, l.length, function(D) { return l[D](k); }, function(D) { return l[D](_); }, k, _); }, d = 0; d < e.length; d++) { var v = e[d].key, h6 = n[v][a[v]]; h6 < s && (o = v, s = h6); } if (i.mode === "threshold" && s >= i.threshold || i.mode === "dendrogram" && e.length === 1) return false; var f = r[o], p = r[a[o]], m; i.mode === "dendrogram" ? m = { left: f, right: p, key: f.key } : m = { value: f.value.concat(p.value), key: f.key }, e[f.index] = m, e.splice(p.index, 1), r[f.key] = m; for (var g = 0; g < e.length; g++) { var y = e[g]; f.key === y.key ? u = 1 / 0 : i.linkage === "min" ? (u = n[f.key][y.key], n[f.key][y.key] > n[p.key][y.key] && (u = n[p.key][y.key])) : i.linkage === "max" ? (u = n[f.key][y.key], n[f.key][y.key] < n[p.key][y.key] && (u = n[p.key][y.key])) : i.linkage === "mean" ? u = (n[f.key][y.key] * f.size + n[p.key][y.key] * p.size) / (f.size + p.size) : i.mode === "dendrogram" ? u = c(y.value, f.value) : u = c(y.value[0], f.value[0]), n[f.key][y.key] = n[y.key][f.key] = u; } for (var b = 0; b < e.length; b++) { var w = e[b].key; if (a[w] === f.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 f.key = p.key = f.index = p.index = null, true; }; var Zo = function t(e, r, n) { e && (e.value ? r.push(e.value) : (e.left && t(e.left, r), e.right && t(e.right, r))); }; var N4 = function t3(e, r) { if (!e) return ""; if (e.left && e.right) { var n = t3(e.left, r), a = t3(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(); }; var $4 = function t6(e, r, n) { if (!e) return []; var a = [], i = [], o = []; return r === 0 ? (e.left && Zo(e.left, a), e.right && Zo(e.right, i), o = a.concat(i), [n.collection(o)]) : r === 1 ? e.value ? [n.collection(e.value)] : (e.left && Zo(e.left, a), e.right && Zo(e.right, i), [n.collection(a), n.collection(i)]) : e.value ? [n.collection(e.value)] : (e.left && (a = t6(e.left, r - 1, n)), e.right && (i = t6(e.right, r - 1, n)), a.concat(i)); }; var wf = function(e) { for (var r = this.cy(), n = this.nodes(), a = B4(e), i = a.attributes, o = function(b, w) { return al(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 v = { value: a.mode === "dendrogram" ? n[d] : [n[d]], key: d, index: d }; s[d] = v, c[d] = v, u[d] = [], l[d] = 0; } for (var h6 = 0; h6 < s.length; h6++) for (var f = 0; f <= h6; f++) { var p = void 0; a.mode === "dendrogram" ? p = h6 === f ? 1 / 0 : o(s[h6].value, s[f].value) : p = h6 === f ? 1 / 0 : o(s[h6].value[0], s[f].value[0]), u[h6][f] = p, u[f][h6] = p, p < u[h6][l[h6]] && (l[h6] = f); } for (var m = bf(s, c, u, l, a); m; ) m = bf(s, c, u, l, a); var g; return a.mode === "dendrogram" ? (g = $4(s[0], a.dendrogramDepth, r), a.addDendrogram && N4(s[0], r)) : (g = new Array(s.length), s.forEach(function(y, b) { y.key = y.index = null, g[b] = r.collection(y.value); })), g; }; var R4 = { hierarchicalClustering: wf, hca: wf }; var z4 = Wt({ 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') ] }); var V4 = function(e) { var r = e.damping, n = e.preference; 0.5 <= r && r < 1 || yt("Damping must range on [0.5, 1). Got: ".concat(r)); var a = ["median", "mean", "min", "max"]; return a.some(function(i) { return i === n; }) || be(n) || yt("Preference must be one of [".concat(a.map(function(i) { return "'".concat(i, "'"); }).join(", "), "] or a number. Got: ").concat(n)), z4(e); }; var H4 = function(e, r, n, a) { var i = function(s, u) { return a[u](s); }; return -al(e, a.length, function(o) { return i(r, o); }, function(o) { return i(n, o); }, r, n); }; var q4 = function(e, r) { var n = null; return r === "median" ? n = V5(e) : r === "mean" ? n = z5(e) : r === "min" ? n = $5(e) : r === "max" ? n = R5(e) : n = r, n; }; var K4 = 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; }; var Cf = 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; }; var U4 = function(e, r, n) { for (var a = Cf(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, v = 0; v < o.length; v++) d += r[o[v] * e + o[c]]; d > l && (u = c, l = d); } n[i] = o[u]; } return a = Cf(e, r, n), a; }; var xf = function(e) { for (var r = this.cy(), n = this.nodes(), a = V4(e), i = {}, o = 0; o < n.length; o++) i[n[o].id()] = o; var s, u, l, c, d, v; s = n.length, u = s * s, l = new Array(u); for (var h6 = 0; h6 < u; h6++) l[h6] = -1 / 0; for (var f = 0; f < s; f++) for (var p = 0; p < s; p++) f !== p && (l[f * s + p] = H4(a.distance, n[f], n[p], a.attributes)); c = q4(l, a.preference); for (var m = 0; m < s; m++) l[m * s + m] = c; d = new Array(u); for (var g = 0; g < u; g++) d[g] = 0; v = new Array(u); for (var y = 0; y < u; y++) v[y] = 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), T = 0; T < C.length; T++) C[T] = 0; var k; for (k = 0; k < a.maxIterations; k++) { for (var _ = 0; _ < s; _++) { for (var D = -1 / 0, O = -1 / 0, F = -1, L = 0, B = 0; B < s; B++) b[B] = d[_ * s + B], L = v[_ * s + B] + l[_ * s + B], L >= D ? (O = D, D = L, F = B) : L > O && (O = L); for (var I = 0; I < s; I++) d[_ * s + I] = (1 - a.damping) * (l[_ * s + I] - D) + a.damping * b[I]; d[_ * s + F] = (1 - a.damping) * (l[_ * s + F] - O) + a.damping * b[F]; } for (var M = 0; M < s; M++) { for (var A = 0, R = 0; R < s; R++) b[R] = v[R * s + M], w[R] = Math.max(0, d[R * s + M]), A += w[R]; A -= w[M], w[M] = d[M * s + M], A += w[M]; for (var K = 0; K < s; K++) v[K * s + M] = (1 - a.damping) * Math.min(0, A - w[K]) + a.damping * b[K]; v[M * s + M] = (1 - a.damping) * (A - w[M]) + a.damping * b[M]; } for (var H = 0, q = 0; q < s; q++) { var ee = v[q * s + q] + d[q * s + q] > 0 ? 1 : 0; C[k % a.minIterations * s + q] = ee, H += ee; } if (H > 0 && (k >= a.minIterations - 1 || k == a.maxIterations - 1)) { for (var se = 0, oe = 0; oe < s; oe++) { x[oe] = 0; for (var ae = 0; ae < a.minIterations; ae++) x[oe] += C[ae * s + oe]; (x[oe] === 0 || x[oe] === a.minIterations) && se++; } if (se === s) break; } } for (var ue = K4(s, d, v), te = U4(s, l, ue), $ = {}, G = 0; G < ue.length; G++) $[ue[G]] = []; for (var Q = 0; Q < n.length; Q++) { var ge = i[n[Q].id()], Ee = te[ge]; Ee != null && $[Ee].push(n[Q]); } for (var fe = new Array(ue.length), me = 0; me < ue.length; me++) fe[me] = r.collection($[ue[me]]); return fe; }; var G4 = { affinityPropagation: xf, ap: xf }; var W4 = Wt({ root: void 0, directed: false }); var Y4 = { hierholzer: function(e) { if (!Xe(e)) { var r = arguments; e = { root: r[0], directed: r[1] }; } var n = W4(e), a = n.root, i = n.directed, o = this, s = false, u, l, c; a && (c = Fe(a) ? this.filter(a)[0].id() : a[0].id()); var d = {}, v = {}; i ? o.forEach(function(y) { var b = y.id(); if (y.isNode()) { var w = y.indegree(true), x = y.outdegree(true), E = w - x, C = x - w; E == 1 ? u ? s = true : u = b : C == 1 ? l ? s = true : l = b : (C > 1 || E > 1) && (s = true), d[b] = [], y.outgoers().forEach(function(T) { T.isEdge() && d[b].push(T.id()); }); } else v[b] = [void 0, y.target().id()]; }) : o.forEach(function(y) { var b = y.id(); if (y.isNode()) { var w = y.degree(true); w % 2 && (u ? l ? s = true : l = b : u = b), d[b] = [], y.connectedEdges().forEach(function(x) { return d[b].push(x.id()); }); } else v[b] = [y.source().id(), y.target().id()]; }); var h6 = { found: false, trail: void 0 }; if (s) return h6; if (l && u) if (i) { if (c && l != c) return h6; c = l; } else { if (c && l != c && u != c) return h6; c || (c = l); } else c || (c = o[0].id()); var f = function(b) { for (var w = b, x = [b], E, C, T; d[w].length; ) E = d[w].shift(), C = v[E][0], T = v[E][1], w != T ? (d[T] = d[T].filter(function(k) { return k != E; }), w = T) : !i && w != C && (d[C] = d[C].filter(function(k) { return k != E; }), w = C), x.unshift(E), x.unshift(w); return x; }, p = [], m = []; for (m = f(c); m.length != 1; ) d[m[0]].length == 0 ? (p.unshift(o.getElementById(m.shift())), p.unshift(o.getElementById(m.shift()))) : m = f(m.shift()).concat(m); p.unshift(o.getElementById(m.shift())); for (var g in d) if (d[g].length) return h6; return h6.found = true, h6.trail = this.spawn(p, true), h6; } }; var Xo = function() { var e = this, r = {}, n = 0, a = 0, i = [], o = [], s = {}, u = function(v, h6) { for (var f = o.length - 1, p = [], m = e.spawn(); o[f].x != v || o[f].y != h6; ) p.push(o.pop().edge), f--; p.push(o.pop().edge), p.forEach(function(g) { var y = g.connectedNodes().intersection(e); m.merge(g), y.forEach(function(b) { var w = b.id(), x = b.connectedEdges().intersection(e); m.merge(b), r[w].cutVertex ? m.merge(x.filter(function(E) { return E.isLoop(); })) : m.merge(x); }); }), i.push(m); }, l = function d(v, h6, f) { v === f && (a += 1), r[h6] = { id: n, low: n++, cutVertex: false }; var p = e.getElementById(h6).connectedEdges().intersection(e); if (p.size() === 0) i.push(e.spawn(e.getElementById(h6))); else { var m, g, y, b; p.forEach(function(w) { m = w.source().id(), g = w.target().id(), y = m === h6 ? g : m, y !== f && (b = w.id(), s[b] || (s[b] = true, o.push({ x: h6, y, edge: w })), y in r ? r[h6].low = Math.min(r[h6].low, r[y].id) : (d(v, y, h6), r[h6].low = Math.min(r[h6].low, r[y].low), r[h6].id <= r[y].low && (r[h6].cutVertex = true, u(h6, y)))); }); } }; e.forEach(function(d) { if (d.isNode()) { var v = d.id(); v in r || (a = 0, l(v, v), r[v].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 }; }; var Z4 = { hopcroftTarjanBiconnected: Xo, htbc: Xo, htb: Xo, hopcroftTarjanBiconnectedComponents: Xo }; var jo = 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: false }; var c = e.getElementById(l).connectedEdges().intersection(e); if (c.forEach(function(p) { var m = p.target().id(); m !== l && (m in r || u(m), r[m].explored || (r[l].low = Math.min(r[l].low, r[m].low))); }), r[l].index === r[l].low) { for (var d = e.spawn(); ; ) { var v = i.pop(); if (d.merge(e.getElementById(v)), r[v].low = r[l].index, r[v].explored = true, v === l) break; } var h6 = d.edgesWith(d), f = d.merge(h6); a.push(f), o = o.difference(f); } }; return e.forEach(function(u) { if (u.isNode()) { var l = u.id(); l in r || s(l); } }), { cut: o, components: a }; }; var X4 = { tarjanStronglyConnected: jo, tsc: jo, tscc: jo, tarjanStronglyConnectedComponents: jo }; var xp = {}; [ao, T5, _5, P5, L5, F5, B5, s4, Wa, Ya, uu, w4, F4, R4, G4, Y4, Z4, X4].forEach(function(t13) { Re(xp, t13); }); var Ep = 0; var kp = 1; var Sp = 2; var yn = function t7(e) { if (!(this instanceof t7)) return new t7(e); this.id = "Thenable/1.0.7", this.state = Ep, 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)); }; yn.prototype = { /* promise resolving methods */ fulfill: function(e) { return Ef(this, kp, "fulfillValue", e); }, reject: function(e) { return Ef(this, Sp, "rejectReason", e); }, /* "The then Method" [Promises/A+ 1.1, 1.2, 2.2] */ then: function(e, r) { var n = this, a = new yn(); return n.onFulfilled.push(Sf(e, a, "fulfill")), n.onRejected.push(Sf(r, a, "reject")), Tp(n), a.proxy; } }; var Ef = function(e, r, n, a) { return e.state === Ep && (e.state = r, e[n] = a, Tp(e)), e; }; var Tp = function(e) { e.state === kp ? kf(e, "onFulfilled", e.fulfillValue) : e.state === Sp && kf(e, "onRejected", e.rejectReason); }; var kf = 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); } }; var Sf = 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; } j4(r, i); } }; }; var j4 = function t8(e, r) { if (e === r || e.proxy === r) { e.reject(new TypeError("cannot resolve promise with itself")); return; } var n; if (Ft(r) === "object" && r !== null || typeof r == "function") try { n = r.then; } catch (i) { e.reject(i); return; } if (typeof n == "function") { var a = false; try { n.call( r, /* resolvePromise */ /* [Promises/A+ 2.3.3.3.1] */ function(i) { a || (a = true, i === r ? e.reject(new TypeError("circular thenable chain")) : t8(e, i)); }, /* rejectPromise */ /* [Promises/A+ 2.3.3.3.2] */ function(i) { a || (a = true, e.reject(i)); } ); } catch (i) { a || e.reject(i); } return; } e.fulfill(r); }; yn.all = function(t13) { return new yn(function(e, r) { for (var n = new Array(t13.length), a = 0, i = function(u, l) { n[u] = l, a++, a === t13.length && e(n); }, o = 0; o < t13.length; o++) (function(s) { var u = t13[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); }); }; yn.resolve = function(t13) { return new yn(function(e, r) { e(t13); }); }; yn.reject = function(t13) { return new yn(function(e, r) { r(t13); }); }; var hi = typeof Promise < "u" ? Promise : yn; var cu = function(e, r, n) { var a = sc(e), i = !a, o = this._private = Re({ duration: 1e3 }, r, n); if (o.target = e, o.style = o.style || o.css, o.started = false, o.playing = false, o.hooked = false, o.applying = false, o.progress = 0, o.completes = [], o.frames = [], o.complete && pt(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; }; var wa = cu.prototype; Re(wa, { 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), yr(e.target) && e.target.cy().addToAnimationPool(e.target), e.hooked = true; } return this; }, play: function() { var e = this._private; return e.progress === 1 && (e.progress = 0), e.playing = true, e.started = false, e.stopped = false, this.hook(), this; }, playing: function() { return this._private.playing; }, apply: function() { var e = this._private; return e.applying = true, e.started = false, e.stopped = false, this.hook(), this; }, applying: function() { return this._private.applying; }, pause: function() { var e = this._private; return e.playing = false, e.started = false, this; }, stop: function() { var e = this._private; return e.playing = false, e.started = false, e.stopped = true, 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 = false, 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 = false; 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 hi(function(a, i) { n.push(function() { a(); }); }); } }); wa.complete = wa.completed; wa.run = wa.play; wa.running = wa.playing; var Q4 = { 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 false; 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 = Re({}, r, n); var d = Object.keys(r).length === 0; if (d) return new cu(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 v = r.renderedPosition, h6 = s.pan(), f = s.zoom(); r.position = dp(v, f, h6); } if (u && r.panBy != null) { var p = r.panBy, m = s.pan(); r.pan = { x: m.x + p.x, y: m.y + p.y }; } var g = r.center || r.centre; if (u && g != null) { var y = s.getCenterPan(g.eles, r.zoom); y != null && (r.pan = y); } 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 cu(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 = Re({}, 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: true } : 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, v = 0; v < d.length; v++) { var h6 = d[v], f = h6._private; n && (f.duration = 0); } r && (c.animation.queue = []), n || (c.animation.current = []); } return s.notify("draw"), this; }; } // stop }; var J4 = Array.isArray; var il = J4; var e3 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; var t32 = /^\w*$/; function r3(t13, e) { if (il(t13)) return false; var r = typeof t13; return r == "number" || r == "symbol" || r == "boolean" || t13 == null || Po(t13) ? true : t32.test(t13) || !e3.test(t13) || e != null && t13 in Object(e); } var n3 = r3; var a3 = "[object AsyncFunction]"; var i3 = "[object Function]"; var o3 = "[object GeneratorFunction]"; var s3 = "[object Proxy]"; function l3(t13) { if (!ga(t13)) return false; var e = rp(t13); return e == i3 || e == o3 || e == a3 || e == s3; } var u3 = l3; var c3 = el["__core-js_shared__"]; var $l = c3; var Tf = function() { var t13 = /[^.]+$/.exec($l && $l.keys && $l.keys.IE_PROTO || ""); return t13 ? "Symbol(src)_1." + t13 : ""; }(); function d3(t13) { return !!Tf && Tf in t13; } var f3 = d3; var v3 = Function.prototype; var h3 = v3.toString; function p3(t13) { if (t13 != null) { try { return h3.call(t13); } catch { } try { return t13 + ""; } catch { } } return ""; } var g3 = p3; var m3 = /[\\^$.*+?()[\]{}|]/g; var y3 = /^\[object .+?Constructor\]$/; var b3 = Function.prototype; var w3 = Object.prototype; var C3 = b3.toString; var x3 = w3.hasOwnProperty; var E3 = RegExp( "^" + C3.call(x3).replace(m3, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function k3(t13) { if (!ga(t13) || f3(t13)) return false; var e = u3(t13) ? E3 : y3; return e.test(g3(t13)); } var S3 = k3; function T3(t13, e) { return t13 == null ? void 0 : t13[e]; } var _3 = T3; function D3(t13, e) { var r = _3(t13, e); return S3(r) ? r : void 0; } var gc = D3; var P3 = gc(Object, "create"); var so = P3; function O3() { this.__data__ = so ? so(null) : {}, this.size = 0; } var L3 = O3; function I3(t13) { var e = this.has(t13) && delete this.__data__[t13]; return this.size -= e ? 1 : 0, e; } var F3 = I3; var A3 = "__lodash_hash_undefined__"; var M3 = Object.prototype; var B3 = M3.hasOwnProperty; function N3(t13) { var e = this.__data__; if (so) { var r = e[t13]; return r === A3 ? void 0 : r; } return B3.call(e, t13) ? e[t13] : void 0; } var $3 = N3; var R3 = Object.prototype; var z3 = R3.hasOwnProperty; function V3(t13) { var e = this.__data__; return so ? e[t13] !== void 0 : z3.call(e, t13); } var H3 = V3; var q3 = "__lodash_hash_undefined__"; function K3(t13, e) { var r = this.__data__; return this.size += this.has(t13) ? 0 : 1, r[t13] = so && e === void 0 ? q3 : e, this; } var U3 = K3; function pi(t13) { var e = -1, r = t13 == null ? 0 : t13.length; for (this.clear(); ++e < r; ) { var n = t13[e]; this.set(n[0], n[1]); } } pi.prototype.clear = L3; pi.prototype.delete = F3; pi.prototype.get = $3; pi.prototype.has = H3; pi.prototype.set = U3; var _f = pi; function G3() { this.__data__ = [], this.size = 0; } var W3 = G3; function Y3(t13, e) { return t13 === e || t13 !== t13 && e !== e; } var _p = Y3; function Z3(t13, e) { for (var r = t13.length; r--; ) if (_p(t13[r][0], e)) return r; return -1; } var ol = Z3; var X3 = Array.prototype; var j3 = X3.splice; function Q3(t13) { var e = this.__data__, r = ol(e, t13); if (r < 0) return false; var n = e.length - 1; return r == n ? e.pop() : j3.call(e, r, 1), --this.size, true; } var J3 = Q3; function e_(t13) { var e = this.__data__, r = ol(e, t13); return r < 0 ? void 0 : e[r][1]; } var t_ = e_; function r_(t13) { return ol(this.__data__, t13) > -1; } var n_ = r_; function a_(t13, e) { var r = this.__data__, n = ol(r, t13); return n < 0 ? (++this.size, r.push([t13, e])) : r[n][1] = e, this; } var i_ = a_; function gi(t13) { var e = -1, r = t13 == null ? 0 : t13.length; for (this.clear(); ++e < r; ) { var n = t13[e]; this.set(n[0], n[1]); } } gi.prototype.clear = W3; gi.prototype.delete = J3; gi.prototype.get = t_; gi.prototype.has = n_; gi.prototype.set = i_; var o_ = gi; var s_ = gc(el, "Map"); var l_ = s_; function u_() { this.size = 0, this.__data__ = { hash: new _f(), map: new (l_ || o_)(), string: new _f() }; } var c_ = u_; function d_(t13) { var e = typeof t13; return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t13 !== "__proto__" : t13 === null; } var f_ = d_; function v_(t13, e) { var r = t13.__data__; return f_(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map; } var sl = v_; function h_(t13) { var e = sl(this, t13).delete(t13); return this.size -= e ? 1 : 0, e; } var p_ = h_; function g_(t13) { return sl(this, t13).get(t13); } var m_ = g_; function y_(t13) { return sl(this, t13).has(t13); } var b_ = y_; function w_(t13, e) { var r = sl(this, t13), n = r.size; return r.set(t13, e), this.size += r.size == n ? 0 : 1, this; } var C_ = w_; function mi(t13) { var e = -1, r = t13 == null ? 0 : t13.length; for (this.clear(); ++e < r; ) { var n = t13[e]; this.set(n[0], n[1]); } } mi.prototype.clear = c_; mi.prototype.delete = p_; mi.prototype.get = m_; mi.prototype.has = b_; mi.prototype.set = C_; var Dp = mi; var x_ = "Expected a function"; function mc(t13, e) { if (typeof t13 != "function" || e != null && typeof e != "function") throw new TypeError(x_); 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 = t13.apply(this, n); return r.cache = i.set(a, o) || i, o; }; return r.cache = new (mc.Cache || Dp)(), r; } mc.Cache = Dp; var E_ = mc; var k_ = 500; function S_(t13) { var e = E_(t13, function(n) { return r.size === k_ && r.clear(), n; }), r = e.cache; return e; } var T_ = S_; var __ = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; var D_ = /\\(\\)?/g; var P_ = T_(function(t13) { var e = []; return t13.charCodeAt(0) === 46 && e.push(""), t13.replace(__, function(r, n, a, i) { e.push(a ? i.replace(D_, "$1") : n || r); }), e; }); var Pp = P_; function O_(t13, e) { for (var r = -1, n = t13 == null ? 0 : t13.length, a = Array(n); ++r < n; ) a[r] = e(t13[r], r, t13); return a; } var Op = O_; var L_ = 1 / 0; var Df = ii ? ii.prototype : void 0; var Pf = Df ? Df.toString : void 0; function Lp(t13) { if (typeof t13 == "string") return t13; if (il(t13)) return Op(t13, Lp) + ""; if (Po(t13)) return Pf ? Pf.call(t13) : ""; var e = t13 + ""; return e == "0" && 1 / t13 == -L_ ? "-0" : e; } var I_ = Lp; function F_(t13) { return t13 == null ? "" : I_(t13); } var Ip = F_; function A_(t13, e) { return il(t13) ? t13 : n3(t13, e) ? [t13] : Pp(Ip(t13)); } var Fp = A_; var M_ = 1 / 0; function B_(t13) { if (typeof t13 == "string" || Po(t13)) return t13; var e = t13 + ""; return e == "0" && 1 / t13 == -M_ ? "-0" : e; } var yc = B_; function N_(t13, e) { e = Fp(e, t13); for (var r = 0, n = e.length; t13 != null && r < n; ) t13 = t13[yc(e[r++])]; return r && r == n ? t13 : void 0; } var $_ = N_; function R_(t13, e, r) { var n = t13 == null ? void 0 : $_(t13, e); return n === void 0 ? r : n; } var z_ = R_; var V_ = function() { try { var t13 = gc(Object, "defineProperty"); return t13({}, "", {}), t13; } catch { } }(); var Of = V_; function H_(t13, e, r) { e == "__proto__" && Of ? Of(t13, e, { configurable: true, enumerable: true, value: r, writable: true }) : t13[e] = r; } var q_ = H_; var K_ = Object.prototype; var U_ = K_.hasOwnProperty; function G_(t13, e, r) { var n = t13[e]; (!(U_.call(t13, e) && _p(n, r)) || r === void 0 && !(e in t13)) && q_(t13, e, r); } var W_ = G_; var Y_ = 9007199254740991; var Z_ = /^(?:0|[1-9]\d*)$/; function X_(t13, e) { var r = typeof t13; return e = e ?? Y_, !!e && (r == "number" || r != "symbol" && Z_.test(t13)) && t13 > -1 && t13 % 1 == 0 && t13 < e; } var j_ = X_; function Q_(t13, e, r, n) { if (!ga(t13)) return t13; e = Fp(e, t13); for (var a = -1, i = e.length, o = i - 1, s = t13; s != null && ++a < i; ) { var u = yc(e[a]), l = r; if (u === "__proto__" || u === "constructor" || u === "prototype") return t13; if (a != o) { var c = s[u]; l = n ? n(c, u, s) : void 0, l === void 0 && (l = ga(c) ? c : j_(e[a + 1]) ? [] : {}); } W_(s, u, l), s = s[u]; } return t13; } var J_ = Q_; function eD(t13, e, r) { return t13 == null ? t13 : J_(t13, e, r); } var tD = eD; function rD(t13, e) { var r = -1, n = t13.length; for (e || (e = Array(n)); ++r < n; ) e[r] = t13[r]; return e; } var nD = rD; function aD(t13) { return il(t13) ? Op(t13, yc) : Po(t13) ? [t13] : nD(Pp(Ip(t13))); } var iD = aD; var oD = { // access data field data: function(e) { var r = { field: "data", bindingEvent: "data", allowBinding: false, allowSetting: false, allowGetting: false, settingEvent: "data", settingTriggersEvent: false, triggerFnName: "trigger", immutableKeys: {}, // key => true if immutable updateStyle: false, beforeGet: function(a) { }, beforeSet: function(a, i) { }, onSet: function(a) { }, canSet: function(a) { return true; } }; return e = Re({}, 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 (Fe(a)) { var d = a.indexOf(".") !== -1, v = d && iD(a); if (o.allowGetting && i === void 0) { var h6; return c && (o.beforeGet(c), v && c._private[o.field][a] === void 0 ? h6 = z_(c._private[o.field], v) : h6 = c._private[o.field][a]), h6; } else if (o.allowSetting && i !== void 0) { var f = !o.immutableKeys[a]; if (f) { var p = Uh({}, a, i); o.beforeSet(s, p); for (var m = 0, g = l.length; m < g; m++) { var y = l[m]; o.canSet(y) && (v && c._private[o.field][a] === void 0 ? tD(y._private[o.field], v, i) : y._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 T = !o.immutableKeys[w]; if (T) for (var k = 0; k < l.length; k++) { var _ = l[k]; 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 && pt(a)) { var D = a; s.on(o.bindingEvent, D); } 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: false, immutableKeys: {} // key => true if immutable }; return e = Re({}, r, e), function(a) { var i = e, o = this, s = o.length !== void 0, u = s ? o : [o]; if (Fe(a)) { for (var l = a.split(/\s+/), c = l.length, d = 0; d < c; d++) { var v = l[d]; if (!qn(v)) { var h6 = !i.immutableKeys[v]; if (h6) for (var f = 0, p = u.length; f < p; f++) u[f]._private[i.field][v] = void 0; } } i.triggerEvent && o[i.triggerFnName](i.event); } else if (a === void 0) { for (var m = 0, g = u.length; m < g; m++) for (var y = u[m]._private[i.field], b = Object.keys(y), w = 0; w < b.length; w++) { var x = b[w], E = !i.immutableKeys[x]; E && (y[x] = void 0); } i.triggerEvent && o[i.triggerFnName](i.event); } return o; }; } // removeData }; var sD = { 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 hi(function(s, u) { var l = function(h6) { i.off.apply(i, d), s(h6); }, c = o.concat([l]), d = c.concat([]); i.on.apply(i, c); }); }; } }; var et = {}; [Q4, oD, sD].forEach(function(t13) { Re(et, t13); }); var lD = { animate: et.animate(), animation: et.animation(), animated: et.animated(), clearQueue: et.clearQueue(), delay: et.delay(), delayAnimation: et.delayAnimation(), stop: et.stop() }; var ds = { classes: function(e) { var r = this; if (e === void 0) { var n = []; return r[0]._private.classes.forEach(function(f) { return n.push(f); }), n; } else st(e) || (e = (e || "").match(/\S+/g) || []); for (var a = [], i = new vi(e), o = 0; o < r.length; o++) { for (var s = r[o], u = s._private, l = u.classes, c = false, d = 0; d < e.length; d++) { var v = e[d], h6 = l.has(v); if (!h6) { c = true; 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, true); }, hasClass: function(e) { var r = this[0]; return r != null && r._private.classes.has(e); }, toggleClass: function(e, r) { st(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 = false, d = 0; d < e.length; d++) { var v = e[d], h6 = l.has(v), f = false; r || a && !h6 ? (l.add(v), f = true) : (!r || a && h6) && (l.delete(v), f = true), !c && f && (i.push(u), c = true); } return i.length > 0 && this.spawn(i).updateStyle().emit("class"), n; }, removeClass: function(e) { return this.toggleClass(e, false); }, 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; } }; ds.className = ds.classNames = ds.classes; var Ye = { 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: It, // 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+" }; Ye.variable = "(?:[\\w-.]|(?:\\\\" + Ye.metaChar + "))+"; Ye.className = "(?:[\\w-]|(?:\\\\" + Ye.metaChar + "))+"; Ye.value = Ye.string + "|" + Ye.number; Ye.id = Ye.variable; (function() { var t13, e, r; for (t13 = Ye.comparatorOp.split("|"), r = 0; r < t13.length; r++) e = t13[r], Ye.comparatorOp += "|@" + e; for (t13 = Ye.comparatorOp.split("|"), r = 0; r < t13.length; r++) e = t13[r], !(e.indexOf("!") >= 0) && e !== "=" && (Ye.comparatorOp += "|\\!" + e); })(); var it = function() { return { checks: [] }; }; var Se = { /** 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 }; var du = [{ 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(t13, e) { return wT(t13.selector, e.selector); }); var uD = function() { for (var t13 = {}, e, r = 0; r < du.length; r++) e = du[r], t13[e.selector] = e.matches; return t13; }(); var cD = function(e, r) { return uD[e](r); }; var dD = "(" + du.map(function(t13) { return t13.selector; }).join("|") + ")"; var Fa = function(e) { return e.replace(new RegExp("\\\\(" + Ye.metaChar + ")", "g"), function(r, n) { return n; }); }; var Pn = function(e, r, n) { e[e.length - 1] = n; }; var fu = [{ name: "group", // just used for identifying when debugging query: true, regex: "(" + Ye.group + ")", populate: function(e, r, n) { var a = Mr(n, 1), i = a[0]; r.checks.push({ type: Se.GROUP, value: i === "*" ? i : i + "s" }); } }, { name: "state", query: true, regex: dD, populate: function(e, r, n) { var a = Mr(n, 1), i = a[0]; r.checks.push({ type: Se.STATE, value: i }); } }, { name: "id", query: true, regex: "\\#(" + Ye.id + ")", populate: function(e, r, n) { var a = Mr(n, 1), i = a[0]; r.checks.push({ type: Se.ID, value: Fa(i) }); } }, { name: "className", query: true, regex: "\\.(" + Ye.className + ")", populate: function(e, r, n) { var a = Mr(n, 1), i = a[0]; r.checks.push({ type: Se.CLASS, value: Fa(i) }); } }, { name: "dataExists", query: true, regex: "\\[\\s*(" + Ye.variable + ")\\s*\\]", populate: function(e, r, n) { var a = Mr(n, 1), i = a[0]; r.checks.push({ type: Se.DATA_EXIST, field: Fa(i) }); } }, { name: "dataCompare", query: true, regex: "\\[\\s*(" + Ye.variable + ")\\s*(" + Ye.comparatorOp + ")\\s*(" + Ye.value + ")\\s*\\]", populate: function(e, r, n) { var a = Mr(n, 3), i = a[0], o = a[1], s = a[2], u = new RegExp("^" + Ye.string + "$").exec(s) != null; u ? s = s.substring(1, s.length - 1) : s = parseFloat(s), r.checks.push({ type: Se.DATA_COMPARE, field: Fa(i), operator: o, value: s }); } }, { name: "dataBool", query: true, regex: "\\[\\s*(" + Ye.boolOp + ")\\s*(" + Ye.variable + ")\\s*\\]", populate: function(e, r, n) { var a = Mr(n, 2), i = a[0], o = a[1]; r.checks.push({ type: Se.DATA_BOOL, field: Fa(o), operator: i }); } }, { name: "metaCompare", query: true, regex: "\\[\\[\\s*(" + Ye.meta + ")\\s*(" + Ye.comparatorOp + ")\\s*(" + Ye.number + ")\\s*\\]\\]", populate: function(e, r, n) { var a = Mr(n, 3), i = a[0], o = a[1], s = a[2]; r.checks.push({ type: Se.META_COMPARE, field: Fa(i), operator: o, value: parseFloat(s) }); } }, { name: "nextQuery", separator: true, regex: Ye.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: true, regex: Ye.directedEdge, populate: function(e, r) { if (e.currentSubject == null) { var n = it(), a = r, i = it(); return n.checks.push({ type: Se.DIRECTED_EDGE, source: a, target: i }), Pn(e, r, n), e.edgeCount++, i; } else { var o = it(), s = r, u = it(); return o.checks.push({ type: Se.NODE_SOURCE, source: s, target: u }), Pn(e, r, o), e.edgeCount++, u; } } }, { name: "undirectedEdge", separator: true, regex: Ye.undirectedEdge, populate: function(e, r) { if (e.currentSubject == null) { var n = it(), a = r, i = it(); return n.checks.push({ type: Se.UNDIRECTED_EDGE, nodes: [a, i] }), Pn(e, r, n), e.edgeCount++, i; } else { var o = it(), s = r, u = it(); return o.checks.push({ type: Se.NODE_NEIGHBOR, node: s, neighbor: u }), Pn(e, r, o), u; } } }, { name: "child", separator: true, regex: Ye.child, populate: function(e, r) { if (e.currentSubject == null) { var n = it(), a = it(), i = e[e.length - 1]; return n.checks.push({ type: Se.CHILD, parent: i, child: a }), Pn(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: Se.COMPOUND_SPLIT, left: s, right: u, subject: l }), l.checks = r.checks, r.checks = [{ type: Se.TRUE }], d.checks.push({ type: Se.TRUE }), u.checks.push({ type: Se.PARENT, // type is swapped on right side queries parent: d, child: c // empty for now }), Pn(e, s, o), e.currentSubject = l, e.compoundCount++, c; } else { var v = it(), h6 = it(), f = [{ type: Se.PARENT, parent: v, child: h6 }]; return v.checks = r.checks, r.checks = f, e.compoundCount++, h6; } } }, { name: "descendant", separator: true, regex: Ye.descendant, populate: function(e, r) { if (e.currentSubject == null) { var n = it(), a = it(), i = e[e.length - 1]; return n.checks.push({ type: Se.DESCENDANT, ancestor: i, descendant: a }), Pn(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: Se.COMPOUND_SPLIT, left: s, right: u, subject: l }), l.checks = r.checks, r.checks = [{ type: Se.TRUE }], d.checks.push({ type: Se.TRUE }), u.checks.push({ type: Se.ANCESTOR, // type is swapped on right side queries ancestor: d, descendant: c // empty for now }), Pn(e, s, o), e.currentSubject = l, e.compoundCount++, c; } else { var v = it(), h6 = it(), f = [{ type: Se.ANCESTOR, ancestor: v, descendant: h6 }]; return v.checks = r.checks, r.checks = f, e.compoundCount++, h6; } } }, { name: "subject", modifier: true, regex: Ye.subject, populate: function(e, r) { if (e.currentSubject != null && e.currentSubject !== r) return tt("Redefinition of subject in selector `" + e.toString() + "`"), false; e.currentSubject = r; var n = e[e.length - 1], a = n.checks[0], i = a == null ? null : a.type; i === Se.DIRECTED_EDGE ? a.type = Se.NODE_TARGET : i === Se.UNDIRECTED_EDGE && (a.type = Se.NODE_NEIGHBOR, a.node = a.nodes[1], a.neighbor = a.nodes[0], a.nodes = null); } }]; fu.forEach(function(t13) { return t13.regexObj = new RegExp("^" + t13.regex); }); var fD = function(e) { for (var r, n, a, i = 0; i < fu.length; i++) { var o = fu[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 }; }; var vD = function(e) { var r = e.match(/^\s+/); if (r) { var n = r[0]; e = e.substring(n.length); } return e; }; var hD = function(e) { var r = this, n = r.inputText = e, a = r[0] = it(); for (r.length = 1, n = vD(n); ; ) { var i = fD(n); if (i.expr == null) return tt("The selector `" + e + "`is invalid"), false; var o = i.match.slice(1), s = i.expr.populate(r, a, o); if (s === false) return false; 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"), false; if (c.edgeCount > 1) return tt("The selector `" + e + "` is invalid because it uses multiple edge selectors"), false; 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 true; }; var pD = function() { if (this.toStringCache != null) return this.toStringCache; for (var e = function(c) { return c ?? ""; }, r = function(c) { return Fe(c) ? '"' + c + '"' : e(c); }, n = function(c) { return " " + c + " "; }, a = function(c, d) { var v = c.type, h6 = c.value; switch (v) { case Se.GROUP: { var f = e(h6); return f.substring(0, f.length - 1); } case Se.DATA_COMPARE: { var p = c.field, m = c.operator; return "[" + p + n(e(m)) + r(h6) + "]"; } case Se.DATA_BOOL: { var g = c.operator, y = c.field; return "[" + e(g) + y + "]"; } case Se.DATA_EXIST: { var b = c.field; return "[" + b + "]"; } case Se.META_COMPARE: { var w = c.operator, x = c.field; return "[[" + x + n(e(w)) + r(h6) + "]]"; } case Se.STATE: return h6; case Se.ID: return "#" + h6; case Se.CLASS: return "." + h6; case Se.PARENT: case Se.CHILD: return i(c.parent, d) + n(">") + i(c.child, d); case Se.ANCESTOR: case Se.DESCENDANT: return i(c.ancestor, d) + " " + i(c.descendant, d); case Se.COMPOUND_SPLIT: { var E = i(c.left, d), C = i(c.subject, d), T = i(c.right, d); return E + (E.length > 0 ? " " : "") + C + T; } case Se.TRUE: return ""; } }, i = function(c, d) { return c.checks.reduce(function(v, h6, f) { return v + (d === c && f === 0 ? "$" : "") + a(h6, 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; }; var gD = { parse: hD, toString: pD }; var Ap = function(e, r, n) { var a, i = Fe(e), o = be(e), s = Fe(n), u, l, c = false, d = false, v = false; switch (r.indexOf("!") >= 0 && (r = r.replace("!", ""), d = true), r.indexOf("@") >= 0 && (r = r.replace("@", ""), c = true), (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 ">": v = true, a = e > n; break; case ">=": v = true, a = e >= n; break; case "<": v = true, a = e < n; break; case "<=": v = true, a = e <= n; break; default: a = false; break; } return d && (e != null || !v) && (a = !a), a; }; var mD = function(e, r) { switch (r) { case "?": return !!e; case "!": return !e; case "^": return e === void 0; } }; var yD = function(e) { return e !== void 0; }; var bc = function(e, r) { return e.data(r); }; var bD = function(e, r) { return e[r](); }; var bt = []; var vt = function(e, r) { return e.checks.every(function(n) { return bt[n.type](n, r); }); }; bt[Se.GROUP] = function(t13, e) { var r = t13.value; return r === "*" || r === e.group(); }; bt[Se.STATE] = function(t13, e) { var r = t13.value; return cD(r, e); }; bt[Se.ID] = function(t13, e) { var r = t13.value; return e.id() === r; }; bt[Se.CLASS] = function(t13, e) { var r = t13.value; return e.hasClass(r); }; bt[Se.META_COMPARE] = function(t13, e) { var r = t13.field, n = t13.operator, a = t13.value; return Ap(bD(e, r), n, a); }; bt[Se.DATA_COMPARE] = function(t13, e) { var r = t13.field, n = t13.operator, a = t13.value; return Ap(bc(e, r), n, a); }; bt[Se.DATA_BOOL] = function(t13, e) { var r = t13.field, n = t13.operator; return mD(bc(e, r), n); }; bt[Se.DATA_EXIST] = function(t13, e) { var r = t13.field; return t13.operator, yD(bc(e, r)); }; bt[Se.UNDIRECTED_EDGE] = function(t13, e) { var r = t13.nodes[0], n = t13.nodes[1], a = e.source(), i = e.target(); return vt(r, a) && vt(n, i) || vt(n, a) && vt(r, i); }; bt[Se.NODE_NEIGHBOR] = function(t13, e) { return vt(t13.node, e) && e.neighborhood().some(function(r) { return r.isNode() && vt(t13.neighbor, r); }); }; bt[Se.DIRECTED_EDGE] = function(t13, e) { return vt(t13.source, e.source()) && vt(t13.target, e.target()); }; bt[Se.NODE_SOURCE] = function(t13, e) { return vt(t13.source, e) && e.outgoers().some(function(r) { return r.isNode() && vt(t13.target, r); }); }; bt[Se.NODE_TARGET] = function(t13, e) { return vt(t13.target, e) && e.incomers().some(function(r) { return r.isNode() && vt(t13.source, r); }); }; bt[Se.CHILD] = function(t13, e) { return vt(t13.child, e) && vt(t13.parent, e.parent()); }; bt[Se.PARENT] = function(t13, e) { return vt(t13.parent, e) && e.children().some(function(r) { return vt(t13.child, r); }); }; bt[Se.DESCENDANT] = function(t13, e) { return vt(t13.descendant, e) && e.ancestors().some(function(r) { return vt(t13.ancestor, r); }); }; bt[Se.ANCESTOR] = function(t13, e) { return vt(t13.ancestor, e) && e.descendants().some(function(r) { return vt(t13.descendant, r); }); }; bt[Se.COMPOUND_SPLIT] = function(t13, e) { return vt(t13.subject, e) && vt(t13.left, e) && vt(t13.right, e); }; bt[Se.TRUE] = function() { return true; }; bt[Se.COLLECTION] = function(t13, e) { var r = t13.value; return r.has(e); }; bt[Se.FILTER] = function(t13, e) { var r = t13.value; return r(e); }; var wD = function(e) { var r = this; if (r.length === 1 && r[0].checks.length === 1 && r[0].checks[0].type === Se.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 (vt(s, i)) return true; } return false; }; return r.text() == null && (n = function() { return true; }), e.filter(n); }; var CD = function(e) { for (var r = this, n = 0; n < r.length; n++) { var a = r[n]; if (vt(a, e)) return true; } return false; }; var xD = { matches: CD, filter: wD }; var Un = function(e) { this.inputText = e, this.currentSubject = null, this.compoundCount = 0, this.edgeCount = 0, this.length = 0, e == null || Fe(e) && e.match(/^\s*$/) || (yr(e) ? this.addQuery({ checks: [{ type: Se.COLLECTION, value: e.collection() }] }) : pt(e) ? this.addQuery({ checks: [{ type: Se.FILTER, value: e }] }) : Fe(e) ? this.parse(e) || (this.invalid = true) : yt("A selector must be created from a string; found ")); }; var Gn = Un.prototype; [gD, xD].forEach(function(t13) { return Re(Gn, t13); }); Gn.text = function() { return this.inputText; }; Gn.size = function() { return this.length; }; Gn.eq = function(t13) { return this[t13]; }; Gn.sameText = function(t13) { return !this.invalid && !t13.invalid && this.text() === t13.text(); }; Gn.addQuery = function(t13) { this[this.length++] = t13; }; Gn.selector = Gn.toString; var Rn = { allAre: function(e) { var r = new Un(e); return this.every(function(n) { return r.matches(n); }); }, is: function(e) { var r = new Un(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 true; } return false; }, 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 false; } return true; }, same: function(e) { if (this === e) return true; e = this.cy().collection(e); var r = this.length, n = e.length; return r !== n ? false : 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()); }); } }; Rn.allAreNeighbours = Rn.allAreNeighbors; Rn.has = Rn.contains; Rn.equal = Rn.equals = Rn.same; var Sr = function(e, r) { return function(a, i, o, s) { var u = a, l = this, c; if (u == null ? c = "" : yr(u) && u.length === 1 && (c = u.id()), l.length === 1 && c) { var d = l[0]._private, v = d.traversalCache = d.traversalCache || {}, h6 = v[r] = v[r] || [], f = ma(c), p = h6[f]; return p || (h6[f] = e.call(l, a, i, o, s)); } else return e.call(l, a, i, o, s); }; }; var li = { 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, true).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, true).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: Sr(function(t13) { 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, true).filter(t13); }, "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, true).filter(e); } }; function wc(t13, e, r, n) { for (var a = [], i = new vi(), o = t13.cy(), s = o.hasCompoundNodes(), u = 0; u < t13.length; u++) { var l = t13[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 t13; } function Mp(t13, 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()) || t13.push(i); } } li.forEachDown = function(t13) { var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; return wc(this, t13, e, Mp); }; function Bp(t13, e, r) { if (r.isChild()) { var n = r._private.parent; e.has(n.id()) || t13.push(n); } } li.forEachUp = function(t13) { var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; return wc(this, t13, e, Bp); }; function ED(t13, e, r) { Bp(t13, e, r), Mp(t13, e, r); } li.forEachUpAndDown = function(t13) { var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; return wc(this, t13, e, ED); }; li.ancestors = li.parents; var lo; var Np; lo = Np = { data: et.data({ field: "data", bindingEvent: "data", allowBinding: true, allowSetting: true, settingEvent: "data", settingTriggersEvent: true, triggerFnName: "trigger", allowGetting: true, immutableKeys: { id: true, source: true, target: true, parent: true }, updateStyle: true }), removeData: et.removeData({ field: "data", event: "data", triggerFnName: "trigger", triggerEvent: true, immutableKeys: { id: true, source: true, target: true, parent: true }, updateStyle: true }), scratch: et.data({ field: "scratch", bindingEvent: "scratch", allowBinding: true, allowSetting: true, settingEvent: "scratch", settingTriggersEvent: true, triggerFnName: "trigger", allowGetting: true, updateStyle: true }), removeScratch: et.removeData({ field: "scratch", event: "scratch", triggerFnName: "trigger", triggerEvent: true, updateStyle: true }), rscratch: et.data({ field: "rscratch", allowBinding: false, allowSetting: true, settingTriggersEvent: false, allowGetting: true }), removeRscratch: et.removeData({ field: "rscratch", triggerEvent: false }), id: function() { var e = this[0]; if (e) return e._private.data.id; } }; lo.attr = lo.data; lo.removeAttr = lo.removeData; var kD = Np; var ll = {}; function Rl(t13) { return function(e) { var r = this; if (e === void 0 && (e = true), 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 += t13(a, s)); } return n; } else return; }; } Re(ll, { degree: Rl(function(t13, e) { return e.source().same(e.target()) ? 2 : 1; }), indegree: Rl(function(t13, e) { return e.target().same(t13) ? 1 : 0; }), outdegree: Rl(function(t13, e) { return e.source().same(t13) ? 1 : 0; }) }); function Aa(t13, e) { return function(r) { for (var n, a = this.nodes(), i = 0; i < a.length; i++) { var o = a[i], s = o[t13](r); s !== void 0 && (n === void 0 || e(s, n)) && (n = s); } return n; }; } Re(ll, { minDegree: Aa("degree", function(t13, e) { return t13 < e; }), maxDegree: Aa("degree", function(t13, e) { return t13 > e; }), minIndegree: Aa("indegree", function(t13, e) { return t13 < e; }), maxIndegree: Aa("indegree", function(t13, e) { return t13 > e; }), minOutdegree: Aa("outdegree", function(t13, e) { return t13 < e; }), maxOutdegree: Aa("outdegree", function(t13, e) { return t13 > e; }) }); Re(ll, { totalDegree: function(e) { for (var r = 0, n = this.nodes(), a = 0; a < n.length; a++) r += n[a].degree(e); return r; } }); var zr; var $p; var Rp = 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(); } } }; var Lf = { field: "position", bindingEvent: "position", allowBinding: true, allowSetting: true, settingEvent: "position", settingTriggersEvent: true, triggerFnName: "emitAndNotify", allowGetting: true, validKeys: ["x", "y"], beforeGet: function(e) { e.updateCompoundBounds(); }, beforeSet: function(e, r) { Rp(e, r, false); }, onSet: function(e) { e.dirtyCompoundBoundsCache(); }, canSet: function(e) { return !e.locked(); } }; zr = $p = { position: et.data(Lf), // position but no notification to renderer silentPosition: et.data(Re({}, Lf, { allowBinding: false, allowSetting: true, settingTriggersEvent: false, allowGetting: false, beforeSet: function(e, r) { Rp(e, r, true); }, onSet: function(e) { e.dirtyCompoundBoundsCache(); } })), positions: function(e, r) { if (Xe(e)) r ? this.silentPosition(e) : this.position(e); else if (pt(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, true); }, shift: function(e, r, n) { var a; if (Xe(e) ? (a = { x: be(e.x) ? e.x : 0, y: be(e.y) ? e.y : 0 }, n = r) : Fe(e) && be(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, true) : Fe(e) && be(r) && this.shift(e, r, true), 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 && Fe(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(dp(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 && Fe(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, v = d; d && (c = c[0]); var h6 = v ? c.position() : { x: 0, y: 0 }; r !== void 0 ? l.position(e, r + h6[e]) : i !== void 0 && l.position({ x: i.x + h6.x, y: i.y + h6.y }); } else { var f = n.position(), p = s ? n.parent() : null, m = p && p.length > 0, g = m; m && (p = p[0]); var y = g ? p.position() : { x: 0, y: 0 }; return i = { x: f.x - y.x, y: f.y - y.y }, e === void 0 ? i : i[e]; } else if (!o) return; return this; } }; zr.modelPosition = zr.point = zr.position; zr.modelPositions = zr.points = zr.positions; zr.renderedPoint = zr.renderedPosition; zr.relativePoint = zr.relativePosition; var SD = $p; var Za; var Xn; Za = Xn = {}; Xn.renderedBoundingBox = function(t13) { var e = this.boundingBox(t13), 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 }; }; Xn.dirtyCompoundBoundsCache = function() { var t13 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false, e = this.cy(); return !e.styleEnabled() || !e.hasCompoundNodes() ? this : (this.forEachUp(function(r) { if (r.isParent()) { var n = r._private; n.compoundBoundsClean = false, n.bbCache = null, t13 || r.emitAndNotify("bounds"); } }), this); }; Xn.updateCompoundBounds = function() { var t13 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false, e = this.cy(); if (!e.styleEnabled() || !e.hasCompoundNodes()) return this; if (!t13 && 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: false, // updating the compound bounds happens outside of the regular // cache cycle (i.e. before fired events) useCache: false }), v = s.position; (d.w === 0 || d.h === 0) && (d = { w: o.pstyle("width").pfValue, h: o.pstyle("height").pfValue }, d.x1 = v.x - d.w / 2, d.x2 = v.x + d.w / 2, d.y1 = v.y - d.h / 2, d.y2 = v.y + d.h / 2); function h6(k, _, D) { var O = 0, F = 0, L = _ + D; return k > 0 && L > 0 && (O = _ / L * k, F = D / L * k), { biasDiff: O, biasComplementDiff: F }; } function f(k, _, D, O) { if (D.units === "%") switch (O) { case "width": return k > 0 ? D.pfValue * k : 0; case "height": return _ > 0 ? D.pfValue * _ : 0; case "average": return k > 0 && _ > 0 ? D.pfValue * (k + _) / 2 : 0; case "min": return k > 0 && _ > 0 ? k > _ ? D.pfValue * _ : D.pfValue * k : 0; case "max": return k > 0 && _ > 0 ? k > _ ? D.pfValue * k : D.pfValue * _ : 0; default: return 0; } else return D.units === "px" ? D.pfValue : 0; } var p = c.width.left.value; c.width.left.units === "px" && c.width.val > 0 && (p = p * 100 / c.width.val); var m = c.width.right.value; c.width.right.units === "px" && c.width.val > 0 && (m = m * 100 / c.width.val); var g = c.height.top.value; c.height.top.units === "px" && c.height.val > 0 && (g = g * 100 / c.height.val); var y = c.height.bottom.value; c.height.bottom.units === "px" && c.height.val > 0 && (y = y * 100 / c.height.val); var b = h6(c.width.val - d.w, p, m), w = b.biasDiff, x = b.biasComplementDiff, E = h6(c.height.val - d.h, g, y), C = E.biasDiff, T = E.biasComplementDiff; s.autoPadding = f(d.w, d.h, o.pstyle("padding"), o.pstyle("padding-relative-to").value), s.autoWidth = Math.max(d.w, c.width.val), v.x = (-w + d.x1 + d.x2 + x) / 2, s.autoHeight = Math.max(d.h, c.height.val), v.y = (-C + d.y1 + d.y2 + T) / 2; } for (var n = 0; n < this.length; n++) { var a = this[n], i = a._private; (!i.compoundBoundsClean || t13) && (r(a), e.batching() || (i.compoundBoundsClean = true)); } return this; }; var Er = function(e) { return e === 1 / 0 || e === -1 / 0 ? 0 : e; }; var Br = 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); }; var ra = function(e, r) { return r == null ? e : Br(e, r.x1, r.y1, r.x2, r.y2); }; var Li = function(e, r, n) { return Nr(e, r, n); }; var Qo = 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, us(d, 1), Br(e, d.x1, d.y1, d.x2, d.y2); } } }; var zl = 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 = Li(o, "labelWidth", n), d = Li(o, "labelHeight", n), v = Li(o, "labelX", n), h6 = Li(o, "labelY", n), f = r.pstyle(a + "text-margin-x").pfValue, p = r.pstyle(a + "text-margin-y").pfValue, m = r.isEdge(), g = r.pstyle(a + "text-rotation"), y = 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, T = c, k = T / 2, _ = C / 2, D, O, F, L; if (m) D = v - k, O = v + k, F = h6 - _, L = h6 + _; else { switch (u.value) { case "left": D = v - T, O = v; break; case "center": D = v - k, O = v + k; break; case "right": D = v, O = v + T; break; } switch (l.value) { case "top": F = h6 - C, L = h6; break; case "center": F = h6 - _, L = h6 + _; break; case "bottom": F = h6, L = h6 + C; break; } } D += f - Math.max(y, w) - x - E, O += f + Math.max(y, w) + x + E, F += p - Math.max(y, w) - x - E, L += p + Math.max(y, w) + x + E; var B = n || "main", I = i.labelBounds, M = I[B] = I[B] || {}; M.x1 = D, M.y1 = F, M.x2 = O, M.y2 = L, M.w = O - D, M.h = L - F; var A = m && g.strValue === "autorotate", R = g.pfValue != null && g.pfValue !== 0; if (A || R) { var K = A ? Li(i.rstyle, "labelAngle", n) : g.pfValue, H = Math.cos(K), q = Math.sin(K), ee = (D + O) / 2, se = (F + L) / 2; if (!m) { switch (u.value) { case "left": ee = O; break; case "right": ee = D; break; } switch (l.value) { case "top": se = L; break; case "bottom": se = F; break; } } var oe = function(Ee, fe) { return Ee = Ee - ee, fe = fe - se, { x: Ee * H - fe * q + ee, y: Ee * q + fe * H + se }; }, ae = oe(D, F), ue = oe(D, L), te = oe(O, F), $ = oe(O, L); D = Math.min(ae.x, ue.x, te.x, $.x), O = Math.max(ae.x, ue.x, te.x, $.x), F = Math.min(ae.y, ue.y, te.y, $.y), L = Math.max(ae.y, ue.y, te.y, $.y); } var G = B + "Rot", Q = I[G] = I[G] || {}; Q.x1 = D, Q.y1 = F, Q.x2 = O, Q.y2 = L, Q.w = O - D, Q.h = L - F, Br(e, D, F, O, L), Br(i.labelBounds.all, D, F, O, L); } return e; } }; var TD = 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 v = e.h * l - e.h, h6 = e.w * u - e.w; if (cs(e, [Math.ceil(v / 2), Math.ceil(h6 / 2)]), c != 0 || d !== 0) { var f = W5(e, c, d); vp(e, f); } } } }; var _D = function(e, r) { var n = e._private.cy, a = n.styleEnabled(), i = n.headless(), o = pr(), s = e._private, u = e.isNode(), l = e.isEdge(), c, d, v, h6, f, p, m = s.rstyle, g = u && a ? e.pstyle("bounds-expansion").pfValue : [0], y = function(Ce) { return Ce.pstyle("display").value !== "none"; }, b = !a || y(e) && (!l || y(e.source()) && y(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 T = Math.max(x, C), k = 0, _ = 0; if (a && (k = e.pstyle("width").pfValue, _ = k / 2), u && r.includeNodes) { var D = e.position(); f = D.x, p = D.y; var O = e.outerWidth(), F = O / 2, L = e.outerHeight(), B = L / 2; c = f - F, d = f + F, v = p - B, h6 = p + B, Br(o, c, v, d, h6), a && r.includeOutlines && TD(o, e); } else if (l && r.includeEdges) if (a && !i) { var I = e.pstyle("curve-style").strValue; if (c = Math.min(m.srcX, m.midX, m.tgtX), d = Math.max(m.srcX, m.midX, m.tgtX), v = Math.min(m.srcY, m.midY, m.tgtY), h6 = Math.max(m.srcY, m.midY, m.tgtY), c -= _, d += _, v -= _, h6 += _, Br(o, c, v, d, h6), I === "haystack") { var M = m.haystackPts; if (M && M.length === 2) { if (c = M[0].x, v = M[0].y, d = M[1].x, h6 = M[1].y, c > d) { var A = c; c = d, d = A; } if (v > h6) { var R = v; v = h6, h6 = R; } Br(o, c - _, v - _, d + _, h6 + _); } } else if (I === "bezier" || I === "unbundled-bezier" || I.endsWith("segments") || I.endsWith("taxi")) { var K; switch (I) { case "bezier": case "unbundled-bezier": K = m.bezierPts; break; case "segments": case "taxi": case "round-segments": case "round-taxi": K = m.linePts; break; } if (K != null) for (var H = 0; H < K.length; H++) { var q = K[H]; c = q.x - _, d = q.x + _, v = q.y - _, h6 = q.y + _, Br(o, c, v, d, h6); } } } else { var ee = e.source(), se = ee.position(), oe = e.target(), ae = oe.position(); if (c = se.x, d = ae.x, v = se.y, h6 = ae.y, c > d) { var ue = c; c = d, d = ue; } if (v > h6) { var te = v; v = h6, h6 = te; } c -= _, d += _, v -= _, h6 += _, Br(o, c, v, d, h6); } if (a && r.includeEdges && l && (Qo(o, e, "mid-source"), Qo(o, e, "mid-target"), Qo(o, e, "source"), Qo(o, e, "target")), a) { var $ = e.pstyle("ghost").value === "yes"; if ($) { var G = e.pstyle("ghost-offset-x").pfValue, Q = e.pstyle("ghost-offset-y").pfValue; Br(o, o.x1 + G, o.y1 + Q, o.x2 + G, o.y2 + Q); } } var ge = s.bodyBounds = s.bodyBounds || {}; cf(ge, o), cs(ge, g), us(ge, 1), a && (c = o.x1, d = o.x2, v = o.y1, h6 = o.y2, Br(o, c - T, v - T, d + T, h6 + T)); var Ee = s.overlayBounds = s.overlayBounds || {}; cf(Ee, o), cs(Ee, g), us(Ee, 1); var fe = s.labelBounds = s.labelBounds || {}; fe.all != null ? G5(fe.all) : fe.all = pr(), a && r.includeLabels && (r.includeMainLabels && zl(o, e, null), l && (r.includeSourceLabels && zl(o, e, "source"), r.includeTargetLabels && zl(o, e, "target"))); } return o.x1 = Er(o.x1), o.y1 = Er(o.y1), o.x2 = Er(o.x2), o.y2 = Er(o.y2), o.w = Er(o.x2 - o.x1), o.h = Er(o.y2 - o.y1), o.w > 0 && o.h > 0 && b && (cs(o, g), us(o, 1)), o; }; var zp = 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; }; var Vp = function(e) { if (e.isEdge()) { var r = e.source().position(), n = e.target().position(), a = function(o) { return Math.round(o); }; return v5([a(r.x), a(r.y), a(n.x), a(n.y)]); } else return 0; }; var If = function(e, r) { var n = e._private, a, i = e.isEdge(), o = r == null ? Ff : zp(r), s = o === Ff, u = Vp(e), l = n.bbCachePosKey === u, c = r.useCache && l, d = function(p) { return p._private.bbCache == null || p._private.styleDirty; }, v = !c || d(e) || i && d(e.source()) || d(e.target()); if (v ? (l || e.recalculateRenderedStyle(c), a = _D(e, uo), n.bbCache = a, n.bbCachePosKey = u) : a = n.bbCache, !s) { var h6 = e.isNode(); a = pr(), (r.includeNodes && h6 || r.includeEdges && !h6) && (r.includeOverlays ? ra(a, n.overlayBounds) : ra(a, n.bodyBounds)), r.includeLabels && (r.includeMainLabels && (!i || r.includeSourceLabels && r.includeTargetLabels) ? ra(a, n.labelBounds.all) : (r.includeMainLabels && ra(a, n.labelBounds.mainRot), r.includeSourceLabels && ra(a, n.labelBounds.sourceRot), r.includeTargetLabels && ra(a, n.labelBounds.targetRot))), a.w = a.x2 - a.x1, a.h = a.y2 - a.y1; } return a; }; var uo = { includeNodes: true, includeEdges: true, includeLabels: true, includeMainLabels: true, includeSourceLabels: true, includeTargetLabels: true, includeOverlays: true, includeUnderlays: true, includeOutlines: true, useCache: true }; var Ff = zp(uo); var Af = Wt(uo); Xn.boundingBox = function(t13) { var e; if (this.length === 1 && this[0]._private.bbCache != null && !this[0]._private.styleDirty && (t13 === void 0 || t13.useCache === void 0 || t13.useCache === true)) t13 === void 0 ? t13 = uo : t13 = Af(t13), e = If(this[0], t13); else { e = pr(), t13 = t13 || uo; var r = Af(t13), 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 = Vp(s), c = u.bbCachePosKey === l, d = r.useCache && c && !u.styleDirty; s.recalculateRenderedStyle(d); } this.updateCompoundBounds(!t13.useCache); for (var v = 0; v < n.length; v++) { var h6 = n[v]; ra(e, If(h6, r)); } } return e.x1 = Er(e.x1), e.y1 = Er(e.y1), e.x2 = Er(e.x2), e.y2 = Er(e.y2), e.w = Er(e.x2 - e.x1), e.h = Er(e.y2 - e.y1), e; }; Xn.dirtyBoundingBoxCache = function() { for (var t13 = 0; t13 < this.length; t13++) { var e = this[t13]._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; }; Xn.boundingBoxAt = function(t13) { 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(t13)) { var i = t13; t13 = function() { return i; }; } var o = function(c, d) { return c._private.bbAtOldPos = t13(c, d); }, s = function(c) { return c._private.bbAtOldPos; }; r.startBatch(), e.forEach(o).silentPositions(t13), n && (a.dirtyCompoundBoundsCache(), a.dirtyBoundingBoxCache(), a.updateCompoundBounds(true)); var u = U5(this.boundingBox({ useCache: false })); return e.silentPositions(s), n && (a.dirtyCompoundBoundsCache(), a.dirtyBoundingBoxCache(), a.updateCompoundBounds(true)), r.endBatch(), u; }; Za.boundingbox = Za.bb = Za.boundingBox; Za.renderedBoundingbox = Za.renderedBoundingBox; var DD = Xn; var $i; var Lo; $i = Lo = {}; var Hp = function(e) { e.uppercaseName = rf(e.name), e.autoName = "auto" + e.uppercaseName, e.labelName = "label" + e.uppercaseName, e.outerName = "outer" + e.uppercaseName, e.uppercaseOuterName = rf(e.outerName), $i[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; }, $i["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; }, $i["rendered" + e.uppercaseName] = function() { var n = this[0]; if (n) { var a = n[e.name](); return a * this.cy().zoom(); } }, $i["rendered" + e.uppercaseOuterName] = function() { var n = this[0]; if (n) { var a = n[e.outerName](); return a * this.cy().zoom(); } }; }; Hp({ name: "width" }); Hp({ name: "height" }); Lo.padding = function() { var t13 = this[0], e = t13._private; return t13.isParent() ? (t13.updateCompoundBounds(), e.autoPadding !== void 0 ? e.autoPadding : t13.pstyle("padding").pfValue) : t13.pstyle("padding").pfValue; }; Lo.paddedHeight = function() { var t13 = this[0]; return t13.height() + 2 * t13.padding(); }; Lo.paddedWidth = function() { var t13 = this[0]; return t13.width() + 2 * t13.padding(); }; var PD = Lo; var OD = function(e, r) { if (e.isEdge()) return r(e); }; var LD = function(e, r) { if (e.isEdge()) { var n = e.cy(); return nl(r(e), n.zoom(), n.pan()); } }; var ID = 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); }); } }; var FD = function(e) { return e.renderer().getControlPoints(e); }; var AD = function(e) { return e.renderer().getSegmentPoints(e); }; var MD = function(e) { return e.renderer().getSourceEndpoint(e); }; var BD = function(e) { return e.renderer().getTargetEndpoint(e); }; var ND = function(e) { return e.renderer().getEdgeMidpoint(e); }; var Mf = { controlPoints: { get: FD, mult: true }, segmentPoints: { get: AD, mult: true }, sourceEndpoint: { get: MD }, targetEndpoint: { get: BD }, midpoint: { get: ND } }; var $D = function(e) { return "rendered" + e[0].toUpperCase() + e.substr(1); }; var RD = Object.keys(Mf).reduce(function(t13, e) { var r = Mf[e], n = $D(e); return t13[e] = function() { return OD(this, r.get); }, r.mult ? t13[n] = function() { return ID(this, r.get); } : t13[n] = function() { return LD(this, r.get); }, t13; }, {}); var zD = Re({}, SD, DD, PD, RD); var qp = function(e, r) { this.recycle(e, r); }; function Ii() { return false; } function Jo() { return true; } qp.prototype = { instanceString: function() { return "event"; }, recycle: function(e, r) { if (this.isImmediatePropagationStopped = this.isPropagationStopped = this.isDefaultPrevented = Ii, e != null && e.preventDefault ? (this.type = e.type, this.isDefaultPrevented = e.defaultPrevented ? Jo : Ii) : 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 = Jo; var e = this.originalEvent; e && e.preventDefault && e.preventDefault(); }, stopPropagation: function() { this.isPropagationStopped = Jo; var e = this.originalEvent; e && e.stopPropagation && e.stopPropagation(); }, stopImmediatePropagation: function() { this.isImmediatePropagationStopped = Jo, this.stopPropagation(); }, isDefaultPrevented: Ii, isPropagationStopped: Ii, isImmediatePropagationStopped: Ii }; var Kp = /^([^.]+)(\.(?:[^.]+))?$/; var VD = ".*"; var Up = { qualifierCompare: function(e, r) { return e === r; }, eventMatches: function() { return true; }, addEventFields: function() { }, callbackContext: function(e) { return e; }, beforeEmit: function() { }, afterEmit: function() { }, bubble: function() { return false; }, parent: function() { return null; }, context: null }; var Bf = Object.keys(Up); var HD = {}; function ul() { for (var t13 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : HD, e = arguments.length > 1 ? arguments[1] : void 0, r = 0; r < Bf.length; r++) { var n = Bf[r]; this[n] = t13[n] || Up[n]; } this.context = e || this.context, this.listeners = [], this.emitting = 0; } var Wn = ul.prototype; var Gp = function(e, r, n, a, i, o, s) { pt(a) && (i = a, a = null), s && (o == null ? o = s : o = Re({}, o, s)); for (var u = st(n) ? n : n.split(/\s+/), l = 0; l < u.length; l++) { var c = u[l]; if (!qn(c)) { var d = c.match(Kp); if (d) { var v = d[1], h6 = d[2] ? d[2] : null, f = r(e, c, v, h6, a, i, o); if (f === false) break; } } } }; var Nf = function(e, r) { return e.addEventFields(e.context, r), new qp(r.type, r); }; var qD = function(e, r, n) { if (uT(n)) { r(e, n); return; } else if (Xe(n)) { r(e, Nf(e, n)); return; } for (var a = st(n) ? n : n.split(/\s+/), i = 0; i < a.length; i++) { var o = a[i]; if (!qn(o)) { var s = o.match(Kp); if (s) { var u = s[1], l = s[2] ? s[2] : null, c = Nf(e, { type: u, namespace: l, target: e.context }); r(e, c); } } } }; Wn.on = Wn.addListener = function(t13, e, r, n, a) { return Gp(this, function(i, o, s, u, l, c, d) { pt(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 }); }, t13, e, r, n, a), this; }; Wn.one = function(t13, e, r, n) { return this.on(t13, e, r, n, { one: true }); }; Wn.removeListener = Wn.off = function(t13, e, r, n) { var a = this; this.emitting !== 0 && (this.listeners = y5(this.listeners)); for (var i = this.listeners, o = function(l) { var c = i[l]; Gp(a, function(d, v, h6, f, p, m) { if ((c.type === h6 || t13 === "*") && (!f && c.namespace !== ".*" || c.namespace === f) && (!p || d.qualifierCompare(c.qualifier, p)) && (!m || c.callback === m)) return i.splice(l, 1), false; }, t13, e, r, n); }, s = i.length - 1; s >= 0; s--) o(s); return this; }; Wn.removeAllListeners = function() { return this.removeListener("*"); }; Wn.emit = Wn.trigger = function(t13, e, r) { var n = this.listeners, a = n.length; return this.emitting++, st(e) || (e = [e]), qD(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 === VD) && i.eventMatches(i.context, d, o)) { var v = [o]; e != null && w5(v, e), i.beforeEmit(i.context, d, o), d.conf && d.conf.one && (i.listeners = i.listeners.filter(function(p) { return p !== d; })); var h6 = i.callbackContext(i.context, d, o), f = d.callback.apply(h6, v); i.afterEmit(i.context, d, o), f === false && (o.stopPropagation(), o.preventDefault()); } }, u = 0; u < a; u++) s(u); i.bubble(i.context) && !o.isPropagationStopped() && i.parent(i.context).emit(o, e); }, t13), this.emitting--, this; }; var KD = { 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 && Do(n.target) && a.matches(n.target) : true; }, 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 true; }, parent: function(e) { return e.isChild() ? e.parent() : e.cy(); } }; var es = function(e) { return Fe(e) ? new Un(e) : e; }; var Wp = { createEmitter: function() { for (var e = 0; e < this.length; e++) { var r = this[e], n = r._private; n.emitter || (n.emitter = new ul(KD, r)); } return this; }, emitter: function() { return this._private.emitter; }, on: function(e, r, n) { for (var a = es(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 = es(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 = es(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 = es(r), i = 0; i < this.length; i++) { var o = this[i]; o.emitter().on(e, a, n, { once: true, 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(Wp); var Yp = { 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 (Fe(e) || yr(e)) return new Un(e).filter(this); if (pt(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) { Fe(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 (Fe(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; Fe(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], v = d._private.data.id, h6 = l.hasElementWithId(v); h6 || n.push(d); } }; return o(a, i), o(i, a), n; }, diff: function(e) { var r = this._private.cy; Fe(e) && (e = r.$(e)); var n = this.spawn(), a = this.spawn(), i = this.spawn(), o = this, s = e, u = function(c, d, v) { for (var h6 = 0; h6 < c.length; h6++) { var f = c[h6], p = f._private.data.id, m = d.hasElementWithId(p); m ? i.merge(f) : v.push(f); } }; 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 (Fe(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 && Fe(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 && Fe(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 }; } }; var Je = Yp; Je.u = Je["|"] = Je["+"] = Je.union = Je.or = Je.add; Je["\\"] = Je["!"] = Je["-"] = Je.difference = Je.relativeComplement = Je.subtract = Je.not; Je.n = Je["&"] = Je["."] = Je.and = Je.intersection = Je.intersect; Je["^"] = Je["(+)"] = Je["(-)"] = Je.symmetricDifference = Je.symdiff = Je.xor; Je.fnFilter = Je.filterFn = Je.stdFilter = Je.filter; Je.complement = Je.abscomp = Je.absoluteComplement; var UD = { 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; } }; var Zp = 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" ? uc : 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(); }; var As = { forEach: function(e, r) { if (pt(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 === false) 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 (!pt(e)) return this; var r = this.toArray().sort(e); return this.spawn(r); }, sortByZIndex: function() { return this.sort(Zp); }, 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 : uc - 1; } else { var i = r.source, o = r.target, s = i.zDepth(), u = o.zDepth(); return Math.max(s, u, 0); } } } }; As.each = As.forEach; var GD = function() { var e = "undefined", r = (typeof Symbol > "u" ? "undefined" : Ft(Symbol)) != e && Ft(Symbol.iterator) != e; r && (As[Symbol.iterator] = function() { var n = this, a = { value: void 0, done: false }, i = 0, o = this.length; return Uh({ next: function() { return i < o ? a.value = n[i++] : (a.value = void 0, a.done = true), a; } }, Symbol.iterator, function() { return this; }); }); }; GD(); var WD = Wt({ nodeDimensionsIncludeLabels: false }); var fs = { // Calculates and returns node dimensions { x, y } based on options given layoutDimensions: function(e) { e = WD(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 = to(n, s); e.emit({ type: "layoutstart", layout: e }), e.animations = []; var l = function(E, C, T) { var k = { x: C.x1 + C.w / 2, y: C.y1 + C.h / 2 }, _ = { // scale from center of bounding box (not necessarily 0,0) x: (T.x - k.x) * E, y: (T.y - k.y) * E }; return { x: k.x + _.x, y: k.y + _.y }; }, c = r.spacingFactor && r.spacingFactor !== 1, d = function() { if (!c) return null; for (var E = pr(), C = 0; C < a.length; C++) { var T = a[C], k = u(T, C); Y5(E, k.x, k.y); } return E; }, v = d(), h6 = to(function(x, E) { var C = u(x, E); if (c) { var T = Math.abs(r.spacingFactor); C = l(T, v, C); } return r.transform != null && (C = r.transform(x, C)), C; }, s); if (r.animate) { for (var f = 0; f < a.length; f++) { var p = a[f], m = h6(p, f), g = r.animateFilter == null || r.animateFilter(p, f); if (g) { var y = p.animation({ position: m, duration: r.animationDuration, easing: r.animationEasing }); e.animations.push(y); } else p.position(m); } if (r.fit) { var b = i.animation({ fit: { boundingBox: o.boundingBoxAt(h6), 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 }), hi.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(h6), 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(Re({}, e, { eles: this })); } }; fs.createLayout = fs.makeLayout = fs.layout; function Xp(t13, e, r) { var n = r._private, a = n.styleCache = n.styleCache || [], i; return (i = a[t13]) != null || (i = a[t13] = e(r)), i; } function cl(t13, e) { return t13 = ma(t13), function(n) { return Xp(t13, e, n); }; } function dl(t13, e) { t13 = ma(t13); var r = function(a) { return e.call(a); }; return function() { var a = this[0]; if (a) return Xp(t13, r, a); }; } var Ut = { 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 = true; }), 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 = false, 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] : true, 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 = false, i = n.style(); if (Xe(e)) { var o = e; i.applyBypass(this, o, a), this.emitAndNotify("style"); } else if (Fe(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 = false, 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 false; 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 false; var r = this[0]; return !!r._private.backgrounding; } }; function Vl(t13, e) { var r = t13._private, n = r.data.parent ? t13.parents() : null; if (n) for (var a = 0; a < n.length; a++) { var i = n[a]; if (!e(i)) return false; } return true; } function Cc(t13) { var e = t13.ok, r = t13.edgeOkViaNode || t13.ok, n = t13.parentOk || t13.ok; return function() { var a = this.cy(); if (!a.styleEnabled()) return true; var i = this[0], o = a.hasCompoundNodes(); if (i) { var s = i._private; if (!e(i)) return false; if (i.isNode()) return !o || Vl(i, n); var u = s.source, l = s.target; return r(u) && (!o || Vl(u, r)) && (u === l || r(l) && (!o || Vl(l, r))); } }; } var yi = cl("eleTakesUpSpace", function(t13) { return t13.pstyle("display").value === "element" && t13.width() !== 0 && (t13.isNode() ? t13.height() !== 0 : true); }); Ut.takesUpSpace = dl("takesUpSpace", Cc({ ok: yi })); var YD = cl("eleInteractive", function(t13) { return t13.pstyle("events").value === "yes" && t13.pstyle("visibility").value === "visible" && yi(t13); }); var ZD = cl("parentInteractive", function(t13) { return t13.pstyle("visibility").value === "visible" && yi(t13); }); Ut.interactive = dl("interactive", Cc({ ok: YD, parentOk: ZD, edgeOkViaNode: yi })); Ut.noninteractive = function() { var t13 = this[0]; if (t13) return !t13.interactive(); }; var XD = cl("eleVisible", function(t13) { return t13.pstyle("visibility").value === "visible" && t13.pstyle("opacity").pfValue !== 0 && yi(t13); }); var jD = yi; Ut.visible = dl("visible", Cc({ ok: XD, edgeOkViaNode: jD })); Ut.hidden = function() { var t13 = this[0]; if (t13) return !t13.visible(); }; Ut.isBundledBezier = dl("isBundledBezier", function() { return this.cy().styleEnabled() ? !this.removed() && this.pstyle("curve-style").value === "bezier" && this.takesUpSpace() : false; }); Ut.bypass = Ut.css = Ut.style; Ut.renderedCss = Ut.renderedStyle; Ut.removeBypass = Ut.removeCss = Ut.removeStyle; Ut.pstyle = Ut.parsedStyle; var zn = {}; function $f(t13) { return function() { var e = arguments, r = []; if (e.length === 2) { var n = e[0], a = e[1]; this.on(t13.event, n, a); } else if (e.length === 1 && pt(e[0])) { var i = e[0]; this.on(t13.event, i); } else if (e.length === 0 || e.length === 1 && st(e[0])) { for (var o = e.length === 1 ? e[0] : null, s = 0; s < this.length; s++) { var u = this[s], l = !t13.ableField || u._private[t13.ableField], c = u._private[t13.field] != t13.value; if (t13.overrideAble) { var d = t13.overrideAble(u); if (d !== void 0 && (l = d, !d)) return this; } l && (u._private[t13.field] = t13.value, c && r.push(u)); } var v = this.spawn(r); v.updateStyle(), v.emit(t13.event), o && v.emit(o); } return this; }; } function bi(t13) { zn[t13.field] = function() { var e = this[0]; if (e) { if (t13.overrideField) { var r = t13.overrideField(e); if (r !== void 0) return r; } return e._private[t13.field]; } }, zn[t13.on] = $f({ event: t13.on, field: t13.field, ableField: t13.ableField, overrideAble: t13.overrideAble, value: true }), zn[t13.off] = $f({ event: t13.off, field: t13.field, ableField: t13.ableField, overrideAble: t13.overrideAble, value: false }); } bi({ field: "locked", overrideField: function(e) { return e.cy().autolock() ? true : void 0; }, on: "lock", off: "unlock" }); bi({ field: "grabbable", overrideField: function(e) { return e.cy().autoungrabify() || e.pannable() ? false : void 0; }, on: "grabify", off: "ungrabify" }); bi({ field: "selected", ableField: "selectable", overrideAble: function(e) { return e.cy().autounselectify() ? false : void 0; }, on: "select", off: "unselect" }); bi({ field: "selectable", overrideField: function(e) { return e.cy().autounselectify() ? false : void 0; }, on: "selectify", off: "unselectify" }); zn.deselect = zn.unselect; zn.grabbed = function() { var t13 = this[0]; if (t13) return t13._private.grabbed; }; bi({ field: "active", on: "activate", off: "unactivate" }); bi({ field: "pannable", on: "panify", off: "unpanify" }); zn.inactive = function() { var t13 = this[0]; if (t13) return !t13._private.active; }; var nr = {}; var Rf = 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 = false, l = s.connectedEdges(), c = 0; c < l.length; c++) { var d = l[c], v = d.source(), h6 = d.target(); if (e.noIncomingEdges && h6 === s && v !== s || e.noOutgoingEdges && v === s && h6 !== s) { u = true; break; } } u || i.push(s); } } return this.spawn(i, true).filter(n); }; }; var zf = 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, true).filter(r); }; }; var Vf = 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 = false, u = 0; u < o.length; u++) { var l = o[u], c = l.id(); i[c] || (i[c] = true, a.push(l), s = true); } if (!s) break; n = o; } return this.spawn(a, true).filter(r); }; }; nr.clearTraversalCache = function() { for (var t13 = 0; t13 < this.length; t13++) this[t13]._private.traversalCache = null; }; Re(nr, { // get the root nodes in the DAG roots: Rf({ noIncomingEdges: true }), // get the leaf nodes in the DAG leaves: Rf({ noOutgoingEdges: true }), // normally called children in graph theory // these nodes =edges=> outgoing nodes outgoers: Sr(zf({ outgoing: true }), "outgoers"), // aka DAG descendants successors: Vf({ outgoing: true }), // normally called parents in graph theory // these nodes <=edges= incoming nodes incomers: Sr(zf({ incoming: true }), "incomers"), // aka DAG ancestors predecessors: Vf({ incoming: true }) }); Re(nr, { neighborhood: Sr(function(t13) { 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, true).filter(t13); }, "neighborhood"), closedNeighborhood: function(e) { return this.neighborhood().add(this).filter(e); }, openNeighborhood: function(e) { return this.neighborhood(e); } }); nr.neighbourhood = nr.neighborhood; nr.closedNeighbourhood = nr.closedNeighborhood; nr.openNeighbourhood = nr.openNeighborhood; Re(nr, { source: Sr(function(e) { var r = this[0], n; return r && (n = r._private.source || r.cy().collection()), n && e ? n.filter(e) : n; }, "source"), target: Sr(function(e) { var r = this[0], n; return r && (n = r._private.target || r.cy().collection()), n && e ? n.filter(e) : n; }, "target"), sources: Hf({ attr: "source" }), targets: Hf({ attr: "target" }) }); function Hf(t13) { return function(r) { for (var n = [], a = 0; a < this.length; a++) { var i = this[a], o = i._private[t13.attr]; o && n.push(o); } return this.spawn(n, true).filter(r); }; } Re(nr, { edgesWith: Sr(qf(), "edgesWith"), edgesTo: Sr(qf({ thisIsSrc: true }), "edgesTo") }); function qf(t13) { return function(r) { var n = [], a = this._private.cy, i = t13 || {}; Fe(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), v = r.hasElementWithId(c.source) && this.hasElementWithId(c.target), h6 = d || v; h6 && ((i.thisIsSrc || i.thisIsTgt) && (i.thisIsSrc && !d || i.thisIsTgt && !v) || n.push(l)); } return this.spawn(n, true); }; } Re(nr, { connectedEdges: Sr(function(t13) { 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, true).filter(t13); }, "connectedEdges"), connectedNodes: Sr(function(t13) { 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, true).filter(t13); }, "connectedNodes"), parallelEdges: Sr(Kf(), "parallelEdges"), codirectedEdges: Sr(Kf({ codirected: true }), "codirectedEdges") }); function Kf(t13) { var e = { codirected: false }; return t13 = Re({}, e, t13), function(n) { for (var a = [], i = this.edges(), o = t13, s = 0; s < i.length; s++) for (var u = i[s], l = u._private, c = l.source, d = c._private.data.id, v = l.data.target, h6 = c._private.edges, f = 0; f < h6.length; f++) { var p = h6[f], m = p._private.data, g = m.target, y = m.source, b = g === v && y === d, w = d === g && v === y; (o.codirected && b || !o.codirected && (b || w)) && a.push(p); } return this.spawn(a, true).filter(n); }; } Re(nr, { 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: false, roots: d, visit: function(h6) { return s(h6, c); } }), c.forEach(function(v) { v.connectedEdges().forEach(function(h6) { r.has(h6) && c.has(h6.source()) && c.has(h6.target()) && c.merge(h6); }); }); }; do u(); while (i.length > 0); return o; }, component: function() { var e = this[0]; return e.cy().mutableElements().components(e)[0]; } }); nr.componentsOf = nr.components; var Gt = function(e, r) { var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false, a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false; if (e === void 0) { yt("A collection must have a reference to the core"); return; } var i = new Xr(), o = false; if (!r) r = []; else if (r.length > 0 && Xe(r[0]) && !Do(r[0])) { o = true; for (var s = [], u = new vi(), l = 0, c = r.length; l < c; l++) { var d = r[l]; d.data == null && (d.data = {}); var v = d.data; if (v.id == null) v.id = up(); else if (e.hasElementWithId(v.id) || u.has(v.id)) continue; var h6 = new rl(e, d, false); s.push(h6), u.add(v.id); } r = s; } this.length = 0; for (var f = 0, p = r.length; f < p; f++) { var m = r[f][0]; if (m != null) { var g = m._private.data.id; (!n || !i.has(g)) && (n && i.set(g, { index: this.length, ele: m }), this[this.length] = m, this.length++); } } this._private = { eles: this, cy: e, get map() { return this.lazyMap == null && this.rebuildMap(), this.lazyMap; }, set map(y) { this.lazyMap = y; }, rebuildMap: function() { for (var b = this.lazyMap = new Xr(), 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(); }; var dt = rl.prototype = Gt.prototype = Object.create(Array.prototype); dt.instanceString = function() { return "collection"; }; dt.spawn = function(t13, e) { return new Gt(this.cy(), t13, e); }; dt.spawnSelf = function() { return this.spawn(this); }; dt.cy = function() { return this._private.cy; }; dt.renderer = function() { return this._private.cy.renderer(); }; dt.element = function() { return this[0]; }; dt.collection = function() { return Zh(this) ? this : new Gt(this._private.cy, [this]); }; dt.unique = function() { return new Gt(this._private.cy, this, true); }; dt.hasElementWithId = function(t13) { return t13 = "" + t13, this._private.map.has(t13); }; dt.getElementById = function(t13) { t13 = "" + t13; var e = this._private.cy, r = this._private.map.get(t13); return r ? r.ele : new Gt(e); }; dt.$id = dt.getElementById; dt.poolIndex = function() { var t13 = this._private.cy, e = t13._private.elements, r = this[0]._private.data.id; return e._private.map.get(r).index; }; dt.indexOf = function(t13) { var e = t13[0]._private.data.id; return this._private.map.get(e).index; }; dt.indexOfId = function(t13) { return t13 = "" + t13, this._private.map.get(t13).index; }; dt.json = function(t13) { var e = this.element(), r = this.cy(); if (e == null && t13) return this; if (e != null) { var n = e._private; if (Xe(t13)) { if (r.startBatch(), t13.data) { e.data(t13.data); var a = n.data; if (e.isEdge()) { var i = false, o = {}, s = t13.data.source, u = t13.data.target; s != null && s != a.source && (o.source = "" + s, i = true), u != null && u != a.target && (o.target = "" + u, i = true), i && (e = e.move(o)); } else { var l = "parent" in t13.data, c = t13.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 })); } } t13.position && e.position(t13.position); var d = function(p, m, g) { var y = t13[p]; y != null && y !== n[p] && (y ? e[m]() : e[g]()); }; 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"), t13.classes != null && e.classes(t13.classes), r.endBatch(), this; } else if (t13 === void 0) { var v = { data: Zr(n.data), position: Zr(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 }; v.classes = ""; var h6 = 0; return n.classes.forEach(function(f) { return v.classes += h6++ === 0 ? f : " " + f; }), v; } } }; dt.jsons = function() { for (var t13 = [], e = 0; e < this.length; e++) { var r = this[e], n = r.json(); t13.push(n); } return t13; }; dt.clone = function() { for (var t13 = this.cy(), e = [], r = 0; r < this.length; r++) { var n = this[r], a = n.json(), i = new rl(t13, a, false); e.push(i); } return new Gt(t13, e); }; dt.copy = dt.clone; dt.restore = function() { for (var t13 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true, 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, v = function() { s.splice(d, 1), d--; }; for (d = 0; d < s.length; d++) { var h6 = s[d], f = h6._private, p = f.data; if (h6.clearTraversalCache(), !(!e && !f.removed)) { if (p.id === void 0) p.id = up(); else if (be(p.id)) p.id = "" + p.id; else if (qn(p.id) || !Fe(p.id)) { yt("Can not create element with invalid string ID `" + p.id + "`"), v(); continue; } else if (n.hasElementWithId(p.id)) { yt("Can not create second element with ID `" + p.id + "`"), v(); continue; } } var m = p.id; if (h6.isNode()) { var g = f.position; g.x == null && (g.x = 0), g.y == null && (g.y = 0); } if (h6.isEdge()) { for (var y = h6, b = ["source", "target"], w = b.length, x = false, E = 0; E < w; E++) { var C = b[E], T = p[C]; be(T) && (T = p[C] = "" + p[C]), T == null || T === "" ? (yt("Can not create edge `" + m + "` with unspecified " + C), x = true) : n.hasElementWithId(T) || (yt("Can not create edge `" + m + "` with nonexistant " + C + " `" + T + "`"), x = true); } if (x) { v(); continue; } var k = n.getElementById(p.source), _ = n.getElementById(p.target); k.same(_) ? k._private.edges.push(y) : (k._private.edges.push(y), _._private.edges.push(y)), y._private.source = k, y._private.target = _; } f.map = new Xr(), f.map.set(m, { ele: h6, index: 0 }), f.removed = false, e && n.addToPool(h6); } for (var D = 0; D < i.length; D++) { var O = i[D], F = O._private.data; be(F.parent) && (F.parent = "" + F.parent); var L = F.parent, B = L != null; if (B || O._private.parent) { var I = O._private.parent ? n.collection().merge(O._private.parent) : n.getElementById(L); if (I.empty()) F.parent = void 0; else if (I[0].removed()) tt("Node added with missing parent, reference to parent removed"), F.parent = void 0, O._private.parent = null; else { for (var M = false, A = I; !A.empty(); ) { if (O.same(A)) { M = true, F.parent = void 0; break; } A = A.parent(); } M || (I[0]._private.children.push(O), O._private.parent = I[0], a.hasCompoundNodes = true); } } } if (s.length > 0) { for (var R = s.length === r.length ? r : new Gt(n, s), K = 0; K < R.length; K++) { var H = R[K]; H.isNode() || (H.parallelEdges().clearTraversalCache(), H.source().clearTraversalCache(), H.target().clearTraversalCache()); } var q; a.hasCompoundNodes ? q = n.collection().merge(R).merge(R.connectedNodes()).merge(R.parent()) : q = R, q.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t13), t13 ? R.emitAndNotify("add") : e && R.emit("add"); } return r; }; dt.removed = function() { var t13 = this[0]; return t13 && t13._private.removed; }; dt.inside = function() { var t13 = this[0]; return t13 && !t13._private.removed; }; dt.remove = function() { var t13 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true, r = this, n = [], a = {}, i = r._private.cy; function o(L) { for (var B = L._private.edges, I = 0; I < B.length; I++) u(B[I]); } function s(L) { for (var B = L._private.children, I = 0; I < B.length; I++) u(B[I]); } function u(L) { var B = a[L.id()]; e && L.removed() || B || (a[L.id()] = true, L.isNode() ? (n.push(L), o(L), s(L)) : n.unshift(L)); } for (var l = 0, c = r.length; l < c; l++) { var d = r[l]; u(d); } function v(L, B) { var I = L._private.edges; Kn(I, B), L.clearTraversalCache(); } function h6(L) { L.clearTraversalCache(); } var f = []; f.ids = {}; function p(L, B) { B = B[0], L = L[0]; var I = L._private.children, M = L.id(); Kn(I, B), B._private.parent = null, f.ids[M] || (f.ids[M] = true, f.push(L)); } r.dirtyCompoundBoundsCache(), e && i.removeFromPool(n); for (var m = 0; m < n.length; m++) { var g = n[m]; if (g.isEdge()) { var y = g.source()[0], b = g.target()[0]; v(y, g), v(b, g); for (var w = g.parallelEdges(), x = 0; x < w.length; x++) { var E = w[x]; h6(E), E.isBundledBezier() && E.dirtyBoundingBoxCache(); } } else { var C = g.parent(); C.length !== 0 && p(C, g); } e && (g._private.removed = true); } var T = i._private.elements; i._private.hasCompoundNodes = false; for (var k = 0; k < T.length; k++) { var _ = T[k]; if (_.isParent()) { i._private.hasCompoundNodes = true; break; } } var D = new Gt(this.cy(), n); D.size() > 0 && (t13 ? D.emitAndNotify("remove") : e && D.emit("remove")); for (var O = 0; O < f.length; O++) { var F = f[O]; (!e || !F.removed()) && F.updateStyle(); } return D; }; dt.move = function(t13) { var e = this._private.cy, r = this, n = false, a = false, i = function(f) { return f == null ? f : "" + f; }; if (t13.source !== void 0 || t13.target !== void 0) { var o = i(t13.source), s = i(t13.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 h6 = 0; h6 < r.length; h6++) { var f = r[h6], p = f._private.data; f.isEdge() && (u && (p.source = o), l && (p.target = s)); } r.restore(n, a); }), r.emitAndNotify("move")); } else if (t13.parent !== void 0) { var c = i(t13.parent), d = c === null || e.hasElementWithId(c); if (d) { var v = c === null ? void 0 : c; e.batch(function() { var h6 = r.remove(n, a); h6.emitAndNotify("moveout"); for (var f = 0; f < r.length; f++) { var p = r[f], m = p._private.data; p.isNode() && (m.parent = v); } h6.restore(n, a); }), r.emitAndNotify("move"); } } return this; }; [xp, lD, ds, Rn, li, kD, ll, zD, Wp, Yp, UD, As, fs, Ut, zn, nr].forEach(function(t13) { Re(dt, t13); }); var QD = { add: function(e) { var r, n = this; if (yr(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 Gt(n, i); } } else if (st(e)) { var u = e; r = new Gt(n, u); } else if (Xe(e) && (st(e.nodes) || st(e.edges))) { for (var l = e, c = [], d = ["nodes", "edges"], v = 0, h6 = d.length; v < h6; v++) { var f = d[v], p = l[f]; if (st(p)) for (var m = 0, g = p.length; m < g; m++) { var y = Re({ group: f }, p[m]); c.push(y); } } r = new Gt(n, c); } else { var b = e; r = new rl(n, b).collection(); } return r; }, remove: function(e) { if (!yr(e)) { if (Fe(e)) { var r = e; e = this.$(r); } } return e.remove(); } }; function JD(t13, 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 false; for (var d = 0; d < 4; ++d) if (typeof arguments[d] != "number" || isNaN(arguments[d]) || !isFinite(arguments[d])) return false; t13 = Math.min(t13, 1), r = Math.min(r, 1), t13 = Math.max(t13, 0), r = Math.max(r, 0); var v = c ? new Float32Array(u) : new Array(u); function h6(_, D) { return 1 - 3 * D + 3 * _; } function f(_, D) { return 3 * D - 6 * _; } function p(_) { return 3 * _; } function m(_, D, O) { return ((h6(D, O) * _ + f(D, O)) * _ + p(D)) * _; } function g(_, D, O) { return 3 * h6(D, O) * _ * _ + 2 * f(D, O) * _ + p(D); } function y(_, D) { for (var O = 0; O < a; ++O) { var F = g(D, t13, r); if (F === 0) return D; var L = m(D, t13, r) - _; D -= L / F; } return D; } function b() { for (var _ = 0; _ < u; ++_) v[_] = m(_ * l, t13, r); } function w(_, D, O) { var F, L, B = 0; do L = D + (O - D) / 2, F = m(L, t13, r) - _, F > 0 ? O = L : D = L; while (Math.abs(F) > o && ++B < s); return L; } function x(_) { for (var D = 0, O = 1, F = u - 1; O !== F && v[O] <= _; ++O) D += l; --O; var L = (_ - v[O]) / (v[O + 1] - v[O]), B = D + L * l, I = g(B, t13, r); return I >= i ? y(_, B) : I === 0 ? B : w(_, D, D + l); } var E = false; function C() { E = true, (t13 !== e || r !== n) && b(); } var T = function(D) { return E || C(), t13 === e && r === n ? D : D === 0 ? 0 : D === 1 ? 1 : m(x(D), e, n); }; T.getControlPoints = function() { return [{ x: t13, y: e }, { x: r, y: n }]; }; var k = "generateBezier(" + [t13, e, r, n] + ")"; return T.toString = function() { return k; }, T; } var eP = /* @__PURE__ */ function() { function t13(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: t13(o) }; } function r(n, a) { var i = { dx: n.v, dv: t13(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, v, h6, f; for (a = parseFloat(a) || 500, i = parseFloat(i) || 20, o = o || null, s.tension = a, s.friction = i, v = o !== null, v ? (l = n(a, i), h6 = l / o * d) : h6 = d; f = r(f || s, h6), u.push(1 + f.x), l += 16, Math.abs(f.x) > c && Math.abs(f.v) > c; ) ; return v ? function(p) { return u[p * (u.length - 1) | 0]; } : l; }; }(); var ct = function(e, r, n, a) { var i = JD(e, r, n, a); return function(o, s, u) { return o + (s - o) * i(u); }; }; var vs = { 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 vs.linear; var a = eP(e, r, n); return function(i, o, s) { return i + (o - i) * a(s); }; }, "cubic-bezier": ct }; function Uf(t13, e, r, n, a) { if (n === 1 || e === r) return r; var i = a(e, r, n); return t13 == null || ((t13.roundValue || t13.color) && (i = Math.round(i)), t13.min !== void 0 && (i = Math.max(i, t13.min)), t13.max !== void 0 && (i = Math.min(i, t13.max))), i; } function Gf(t13, e) { return t13.pfValue != null || t13.value != null ? t13.pfValue != null && (e == null || e.type.units !== "%") ? t13.pfValue : t13.value : t13; } function Ma(t13, e, r, n, a) { var i = a != null ? a.type : null; r < 0 ? r = 0 : r > 1 && (r = 1); var o = Gf(t13, a), s = Gf(e, a); if (be(o) && be(s)) return Uf(i, o, s, r, n); if (st(o) && st(s)) { for (var u = [], l = 0; l < s.length; l++) { var c = o[l], d = s[l]; if (c != null && d != null) { var v = Uf(i, c, d, r, n); u.push(v); } else u.push(d); } return u; } } function tP(t13, e, r, n) { var a = !n, i = t13._private, o = e._private, s = o.easing, u = o.startTime, l = n ? t13 : t13.cy(), c = l.style(); if (!o.easingImpl) if (s == null) o.easingImpl = vs.linear; else { var d; if (Fe(s)) { var v = c.parse("transition-timing-function", s); d = v.value; } else d = s; var h6, f; Fe(d) ? (h6 = d, f = []) : (h6 = d[1], f = d.slice(2).map(function(R) { return +R; })), f.length > 0 ? (h6 === "spring" && f.push(o.duration), o.easingImpl = vs[h6].apply(null, f)) : o.easingImpl = vs[h6]; } var p = o.easingImpl, m; if (o.duration === 0 ? m = 1 : m = (r - u) / o.duration, o.applying && (m = o.progress), m < 0 ? m = 0 : m > 1 && (m = 1), o.delay == null) { var g = o.startPosition, y = o.position; if (y && a && !t13.locked()) { var b = {}; Fi(g.x, y.x) && (b.x = Ma(g.x, y.x, m, p)), Fi(g.y, y.y) && (b.y = Ma(g.y, y.y, m, p)), t13.position(b); } var w = o.startPan, x = o.pan, E = i.pan, C = x != null && n; C && (Fi(w.x, x.x) && (E.x = Ma(w.x, x.x, m, p)), Fi(w.y, x.y) && (E.y = Ma(w.y, x.y, m, p)), t13.emit("pan")); var T = o.startZoom, k = o.zoom, _ = k != null && n; _ && (Fi(T, k) && (i.zoom = io(i.minZoom, Ma(T, k, m, p), i.maxZoom)), t13.emit("zoom")), (C || _) && t13.emit("viewport"); var D = o.style; if (D && D.length > 0 && a) { for (var O = 0; O < D.length; O++) { var F = D[O], L = F.name, B = F, I = o.startStyle[L], M = c.properties[I.name], A = Ma(I, B, m, p, M); c.overrideBypass(t13, L, A); } t13.emit("style"); } } return o.progress = m, m; } function Fi(t13, e) { return t13 == null || e == null ? false : be(t13) && be(e) ? true : !!(t13 && e); } function rP(t13, e, r, n) { var a = e._private; a.started = true, a.startTime = r - a.progress * a.duration; } function Wf(t13, e) { var r = e._private.aniEles, n = []; function a(c, d) { var v = c._private, h6 = v.animation.current, f = v.animation.queue, p = false; if (h6.length === 0) { var m = f.shift(); m && h6.push(m); } for (var g = function(E) { for (var C = E.length - 1; C >= 0; C--) { var T = E[C]; T(); } E.splice(0, E.length); }, y = h6.length - 1; y >= 0; y--) { var b = h6[y], w = b._private; if (w.stopped) { h6.splice(y, 1), w.hooked = false, w.playing = false, w.started = false, g(w.frames); continue; } !w.playing && !w.applying || (w.playing && w.applying && (w.applying = false), w.started || rP(c, b, t13), tP(c, b, t13, d), w.applying && (w.applying = false), g(w.frames), w.step != null && w.step(t13), b.completed() && (h6.splice(y, 1), w.hooked = false, w.playing = false, w.started = false, g(w.completes)), p = true); } return !d && h6.length === 0 && f.length === 0 && n.push(c), p; } for (var i = false, o = 0; o < r.length; o++) { var s = r[o], u = a(s); i = i || u; } var l = a(e, true); (i || l) && (r.length > 0 ? e.notify("draw", r) : e.notify("draw")), r.unmerge(n), e.emit("step"); } var nP = { // 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 = false; }, startAnimationLoop: function() { var e = this; if (e._private.animationsRunning = true, !e.styleEnabled()) return; function r() { e._private.animationsRunning && Ps(function(i) { Wf(i, e), r(); }); } var n = e.renderer(); n && n.beforeRender ? n.beforeRender(function(i, o) { Wf(o, e); }, n.beforeRenderPriorities.animations) : r(); } }; var aP = { 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 && Do(n.target) && a.matches(n.target) : true; }, addEventFields: function(e, r) { r.cy = e, r.target = e; }, callbackContext: function(e, r, n) { return r.qualifier != null ? n.target : e; } }; var ts = function(e) { return Fe(e) ? new Un(e) : e; }; var jp = { createEmitter: function() { var e = this._private; return e.emitter || (e.emitter = new ul(aP, this)), this; }, emitter: function() { return this._private.emitter; }, on: function(e, r, n) { return this.emitter().on(e, ts(r), n), this; }, removeListener: function(e, r, n) { return this.emitter().removeListener(e, ts(r), n), this; }, removeAllListeners: function() { return this.emitter().removeAllListeners(), this; }, one: function(e, r, n) { return this.emitter().one(e, ts(r), n), this; }, once: function(e, r, n) { return this.emitter().one(e, ts(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(jp); var vu = { 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); } }; vu.jpeg = vu.jpg; var hs = { layout: function(e) { var r = this; if (e == null) { yt("Layout options must be specified to make a layout"); return; } if (e.name == null) { yt("A `name` must be specified to make a layout"); return; } var n = e.name, a = r.extension("layout", n); if (a == null) { yt("No such layout `" + n + "` found. Did you forget to import it and `cytoscape.use()` it?"); return; } var i; Fe(e.eles) ? i = r.$(e.eles) : i = e.eles != null ? e.eles : r.$(); var o = new a(Re({}, e, { cy: r, eles: i })); return o; } }; hs.createLayout = hs.makeLayout = hs.layout; var iP = { 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(false), e(), this.notifications(true); }, 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); } }); } }; var oP = Wt({ hideEdgesOnViewport: false, textureOnViewport: false, motionBlur: false, motionBlurOpacity: 0.05, pixelRatio: void 0, desktopTapThreshold: 4, touchTapThreshold: 8, wheelSensitivity: 1, debug: false, showFps: false }); var hu = { 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) { yt("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 = oP(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); } }; hu.invalidateDimensions = hu.resize; var ps = { // 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 Fe(e) ? this.$(e) : yr(e) ? e.collection() : st(e) ? (r || (r = {}), new Gt(this, e, r.unique, r.removed)) : new Gt(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; } }; ps.elements = ps.filter = ps.$; var ir = {}; var Ki = "t"; var sP = "f"; ir.apply = function(t13) { for (var e = this, r = e._private, n = r.cy, a = n.collection(), i = 0; i < t13.length; i++) { var o = t13[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 = true; var c = e.updateStyleHints(o); c && a.push(o); } } return a; }; ir.getPropertiesDiff = function(t13, e) { var r = this, n = r._private.propDiffs = r._private.propDiffs || {}, a = t13 + "-" + e, i = n[a]; if (i) return i; for (var o = [], s = {}, u = 0; u < r.length; u++) { var l = r[u], c = t13[u] === Ki, d = e[u] === Ki, v = c !== d, h6 = l.mappedProperties.length > 0; if (v || d && h6) { var f = void 0; v && h6 || v ? f = l.properties : h6 && (f = l.mappedProperties); for (var p = 0; p < f.length; p++) { for (var m = f[p], g = m.name, y = false, b = u + 1; b < r.length; b++) { var w = r[b], x = e[b] === Ki; if (x && (y = w.properties[m.name] != null, y)) break; } !s[g] && !y && (s[g] = true, o.push(g)); } } } return n[a] = o, o; }; ir.getContextMeta = function(t13) { for (var e = this, r = "", n, a = t13._private.styleCxtKey || "", i = 0; i < e.length; i++) { var o = e[i], s = o.selector && o.selector.matches(t13); s ? r += Ki : r += sP; } return n = e.getPropertiesDiff(a, r), t13._private.styleCxtKey = r, { key: r, diffPropNames: n, empty: n.length === 0 }; }; ir.getContextStyle = function(t13) { var e = t13.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] === Ki; 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; }; ir.applyContextStyle = function(t13, e, r) { for (var n = this, a = t13.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: true } : l = { name: u, delete: true }; else continue; if (c !== l) { if (l.mapped === o.fn && c != null && c.mapping != null && c.mapping.value === l.value) { var d = c.mapping, v = d.fnValue = l.value(r); if (v === d.prevFnValue) continue; } var h6 = i[u] = { prev: c }; n.applyParsedProperty(r, l), h6.next = r.pstyle(u), h6.next && h6.next.bypass && (h6.next = h6.next.bypassed); } } return { diffProps: i }; }; ir.updateStyleHints = function(t13) { var e = t13._private, r = this, n = r.propertyGroupNames, a = r.propertyGroupKeys, i = function(Q, ge, Ee) { return r.getPropertiesHash(Q, ge, Ee); }, o = e.styleKey; if (t13.removed()) return false; var s = e.group === "nodes", u = t13._private.style; n = Object.keys(u); for (var l = 0; l < a.length; l++) { var c = a[l]; e.styleKeys[c] = [Va, Bi]; } for (var d = function(Q, ge) { return e.styleKeys[ge][0] = ro(Q, e.styleKeys[ge][0]); }, v = function(Q, ge) { return e.styleKeys[ge][1] = no(Q, e.styleKeys[ge][1]); }, h6 = function(Q, ge) { d(Q, ge), v(Q, ge); }, f = function(Q, ge) { for (var Ee = 0; Ee < Q.length; Ee++) { var fe = Q.charCodeAt(Ee); d(fe, ge), v(fe, ge); } }, p = 2e9, m = function(Q) { return -128 < Q && Q < 128 && Math.floor(Q) !== Q ? p - (Q * 1024 | 0) : Q; }, g = 0; g < n.length; g++) { var y = n[g], b = u[y]; if (b != null) { var w = this.properties[y], x = w.type, E = w.groupKey, C = void 0; w.hashOverride != null ? C = w.hashOverride(t13, b) : b.pfValue != null && (C = b.pfValue); var T = w.enums == null ? b.value : null, k = C != null, _ = T != null, D = k || _, O = b.units; if (x.number && D && !x.multiple) { var F = k ? C : T; h6(m(F), E), !k && O != null && f(O, E); } else f(b.strValue, E); } } for (var L = [Va, Bi], B = 0; B < a.length; B++) { var I = a[B], M = e.styleKeys[I]; L[0] = ro(M[0], L[0]), L[1] = no(M[1], L[1]); } e.styleKey = f5(L[0], L[1]); var A = e.styleKeys; e.labelDimsKey = Dn(A.labelDimensions); var R = i(t13, ["label"], A.labelDimensions); if (e.labelKey = Dn(R), e.labelStyleKey = Dn(Go(A.commonLabel, R)), !s) { var K = i(t13, ["source-label"], A.labelDimensions); e.sourceLabelKey = Dn(K), e.sourceLabelStyleKey = Dn(Go(A.commonLabel, K)); var H = i(t13, ["target-label"], A.labelDimensions); e.targetLabelKey = Dn(H), e.targetLabelStyleKey = Dn(Go(A.commonLabel, H)); } if (s) { var q = e.styleKeys, ee = q.nodeBody, se = q.nodeBorder, oe = q.nodeOutline, ae = q.backgroundImage, ue = q.compound, te = q.pie, $ = [ee, se, oe, ae, ue, te].filter(function(G) { return G != null; }).reduce(Go, [Va, Bi]); e.nodeKey = Dn($), e.hasPie = te != null && te[0] !== Va && te[1] !== Bi; } return o !== e.styleKey; }; ir.clearStyleHints = function(t13) { var e = t13._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; }; ir.applyParsedProperty = function(t13, e) { var r = this, n = e, a = t13._private.style, i, o = r.types, s = r.properties[n.name].type, u = n.bypass, l = a[n.name], c = l && l.bypass, d = t13._private, v = "mapping", h6 = function(ee) { return ee == null ? null : ee.pfValue != null ? ee.pfValue : ee.value; }, f = function() { var ee = h6(l), se = h6(n); r.checkTriggers(t13, n.name, ee, se); }; if (e.name === "curve-style" && t13.isEdge() && // loops must be bundled beziers (e.value !== "bezier" && t13.isLoop() || // edges connected to compound nodes can not be haystacks e.value === "haystack" && (t13.source().isParent() || t13.target().isParent())) && (n = e = this.parse(e.name, "bezier", u)), n.delete) return a[n.name] = void 0, f(), true; if (n.deleteBypassed) return l ? l.bypass ? (l.bypassed = void 0, f(), true) : false : (f(), true); if (n.deleteBypass) return l ? l.bypass ? (a[n.name] = l.bypassed, f(), true) : false : (f(), true); var p = function() { tt("Do not assign mappings to elements without corresponding data (i.e. ele `" + t13.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 m = n.field.split("."), g = d.data, y = 0; y < m.length && g; y++) { var b = m[y]; g = g[b]; } if (g == null) return p(), false; var w; if (be(g)) { var x = n.fieldMax - n.fieldMin; x === 0 ? w = 0 : w = (g - n.fieldMin) / x; } else return tt("Do not use continuous mappers without specifying numeric data (i.e. `" + n.field + ": " + g + "` for `" + t13.id() + "` is non-numeric)"), false; if (w < 0 ? w = 0 : w > 1 && (w = 1), s.color) { var E = n.valueMin[0], C = n.valueMax[0], T = n.valueMin[1], k = n.valueMax[1], _ = n.valueMin[2], D = n.valueMax[2], O = n.valueMin[3] == null ? 1 : n.valueMin[3], F = n.valueMax[3] == null ? 1 : n.valueMax[3], L = [Math.round(E + (C - E) * w), Math.round(T + (k - T) * w), Math.round(_ + (D - _) * w), Math.round(O + (F - 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: L, strValue: "rgb(" + L[0] + ", " + L[1] + ", " + L[2] + ")" }; } else if (s.number) { var B = n.valueMin + (n.valueMax - n.valueMin) * w; i = this.parse(n.name, B, n.bypass, v); } else return false; if (!i) return p(), false; i.mapping = n, n = i; break; } case o.data: { for (var I = n.field.split("."), M = d.data, A = 0; A < I.length && M; A++) { var R = I[A]; M = M[R]; } if (M != null && (i = this.parse(n.name, M, n.bypass, v)), !i) return p(), false; i.mapping = n, n = i; break; } case o.fn: { var K = n.value, H = n.fnValue != null ? n.fnValue : K(t13); if (n.prevFnValue = H, H == null) return tt("Custom function mappers may not return null (i.e. `" + n.name + "` for ele `" + t13.id() + "` is null)"), false; if (i = this.parse(n.name, H, n.bypass, v), !i) return tt("Custom function mappers may not return invalid values for the property type (i.e. `" + n.name + "` for ele `" + t13.id() + "` is invalid)"), false; i.mapping = Zr(n), n = i; break; } case void 0: break; default: return false; } return u ? (c ? n.bypassed = l.bypassed : n.bypassed = l, a[n.name] = n) : c ? l.bypassed = n : a[n.name] = n, f(), true; }; ir.cleanElements = function(t13, e) { for (var r = 0; r < t13.length; r++) { var n = t13[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); } } }; ir.update = function() { var t13 = this._private.cy, e = t13.mutableElements(); e.updateStyle(); }; ir.updateTransitions = function(t13, e) { var r = this, n = t13._private, a = t13.pstyle("transition-property").value, i = t13.pstyle("transition-duration").pfValue, o = t13.pstyle("transition-delay").pfValue; if (a.length > 0 && i > 0) { for (var s = {}, u = false, l = 0; l < a.length; l++) { var c = a[l], d = t13.pstyle(c), v = e[c]; if (v) { var h6 = v.prev, f = h6, p = v.next != null ? v.next : d, m = false, g = void 0, y = 1e-6; f && (be(f.pfValue) && be(p.pfValue) ? (m = p.pfValue - f.pfValue, g = f.pfValue + y * m) : be(f.value) && be(p.value) ? (m = p.value - f.value, g = f.value + y * m) : st(f.value) && st(p.value) && (m = f.value[0] !== p.value[0] || f.value[1] !== p.value[1] || f.value[2] !== p.value[2], g = f.strValue), m && (s[c] = p.strValue, this.applyBypass(t13, c, g), u = true)); } } if (!u) return; n.transitioning = true, new hi(function(b) { o > 0 ? t13.delayAnimation(o).play().promise().then(b) : b(); }).then(function() { return t13.animation({ style: s, duration: i, easing: t13.pstyle("transition-timing-function").value, queue: false }).play().promise(); }).then(function() { r.removeBypasses(t13, a), t13.emitAndNotify("style"), n.transitioning = false; }); } else n.transitioning && (this.removeBypasses(t13, a), t13.emitAndNotify("style"), n.transitioning = false); }; ir.checkTrigger = function(t13, e, r, n, a, i) { var o = this.properties[e], s = a(o); s != null && s(r, n) && i(o); }; ir.checkZOrderTrigger = function(t13, e, r, n) { var a = this; this.checkTrigger(t13, e, r, n, function(i) { return i.triggersZOrder; }, function() { a._private.cy.notify("zorder", t13); }); }; ir.checkBoundsTrigger = function(t13, e, r, n) { this.checkTrigger(t13, e, r, n, function(a) { return a.triggersBounds; }, function(a) { t13.dirtyCompoundBoundsCache(), t13.dirtyBoundingBoxCache(), // only for beziers -- so performance of other edges isn't affected a.triggersBoundsOfParallelBeziers && e === "curve-style" && (r === "bezier" || n === "bezier") && t13.parallelEdges().forEach(function(i) { i.isBundledBezier() && i.dirtyBoundingBoxCache(); }), a.triggersBoundsOfConnectedEdges && e === "display" && (r === "none" || n === "none") && t13.connectedEdges().forEach(function(i) { i.dirtyBoundingBoxCache(); }); }); }; ir.checkTriggers = function(t13, e, r, n) { t13.dirtyStyleCache(), this.checkZOrderTrigger(t13, e, r, n), this.checkBoundsTrigger(t13, e, r, n); }; var Io = {}; Io.applyBypass = function(t13, e, r, n) { var a = this, i = [], o = true; 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, true); c && i.push(c); } } else if (Fe(e)) { var d = this.parse(e, r, true); d && i.push(d); } else if (Xe(e)) { var v = e; n = r; for (var h6 = Object.keys(v), f = 0; f < h6.length; f++) { var p = h6[f], m = v[p]; if (m === void 0 && (m = v[Js(p)]), m !== void 0) { var g = this.parse(p, m, true); g && i.push(g); } } } else return false; if (i.length === 0) return false; for (var y = false, b = 0; b < t13.length; b++) { for (var w = t13[b], x = {}, E = void 0, C = 0; C < i.length; C++) { var T = i[C]; if (n) { var k = w.pstyle(T.name); E = x[T.name] = { prev: k }; } y = this.applyParsedProperty(w, Zr(T)) || y, n && (E.next = w.pstyle(T.name)); } y && this.updateStyleHints(w), n && this.updateTransitions(w, x, o); } return y; }; Io.overrideBypass = function(t13, e, r) { e = lc(e); for (var n = 0; n < t13.length; n++) { var a = t13[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); } }; Io.removeAllBypasses = function(t13, e) { return this.removeBypasses(t13, this.propertyNames, e); }; Io.removeBypasses = function(t13, e, r) { for (var n = true, a = 0; a < t13.length; a++) { for (var i = t13[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 = "", v = this.parse(u, d, true), h6 = o[l.name] = { prev: c }; this.applyParsedProperty(i, v), h6.next = i.pstyle(l.name); } } this.updateStyleHints(i), r && this.updateTransitions(i, o, n); } }; var xc = {}; xc.getEmSizeInPixels = function() { var t13 = this.containerCss("font-size"); return t13 != null ? parseFloat(t13) : 1; }; xc.containerCss = function(t13) { var e = this._private.cy, r = e.container(), n = e.window(); if (n && r && n.getComputedStyle) return n.getComputedStyle(r).getPropertyValue(t13); }; var rn = {}; rn.getRenderedStyle = function(t13, e) { return e ? this.getStylePropertyValue(t13, e, true) : this.getRawStyle(t13, true); }; rn.getRawStyle = function(t13, e) { var r = this; if (t13 = t13[0], t13) { for (var n = {}, a = 0; a < r.properties.length; a++) { var i = r.properties[a], o = r.getStylePropertyValue(t13, i.name, e); o != null && (n[i.name] = o, n[Js(i.name)] = o); } return n; } }; rn.getIndexedStyle = function(t13, e, r, n) { var a = t13.pstyle(e)[r][n]; return a ?? t13.cy().style().getDefaultProperty(e)[r][0]; }; rn.getStylePropertyValue = function(t13, e, r) { var n = this; if (t13 = t13[0], t13) { var a = n.properties[e]; a.alias && (a = a.pointsTo); var i = a.type, o = t13.pstyle(a.name); if (o) { var s = o.value, u = o.units, l = o.strValue; if (r && i.number && s != null && be(s)) { var c = t13.cy().zoom(), d = function(m) { return m * c; }, v = function(m, g) { return d(m) + g; }, h6 = st(s), f = h6 ? u.every(function(p) { return p != null; }) : u != null; return f ? h6 ? s.map(function(p, m) { return v(p, u[m]); }).join(" ") : v(s, u) : h6 ? s.map(function(p) { return Fe(p) ? p : "" + d(p); }).join(" ") : "" + d(s); } else if (l != null) return l; } return null; } }; rn.getAnimationStartStyle = function(t13, e) { for (var r = {}, n = 0; n < e.length; n++) { var a = e[n], i = a.name, o = t13.pstyle(i); o !== void 0 && (Xe(o) ? o = this.parse(i, o.strValue) : o = this.parse(i, o)), o && (r[i] = o); } return r; }; rn.getPropsList = function(t13) { var e = this, r = [], n = t13, 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[lc(s)], c = this.parse(l.name, u); c && r.push(c); } return r; }; rn.getNonDefaultPropertiesHash = function(t13, e, r) { var n = r.slice(), a, i, o, s, u, l; for (u = 0; u < e.length; u++) if (a = e[u], i = t13.pstyle(a, false), i != null) if (i.pfValue != null) n[0] = ro(s, n[0]), n[1] = no(s, n[1]); else for (o = i.strValue, l = 0; l < o.length; l++) s = o.charCodeAt(l), n[0] = ro(s, n[0]), n[1] = no(s, n[1]); return n; }; rn.getPropertiesHash = rn.getNonDefaultPropertiesHash; var fl = {}; fl.appendFromJson = function(t13) { for (var e = this, r = 0; r < t13.length; r++) { var n = t13[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; }; fl.fromJson = function(t13) { var e = this; return e.resetToDefault(), e.appendFromJson(t13), e; }; fl.json = function() { for (var t13 = [], 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; } t13.push({ selector: n ? n.toString() : "core", style: i }); } return t13; }; var Ec = {}; Ec.appendFromString = function(t13) { var e = this, r = this, n = "" + t13, 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 v = new Un(d); if (v.invalid) { tt("Skipping parsing of block: Invalid selector found in string stylesheet: " + d), s(); continue; } } var h6 = c[2], f = false; i = h6; for (var p = []; ; ) { var m = i.match(/^\s*$/); if (m) break; var g = i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/); if (!g) { tt("Skipping parsing of block: Invalid formatting of style property and value definitions found in:" + h6), f = true; break; } o = g[0]; var y = g[1], b = g[2], w = e.properties[y]; if (!w) { tt("Skipping property: Invalid property name in: " + o), u(); continue; } var x = r.parse(y, b); if (!x) { tt("Skipping property: Invalid property definition in: " + o), u(); continue; } p.push({ name: y, val: b }), u(); } if (f) { 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; }; Ec.fromString = function(t13) { var e = this; return e.resetToDefault(), e.appendFromString(t13), e; }; var Rt = {}; (function() { var t13 = It, e = pT, r = mT, n = yT, a = bT, i = function($) { return "^" + $ + "\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"; }, o = function($) { var G = t13 + "|\\w+|" + e + "|" + r + "|" + n + "|" + a; return "^" + $ + "\\s*\\(([\\w\\.]+)\\s*\\,\\s*(" + t13 + ")\\s*\\,\\s*(" + t13 + ")\\s*,\\s*(" + G + ")\\s*\\,\\s*(" + G + ")\\)$"; }, s = [`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`, "^(none)$", "^(.+)$"]; Rt.types = { time: { number: true, min: 0, units: "s|ms", implicitUnits: "ms" }, percent: { number: true, min: 0, max: 100, units: "%", implicitUnits: "%" }, percentages: { number: true, min: 0, max: 100, units: "%", implicitUnits: "%", multiple: true }, zeroOneNumber: { number: true, min: 0, max: 1, unitless: true }, zeroOneNumbers: { number: true, min: 0, max: 1, unitless: true, multiple: true }, nOneOneNumber: { number: true, min: -1, max: 1, unitless: true }, nonNegativeInt: { number: true, min: 0, integer: true, unitless: true }, nonNegativeNumber: { number: true, min: 0, unitless: true }, position: { enums: ["parent", "origin"] }, nodeSize: { number: true, min: 0, enums: ["label"] }, number: { number: true, unitless: true }, numbers: { number: true, unitless: true, multiple: true }, positiveNumber: { number: true, unitless: true, min: 0, strictMin: true }, size: { number: true, min: 0 }, bidirectionalSize: { number: true }, // allows negative bidirectionalSizeMaybePercent: { number: true, allowPercent: true }, // allows negative bidirectionalSizes: { number: true, multiple: true }, // allows negative sizeMaybePercent: { number: true, min: 0, allowPercent: true }, axisDirection: { enums: ["horizontal", "leftward", "rightward", "vertical", "upward", "downward", "auto"] }, paddingRelativeTo: { enums: ["width", "height", "average", "min", "max"] }, bgWH: { number: true, min: 0, allowPercent: true, enums: ["auto"], multiple: true }, bgPos: { number: true, allowPercent: true, multiple: true }, bgRelativeTo: { enums: ["inner", "include-padding"], multiple: true }, bgRepeat: { enums: ["repeat", "repeat-x", "repeat-y", "no-repeat"], multiple: true }, bgFit: { enums: ["none", "contain", "cover"], multiple: true }, bgCrossOrigin: { enums: ["anonymous", "use-credentials", "null"], multiple: true }, bgClip: { enums: ["none", "node"], multiple: true }, bgContainment: { enums: ["inside", "over"], multiple: true }, color: { color: true }, colors: { color: true, multiple: true }, fill: { enums: ["solid", "linear-gradient", "radial-gradient"] }, bool: { enums: ["yes", "no"] }, bools: { enums: ["yes", "no"], multiple: true }, 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: true }, 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: true, 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: true, 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: true }, data: { mapping: true, regex: i("data") }, layoutData: { mapping: true, regex: i("layoutData") }, scratch: { mapping: true, regex: i("scratch") }, mapData: { mapping: true, regex: o("mapData") }, mapLayoutData: { mapping: true, regex: o("mapLayoutData") }, mapScratch: { mapping: true, regex: o("mapScratch") }, fn: { mapping: true, fn: true }, url: { regexes: s, singleRegexMatchValue: true }, urls: { regexes: s, singleRegexMatchValue: true, multiple: true }, propList: { propList: true }, angle: { number: true, units: "deg|rad", implicitUnits: "rad" }, textRotation: { number: true, units: "deg|rad", implicitUnits: "rad", enums: ["none", "autorotate"] }, polygonPointList: { number: true, multiple: true, evenMultiple: true, min: -1, max: 1, unitless: true }, edgeDistances: { enums: ["intersection", "node-position", "endpoints"] }, edgeEndpoint: { number: true, multiple: true, 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: true, validate: function($, G) { switch ($.length) { case 2: return G[0] !== "deg" && G[0] !== "rad" && G[1] !== "deg" && G[1] !== "rad"; case 1: return Fe($[0]) || G[0] === "deg" || G[0] === "rad"; default: return false; } } }, easing: { regexes: ["^(spring)\\s*\\(\\s*(" + t13 + ")\\s*,\\s*(" + t13 + ")\\s*\\)$", "^(cubic-bezier)\\s*\\(\\s*(" + t13 + ")\\s*,\\s*(" + t13 + ")\\s*,\\s*(" + t13 + ")\\s*,\\s*(" + t13 + ")\\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: true, multiple: true, min: 0, validate: function($) { var G = $.length; return G === 1 || G === 2 || G === 4; } } }; var u = { zeroNonZero: function($, G) { return ($ == null || G == null) && $ !== G || $ == 0 && G != 0 ? true : $ != 0 && G == 0; }, any: function($, G) { return $ != G; }, emptyNonEmpty: function($, G) { var Q = qn($), ge = qn(G); return Q && !ge || !Q && ge; } }, l = Rt.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 }], v = [{ 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 }], h6 = [{ 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 }], f = [{ 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 }], m = [{ name: "display", type: l.display, triggersZOrder: u.any, triggersBounds: u.any, triggersBoundsOfConnectedEdges: true }, { 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 }], g = [{ 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 }], y = [{ 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($, G) { return G.value === "label" ? -$.poolIndex() : G.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 }], T = [{ 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 }], k = [{ 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: true }, { 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 }], D = [{ 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 }], F = []; Rt.pieBackgroundN = 16, F.push({ name: "pie-size", type: l.sizeMaybePercent }); for (var L = 1; L <= Rt.pieBackgroundN; L++) F.push({ name: "pie-" + L + "-background-color", type: l.color }), F.push({ name: "pie-" + L + "-background-size", type: l.percent }), F.push({ name: "pie-" + L + "-background-opacity", type: l.zeroOneNumber }); var B = [], I = Rt.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(te) { I.forEach(function($) { var G = $ + "-" + te.name, Q = te.type, ge = te.triggersBounds; B.push({ name: G, type: Q, triggersBounds: ge }); }); }, {}); var M = Rt.properties = [].concat(p, b, m, g, y, D, f, h6, c, d, v, x, E, C, T, F, k, _, B, O), A = Rt.propertyGroups = { // common to all eles behavior: p, transition: b, visibility: m, overlay: g, underlay: y, ghost: D, // labels commonLabel: f, labelDimensions: h6, mainLabel: c, sourceLabel: d, targetLabel: v, // node props nodeBody: x, nodeBorder: E, nodeOutline: C, backgroundImage: T, pie: F, compound: k, // edge props edgeLine: _, edgeArrow: B, core: O }, R = Rt.propertyGroupNames = {}, K = Rt.propertyGroupKeys = Object.keys(A); K.forEach(function(te) { R[te] = A[te].map(function($) { return $.name; }), A[te].forEach(function($) { return $.groupKey = te; }); }); var H = Rt.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" }]; Rt.propertyNames = M.map(function(te) { return te.name; }); for (var q = 0; q < M.length; q++) { var ee = M[q]; M[ee.name] = ee; } for (var se = 0; se < H.length; se++) { var oe = H[se], ae = M[oe.pointsTo], ue = { name: oe.name, alias: true, pointsTo: ae }; M.push(ue), M[oe.name] = ue; } })(); Rt.getDefaultProperty = function(t13) { return this.getDefaultProperties()[t13]; }; Rt.getDefaultProperties = function() { var t13 = this._private; if (t13.defaultProperties != null) return t13.defaultProperties; for (var e = Re({ // 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 <= Rt.pieBackgroundN; c++) { var d = l.name.replace("{{i}}", c), v = l.value; u[d] = v; } 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 Rt.arrowPrefixes.forEach(function(c) { var d = c + "-" + l.name, v = l.value; u[d] = v; }), 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 t13.defaultProperties = r, t13.defaultProperties; }; Rt.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 vl = {}; vl.parse = function(t13, e, r, n) { var a = this; if (pt(e)) return a.parseImplWarn(t13, e, r, n); var i = n === "mapping" || n === true || n === false || n == null ? "dontcare" : n, o = r ? "t" : "f", s = "" + e, u = op(t13, s, o, i), l = a.propCache = a.propCache || [], c; return (c = l[u]) || (c = l[u] = a.parseImplWarn(t13, e, r, n)), (r || n === "mapping") && (c = Zr(c), c && (c.value = Zr(c.value))), c; }; vl.parseImplWarn = function(t13, e, r, n) { var a = this.parseImpl(t13, e, r, n); return !a && e != null && tt("The style property `".concat(t13, ": ").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; }; vl.parseImpl = function(t13, e, r, n) { var a = this; t13 = lc(t13); var i = a.properties[t13], o = e, s = a.types; if (!i || e === void 0) return null; i.alias && (i = i.pointsTo, t13 = i.name); var u = Fe(e); u && (e = e.trim()); var l = i.type; if (!l) return null; if (r && (e === "" || e === null)) return { name: t13, value: e, bypass: true, deleteBypass: true }; if (pt(e)) return { name: t13, 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 false; var v = s.data; return { name: t13, value: c, strValue: "" + e, mapped: v, 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 false; var h6 = s.mapData; if (!(l.color || l.number)) return false; var f = this.parse(t13, d[4]); if (!f || f.mapped) return false; var p = this.parse(t13, d[5]); if (!p || p.mapped) return false; if (f.pfValue === p.pfValue || f.strValue === p.strValue) return tt("`" + t13 + ": " + e + "` is not a valid mapper because the output range is zero; converting to `" + t13 + ": " + f.strValue + "`"), this.parse(t13, f.strValue); if (l.color) { var m = f.value, g = p.value, y = m[0] === g[0] && m[1] === g[1] && m[2] === g[2] && // optional alpha (m[3] === g[3] || (m[3] == null || m[3] === 1) && (g[3] == null || g[3] === 1)); if (y) return false; } return { name: t13, value: d, strValue: "" + e, mapped: h6, field: d[1], fieldMin: parseFloat(d[2]), // min & max are numeric fieldMax: parseFloat(d[3]), valueMin: f.value, valueMax: p.value, bypass: r }; } } if (l.multiple && n !== "multiple") { var b; if (u ? b = e.split(/\s+/) : st(e) ? b = e : b = [e], l.evenMultiple && b.length % 2 !== 0) return null; for (var w = [], x = [], E = [], C = "", T = false, k = 0; k < b.length; k++) { var _ = a.parse(t13, b[k], r, "multiple"); T = T || Fe(_.value), w.push(_.value), E.push(_.pfValue != null ? _.pfValue : _.value), x.push(_.units), C += (k > 0 ? " " : "") + _.strValue; } return l.validate && !l.validate(w, x) ? null : l.singleEnum && T ? w.length === 1 && Fe(w[0]) ? { name: t13, value: w[0], strValue: w[0], bypass: r } : null : { name: t13, value: w, pfValue: E, strValue: C, bypass: r, units: x }; } var D = function() { for (var $ = 0; $ < l.enums.length; $++) { var G = l.enums[$]; if (G === e) return { name: t13, value: e, strValue: "" + e, bypass: r }; } return null; }; if (l.number) { var O, F = "px"; if (l.units && (O = l.units), l.implicitUnits && (F = l.implicitUnits), !l.unitless) if (u) { var L = "px|em" + (l.allowPercent ? "|\\%" : ""); O && (L = O); var B = e.match("^(" + It + ")(" + L + ")?$"); B && (e = B[1], O = B[2] || F); } else (!O || l.implicitUnits) && (O = F); if (e = parseFloat(e), isNaN(e) && l.enums === void 0) return null; if (isNaN(e) && l.enums !== void 0) return e = o, D(); if (l.integer && !lT(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 I = { name: t13, value: e, strValue: "" + e + (O || ""), units: O, bypass: r }; return l.unitless || O !== "px" && O !== "em" ? I.pfValue = e : I.pfValue = O === "px" || !O ? e : this.getEmSizeInPixels() * e, (O === "ms" || O === "s") && (I.pfValue = O === "ms" ? e : 1e3 * e), (O === "deg" || O === "rad") && (I.pfValue = O === "rad" ? e : H5(e)), O === "%" && (I.pfValue = e / 100), I; } else if (l.propList) { var M = [], A = "" + e; if (A !== "none") { for (var R = A.split(/\s*,\s*|\s+/), K = 0; K < R.length; K++) { var H = R[K].trim(); a.properties[H] ? M.push(H) : tt("`" + H + "` is not a valid property name"); } if (M.length === 0) return null; } return { name: t13, value: M, strValue: M.length === 0 ? "none" : M.join(" "), bypass: r }; } else if (l.color) { var q = ST(e); return q ? { name: t13, value: q, pfValue: q, strValue: "rgb(" + q[0] + "," + q[1] + "," + q[2] + ")", // n.b. no spaces b/c of multiple support bypass: r } : null; } else if (l.regex || l.regexes) { if (l.enums) { var ee = D(); if (ee) return ee; } for (var se = l.regexes ? l.regexes : [l.regex], oe = 0; oe < se.length; oe++) { var ae = new RegExp(se[oe]), ue = ae.exec(e); if (ue) return { name: t13, value: l.singleRegexMatchValue ? ue[1] : ue, strValue: "" + e, bypass: r }; } return null; } else return l.string ? { name: t13, value: "" + e, strValue: "" + e, bypass: r } : l.enums ? D() : null; }; var rr = function t9(e) { if (!(this instanceof t9)) return new t9(e); if (!sc(e)) { yt("A style must have a core reference"); return; } this._private = { cy: e, coreStyle: {} }, this.length = 0, this.resetToDefault(); }; var ar = rr.prototype; ar.instanceString = function() { return "style"; }; ar.clear = function() { for (var t13 = this._private, e = t13.cy, r = e.elements(), n = 0; n < this.length; n++) this[n] = void 0; return this.length = 0, t13.contextStyles = {}, t13.propDiffs = {}, this.cleanElements(r, true), r.forEach(function(a) { var i = a[0]._private; i.styleDirty = true, i.appliedInitStyle = false; }), this; }; ar.resetToDefault = function() { return this.clear(), this.addDefaultStylesheet(), this; }; ar.core = function(t13) { return this._private.coreStyle[t13] || this.getDefaultProperty(t13); }; ar.selector = function(t13) { var e = t13 === "core" ? null : new Un(t13), r = this.length++; return this[r] = { selector: e, properties: [], mappedProperties: [], index: r }, this; }; ar.css = function() { var t13 = this, e = arguments; if (e.length === 1) for (var r = e[0], n = 0; n < t13.properties.length; n++) { var a = t13.properties[n], i = r[a.name]; i === void 0 && (i = r[Js(a.name)]), i !== void 0 && this.cssRule(a.name, i); } else e.length === 2 && this.cssRule(e[0], e[1]); return this; }; ar.style = ar.css; ar.cssRule = function(t13, e) { var r = this.parse(t13, 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 = true), r.mapped && this[n].mappedProperties.push(r); var a = !this[n].selector; a && (this._private.coreStyle[r.name] = r); } return this; }; ar.append = function(t13) { return Xh(t13) ? t13.appendToStyle(this) : st(t13) ? this.appendFromJson(t13) : Fe(t13) && this.appendFromString(t13), this; }; rr.fromJson = function(t13, e) { var r = new rr(t13); return r.fromJson(e), r; }; rr.fromString = function(t13, e) { return new rr(t13).fromString(e); }; [ir, Io, xc, rn, fl, Ec, Rt, vl].forEach(function(t13) { Re(ar, t13); }); rr.types = ar.types; rr.properties = ar.properties; rr.propertyGroups = ar.propertyGroups; rr.propertyGroupNames = ar.propertyGroupNames; rr.propertyGroupKeys = ar.propertyGroupKeys; var lP = { style: function(e) { if (e) { var r = this.setStyle(e); r.update(); } return this._private.style; }, setStyle: function(e) { var r = this._private; return Xh(e) ? r.style = e.generateStyle(this) : st(e) ? r.style = rr.fromJson(this, e) : Fe(e) ? r.style = rr.fromString(this, e) : r.style = rr(this), r.style; }, // e.g. cy.data() changed => recalc ele mappers updateStyle: function() { this.mutableElements().updateStyle(); } }; var uP = "single"; var Ca = { 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 = uP), 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 (Fe(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, be(o) && (r.x = o), be(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") && be(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, be(u) && (a.x += u), be(l) && (a.y += l), this.emit("pan viewport")); break; case 2: i = e, o = r, (i === "x" || i === "y") && be(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 (be(e) && r === void 0 && (r = e, e = void 0), !(!this._private.panningEnabled || !this._private.zoomingEnabled)) { var n; if (Fe(e)) { var a = e; e = this.$(a); } else if (dT(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 yr(e) || (e = this.mutableElements()); if (!(yr(e) && e.empty())) { n = n || e.boundingBox(); var o = this.width(), s = this.height(), u; if (r = be(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 be(e) && be(r) && e <= r ? (n.minZoom = e, n.maxZoom = r) : be(e) && r === void 0 && e <= n.maxZoom ? n.minZoom = e : be(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 = false; if (r.zoomingEnabled || (s = true), be(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 = true)), o = o > r.maxZoom ? r.maxZoom : o, o = o < r.minZoom ? r.minZoom : o, s || !be(o) || o === a || i != null && (!be(i.x) || !be(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: true, panned: true, zoom: c, pan: d }; } else return { zoomed: true, panned: false, 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 = true, a = true, i = [], o = false, s = false; if (!e) return this; if (be(e.zoom) || (n = false), Xe(e.pan) || (a = false), !n && !a) return this; if (n) { var u = e.zoom; u < r.minZoom || u > r.maxZoom || !r.zoomingEnabled ? o = true : (r.zoom = u, i.push("zoom")); } if (a && (!o || !e.cancelOnFailedZoom) && r.panningEnabled) { var l = e.pan; be(l.x) && (r.pan.x = l.x, s = false), be(l.y) && (r.pan.y = l.y, s = false), 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 (Fe(e)) { var n = e; e = this.mutableElements().filter(n); } else yr(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; } }; Ca.centre = Ca.center; Ca.autolockNodes = Ca.autolock; Ca.autoungrabifyNodes = Ca.autoungrabify; var co = { data: et.data({ field: "data", bindingEvent: "data", allowBinding: true, allowSetting: true, settingEvent: "data", settingTriggersEvent: true, triggerFnName: "trigger", allowGetting: true, updateStyle: true }), removeData: et.removeData({ field: "data", event: "data", triggerFnName: "trigger", triggerEvent: true, updateStyle: true }), scratch: et.data({ field: "scratch", bindingEvent: "scratch", allowBinding: true, allowSetting: true, settingEvent: "scratch", settingTriggersEvent: true, triggerFnName: "trigger", allowGetting: true, updateStyle: true }), removeScratch: et.removeData({ field: "scratch", event: "scratch", triggerFnName: "trigger", triggerEvent: true, updateStyle: true }) }; co.attr = co.data; co.removeAttr = co.removeData; var fo = function(e) { var r = this; e = Re({}, e); var n = e.container; n && !Ds(n) && Ds(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 = Ot !== void 0 && n !== void 0 && !e.headless, s = e; s.layout = Re({ name: o ? "grid" : "null" }, s.layout), s.renderer = Re({ name: o ? "canvas" : "null" }, s.renderer); var u = function(f, p, m) { return p !== void 0 ? p : m !== void 0 ? m : f; }, l = this._private = { container: n, // html dom ele container ready: false, // whether ready has been triggered options: s, // cached options elements: new Gt(this), // elements in the graph listeners: [], // list of listeners aniEles: new Gt(this), // elements being animated data: s.data || {}, // data for the core scratch: {}, // scratch object for core layout: null, renderer: null, destroyed: false, // whether destroy was called notificationsEnabled: true, // whether notifications are sent to the renderer minZoom: 1e-50, maxZoom: 1e50, zoomingEnabled: u(true, s.zoomingEnabled), userZoomingEnabled: u(true, s.userZoomingEnabled), panningEnabled: u(true, s.panningEnabled), userPanningEnabled: u(true, s.userPanningEnabled), boxSelectionEnabled: u(true, s.boxSelectionEnabled), autolock: u(false, s.autolock, s.autolockNodes), autoungrabify: u(false, s.autoungrabify, s.autoungrabifyNodes), autounselectify: u(false, s.autounselectify), styleEnabled: s.styleEnabled === void 0 ? o : s.styleEnabled, zoom: be(s.zoom) ? s.zoom : 1, pan: { x: Xe(s.pan) && be(s.pan.x) ? s.pan.x : 0, y: Xe(s.pan) && be(s.pan.y) ? s.pan.y : 0 }, animation: { // object for currently-running animations current: [], queue: [] }, hasCompoundNodes: false, multiClickDebounceTime: u(250, s.multiClickDebounceTime) }; this.createEmitter(), this.selectionType(s.selectionType), this.zoomRange({ min: s.minZoom, max: s.maxZoom }); var c = function(f, p) { var m = f.some(fT); if (m) return hi.all(f).then(p); p(f); }; l.styleEnabled && r.setStyle([]); var d = Re({}, s, s.renderer); r.initRenderer(d); var v = function(f, p, m) { r.notifications(false); var g = r.mutableElements(); g.length > 0 && g.remove(), f != null && (Xe(f) || st(f)) && r.add(f), r.one("layoutready", function(b) { r.notifications(true), r.emit(b), r.one("load", p), r.emitAndNotify("load"); }).one("layoutstop", function() { r.one("done", m), r.emit("done"); }); var y = Re({}, r._private.options.layout); y.eles = r.elements(), r.layout(y).run(); }; c([s.style, s.elements], function(h6) { var f = h6[0], p = h6[1]; l.styleEnabled && r.style().append(f), v(p, function() { r.startAnimationLoop(), l.ready = true, pt(s.ready) && r.on("ready", s.ready); for (var m = 0; m < i.length; m++) { var g = i[m]; r.on("ready", g); } a && (a.readies = []), r.emit("ready"); }, s.done); }); }; var Ms = fo.prototype; Re(Ms, { 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 = true, 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 Ot; var r = this._private.container.ownerDocument; return r === void 0 || r == null ? Ot : r.defaultView || Ot; }, mount: function(e) { if (e != null) { var r = this, n = r._private, a = n.options; return !Ds(e) && Ds(e[0]) && (e = e[0]), r.stopAnimationLoop(), r.destroyRenderer(), n.container = e, n.styleEnabled = true, r.invalidateSize(), r.initRenderer(Re({}, 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 Zr(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 = [], T = 0; T < w.length; T++) { var k = w[T]; if (!k.data.id) { tt("cy.json() cannot handle elements without an ID attribute"); continue; } var _ = "" + k.data.id, D = r.getElementById(_); o[_] = true, D.length !== 0 ? C.push({ ele: D, json: k }) : (x && (k.group = x), E.push(k)); } r.add(E); for (var O = 0; O < C.length; O++) { var F = C[O], L = F.ele, B = F.json; L.json(B); } }; if (st(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]; st(d) && s(d, c); } var v = r.collection(); a.filter(function(b) { return !o[b.id()]; }).forEach(function(b) { b.isParent() ? v.merge(b) : b.remove(); }), v.forEach(function(b) { return b.children().move({ parent: null }); }), v.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 h6 = ["minZoom", "maxZoom", "zoomingEnabled", "userZoomingEnabled", "panningEnabled", "userPanningEnabled", "boxSelectionEnabled", "autolock", "autoungrabify", "autounselectify", "multiClickDebounceTime"], f = 0; f < h6.length; f++) { var p = h6[f]; e[p] != null && r[p](e[p]); } return r.endBatch(), this; } else { var m = !!e, g = {}; m ? g.elements = this.elements().map(function(b) { return b.json(); }) : (g.elements = {}, a.forEach(function(b) { var w = b.group(); g.elements[w] || (g.elements[w] = []), g.elements[w].push(b.json()); })), this._private.styleEnabled && (g.style = r.style().json()), g.data = Zr(r.data()); var y = n.options; return g.zoomingEnabled = n.zoomingEnabled, g.userZoomingEnabled = n.userZoomingEnabled, g.zoom = n.zoom, g.minZoom = n.minZoom, g.maxZoom = n.maxZoom, g.panningEnabled = n.panningEnabled, g.userPanningEnabled = n.userPanningEnabled, g.pan = Zr(n.pan), g.boxSelectionEnabled = n.boxSelectionEnabled, g.renderer = Zr(y.renderer), g.hideEdgesOnViewport = y.hideEdgesOnViewport, g.textureOnViewport = y.textureOnViewport, g.wheelSensitivity = y.wheelSensitivity, g.motionBlur = y.motionBlur, g.multiClickDebounceTime = y.multiClickDebounceTime, g; } } }); Ms.$id = Ms.getElementById; [QD, nP, jp, vu, hs, iP, hu, ps, lP, Ca, co].forEach(function(t13) { Re(Ms, t13); }); var cP = { fit: true, // whether to fit the viewport to the graph directed: false, // whether the tree is directed downwards (or edges can point in any direction if false) padding: 30, // padding on fit circle: false, // put depths in concentric circles if true, put depths top down if false grid: false, // 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: true, // prevents node overlap, may overflow boundingBox if not enough space nodeDimensionsIncludeLabels: false, // 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: false, // 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 true; }, // 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 }; var dP = { maximal: false, // 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: false // 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 }; var Ba = function(e) { return e.scratch("breadthfirst"); }; var Yf = function(e, r) { return e.scratch("breadthfirst", r); }; function Qp(t13) { this.options = Re({}, cP, dP, t13); } Qp.prototype.run = function() { var t13 = this.options, e = t13, r = t13.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 = pr(e.boundingBox ? e.boundingBox : { x1: 0, y1: 0, w: r.width(), h: r.height() }), l; if (yr(e.roots)) l = e.roots; else if (st(e.roots)) { for (var c = [], d = 0; d < e.roots.length; d++) { var v = e.roots[d], h6 = r.getElementById(v); c.push(h6); } l = r.collection(c); } else if (Fe(e.roots)) l = r.$(e.roots); else if (o) l = a.roots(); else { var f = n.components(); l = r.collection(); for (var p = function(me) { var Ce = f[me], ke = Ce.maxDegree(false), xe = Ce.filter(function(De) { return De.degree(false) === ke; }); l = l.add(xe); }, m = 0; m < f.length; m++) p(m); } var g = [], y = {}, b = function(me, Ce) { g[Ce] == null && (g[Ce] = []); var ke = g[Ce].length; g[Ce].push(me), Yf(me, { index: ke, depth: Ce }); }, w = function(me, Ce) { var ke = Ba(me), xe = ke.depth, De = ke.index; g[xe][De] = null, b(me, Ce); }; i.bfs({ roots: l, directed: e.directed, visit: function(me, Ce, ke, xe, De) { var qe = me[0], Ke = qe.id(); b(qe, De), y[Ke] = true; } }); for (var x = [], E = 0; E < a.length; E++) { var C = a[E]; y[C.id()] || x.push(C); } var T = function(me) { for (var Ce = g[me], ke = 0; ke < Ce.length; ke++) { var xe = Ce[ke]; if (xe == null) { Ce.splice(ke, 1), ke--; continue; } Yf(xe, { depth: me, index: ke }); } }, k = function() { for (var me = 0; me < g.length; me++) T(me); }, _ = function(me, Ce) { for (var ke = Ba(me), xe = me.incomers().filter(function(S) { return S.isNode() && n.has(S); }), De = -1, qe = me.id(), Ke = 0; Ke < xe.length; Ke++) { var Be = xe[Ke], Ge = Ba(Be); De = Math.max(De, Ge.depth); } if (ke.depth <= De) { if (!e.acyclic && Ce[qe]) return null; var le = De + 1; return w(me, le), Ce[qe] = le, true; } return false; }; if (o && s) { var D = [], O = {}, F = function(me) { return D.push(me); }, L = function() { return D.shift(); }; for (a.forEach(function(fe) { return D.push(fe); }); D.length > 0; ) { var B = L(), I = _(B, O); if (I) B.outgoers().filter(function(fe) { return fe.isNode() && n.has(fe); }).forEach(F); else if (I === null) { tt("Detected double maximal shift for node `" + B.id() + "`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs."); break; } } } k(); var M = 0; if (e.avoidOverlap) for (var A = 0; A < a.length; A++) { var R = a[A], K = R.layoutDimensions(e), H = K.w, q = K.h; M = Math.max(M, H, q); } var ee = {}, se = function(me) { if (ee[me.id()]) return ee[me.id()]; for (var Ce = Ba(me).depth, ke = me.neighborhood(), xe = 0, De = 0, qe = 0; qe < ke.length; qe++) { var Ke = ke[qe]; if (!(Ke.isEdge() || Ke.isParent() || !a.has(Ke))) { var Be = Ba(Ke); if (Be != null) { var Ge = Be.index, le = Be.depth; if (!(Ge == null || le == null)) { var S = g[le].length; le < Ce && (xe += Ge / S, De++); } } } } return De = Math.max(1, De), xe = xe / De, De === 0 && (xe = 0), ee[me.id()] = xe, xe; }, oe = function(me, Ce) { var ke = se(me), xe = se(Ce), De = ke - xe; return De === 0 ? Qh(me.id(), Ce.id()) : De; }; e.depthSort !== void 0 && (oe = e.depthSort); for (var ae = 0; ae < g.length; ae++) g[ae].sort(oe), T(ae); for (var ue = [], te = 0; te < x.length; te++) ue.push(x[te]); g.unshift(ue), k(); for (var $ = 0, G = 0; G < g.length; G++) $ = Math.max(g[G].length, $); var Q = { x: u.x1 + u.w / 2, y: u.x1 + u.h / 2 }, ge = g.reduce(function(fe, me) { return Math.max(fe, me.length); }, 0), Ee = function(me) { var Ce = Ba(me), ke = Ce.depth, xe = Ce.index, De = g[ke].length, qe = Math.max(u.w / ((e.grid ? ge : De) + 1), M), Ke = Math.max(u.h / (g.length + 1), M), Be = Math.min(u.w / 2 / g.length, u.h / 2 / g.length); if (Be = Math.max(Be, M), e.circle) { var le = Be * ke + Be - (g.length > 0 && g[0].length <= 3 ? Be / 2 : 0), S = 2 * Math.PI / g[ke].length * xe; return ke === 0 && g[0].length === 1 && (le = 1), { x: Q.x + le * Math.cos(S), y: Q.y + le * Math.sin(S) }; } else { var Ge = { x: Q.x + (xe + 1 - (De + 1) / 2) * qe, y: (ke + 1) * Ke }; return Ge; } }; return n.nodes().layoutPositions(this, e, Ee), this; }; var fP = { fit: true, // 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: true, // prevents node overlap, may overflow boundingBox and radius if not enough space nodeDimensionsIncludeLabels: false, // 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: true, // 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: false, // 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 true; }, // 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 Jp(t13) { this.options = Re({}, fP, t13); } Jp.prototype.run = function() { var t13 = this.options, e = t13, r = t13.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 = pr(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, v = 0; v < i.length; v++) { var h6 = i[v], f = h6.layoutDimensions(e), p = f.w, m = f.h; d = Math.max(d, p, m); } if (be(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 g = Math.cos(l) - Math.cos(0), y = Math.sin(l) - Math.sin(0), b = Math.sqrt(d * d / (g * g + y * y)); c = Math.max(b, c); } var w = function(E, C) { var T = e.startAngle + C * l * (a ? 1 : -1), k = c * Math.cos(T), _ = c * Math.sin(T), D = { x: s.x + k, y: s.y + _ }; return D; }; return n.nodes().layoutPositions(this, e, w), this; }; var vP = { fit: true, // 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: true, // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) equidistant: false, // 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: true, // prevents node overlap, may overflow boundingBox if not enough space nodeDimensionsIncludeLabels: false, // 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: false, // 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 true; }, // 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 eg(t13) { this.options = Re({}, vP, t13); } eg.prototype.run = function() { for (var t13 = this.options, e = t13, r = e.counterclockwise !== void 0 ? !e.counterclockwise : e.clockwise, n = t13.cy, a = e.eles, i = a.nodes().not(":parent"), o = pr(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], v = void 0; v = e.concentric(d), u.push({ value: v, node: d }), d._private.scratch.concentric = v; } i.updateStyle(); for (var h6 = 0; h6 < i.length; h6++) { var f = i[h6], p = f.layoutDimensions(e); l = Math.max(l, p.w, p.h); } u.sort(function(fe, me) { return me.value - fe.value; }); for (var m = e.levelWidth(i), g = [[]], y = g[0], b = 0; b < u.length; b++) { var w = u[b]; if (y.length > 0) { var x = Math.abs(y[0].value - w.value); x >= m && (y = [], g.push(y)); } y.push(w); } var E = l + e.minNodeSpacing; if (!e.avoidOverlap) { var C = g.length > 0 && g[0].length > 1, T = Math.min(o.w, o.h) / 2 - E, k = T / (g.length + C ? 1 : 0); E = Math.min(E, k); } for (var _ = 0, D = 0; D < g.length; D++) { var O = g[D], F = e.sweep === void 0 ? 2 * Math.PI - 2 * Math.PI / O.length : e.sweep, L = O.dTheta = F / Math.max(1, O.length - 1); if (O.length > 1 && e.avoidOverlap) { var B = Math.cos(L) - Math.cos(0), I = Math.sin(L) - Math.sin(0), M = Math.sqrt(E * E / (B * B + I * I)); _ = Math.max(M, _); } O.r = _, _ += E; } if (e.equidistant) { for (var A = 0, R = 0, K = 0; K < g.length; K++) { var H = g[K], q = H.r - R; A = Math.max(A, q); } R = 0; for (var ee = 0; ee < g.length; ee++) { var se = g[ee]; ee === 0 && (R = se.r), se.r = R, R += A; } } for (var oe = {}, ae = 0; ae < g.length; ae++) for (var ue = g[ae], te = ue.dTheta, $ = ue.r, G = 0; G < ue.length; G++) { var Q = ue[G], ge = e.startAngle + (r ? 1 : -1) * te * G, Ee = { x: s.x + $ * Math.cos(ge), y: s.y + $ * Math.sin(ge) }; oe[Q.node.id()] = Ee; } return a.nodes().layoutPositions(this, e, function(fe) { var me = fe.id(); return oe[me]; }), this; }; var Hl; var hP = { // 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: true, // 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 true; }, // 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: true, // 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: false, // Randomize the initial positions of the nodes (true) or use existing positions (false) randomize: false, // 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 hl(t13) { this.options = Re({}, hP, t13), 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); } hl.prototype.run = function() { var t13 = this.options, e = t13.cy, r = this; r.stopped = false, (t13.animate === true || t13.animate === false) && r.emit({ type: "layoutstart", layout: r }), t13.debug === true ? Hl = true : Hl = false; var n = pP(e, r, t13); Hl && yP(n), t13.randomize && bP(n); var a = gn(), i = function() { wP(n, e, t13), t13.fit === true && e.fit(t13.padding); }, o = function(v) { return !(r.stopped || v >= t13.numIter || (CP(n, t13), n.temperature = n.temperature * t13.coolingFactor, n.temperature < t13.minTemp)); }, s = function() { if (t13.animate === true || t13.animate === false) i(), r.one("layoutstop", t13.stop), r.emit({ type: "layoutstop", layout: r }); else { var v = t13.eles.nodes(), h6 = tg(n, t13, v); v.layoutPositions(r, t13, h6); } }, u = 0, l = true; if (t13.animate === true) { var c = function d() { for (var v = 0; l && v < t13.refresh; ) l = o(u), u++, v++; if (!l) Xf(n, t13), s(); else { var h6 = gn(); h6 - a >= t13.animationThreshold && i(), Ps(d); } }; c(); } else { for (; l; ) l = o(u), u++; Xf(n, t13), s(); } return this; }; hl.prototype.stop = function() { return this.stopped = true, this.thread && this.thread.stop(), this.emit("layoutstop"), this; }; hl.prototype.destroy = function() { return this.thread && this.thread.stop(), this; }; var pP = function(e, r, n) { for (var a = n.eles.edges(), i = n.eles.nodes(), o = pr(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], v = 0; v < d.length; v++) { var h6 = d[v]; l[h6.id()] = c; } for (var c = 0; c < s.nodeSize; c++) { var f = i[c], p = f.layoutDimensions(n), m = {}; m.isLocked = f.locked(), m.id = f.data("id"), m.parentId = f.data("parent"), m.cmptId = l[f.id()], m.children = [], m.positionX = f.position("x"), m.positionY = f.position("y"), m.offsetX = 0, m.offsetY = 0, m.height = p.w, m.width = p.h, m.maxX = m.positionX + m.width / 2, m.minX = m.positionX - m.width / 2, m.maxY = m.positionY + m.height / 2, m.minY = m.positionY - m.height / 2, m.padLeft = parseFloat(f.style("padding")), m.padRight = parseFloat(f.style("padding")), m.padTop = parseFloat(f.style("padding")), m.padBottom = parseFloat(f.style("padding")), m.nodeRepulsion = pt(n.nodeRepulsion) ? n.nodeRepulsion(f) : n.nodeRepulsion, s.layoutNodes.push(m), s.idToIndex[m.id] = c; } for (var g = [], y = 0, b = -1, w = [], c = 0; c < s.nodeSize; c++) { var f = s.layoutNodes[c], x = f.parentId; x != null ? s.layoutNodes[s.idToIndex[x]].children.push(f.id) : (g[++b] = f.id, w.push(f.id)); } for (s.graphSet.push(w); y <= b; ) { var E = g[y++], C = s.idToIndex[E], h6 = s.layoutNodes[C], T = h6.children; if (T.length > 0) { s.graphSet.push(T); for (var c = 0; c < T.length; c++) g[++b] = T[c]; } } for (var c = 0; c < s.graphSet.length; c++) for (var k = s.graphSet[c], v = 0; v < k.length; v++) { var _ = s.idToIndex[k[v]]; s.indexToGraph[_] = c; } for (var c = 0; c < s.edgeSize; c++) { var D = a[c], O = {}; O.id = D.data("id"), O.sourceId = D.data("source"), O.targetId = D.data("target"); var F = pt(n.idealEdgeLength) ? n.idealEdgeLength(D) : n.idealEdgeLength, L = pt(n.edgeElasticity) ? n.edgeElasticity(D) : n.edgeElasticity, B = s.idToIndex[O.sourceId], I = s.idToIndex[O.targetId], M = s.indexToGraph[B], A = s.indexToGraph[I]; if (M != A) { for (var R = gP(O.sourceId, O.targetId, s), K = s.graphSet[R], H = 0, m = s.layoutNodes[B]; K.indexOf(m.id) === -1; ) m = s.layoutNodes[s.idToIndex[m.parentId]], H++; for (m = s.layoutNodes[I]; K.indexOf(m.id) === -1; ) m = s.layoutNodes[s.idToIndex[m.parentId]], H++; F *= H * n.nestingFactor; } O.idealLength = F, O.elasticity = L, s.layoutEdges.push(O); } return s; }; var gP = function(e, r, n) { var a = mP(e, r, 0, n); return 2 > a.count ? 0 : a.graph; }; var mP = function t10(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]]], v = t10(e, r, d, a); if (v.count !== 0) if (v.count === 1) { if (o++, o === 2) break; } else return v; } } return { count: o, graph: n }; }; var yP; var bP = 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); } }; var tg = 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 }; }; }; var wP = function(e, r, n) { var a = n.layout, i = n.eles.nodes(), o = tg(e, n, i); i.positions(o), e.ready !== true && (e.ready = true, a.one("layoutready", n.ready), a.emit({ type: "layoutready", layout: this })); }; var CP = function(e, r, n) { xP(e, r), SP(e), TP(e, r), _P(e), DP(e); }; var xP = 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]]]; EP(s, l, e, r); } }; var Zf = function(e) { return -e + 2 * e * Math.random(); }; var EP = 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 = Zf(l), u = Zf(l)); var c = kP(e, r, s, u); if (c > 0) var d = a.nodeOverlap * c, v = Math.sqrt(s * s + u * u), h6 = d * s / v, f = d * u / v; else var p = Bs(e, s, u), m = Bs(r, -1 * s, -1 * u), g = m.x - p.x, y = m.y - p.y, b = g * g + y * y, v = Math.sqrt(b), d = (e.nodeRepulsion + r.nodeRepulsion) / b, h6 = d * g / v, f = d * y / v; e.isLocked || (e.offsetX -= h6, e.offsetY -= f), r.isLocked || (r.offsetX += h6, r.offsetY += f); } }; var kP = 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; }; var Bs = 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); }; var SP = 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 = Bs(o, l, c), v = Bs(u, -1 * l, -1 * c), h6 = v.x - d.x, f = v.y - d.y, p = Math.sqrt(h6 * h6 + f * f), m = Math.pow(a.idealLength - p, 2) / a.elasticity; if (p !== 0) var g = m * h6 / p, y = m * f / p; else var g = 0, y = 0; o.isLocked || (o.offsetX += g, o.offsetY += y), u.isLocked || (u.offsetX -= g, u.offsetY -= y); } } }; var TP = 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 v = e.layoutNodes[e.idToIndex[i[d]]]; if (!v.isLocked) { var h6 = s - v.positionX, f = u - v.positionY, p = Math.sqrt(h6 * h6 + f * f); if (p > n) { var m = r.gravity * h6 / p, g = r.gravity * f / p; v.offsetX += m, v.offsetY += g; } } } } }; var _P = 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, v = 0; v < l.length; v++) { var h6 = e.layoutNodes[e.idToIndex[l[v]]]; h6.offsetX += c, h6.offsetY += d, n[++i] = l[v]; } u.offsetX = 0, u.offsetY = 0; } } }; var DP = 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 = PP(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, OP(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); } }; var PP = 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; }; var OP = function t11(e, r) { var n = e.parentId; if (n != null) { var a = r.layoutNodes[r.idToIndex[n]], i = false; if ((a.maxX == null || e.maxX + a.padRight > a.maxX) && (a.maxX = e.maxX + a.padRight, i = true), (a.minX == null || e.minX - a.padLeft < a.minX) && (a.minX = e.minX - a.padLeft, i = true), (a.maxY == null || e.maxY + a.padBottom > a.maxY) && (a.maxY = e.maxY + a.padBottom, i = true), (a.minY == null || e.minY - a.padTop < a.minY) && (a.minY = e.minY - a.padTop, i = true), i) return t11(a, r); } }; var Xf = 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 v = c[d]; c.x1 = Math.min(c.x1, v.positionX - v.width / 2), c.x2 = Math.max(c.x2, v.positionX + v.width / 2), c.y1 = Math.min(c.y1, v.positionY - v.height / 2), c.y2 = Math.max(c.y2, v.positionY + v.height / 2); } c.w = c.x2 - c.x1, c.h = c.y2 - c.y1, l += c.w * c.h; } } a.sort(function(y, b) { return b.w * b.h - y.w * y.h; }); for (var h6 = 0, f = 0, p = 0, m = 0, g = 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 v = c[d]; v.isLocked || (v.positionX += h6 - c.x1, v.positionY += f - c.y1); } h6 += c.w + r.componentSpacing, p += c.w + r.componentSpacing, m = Math.max(m, c.h), p > g && (f += m + r.componentSpacing, h6 = 0, p = 0, m = 0); } } }; var LP = { fit: true, // 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: true, // prevents node overlap, may overflow boundingBox if not enough space avoidOverlapPadding: 10, // extra spacing around nodes when avoidOverlap: true nodeDimensionsIncludeLabels: false, // 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: false, // 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: false, // 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 true; }, // 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 rg(t13) { this.options = Re({}, LP, t13); } rg.prototype.run = function() { var t13 = this.options, e = t13, r = t13.cy, n = e.eles, a = n.nodes().not(":parent"); e.sort && (a = a.sort(e.sort)); var i = pr(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(ee) { 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(se) { if (se == null) return Math.min(u, l); var oe = Math.min(u, l); oe == u ? u = se : l = se; }, d = function(se) { if (se == null) return Math.max(u, l); var oe = Math.max(u, l); oe == u ? u = se : l = se; }, v = e.rows, h6 = e.cols != null ? e.cols : e.columns; if (v != null && h6 != null) u = v, l = h6; else if (v != null && h6 == null) u = v, l = Math.ceil(o / u); else if (v == null && h6 != null) l = h6, u = Math.ceil(o / l); else if (l * u > o) { var f = c(), p = d(); (f - 1) * p >= o ? c(f - 1) : (p - 1) * f >= o && d(p - 1); } else for (; l * u < o; ) { var m = c(), g = d(); (g + 1) * m >= o ? d(g + 1) : c(m + 1); } var y = i.w / l, b = i.h / u; if (e.condense && (y = 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), T = e.avoidOverlapPadding, k = C.w + T, _ = C.h + T; y = Math.max(y, k), b = Math.max(b, _); } for (var D = {}, O = function(se, oe) { return !!D["c-" + se + "-" + oe]; }, F = function(se, oe) { D["c-" + se + "-" + oe] = true; }, L = 0, B = 0, I = function() { B++, B >= l && (B = 0, L++); }, M = {}, A = 0; A < a.length; A++) { var R = a[A], K = e.position(R); if (K && (K.row !== void 0 || K.col !== void 0)) { var H = { row: K.row, col: K.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[R.id()] = H, F(H.row, H.col); } } var q = function(se, oe) { var ae, ue; if (se.locked() || se.isParent()) return false; var te = M[se.id()]; if (te) ae = te.col * y + y / 2 + i.x1, ue = te.row * b + b / 2 + i.y1; else { for (; O(L, B); ) I(); ae = B * y + y / 2 + i.x1, ue = L * b + b / 2 + i.y1, F(L, B), I(); } return { x: ae, y: ue }; }; a.layoutPositions(this, e, q); } return this; }; var IP = { ready: function() { }, // on layoutready stop: function() { } // on layoutstop }; function kc(t13) { this.options = Re({}, IP, t13); } kc.prototype.run = function() { var t13 = this.options, e = t13.eles, r = this; return t13.cy, r.emit("layoutstart"), e.nodes().positions(function() { return { x: 0, y: 0 }; }), r.one("layoutready", t13.ready), r.emit("layoutready"), r.one("layoutstop", t13.stop), r.emit("layoutstop"), this; }; kc.prototype.stop = function() { return this; }; var FP = { 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: true, // 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: false, // 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 true; }, // 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 ng(t13) { this.options = Re({}, FP, t13); } ng.prototype.run = function() { var t13 = this.options, e = t13.eles, r = e.nodes(), n = pt(t13.positions); function a(i) { if (t13.positions == null) return N5(i.position()); if (n) return t13.positions(i); var o = t13.positions[i._private.data.id]; return o ?? null; } return r.layoutPositions(this, t13, function(i, o) { var s = a(i); return i.locked() || s == null ? false : s; }), this; }; var AP = { fit: true, // 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: false, // 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 true; }, // 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 ag(t13) { this.options = Re({}, AP, t13); } ag.prototype.run = function() { var t13 = this.options, e = t13.cy, r = t13.eles, n = pr(t13.boundingBox ? t13.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, t13, a), this; }; var MP = [{ name: "breadthfirst", impl: Qp }, { name: "circle", impl: Jp }, { name: "concentric", impl: eg }, { name: "cose", impl: hl }, { name: "grid", impl: rg }, { name: "null", impl: kc }, { name: "preset", impl: ng }, { name: "random", impl: ag }]; function ig(t13) { this.options = t13, this.notifications = 0; } var jf = function() { }; var Qf = function() { throw new Error("A headless instance can not render images"); }; ig.prototype = { recalculateRenderedStyle: jf, notify: function() { this.notifications++; }, init: jf, isHeadless: function() { return true; }, png: Qf, jpg: Qf }; var Sc = {}; Sc.arrowShapeWidth = 0.3; Sc.registerArrowShapes = function() { var t13 = this.arrowShapes = {}, e = this, r = function(l, c, d, v, h6, f, p) { var m = h6.x - d / 2 - p, g = h6.x + d / 2 + p, y = h6.y - d / 2 - p, b = h6.y + d / 2 + p, w = m <= l && l <= g && y <= c && c <= b; return w; }, n = function(l, c, d, v, h6) { var f = l * Math.cos(v) - c * Math.sin(v), p = l * Math.sin(v) + c * Math.cos(v), m = f * d, g = p * d, y = m + h6.x, b = g + h6.y; return { x: y, y: b }; }, a = function(l, c, d, v) { for (var h6 = [], f = 0; f < l.length; f += 2) { var p = l[f], m = l[f + 1]; h6.push(n(p, m, c, d, v)); } return h6; }, i = function(l) { for (var c = [], d = 0; d < l.length; d++) { var v = l[d]; c.push(v.x, v.y); } return c; }, o = function(l) { return l.pstyle("width").pfValue * l.pstyle("arrow-scale").pfValue * 2; }, s = function(l, c) { Fe(c) && (c = t13[c]), t13[l] = Re({ name: l, points: [-0.15, -0.3, 0.15, -0.3, 0.15, 0.3, -0.15, 0.3], collide: function(v, h6, f, p, m, g) { var y = i(a(this.points, f + 2 * g, p, m)), b = dr(v, h6, y); return b; }, roughCollide: r, draw: function(v, h6, f, p) { var m = a(this.points, h6, f, p); e.arrowShapeImpl("polygon")(v, m); }, spacing: function(v) { return 0; }, gap: o }, c); }; s("none", { collide: Os, roughCollide: Os, draw: cc, spacing: lf, gap: lf }), s("triangle", { points: [-0.15, -0.3, 0, 0, 0.15, -0.3] }), s("arrow", "triangle"), s("triangle-backcurve", { points: t13.triangle.points, controlPoint: [0, -0.15], roughCollide: r, draw: function(l, c, d, v, h6) { var f = a(this.points, c, d, v), p = this.controlPoint, m = n(p[0], p[1], c, d, v); e.arrowShapeImpl(this.name)(l, f, m); }, 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, v, h6, f, p) { var m = i(a(this.points, d + 2 * p, v, h6)), g = i(a(this.pointsTee, d + 2 * p, v, h6)), y = dr(l, c, m) || dr(l, c, g); return y; }, draw: function(l, c, d, v, h6) { var f = a(this.points, c, d, v), p = a(this.pointsTee, c, d, v); e.arrowShapeImpl(this.name)(l, f, 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, v, h6, f, p) { var m = h6, g = Math.pow(m.x - l, 2) + Math.pow(m.y - c, 2) <= Math.pow((d + 2 * p) * this.radius, 2), y = i(a(this.points, d + 2 * p, v, h6)); return dr(l, c, y) || g; }, draw: function(l, c, d, v, h6) { var f = a(this.pointsTr, c, d, v); e.arrowShapeImpl(this.name)(l, f, v.x, v.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(), v = c / l, h6 = 3, f = 5; return d[h6] = d[h6] - v, d[f] = d[f] - v, d; }, collide: function(l, c, d, v, h6, f, p) { var m = i(a(this.points, d + 2 * p, v, h6)), g = i(a(this.crossLinePts(d, f), d + 2 * p, v, h6)), y = dr(l, c, m) || dr(l, c, g); return y; }, draw: function(l, c, d, v, h6) { var f = a(this.points, c, d, v), p = a(this.crossLinePts(c, h6), c, d, v); e.arrowShapeImpl(this.name)(l, f, 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, v, h6, f, p) { var m = h6, g = Math.pow(m.x - l, 2) + Math.pow(m.y - c, 2) <= Math.pow((d + 2 * p) * this.radius, 2); return g; }, draw: function(l, c, d, v, h6) { e.arrowShapeImpl(this.name)(l, v.x, v.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 Da = {}; Da.projectIntoViewport = function(t13, e) { var r = this.cy, n = this.findContainerClientCoords(), a = n[0], i = n[1], o = n[4], s = r.pan(), u = r.zoom(), l = ((t13 - a) / o - s.x) / u, c = ((e - i) / o - s.y) / u; return [l, c]; }; Da.findContainerClientCoords = function() { if (this.containerBB) return this.containerBB; var t13 = this.container, e = t13.getBoundingClientRect(), r = this.cy.window().getComputedStyle(t13), n = function(g) { return parseFloat(r.getPropertyValue(g)); }, 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 = t13.clientWidth, s = t13.clientHeight, u = a.left + a.right, l = a.top + a.bottom, c = i.left + i.right, d = e.width / (o + c), v = o - u, h6 = s - l, f = e.left + a.left + i.left, p = e.top + a.top + i.top; return this.containerBB = [f, p, v, h6, d]; }; Da.invalidateContainerClientCoordsCache = function() { this.containerBB = null; }; Da.findNearestElement = function(t13, e, r, n) { return this.findNearestElements(t13, e, r, n)[0]; }; Da.findNearestElements = function(t13, 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, v = (n ? 8 : 2) / u, h6 = 1 / 0, f, p; r && (o = o.interactive); function m(C, T) { if (C.isNode()) { if (p) return; p = C, s.push(C); } if (C.isEdge() && (T == null || T < h6)) if (f) { if (f.pstyle("z-compound-depth").value === C.pstyle("z-compound-depth").value && f.pstyle("z-compound-depth").value === C.pstyle("z-compound-depth").value) { for (var k = 0; k < s.length; k++) if (s[k].isEdge()) { s[k] = C, f = C, h6 = T ?? h6; break; } } } else s.push(C), f = C, h6 = T ?? h6; } function g(C) { var T = C.outerWidth() + 2 * d, k = C.outerHeight() + 2 * d, _ = T / 2, D = k / 2, O = C.position(), F = C.pstyle("corner-radius").value === "auto" ? "auto" : C.pstyle("corner-radius").pfValue, L = C._private.rscratch; if (O.x - _ <= t13 && t13 <= O.x + _ && O.y - D <= e && e <= O.y + D) { var B = i.nodeShapes[a.getNodeShape(C)]; if (B.checkPoint(t13, e, 0, T, k, O.x, O.y, F, L)) return m(C, 0), true; } } function y(C) { var T = C._private, k = T.rscratch, _ = C.pstyle("width").pfValue, D = C.pstyle("arrow-scale").value, O = _ / 2 + c, F = O * O, L = O * 2, A = T.source, R = T.target, B; if (k.edgeType === "segments" || k.edgeType === "straight" || k.edgeType === "haystack") { for (var I = k.allpts, M = 0; M + 3 < I.length; M += 2) if (X5(t13, e, I[M], I[M + 1], I[M + 2], I[M + 3], L) && F > (B = t4(t13, e, I[M], I[M + 1], I[M + 2], I[M + 3]))) return m(C, B), true; } else if (k.edgeType === "bezier" || k.edgeType === "multibezier" || k.edgeType === "self" || k.edgeType === "compound") { for (var I = k.allpts, M = 0; M + 5 < k.allpts.length; M += 4) if (j5(t13, e, I[M], I[M + 1], I[M + 2], I[M + 3], I[M + 4], I[M + 5], L) && F > (B = e4(t13, e, I[M], I[M + 1], I[M + 2], I[M + 3], I[M + 4], I[M + 5]))) return m(C, B), true; } for (var A = A || T.source, R = R || T.target, K = a.getArrowWidth(_, D), H = [{ name: "source", x: k.arrowStartX, y: k.arrowStartY, angle: k.srcArrowAngle }, { name: "target", x: k.arrowEndX, y: k.arrowEndY, angle: k.tgtArrowAngle }, { name: "mid-source", x: k.midX, y: k.midY, angle: k.midsrcArrowAngle }, { name: "mid-target", x: k.midX, y: k.midY, angle: k.midtgtArrowAngle }], M = 0; M < H.length; M++) { var q = H[M], ee = i.arrowShapes[C.pstyle(q.name + "-arrow-shape").value], se = C.pstyle("width").pfValue; if (ee.roughCollide(t13, e, K, q.angle, { x: q.x, y: q.y }, se, c) && ee.collide(t13, e, K, q.angle, { x: q.x, y: q.y }, se, c)) return m(C), true; } l && s.length > 0 && (g(A), g(R)); } function b(C, T, k) { return Nr(C, T, k); } function w(C, T) { var k = C._private, _ = v, D; T ? D = T + "-" : D = "", C.boundingBox(); var O = k.labelBounds[T || "main"], F = C.pstyle(D + "label").value, L = C.pstyle("text-events").strValue === "yes"; if (!(!L || !F)) { var B = b(k.rscratch, "labelX", T), I = b(k.rscratch, "labelY", T), M = b(k.rscratch, "labelAngle", T), A = C.pstyle(D + "text-margin-x").pfValue, R = C.pstyle(D + "text-margin-y").pfValue, K = O.x1 - _ - A, H = O.x2 + _ - A, q = O.y1 - _ - R, ee = O.y2 + _ - R; if (M) { var se = Math.cos(M), oe = Math.sin(M), ae = function(Ee, fe) { return Ee = Ee - B, fe = fe - I, { x: Ee * se - fe * oe + B, y: Ee * oe + fe * se + I }; }, ue = ae(K, q), te = ae(K, ee), $ = ae(H, q), G = ae(H, ee), Q = [ // with the margin added after the rotation is applied ue.x + A, ue.y + R, $.x + A, $.y + R, G.x + A, G.y + R, te.x + A, te.y + R ]; if (dr(t13, e, Q)) return m(C), true; } else if (oi(O, t13, e)) return m(C), true; } } for (var x = o.length - 1; x >= 0; x--) { var E = o[x]; E.isNode() ? g(E) || w(E) : y(E) || w(E) || w(E, "source") || w(E, "target"); } return s; }; Da.getAllInBox = function(t13, e, r, n) { var a = this.getCachedZSortedEles().interactive, i = [], o = Math.min(t13, r), s = Math.max(t13, r), u = Math.min(e, n), l = Math.max(e, n); t13 = o, r = s, e = u, n = l; for (var c = pr({ x1: t13, y1: e, x2: r, y2: n }), d = 0; d < a.length; d++) { var v = a[d]; if (v.isNode()) { var h6 = v, f = h6.boundingBox({ includeNodes: true, includeEdges: false, includeLabels: false }); vc(c, f) && !hp(f, c) && i.push(h6); } else { var p = v, m = p._private, g = m.rscratch; if (g.startX != null && g.startY != null && !oi(c, g.startX, g.startY) || g.endX != null && g.endY != null && !oi(c, g.endX, g.endY)) continue; if (g.edgeType === "bezier" || g.edgeType === "multibezier" || g.edgeType === "self" || g.edgeType === "compound" || g.edgeType === "segments" || g.edgeType === "haystack") { for (var y = m.rstyle.bezierPts || m.rstyle.linePts || m.rstyle.haystackPts, b = true, w = 0; w < y.length; w++) if (!Z5(c, y[w])) { b = false; break; } b && i.push(p); } else (g.edgeType === "haystack" || g.edgeType === "straight") && i.push(p); } } return i; }; var Ns = {}; Ns.calculateArrowAngles = function(t13) { var e = t13._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, v, h6, g, y; if (r ? (c = e.haystackPts[0], d = e.haystackPts[1], v = e.haystackPts[2], h6 = e.haystackPts[3]) : (c = e.arrowStartX, d = e.arrowStartY, v = e.arrowEndX, h6 = e.arrowEndY), g = e.midX, y = e.midY, i) u = c - e.segpts[0], l = d - e.segpts[1]; else if (a || o || s || n) { var f = e.allpts, p = Nt(f[0], f[2], f[4], 0.1), m = Nt(f[1], f[3], f[5], 0.1); u = c - p, l = d - m; } else u = c - g, l = d - y; e.srcArrowAngle = Wo(u, l); var g = e.midX, y = e.midY; if (r && (g = (c + v) / 2, y = (d + h6) / 2), u = v - c, l = h6 - d, i) { var f = e.allpts; if (f.length / 2 % 2 === 0) { var b = f.length / 2, w = b - 2; u = f[b] - f[w], l = f[b + 1] - f[w + 1]; } else if (e.isRound) u = e.midVector[1], l = -e.midVector[0]; else { var b = f.length / 2 - 1, w = b - 2; u = f[b] - f[w], l = f[b + 1] - f[w + 1]; } } else if (a || o || s) { var f = e.allpts, x = e.ctrlpts, E, C, T, k; if (x.length / 2 % 2 === 0) { var _ = f.length / 2 - 1, D = _ + 2, O = D + 2; E = Nt(f[_], f[D], f[O], 0), C = Nt(f[_ + 1], f[D + 1], f[O + 1], 0), T = Nt(f[_], f[D], f[O], 1e-4), k = Nt(f[_ + 1], f[D + 1], f[O + 1], 1e-4); } else { var D = f.length / 2 - 1, _ = D - 2, O = D + 2; E = Nt(f[_], f[D], f[O], 0.4999), C = Nt(f[_ + 1], f[D + 1], f[O + 1], 0.4999), T = Nt(f[_], f[D], f[O], 0.5), k = Nt(f[_ + 1], f[D + 1], f[O + 1], 0.5); } u = T - E, l = k - C; } if (e.midtgtArrowAngle = Wo(u, l), e.midDispX = u, e.midDispY = l, u *= -1, l *= -1, i) { var f = e.allpts; if (f.length / 2 % 2 !== 0) { if (!e.isRound) { var b = f.length / 2 - 1, F = b + 2; u = -(f[F] - f[b]), l = -(f[F + 1] - f[b + 1]); } } } if (e.midsrcArrowAngle = Wo(u, l), i) u = v - e.segpts[e.segpts.length - 2], l = h6 - e.segpts[e.segpts.length - 1]; else if (a || o || s || n) { var f = e.allpts, L = f.length, p = Nt(f[L - 6], f[L - 4], f[L - 2], 0.9), m = Nt(f[L - 5], f[L - 3], f[L - 1], 0.9); u = v - p, l = h6 - m; } else u = v - g, l = h6 - y; e.tgtArrowAngle = Wo(u, l); }; Ns.getArrowWidth = Ns.getArrowHeight = function(t13, e) { var r = this.arrowWidthCache = this.arrowWidthCache || {}, n = r[t13 + ", " + e]; return n || (n = Math.max(Math.pow(t13 * 13.37, 0.9), 29) * e, r[t13 + ", " + e] = n, n); }; var pu; var gu; var Yr = {}; var xr = {}; var Jf; var ev; var oa; var gs; var un; var ea; var na; var Wr; var Na; var rs; var og; var sg; var mu; var yu; var tv; var rv = 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); }; var BP = 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; }; var NP = function(e, r, n, a, i) { if (e !== tv ? rv(r, e, Yr) : BP(xr, Yr), rv(r, n, xr), Jf = Yr.nx * xr.ny - Yr.ny * xr.nx, ev = Yr.nx * xr.nx - Yr.ny * -xr.ny, un = Math.asin(Math.max(-1, Math.min(1, Jf))), Math.abs(un) < 1e-6) { pu = r.x, gu = r.y, na = Na = 0; return; } oa = 1, gs = false, ev < 0 ? un < 0 ? un = Math.PI + un : (un = Math.PI - un, oa = -1, gs = true) : un > 0 && (oa = -1, gs = true), r.radius !== void 0 ? Na = r.radius : Na = a, ea = un / 2, rs = Math.min(Yr.len / 2, xr.len / 2), i ? (Wr = Math.abs(Math.cos(ea) * Na / Math.sin(ea)), Wr > rs ? (Wr = rs, na = Math.abs(Wr * Math.sin(ea) / Math.cos(ea))) : na = Na) : (Wr = Math.min(rs, Na), na = Math.abs(Wr * Math.sin(ea) / Math.cos(ea))), mu = r.x + xr.nx * Wr, yu = r.y + xr.ny * Wr, pu = mu - xr.ny * na * oa, gu = yu + xr.nx * na * oa, og = r.x + Yr.nx * Wr, sg = r.y + Yr.ny * Wr, tv = r; }; function lg(t13, e) { e.radius === 0 ? t13.lineTo(e.cx, e.cy) : t13.arc(e.cx, e.cy, e.radius, e.startAngle, e.endAngle, e.counterClockwise); } function Tc(t13, e, r, n) { var a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true; 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 } : (NP(t13, e, r, n, a), { cx: pu, cy: gu, radius: na, startX: og, startY: sg, stopX: mu, stopY: yu, startAngle: Yr.ang + Math.PI / 2 * oa, endAngle: xr.ang - Math.PI / 2 * oa, counterClockwise: gs }); } var or = {}; or.findMidptPtsEtc = function(t13, e) { var r = e.posPts, n = e.intersectionPts, a = e.vectorNormInverse, i, o = t13.pstyle("source-endpoint"), s = t13.pstyle("target-endpoint"), u = o.units != null && s.units != null, l = function(x, E, C, T) { var k = T - E, _ = C - x, D = Math.sqrt(_ * _ + k * k); return { x: -k / D, y: _ / D }; }, c = t13.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(t13.source()[0], o), v = Mr(d, 2), h6 = v[0], f = v[1], p = this.manualEndptToPx(t13.target()[0], s), m = Mr(p, 2), g = m[0], y = m[1], b = { x1: h6, y1: f, x2: g, y2: y }; a = l(h6, f, g, y), i = b; } else tt("Edge ".concat(t13.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 }; }; or.findHaystackPoints = function(t13) { for (var e = 0; e < t13.length; e++) { var r = t13[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(), v = o.height(), h6 = s.height(), f = r.pstyle("haystack-radius").value, p = f / 2; a.haystackPts = a.allpts = [a.source.x * c * p + u.x, a.source.y * v * p + u.y, a.target.x * d * p + l.x, a.target.y * h6 * 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 = true, this.storeEdgeProjections(r), this.calculateArrowAngles(r), this.recalculateEdgeLabelProjections(r), this.calculateLabelAngles(r); } }; or.findSegmentsPoints = function(t13, e) { var r = t13._private.rscratch, n = t13.pstyle("segment-weights"), a = t13.pstyle("segment-distances"), i = t13.pstyle("segment-radii"), o = t13.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], v = a.pfValue[c], h6 = 1 - d, f = d, p = this.findMidptPtsEtc(t13, e), m = p.midptPts, g = p.vectorNormInverse, y = { x: m.x1 * h6 + m.x2 * f, y: m.y1 * h6 + m.y2 * f }; r.segpts.push(y.x + g.x * v, y.y + g.y * v), 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"); } }; or.findLoopPoints = function(t13, e, r, n) { var a = t13._private.rscratch, i = e.dirCounts, o = e.srcPos, s = t13.pstyle("control-point-distances"), u = s ? s.pfValue[0] : void 0, l = t13.pstyle("loop-direction").pfValue, c = t13.pstyle("loop-sweep").pfValue, d = t13.pstyle("control-point-step-size").pfValue; a.edgeType = "self"; var v = r, h6 = d; n && (v = 0, h6 = u); var f = l - Math.PI / 2, p = f - c / 2, m = f + c / 2, g = l + "_" + c; v = i[g] === void 0 ? i[g] = 0 : ++i[g], a.ctrlpts = [o.x + Math.cos(p) * 1.4 * h6 * (v / 3 + 1), o.y + Math.sin(p) * 1.4 * h6 * (v / 3 + 1), o.x + Math.cos(m) * 1.4 * h6 * (v / 3 + 1), o.y + Math.sin(m) * 1.4 * h6 * (v / 3 + 1)]; }; or.findCompoundLoopPoints = function(t13, e, r, n) { var a = t13._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 = t13.pstyle("control-point-step-size").pfValue, v = t13.pstyle("control-point-distances"), h6 = v ? v.pfValue[0] : void 0, f = r, p = d; n && (f = 0, p = h6); var m = 50, g = { x: i.x - s / 2, y: i.y - u / 2 }, y = { x: o.x - l / 2, y: o.y - c / 2 }, b = { x: Math.min(g.x, y.x), y: Math.min(g.y, y.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(m, 1.12) / 100) * p * (f / 3 + 1) * x, b.x - (1 + Math.pow(m, 1.12) / 100) * p * (f / 3 + 1) * E, b.y]; }; or.findStraightEdgePoints = function(t13) { t13._private.rscratch.edgeType = "straight"; }; or.findBezierPoints = function(t13, e, r, n, a) { var i = t13._private.rscratch, o = t13.pstyle("control-point-step-size").pfValue, s = t13.pstyle("control-point-distances"), u = t13.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], v = n; i.edgeType = v ? "multibezier" : "bezier", i.ctrlpts = []; for (var h6 = 0; h6 < l; h6++) { var f = (0.5 - e.eles.length / 2 + r) * o * (a ? -1 : 1), p = void 0, m = fp(f); v && (c = s ? s.pfValue[h6] : o, d = u.value[h6]), n ? p = c : p = c !== void 0 ? m * c : void 0; var g = p !== void 0 ? p : f, y = 1 - d, b = d, w = this.findMidptPtsEtc(t13, e), x = w.midptPts, E = w.vectorNormInverse, C = { x: x.x1 * y + x.x2 * b, y: x.y1 * y + x.y2 * b }; i.ctrlpts.push(C.x + E.x * g, C.y + E.y * g); } }; or.findTaxiPoints = function(t13, e) { var r = t13._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, v = e.srcH, h6 = e.tgtW, f = e.tgtH, p = t13.pstyle("edge-distances").value, m = p !== "node-position", g = t13.pstyle("taxi-direction").value, y = g, b = t13.pstyle("taxi-turn"), w = b.units === "%", x = b.pfValue, E = x < 0, C = t13.pstyle("taxi-turn-min-distance").pfValue, T = m ? (d + h6) / 2 : 0, k = m ? (v + f) / 2 : 0, _ = c.x2 - c.x1, D = c.y2 - c.y1, O = function(Ae, Me) { return Ae > 0 ? Math.max(Ae - Me, 0) : Math.min(Ae + Me, 0); }, F = O(_, T), L = O(D, k), B = false; y === l ? g = Math.abs(F) > Math.abs(L) ? a : n : y === u || y === s ? (g = n, B = true) : (y === i || y === o) && (g = a, B = true); var I = g === n, M = I ? L : F, A = I ? D : _, R = fp(A), K = false; !(B && (w || E)) && (y === s && A < 0 || y === u && A > 0 || y === i && A > 0 || y === o && A < 0) && (R *= -1, M = R * Math.abs(M), K = true); var H; if (w) { var q = x < 0 ? 1 + x : x; H = q * M; } else { var ee = x < 0 ? M : 0; H = ee + x * R; } var se = function(Ae) { return Math.abs(Ae) < C || Math.abs(Ae) >= Math.abs(M); }, oe = se(H), ae = se(Math.abs(M) - Math.abs(H)), ue = oe || ae; if (ue && !K) if (I) { var te = Math.abs(A) <= v / 2, $ = Math.abs(_) <= h6 / 2; if (te) { var G = (c.x1 + c.x2) / 2, Q = c.y1, ge = c.y2; r.segpts = [G, Q, G, ge]; } else if ($) { var Ee = (c.y1 + c.y2) / 2, fe = c.x1, me = c.x2; r.segpts = [fe, Ee, me, Ee]; } else r.segpts = [c.x1, c.y2]; } else { var Ce = Math.abs(A) <= d / 2, ke = Math.abs(D) <= f / 2; if (Ce) { var xe = (c.y1 + c.y2) / 2, De = c.x1, qe = c.x2; r.segpts = [De, xe, qe, xe]; } else if (ke) { var Ke = (c.x1 + c.x2) / 2, Be = c.y1, Ge = c.y2; r.segpts = [Ke, Be, Ke, Ge]; } else r.segpts = [c.x2, c.y1]; } else if (I) { var le = c.y1 + H + (m ? v / 2 * R : 0), S = c.x1, z = c.x2; r.segpts = [S, le, z, le]; } else { var ie = c.x1 + H + (m ? d / 2 * R : 0), j = c.y1, Y = c.y2; r.segpts = [ie, j, ie, Y]; } if (r.isRound) { var pe = t13.pstyle("taxi-radius").value, re = t13.pstyle("radius-type").value[0] === "arc-radius"; r.radii = new Array(r.segpts.length / 2).fill(pe), r.isArcRadius = new Array(r.segpts.length / 2).fill(re); } }; or.tryToCorrectInvalidPoints = function(t13, e) { var r = t13._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, v = e.tgtCornerRadius, h6 = e.srcRs, f = e.tgtRs, p = !be(r.startX) || !be(r.startY), m = !be(r.arrowStartX) || !be(r.arrowStartY), g = !be(r.endX) || !be(r.endY), y = !be(r.arrowEndX) || !be(r.arrowEndY), b = 3, w = this.getArrowWidth(t13.pstyle("width").pfValue, t13.pstyle("arrow-scale").value) * this.arrowShapeWidth, x = b * w, E = ya({ x: r.ctrlpts[0], y: r.ctrlpts[1] }, { x: r.startX, y: r.startY }), C = E < x, T = ya({ x: r.ctrlpts[0], y: r.ctrlpts[1] }, { x: r.endX, y: r.endY }), k = T < x, _ = false; if (p || m || C) { _ = true; var D = { // delta x: r.ctrlpts[0] - n.x, y: r.ctrlpts[1] - n.y }, O = Math.sqrt(D.x * D.x + D.y * D.y), F = { // normalised delta x: D.x / O, y: D.y / O }, L = Math.max(i, o), B = { // *2 radius guarantees outside shape x: r.ctrlpts[0] + F.x * 2 * L, y: r.ctrlpts[1] + F.y * 2 * L }, I = l.intersectLine(n.x, n.y, i, o, B.x, B.y, 0, d, h6); C ? (r.ctrlpts[0] = r.ctrlpts[0] + F.x * (x - E), r.ctrlpts[1] = r.ctrlpts[1] + F.y * (x - E)) : (r.ctrlpts[0] = I[0] + F.x * x, r.ctrlpts[1] = I[1] + F.y * x); } if (g || y || k) { _ = true; var M = { // delta x: r.ctrlpts[0] - a.x, y: r.ctrlpts[1] - a.y }, A = Math.sqrt(M.x * M.x + M.y * M.y), R = { // normalised delta x: M.x / A, y: M.y / A }, K = Math.max(i, o), H = { // *2 radius guarantees outside shape x: r.ctrlpts[0] + R.x * 2 * K, y: r.ctrlpts[1] + R.y * 2 * K }, q = c.intersectLine(a.x, a.y, s, u, H.x, H.y, 0, v, f); k ? (r.ctrlpts[0] = r.ctrlpts[0] + R.x * (x - T), r.ctrlpts[1] = r.ctrlpts[1] + R.y * (x - T)) : (r.ctrlpts[0] = q[0] + R.x * x, r.ctrlpts[1] = q[1] + R.y * x); } _ && this.findEndpoints(t13); } }; or.storeAllpts = function(t13) { var e = t13._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 = Nt(e.allpts[n], e.allpts[n + 2], e.allpts[n + 4], a), e.midY = Nt(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(Tc({ 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] }, v = e.roundCorners[c / 2], h6 = [d.x - v.cx, d.y - v.cy], f = v.radius / Math.sqrt(Math.pow(h6[0], 2) + Math.pow(h6[1], 2)); h6 = h6.map(function(p) { return p * f; }), e.midX = v.cx + h6[0], e.midY = v.cy + h6[1], e.midVector = h6; } } } }; or.checkForInvalidEdgeWarning = function(t13) { var e = t13[0]._private.rscratch; e.nodesOverlap || be(e.startX) && be(e.startY) && be(e.endX) && be(e.endY) ? e.loggedErr = false : e.loggedErr || (e.loggedErr = true, tt("Edge `" + t13.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.")); }; or.findEdgeControlPoints = function(t13) { var e = this; if (!(!t13 || t13.length === 0)) { for (var r = this, n = r.cy, a = n.hasCompoundNodes(), i = { map: new Xr(), get: function(C) { var T = this.map.get(C[0]); return T != null ? T.get(C[1]) : null; }, set: function(C, T) { var k = this.map.get(C[0]); k == null && (k = new Xr(), this.map.set(C[0], k)), k.set(C[1], T); } }, o = [], s = [], u = 0; u < t13.length; u++) { var l = t13[u], c = l._private, d = l.pstyle("curve-style").value; if (!(l.removed() || !l.takesUpSpace())) { if (d === "haystack") { s.push(l); continue; } var v = d === "unbundled-bezier" || d.endsWith("segments") || d === "straight" || d === "straight-triangle" || d.endsWith("taxi"), h6 = d === "unbundled-bezier" || d === "bezier", f = c.source, p = c.target, m = f.poolIndex(), g = p.poolIndex(), y = [m, g].sort(), b = i.get(y); b == null && (b = { eles: [] }, i.set(y, b), o.push(y)), b.eles.push(l), v && (b.hasUnbundled = true), h6 && (b.hasBezier = true); } } for (var w = function(C) { var T = o[C], k = i.get(T), _ = void 0; if (!k.hasUnbundled) { var D = k.eles[0].parallelEdges().filter(function(ie) { return ie.isBundledBezier(); }); dc(k.eles), D.forEach(function(ie) { return k.eles.push(ie); }), k.eles.sort(function(ie, j) { return ie.poolIndex() - j.poolIndex(); }); } var O = k.eles[0], F = O.source(), L = O.target(); if (F.poolIndex() > L.poolIndex()) { var B = F; F = L, L = B; } var I = k.srcPos = F.position(), M = k.tgtPos = L.position(), A = k.srcW = F.outerWidth(), R = k.srcH = F.outerHeight(), K = k.tgtW = L.outerWidth(), H = k.tgtH = L.outerHeight(), q = k.srcShape = r.nodeShapes[e.getNodeShape(F)], ee = k.tgtShape = r.nodeShapes[e.getNodeShape(L)], se = k.srcCornerRadius = F.pstyle("corner-radius").value === "auto" ? "auto" : F.pstyle("corner-radius").pfValue, oe = k.tgtCornerRadius = L.pstyle("corner-radius").value === "auto" ? "auto" : L.pstyle("corner-radius").pfValue, ae = k.tgtRs = L._private.rscratch, ue = k.srcRs = F._private.rscratch; k.dirCounts = { north: 0, west: 0, south: 0, east: 0, northwest: 0, southwest: 0, northeast: 0, southeast: 0 }; for (var te = 0; te < k.eles.length; te++) { var $ = k.eles[te], G = $[0]._private.rscratch, Q = $.pstyle("curve-style").value, ge = Q === "unbundled-bezier" || Q.endsWith("segments") || Q.endsWith("taxi"), Ee = !F.same($.source()); if (!k.calculatedIntersection && F !== L && (k.hasBezier || k.hasUnbundled)) { k.calculatedIntersection = true; var fe = q.intersectLine(I.x, I.y, A, R, M.x, M.y, 0, se, ue), me = k.srcIntn = fe, Ce = ee.intersectLine(M.x, M.y, K, H, I.x, I.y, 0, oe, ae), ke = k.tgtIntn = Ce, xe = k.intersectionPts = { x1: fe[0], x2: Ce[0], y1: fe[1], y2: Ce[1] }, De = k.posPts = { x1: I.x, x2: M.x, y1: I.y, y2: M.y }, qe = Ce[1] - fe[1], Ke = Ce[0] - fe[0], Be = Math.sqrt(Ke * Ke + qe * qe), Ge = k.vector = { x: Ke, y: qe }, le = k.vectorNorm = { x: Ge.x / Be, y: Ge.y / Be }, S = { x: -le.y, y: le.x }; k.nodesOverlap = !be(Be) || ee.checkPoint(fe[0], fe[1], 0, K, H, M.x, M.y, oe, ae) || q.checkPoint(Ce[0], Ce[1], 0, A, R, I.x, I.y, se, ue), k.vectorNormInverse = S, _ = { nodesOverlap: k.nodesOverlap, dirCounts: k.dirCounts, calculatedIntersection: true, hasBezier: k.hasBezier, hasUnbundled: k.hasUnbundled, eles: k.eles, srcPos: M, tgtPos: I, srcW: K, srcH: H, tgtW: A, tgtH: R, srcIntn: ke, tgtIntn: me, srcShape: ee, tgtShape: q, posPts: { x1: De.x2, y1: De.y2, x2: De.x1, y2: De.y1 }, intersectionPts: { x1: xe.x2, y1: xe.y2, x2: xe.x1, y2: xe.y1 }, vector: { x: -Ge.x, y: -Ge.y }, vectorNorm: { x: -le.x, y: -le.y }, vectorNormInverse: { x: -S.x, y: -S.y } }; } var z = Ee ? _ : k; G.nodesOverlap = z.nodesOverlap, G.srcIntn = z.srcIntn, G.tgtIntn = z.tgtIntn, G.isRound = Q.startsWith("round"), a && (F.isParent() || F.isChild() || L.isParent() || L.isChild()) && (F.parents().anySame(L) || L.parents().anySame(F) || F.same(L) && F.isParent()) ? e.findCompoundLoopPoints($, z, te, ge) : F === L ? e.findLoopPoints($, z, te, ge) : Q.endsWith("segments") ? e.findSegmentsPoints($, z) : Q.endsWith("taxi") ? e.findTaxiPoints($, z) : Q === "straight" || !ge && k.eles.length % 2 === 1 && te === Math.floor(k.eles.length / 2) ? e.findStraightEdgePoints($) : e.findBezierPoints($, z, te, ge, Ee), e.findEndpoints($), e.tryToCorrectInvalidPoints($, z), e.checkForInvalidEdgeWarning($), e.storeAllpts($), e.storeEdgeProjections($), e.calculateArrowAngles($), e.recalculateEdgeLabelProjections($), e.calculateLabelAngles($); } }, x = 0; x < o.length; x++) w(x); this.findHaystackPoints(s); } }; function ug(t13) { var e = []; if (t13 != null) { for (var r = 0; r < t13.length; r += 2) { var n = t13[r], a = t13[r + 1]; e.push({ x: n, y: a }); } return e; } } or.getSegmentPoints = function(t13) { var e = t13[0]._private.rscratch, r = e.edgeType; if (r === "segments") return this.recalculateRenderedStyle(t13), ug(e.segpts); }; or.getControlPoints = function(t13) { var e = t13[0]._private.rscratch, r = e.edgeType; if (r === "bezier" || r === "multibezier" || r === "self" || r === "compound") return this.recalculateRenderedStyle(t13), ug(e.ctrlpts); }; or.getEdgeMidpoint = function(t13) { var e = t13[0]._private.rscratch; return this.recalculateRenderedStyle(t13), { x: e.midX, y: e.midY }; }; var Fo = {}; Fo.manualEndptToPx = function(t13, e) { var r = this, n = t13.position(), a = t13.outerWidth(), i = t13.outerHeight(), o = t13._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(t13)].intersectLine(n.x, n.y, a, i, c[0], c[1], 0, t13.pstyle("corner-radius").value === "auto" ? "auto" : t13.pstyle("corner-radius").pfValue, o); } }; Fo.findEndpoints = function(t13) { var e = this, r, n = t13.source()[0], a = t13.target()[0], i = n.position(), o = a.position(), s = t13.pstyle("target-arrow-shape").value, u = t13.pstyle("source-arrow-shape").value, l = t13.pstyle("target-distance-from-node").pfValue, c = t13.pstyle("source-distance-from-node").pfValue, d = n._private.rscratch, v = a._private.rscratch, h6 = t13.pstyle("curve-style").value, f = t13._private.rscratch, p = f.edgeType, m = h6 === "taxi", g = p === "self" || p === "compound", y = p === "bezier" || p === "multibezier" || g, b = p !== "bezier", w = p === "straight" || p === "segments", x = p === "segments", E = y || b || w, C = g || m, T = t13.pstyle("source-endpoint"), k = C ? "outside-to-node" : T.value, _ = n.pstyle("corner-radius").value === "auto" ? "auto" : n.pstyle("corner-radius").pfValue, D = t13.pstyle("target-endpoint"), O = C ? "outside-to-node" : D.value, F = a.pstyle("corner-radius").value === "auto" ? "auto" : a.pstyle("corner-radius").pfValue; f.srcManEndpt = T, f.tgtManEndpt = D; var L, B, I, M; if (y) { var A = [f.ctrlpts[0], f.ctrlpts[1]], R = b ? [f.ctrlpts[f.ctrlpts.length - 2], f.ctrlpts[f.ctrlpts.length - 1]] : A; L = R, B = A; } else if (w) { var K = x ? f.segpts.slice(0, 2) : [o.x, o.y], H = x ? f.segpts.slice(f.segpts.length - 2) : [i.x, i.y]; L = H, B = K; } if (O === "inside-to-node") r = [o.x, o.y]; else if (D.units) r = this.manualEndptToPx(a, D); else if (O === "outside-to-line") r = f.tgtIntn; else if (O === "outside-to-node" || O === "outside-to-node-or-label" ? I = L : (O === "outside-to-line" || O === "outside-to-line-or-label") && (I = [i.x, i.y]), r = e.nodeShapes[this.getNodeShape(a)].intersectLine(o.x, o.y, a.outerWidth(), a.outerHeight(), I[0], I[1], 0, F, v), O === "outside-to-node-or-label" || O === "outside-to-line-or-label") { var q = a._private.rscratch, ee = q.labelWidth, se = q.labelHeight, oe = q.labelX, ae = q.labelY, ue = ee / 2, te = se / 2, $ = a.pstyle("text-valign").value; $ === "top" ? ae -= te : $ === "bottom" && (ae += te); var G = a.pstyle("text-halign").value; G === "left" ? oe -= ue : G === "right" && (oe += ue); var Q = oo(I[0], I[1], [oe - ue, ae - te, oe + ue, ae - te, oe + ue, ae + te, oe - ue, ae + te], o.x, o.y); if (Q.length > 0) { var ge = i, Ee = ta(ge, Ha(r)), fe = ta(ge, Ha(Q)), me = Ee; if (fe < Ee && (r = Q, me = fe), Q.length > 2) { var Ce = ta(ge, { x: Q[2], y: Q[3] }); Ce < me && (r = [Q[2], Q[3]]); } } } var ke = Yo(r, L, e.arrowShapes[s].spacing(t13) + l), xe = Yo(r, L, e.arrowShapes[s].gap(t13) + l); if (f.endX = xe[0], f.endY = xe[1], f.arrowEndX = ke[0], f.arrowEndY = ke[1], k === "inside-to-node") r = [i.x, i.y]; else if (T.units) r = this.manualEndptToPx(n, T); else if (k === "outside-to-line") r = f.srcIntn; else if (k === "outside-to-node" || k === "outside-to-node-or-label" ? M = B : (k === "outside-to-line" || k === "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), k === "outside-to-node-or-label" || k === "outside-to-line-or-label") { var De = n._private.rscratch, qe = De.labelWidth, Ke = De.labelHeight, Be = De.labelX, Ge = De.labelY, le = qe / 2, S = Ke / 2, z = n.pstyle("text-valign").value; z === "top" ? Ge -= S : z === "bottom" && (Ge += S); var ie = n.pstyle("text-halign").value; ie === "left" ? Be -= le : ie === "right" && (Be += le); var j = oo(M[0], M[1], [Be - le, Ge - S, Be + le, Ge - S, Be + le, Ge + S, Be - le, Ge + S], i.x, i.y); if (j.length > 0) { var Y = o, pe = ta(Y, Ha(r)), re = ta(Y, Ha(j)), ve = pe; if (re < pe && (r = [j[0], j[1]], ve = re), j.length > 2) { var Ae = ta(Y, { x: j[2], y: j[3] }); Ae < ve && (r = [j[2], j[3]]); } } } var Me = Yo(r, B, e.arrowShapes[u].spacing(t13) + c), _e = Yo(r, B, e.arrowShapes[u].gap(t13) + c); f.startX = _e[0], f.startY = _e[1], f.arrowStartX = Me[0], f.arrowStartY = Me[1], E && (!be(f.startX) || !be(f.startY) || !be(f.endX) || !be(f.endY) ? f.badLine = true : f.badLine = false); }; Fo.getSourceEndpoint = function(t13) { var e = t13[0]._private.rscratch; switch (this.recalculateRenderedStyle(t13), e.edgeType) { case "haystack": return { x: e.haystackPts[0], y: e.haystackPts[1] }; default: return { x: e.arrowStartX, y: e.arrowStartY }; } }; Fo.getTargetEndpoint = function(t13) { var e = t13[0]._private.rscratch; switch (this.recalculateRenderedStyle(t13), e.edgeType) { case "haystack": return { x: e.haystackPts[2], y: e.haystackPts[3] }; default: return { x: e.arrowEndX, y: e.arrowEndY }; } }; var _c = {}; function $P(t13, e, r) { for (var n = function(l, c, d, v) { return Nt(l, c, d, v); }, a = e._private, i = a.rstyle.bezierPts, o = 0; o < t13.bezierProjPcts.length; o++) { var s = t13.bezierProjPcts[o]; i.push({ x: n(r[0], r[2], r[4], s), y: n(r[1], r[3], r[5], s) }); } } _c.storeEdgeProjections = function(t13) { var e = t13._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) $P(this, t13, 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(t13.pstyle("width").pfValue, t13.pstyle("arrow-scale").value) * this.arrowShapeWidth; }; _c.recalculateEdgeProjections = function(t13) { this.findEdgeControlPoints(t13); }; var an = {}; an.recalculateNodeLabelProjection = function(t13) { var e = t13.pstyle("label").strValue; if (!qn(e)) { var r, n, a = t13._private, i = t13.width(), o = t13.height(), s = t13.padding(), u = t13.position(), l = t13.pstyle("text-halign").strValue, c = t13.pstyle("text-valign").strValue, d = a.rscratch, v = 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, v.labelX = r, v.labelY = n, this.calculateLabelAngles(t13), this.applyLabelDimensions(t13); } }; var cg = function(e, r) { var n = Math.atan(r / e); return e === 0 && n < 0 && (n = n * -1), n; }; var dg = function(e, r) { var n = r.x - e.x, a = r.y - e.y; return cg(n, a); }; var RP = function(e, r, n, a) { var i = io(0, a - 1e-3, 1), o = io(0, a + 1e-3, 1), s = Ga(e, r, n, i), u = Ga(e, r, n, o); return dg(s, u); }; an.recalculateEdgeLabelProjections = function(t13) { var e, r = t13._private, n = r.rscratch, a = this, i = { mid: t13.pstyle("label").strValue, source: t13.pstyle("source-label").strValue, target: t13.pstyle("target-label").strValue }; if (i.mid || i.source || i.target) { e = { x: n.midX, y: n.midY }; var o = function(d, v, h6) { An(r.rscratch, d, v, h6), An(r.rstyle, d, v, h6); }; o("labelX", null, e.x), o("labelY", null, e.y); var s = cg(n.midDispX, n.midDispY); o("labelAutoAngle", null, s); var u = function c() { if (c.cache) return c.cache; for (var d = [], v = 0; v + 5 < n.allpts.length; v += 4) { var h6 = { x: n.allpts[v], y: n.allpts[v + 1] }, f = { x: n.allpts[v + 2], y: n.allpts[v + 3] }, p = { x: n.allpts[v + 4], y: n.allpts[v + 5] }; d.push({ p0: h6, p1: f, p2: p, startDist: 0, length: 0, segments: [] }); } var m = r.rstyle.bezierPts, g = a.bezierProjPcts.length; function y(C, T, k, _, D) { var O = ya(T, k), F = C.segments[C.segments.length - 1], L = { p0: T, p1: k, t0: _, t1: D, startDist: F ? F.startDist + F.length : 0, length: O }; C.segments.push(L), 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), y(w, w.p0, m[b * g], 0, a.bezierProjPcts[0]); for (var E = 0; E < g - 1; E++) y(w, m[b * g + E], m[b * g + E + 1], a.bezierProjPcts[E], a.bezierProjPcts[E + 1]); y(w, m[b * g + g - 1], w.p2, a.bezierProjPcts[g - 1], 1); } return c.cache = d; }, l = function(d) { var v, h6 = d === "source"; if (i[d]) { var f = t13.pstyle(d + "-text-offset").pfValue; switch (n.edgeType) { case "self": case "compound": case "bezier": case "multibezier": { for (var p = u(), m, g = 0, y = 0, b = 0; b < p.length; b++) { for (var w = p[h6 ? b : p.length - 1 - b], x = 0; x < w.segments.length; x++) { var E = w.segments[h6 ? x : w.segments.length - 1 - x], C = b === p.length - 1 && x === w.segments.length - 1; if (g = y, y += E.length, y >= f || C) { m = { cp: w, segment: E }; break; } } if (m) break; } var T = m.cp, k = m.segment, _ = (f - g) / k.length, D = k.t1 - k.t0, O = h6 ? k.t0 + D * _ : k.t1 - D * _; O = io(0, O, 1), e = Ga(T.p0, T.p1, T.p2, O), v = RP(T.p0, T.p1, T.p2, O); break; } case "straight": case "segments": case "haystack": { for (var F = 0, L, B, I, M, A = n.allpts.length, R = 0; R + 3 < A && (h6 ? (I = { x: n.allpts[R], y: n.allpts[R + 1] }, M = { x: n.allpts[R + 2], y: n.allpts[R + 3] }) : (I = { x: n.allpts[A - 2 - R], y: n.allpts[A - 1 - R] }, M = { x: n.allpts[A - 4 - R], y: n.allpts[A - 3 - R] }), L = ya(I, M), B = F, F += L, !(F >= f)); R += 2) ; var K = f - B, H = K / L; H = io(0, H, 1), e = K5(I, M, H), v = dg(I, M); break; } } o("labelX", d, e.x), o("labelY", d, e.y), o("labelAutoAngle", d, v); } }; l("source"), l("target"), this.applyLabelDimensions(t13); } }; an.applyLabelDimensions = function(t13) { this.applyPrefixedLabelDimensions(t13), t13.isEdge() && (this.applyPrefixedLabelDimensions(t13, "source"), this.applyPrefixedLabelDimensions(t13, "target")); }; an.applyPrefixedLabelDimensions = function(t13, e) { var r = t13._private, n = this.getLabelText(t13, e), a = this.calculateLabelDimensions(t13, n), i = t13.pstyle("line-height").pfValue, o = t13.pstyle("text-wrap").strValue, s = Nr(r.rscratch, "labelWrapCachedLines", e) || [], u = o !== "wrap" ? 1 : Math.max(s.length, 1), l = a.height / u, c = l * i, d = a.width, v = a.height + (u - 1) * (i - 1) * l; An(r.rstyle, "labelWidth", e, d), An(r.rscratch, "labelWidth", e, d), An(r.rstyle, "labelHeight", e, v), An(r.rscratch, "labelHeight", e, v), An(r.rscratch, "labelLineHeight", e, c); }; an.getLabelText = function(t13, e) { var r = t13._private, n = e ? e + "-" : "", a = t13.pstyle(n + "label").strValue, i = t13.pstyle("text-transform").value, o = function(ee, se) { return se ? (An(r.rscratch, ee, e, se), se) : Nr(r.rscratch, ee, e); }; if (!a) return ""; i == "none" || (i == "uppercase" ? a = a.toUpperCase() : i == "lowercase" && (a = a.toLowerCase())); var s = t13.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 = t13.pstyle("text-max-width").pfValue, v = t13.pstyle("text-overflow-wrap").value, h6 = v === "anywhere", f = [], p = /[\s\u200b]+|$/g, m = 0; m < c.length; m++) { var g = c[m], y = this.calculateLabelDimensions(t13, g), b = y.width; if (h6) { var w = g.split("").join(l); g = w; } if (b > d) { var x = g.matchAll(p), E = "", C = 0, T = Wh(x), k; try { for (T.s(); !(k = T.n()).done; ) { var _ = k.value, D = _[0], O = g.substring(C, _.index); C = _.index + D.length; var F = E.length === 0 ? O : E + O + D, L = this.calculateLabelDimensions(t13, F), B = L.width; B <= d ? E += O + D : (E && f.push(E), E = O + D); } } catch (q) { T.e(q); } finally { T.f(); } E.match(/^[\s\u200b]+$/) || f.push(E); } else f.push(g); } o("labelWrapCachedLines", f), a = o("labelWrapCachedText", f.join(` `)), o("labelWrapKey", u); } else if (s === "ellipsis") { var I = t13.pstyle("text-max-width").pfValue, M = "", A = "…", R = false; if (this.calculateLabelDimensions(t13, a).width < I) return a; for (var K = 0; K < a.length; K++) { var H = this.calculateLabelDimensions(t13, M + a[K] + A).width; if (H > I) break; M += a[K], K === a.length - 1 && (R = true); } return R || (M += A), M; } return a; }; an.getLabelJustification = function(t13) { var e = t13.pstyle("text-justification").strValue, r = t13.pstyle("text-halign").strValue; if (e === "auto") if (t13.isNode()) switch (r) { case "left": return "right"; case "right": return "left"; default: return "center"; } else return "center"; else return e; }; an.calculateLabelDimensions = function(t13, e) { var r = this, n = r.cy.window(), a = n.document, i = ma(e, t13._private.labelDimsKey), o = r.labelDimCache || (r.labelDimCache = []), s = o[i]; if (s != null) return s; var u = 0, l = t13.pstyle("font-style").strValue, c = t13.pstyle("font-size").pfValue, d = t13.pstyle("font-family").strValue, v = t13.pstyle("font-weight").strValue, h6 = this.labelCalcCanvas, f = this.labelCalcCanvasContext; if (!h6) { h6 = this.labelCalcCanvas = a.createElement("canvas"), f = this.labelCalcCanvasContext = h6.getContext("2d"); var p = h6.style; p.position = "absolute", p.left = "-9999px", p.top = "-9999px", p.zIndex = "-1", p.visibility = "hidden", p.pointerEvents = "none"; } f.font = "".concat(l, " ").concat(v, " ").concat(c, "px ").concat(d); for (var m = 0, g = 0, y = e.split(` `), b = 0; b < y.length; b++) { var w = y[b], x = f.measureText(w), E = Math.ceil(x.width), C = c; m = Math.max(E, m), g += C; } return m += u, g += u, o[i] = { width: m, height: g }; }; an.calculateLabelAngle = function(t13, e) { var r = t13._private, n = r.rscratch, a = t13.isEdge(), i = e ? e + "-" : "", o = t13.pstyle(i + "text-rotation"), s = o.strValue; return s === "none" ? 0 : a && s === "autorotate" ? n.labelAutoAngle : s === "autorotate" ? 0 : o.pfValue; }; an.calculateLabelAngles = function(t13) { var e = this, r = t13.isEdge(), n = t13._private, a = n.rscratch; a.labelAngle = e.calculateLabelAngle(t13), r && (a.sourceLabelAngle = e.calculateLabelAngle(t13, "source"), a.targetLabelAngle = e.calculateLabelAngle(t13, "target")); }; var fg = {}; var nv = 28; var av = false; fg.getNodeShape = function(t13) { var e = this, r = t13.pstyle("shape").value; if (r === "cutrectangle" && (t13.width() < nv || t13.height() < nv)) return av || (tt("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"), av = true), "rectangle"; if (t13.isParent()) return r === "rectangle" || r === "roundrectangle" || r === "round-rectangle" || r === "cutrectangle" || r === "cut-rectangle" || r === "barrel" ? r : "rectangle"; if (r === "polygon") { var n = t13.pstyle("shape-polygon-points").value; return e.nodeShapes.makePolygon(n).name; } return r; }; var pl = {}; pl.registerCalculationListeners = function() { var t13 = this.cy, e = t13.collection(), r = this, n = function(o) { var s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; 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 = false, d.cleanConnected = false; } }; r.binder(t13).on("bounds.* dirty.*", function(o) { var s = o.target; n(s); }).on("style.* background.*", function(o) { var s = o.target; n(s, false); }); 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 = true); } if (s) for (var d = 0; d < s.length; d++) { var v = s[d]; v(o, e); } r.recalculateRenderedStyle(e), e = t13.collection(); } }; r.flushRenderedStyleQueue = function() { a(true); }, r.beforeRender(a, r.beforeRenderPriorities.eleCalcs); }; pl.onUpdateEleCalcs = function(t13) { var e = this.onUpdateEleCalcsFns = this.onUpdateEleCalcsFns || []; e.push(t13); }; pl.recalculateRenderedStyle = function(t13, e) { var r = function(w) { return w._private.rstyle.cleanConnected; }, n = [], a = []; if (!this.destroyed) { e === void 0 && (e = true); for (var i = 0; i < t13.length; i++) { var o = t13[i], s = o._private, u = s.rstyle; o.isEdge() && (!r(o.source()) || !r(o.target())) && (u.clean = false), !(e && u.clean || o.removed()) && o.pstyle("display").value !== "none" && (s.group === "nodes" ? a.push(o) : n.push(o), u.clean = true); } for (var l = 0; l < a.length; l++) { var c = a[l], d = c._private, v = d.rstyle, h6 = c.position(); this.recalculateNodeLabelProjection(c), v.nodeX = h6.x, v.nodeY = h6.y, v.nodeW = c.pstyle("width").pfValue, v.nodeH = c.pstyle("height").pfValue; } this.recalculateEdgeProjections(n); for (var f = 0; f < n.length; f++) { var p = n[f], m = p._private, g = m.rstyle, y = m.rscratch; g.srcX = y.arrowStartX, g.srcY = y.arrowStartY, g.tgtX = y.arrowEndX, g.tgtY = y.arrowEndY, g.midX = y.midX, g.midY = y.midY, g.labelAngle = y.labelAngle, g.sourceLabelAngle = y.sourceLabelAngle, g.targetLabelAngle = y.targetLabelAngle; } } }; var gl = {}; gl.updateCachedGrabbedEles = function() { var t13 = this.cachedZSortedEles; if (t13) { t13.drag = [], t13.nondrag = []; for (var e = [], r = 0; r < t13.length; r++) { var n = t13[r], a = n._private.rscratch; n.grabbed() && !n.isParent() ? e.push(n) : a.inDragLayer ? t13.drag.push(n) : t13.nondrag.push(n); } for (var r = 0; r < e.length; r++) { var n = e[r]; t13.drag.push(n); } } }; gl.invalidateCachedZSortedEles = function() { this.cachedZSortedEles = null; }; gl.getCachedZSortedEles = function(t13) { if (t13 || !this.cachedZSortedEles) { var e = this.cy.mutableElements().toArray(); e.sort(Zp), e.interactive = e.filter(function(r) { return r.interactive(); }), this.cachedZSortedEles = e, this.updateCachedGrabbedEles(); } else e = this.cachedZSortedEles; return e; }; var vg = {}; [Da, Ns, or, Fo, _c, an, fg, pl, gl].forEach(function(t13) { Re(vg, t13); }); var hg = {}; hg.getCachedImage = function(t13, e, r) { var n = this, a = n.imageCache = n.imageCache || {}, i = a[t13]; if (i) return i.image.complete || i.image.addEventListener("load", r), i.image; i = a[t13] = a[t13] || {}; var o = i.image = new Image(); o.addEventListener("load", r), o.addEventListener("error", function() { o.error = true; }); var s = "data:", u = t13.substring(0, s.length).toLowerCase() === s; return u || (e = e === "null" ? null : e, o.crossOrigin = e), o.src = t13, o; }; var wi = {}; wi.registerBinding = function(t13, e, r, n) { var a = Array.prototype.slice.apply(arguments, [1]), i = this.binder(t13); return i.on.apply(i, a); }; wi.binder = function(t13) { var e = this, r = e.cy.window(), n = t13 === r || t13 === r.document || t13 === r.document.body || cT(t13); if (e.supportsPassiveEvents == null) { var a = false; try { var i = Object.defineProperty({}, "passive", { get: function() { return a = true, true; } }); 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 ?? false, passive: false, once: false }), e.bindings.push({ target: t13, args: d }), (t13.addEventListener || t13.on).apply(t13, d), this; }; return { on: o, addEventListener: o, addListener: o, bind: o }; }; wi.nodeIsDraggable = function(t13) { return t13 && t13.isNode() && !t13.locked() && t13.grabbable(); }; wi.nodeIsGrabbable = function(t13) { return this.nodeIsDraggable(t13) && t13.interactive(); }; wi.load = function() { var t13 = this, e = t13.cy.window(), r = function(S) { return S.selected(); }, n = function(S, z, ie, j) { S == null && (S = t13.cy); for (var Y = 0; Y < z.length; Y++) { var pe = z[Y]; S.emit({ originalEvent: ie, type: pe, position: j }); } }, a = function(S) { return S.shiftKey || S.metaKey || S.ctrlKey; }, i = function(S, z) { var ie = true; if (t13.cy.hasCompoundNodes() && S && S.pannable()) for (var j = 0; z && j < z.length; j++) { var S = z[j]; if (S.isNode() && S.isParent() && !S.pannable()) { ie = false; break; } } else ie = true; return ie; }, o = function(S) { S[0]._private.grabbed = true; }, s = function(S) { S[0]._private.grabbed = false; }, u = function(S) { S[0]._private.rscratch.inDragLayer = true; }, l = function(S) { S[0]._private.rscratch.inDragLayer = false; }, c = function(S) { S[0]._private.rscratch.isGrabTarget = true; }, d = function(S) { S[0]._private.rscratch.isGrabTarget = false; }, v = function(S, z) { var ie = z.addToList, j = ie.has(S); !j && S.grabbable() && !S.locked() && (ie.merge(S), o(S)); }, h6 = function(S, z) { if (S.cy().hasCompoundNodes() && !(z.inDragLayer == null && z.addToList == null)) { var ie = S.descendants(); z.inDragLayer && (ie.forEach(u), ie.connectedEdges().forEach(u)), z.addToList && v(ie, z); } }, f = function(S, z) { z = z || {}; var ie = S.cy().hasCompoundNodes(); z.inDragLayer && (S.forEach(u), S.neighborhood().stdFilter(function(j) { return !ie || j.isEdge(); }).forEach(u)), z.addToList && S.forEach(function(j) { v(j, z); }), h6(S, z), g(S, { inDragLayer: z.inDragLayer }), t13.updateCachedGrabbedEles(); }, p = f, m = function(S) { S && (t13.getCachedZSortedEles().forEach(function(z) { s(z), l(z), d(z); }), t13.updateCachedGrabbedEles()); }, g = function(S, z) { if (!(z.inDragLayer == null && z.addToList == null) && S.cy().hasCompoundNodes()) { var ie = S.ancestors().orphans(); if (!ie.same(S)) { var j = ie.descendants().spawnSelf().merge(ie).unmerge(S).unmerge(S.descendants()), Y = j.connectedEdges(); z.inDragLayer && (Y.forEach(u), j.forEach(u)), z.addToList && j.forEach(function(pe) { v(pe, z); }); } } }, y = function() { document.activeElement != null && document.activeElement.blur != null && document.activeElement.blur(); }, b = typeof MutationObserver < "u", w = typeof ResizeObserver < "u"; b ? (t13.removeObserver = new MutationObserver(function(le) { for (var S = 0; S < le.length; S++) { var z = le[S], ie = z.removedNodes; if (ie) for (var j = 0; j < ie.length; j++) { var Y = ie[j]; if (Y === t13.container) { t13.destroy(); break; } } } }), t13.container.parentNode && t13.removeObserver.observe(t13.container.parentNode, { childList: true })) : t13.registerBinding(t13.container, "DOMNodeRemoved", function(le) { t13.destroy(); }); var x = tl(function() { t13.cy.resize(); }, 100); b && (t13.styleObserver = new MutationObserver(x), t13.styleObserver.observe(t13.container, { attributes: true })), t13.registerBinding(e, "resize", x), w && (t13.resizeObserver = new ResizeObserver(x), t13.resizeObserver.observe(t13.container)); var E = function(S, z) { for (; S != null; ) z(S), S = S.parentNode; }, C = function() { t13.invalidateContainerClientCoordsCache(); }; E(t13.container, function(le) { t13.registerBinding(le, "transitionend", C), t13.registerBinding(le, "animationend", C), t13.registerBinding(le, "scroll", C); }), t13.registerBinding(t13.container, "contextmenu", function(le) { le.preventDefault(); }); var T = function() { return t13.selection[4] !== 0; }, k = function(S) { for (var z = t13.findContainerClientCoords(), ie = z[0], j = z[1], Y = z[2], pe = z[3], re = S.touches ? S.touches : [S], ve = false, Ae = 0; Ae < re.length; Ae++) { var Me = re[Ae]; if (ie <= Me.clientX && Me.clientX <= ie + Y && j <= Me.clientY && Me.clientY <= j + pe) { ve = true; break; } } if (!ve) return false; for (var _e = t13.container, Ne = S.target, Te = Ne.parentNode, Oe = false; Te; ) { if (Te === _e) { Oe = true; break; } Te = Te.parentNode; } return !!Oe; }; t13.registerBinding(t13.container, "mousedown", function(S) { if (k(S) && !(t13.hoverData.which === 1 && S.which !== 1)) { S.preventDefault(), y(), t13.hoverData.capture = true, t13.hoverData.which = S.which; var z = t13.cy, ie = [S.clientX, S.clientY], j = t13.projectIntoViewport(ie[0], ie[1]), Y = t13.selection, pe = t13.findNearestElements(j[0], j[1], true, false), re = pe[0], ve = t13.dragData.possibleDragElements; t13.hoverData.mdownPos = j, t13.hoverData.mdownGPos = ie; var Ae = function() { t13.hoverData.tapholdCancelled = false, clearTimeout(t13.hoverData.tapholdTimeout), t13.hoverData.tapholdTimeout = setTimeout(function() { if (!t13.hoverData.tapholdCancelled) { var ut = t13.hoverData.down; ut ? ut.emit({ originalEvent: S, type: "taphold", position: { x: j[0], y: j[1] } }) : z.emit({ originalEvent: S, type: "taphold", position: { x: j[0], y: j[1] } }); } }, t13.tapholdDuration); }; if (S.which == 3) { t13.hoverData.cxtStarted = true; var Me = { originalEvent: S, type: "cxttapstart", position: { x: j[0], y: j[1] } }; re ? (re.activate(), re.emit(Me), t13.hoverData.down = re) : z.emit(Me), t13.hoverData.downTime = (/* @__PURE__ */ new Date()).getTime(), t13.hoverData.cxtDragged = false; } else if (S.which == 1) { re && re.activate(); { if (re != null && t13.nodeIsGrabbable(re)) { var _e = function(ut) { return { originalEvent: S, type: ut, position: { x: j[0], y: j[1] } }; }, Ne = function(ut) { ut.emit(_e("grab")); }; if (c(re), !re.selected()) ve = t13.dragData.possibleDragElements = z.collection(), p(re, { addToList: ve }), re.emit(_e("grabon")).emit(_e("grab")); else { ve = t13.dragData.possibleDragElements = z.collection(); var Te = z.$(function(Oe) { return Oe.isNode() && Oe.selected() && t13.nodeIsGrabbable(Oe); }); f(Te, { addToList: ve }), re.emit(_e("grabon")), Te.forEach(Ne); } t13.redrawHint("eles", true), t13.redrawHint("drag", true); } t13.hoverData.down = re, t13.hoverData.downs = pe, t13.hoverData.downTime = (/* @__PURE__ */ new Date()).getTime(); } n(re, ["mousedown", "tapstart", "vmousedown"], S, { x: j[0], y: j[1] }), re == null ? (Y[4] = 1, t13.data.bgActivePosistion = { x: j[0], y: j[1] }, t13.redrawHint("select", true), t13.redraw()) : re.pannable() && (Y[4] = 1), Ae(); } Y[0] = Y[2] = j[0], Y[1] = Y[3] = j[1]; } }, false), t13.registerBinding(e, "mousemove", function(S) { var z = t13.hoverData.capture; if (!(!z && !k(S))) { var ie = false, j = t13.cy, Y = j.zoom(), pe = [S.clientX, S.clientY], re = t13.projectIntoViewport(pe[0], pe[1]), ve = t13.hoverData.mdownPos, Ae = t13.hoverData.mdownGPos, Me = t13.selection, _e = null; !t13.hoverData.draggingEles && !t13.hoverData.dragging && !t13.hoverData.selecting && (_e = t13.findNearestElement(re[0], re[1], true, false)); var Ne = t13.hoverData.last, Te = t13.hoverData.down, Oe = [re[0] - Me[2], re[1] - Me[3]], ut = t13.dragData.possibleDragElements, nt; if (Ae) { var kt = pe[0] - Ae[0], St = kt * kt, wt = pe[1] - Ae[1], Zt = wt * wt, Pt = St + Zt; t13.hoverData.isOverThresholdDrag = nt = Pt >= t13.desktopTapThreshold2; } var Mt = a(S); nt && (t13.hoverData.tapholdCancelled = true); var gr = function() { var W = t13.hoverData.dragDelta = t13.hoverData.dragDelta || []; W.length === 0 ? (W.push(Oe[0]), W.push(Oe[1])) : (W[0] += Oe[0], W[1] += Oe[1]); }; ie = true, n(_e, ["mousemove", "vmousemove", "tapdrag"], S, { x: re[0], y: re[1] }); var Xt = function() { t13.data.bgActivePosistion = void 0, t13.hoverData.selecting || j.emit({ originalEvent: S, type: "boxstart", position: { x: re[0], y: re[1] } }), Me[4] = 1, t13.hoverData.selecting = true, t13.redrawHint("select", true), t13.redraw(); }; if (t13.hoverData.which === 3) { if (nt) { var jt = { originalEvent: S, type: "cxtdrag", position: { x: re[0], y: re[1] } }; Te ? Te.emit(jt) : j.emit(jt), t13.hoverData.cxtDragged = true, (!t13.hoverData.cxtOver || _e !== t13.hoverData.cxtOver) && (t13.hoverData.cxtOver && t13.hoverData.cxtOver.emit({ originalEvent: S, type: "cxtdragout", position: { x: re[0], y: re[1] } }), t13.hoverData.cxtOver = _e, _e && _e.emit({ originalEvent: S, type: "cxtdragover", position: { x: re[0], y: re[1] } })); } } else if (t13.hoverData.dragging) { if (ie = true, j.panningEnabled() && j.userPanningEnabled()) { var wr; if (t13.hoverData.justStartedPan) { var Pr = t13.hoverData.mdownPos; wr = { x: (re[0] - Pr[0]) * Y, y: (re[1] - Pr[1]) * Y }, t13.hoverData.justStartedPan = false; } else wr = { x: Oe[0] * Y, y: Oe[1] * Y }; j.panBy(wr), j.emit("dragpan"), t13.hoverData.dragged = true; } re = t13.projectIntoViewport(S.clientX, S.clientY); } else if (Me[4] == 1 && (Te == null || Te.pannable())) { if (nt) { if (!t13.hoverData.dragging && j.boxSelectionEnabled() && (Mt || !j.panningEnabled() || !j.userPanningEnabled())) Xt(); else if (!t13.hoverData.selecting && j.panningEnabled() && j.userPanningEnabled()) { var ur = i(Te, t13.hoverData.downs); ur && (t13.hoverData.dragging = true, t13.hoverData.justStartedPan = true, Me[4] = 0, t13.data.bgActivePosistion = Ha(ve), t13.redrawHint("select", true), t13.redraw()); } Te && Te.pannable() && Te.active() && Te.unactivate(); } } else { if (Te && Te.pannable() && Te.active() && Te.unactivate(), (!Te || !Te.grabbed()) && _e != Ne && (Ne && n(Ne, ["mouseout", "tapdragout"], S, { x: re[0], y: re[1] }), _e && n(_e, ["mouseover", "tapdragover"], S, { x: re[0], y: re[1] }), t13.hoverData.last = _e), Te) if (nt) { if (j.boxSelectionEnabled() && Mt) Te && Te.grabbed() && (m(ut), Te.emit("freeon"), ut.emit("free"), t13.dragData.didDrag && (Te.emit("dragfreeon"), ut.emit("dragfree"))), Xt(); else if (Te && Te.grabbed() && t13.nodeIsDraggable(Te)) { var Ct = !t13.dragData.didDrag; Ct && t13.redrawHint("eles", true), t13.dragData.didDrag = true, t13.hoverData.draggingEles || f(ut, { inDragLayer: true }); var Tt = { x: 0, y: 0 }; if (be(Oe[0]) && be(Oe[1]) && (Tt.x += Oe[0], Tt.y += Oe[1], Ct)) { var Bt = t13.hoverData.dragDelta; Bt && be(Bt[0]) && be(Bt[1]) && (Tt.x += Bt[0], Tt.y += Bt[1]); } t13.hoverData.draggingEles = true, ut.silentShift(Tt).emit("position drag"), t13.redrawHint("drag", true), t13.redraw(); } } else gr(); ie = true; } if (Me[2] = re[0], Me[3] = re[1], ie) return S.stopPropagation && S.stopPropagation(), S.preventDefault && S.preventDefault(), false; } }, false); var _, D, O; t13.registerBinding(e, "mouseup", function(S) { if (!(t13.hoverData.which === 1 && S.which !== 1 && t13.hoverData.capture)) { var z = t13.hoverData.capture; if (z) { t13.hoverData.capture = false; var ie = t13.cy, j = t13.projectIntoViewport(S.clientX, S.clientY), Y = t13.selection, pe = t13.findNearestElement(j[0], j[1], true, false), re = t13.dragData.possibleDragElements, ve = t13.hoverData.down, Ae = a(S); if (t13.data.bgActivePosistion && (t13.redrawHint("select", true), t13.redraw()), t13.hoverData.tapholdCancelled = true, t13.data.bgActivePosistion = void 0, ve && ve.unactivate(), t13.hoverData.which === 3) { var Me = { originalEvent: S, type: "cxttapend", position: { x: j[0], y: j[1] } }; if (ve ? ve.emit(Me) : ie.emit(Me), !t13.hoverData.cxtDragged) { var _e = { originalEvent: S, type: "cxttap", position: { x: j[0], y: j[1] } }; ve ? ve.emit(_e) : ie.emit(_e); } t13.hoverData.cxtDragged = false, t13.hoverData.which = null; } else if (t13.hoverData.which === 1) { if (n(pe, ["mouseup", "tapend", "vmouseup"], S, { x: j[0], y: j[1] }), !t13.dragData.didDrag && // didn't move a node around !t13.hoverData.dragged && // didn't pan !t13.hoverData.selecting && // not box selection !t13.hoverData.isOverThresholdDrag && (n(ve, ["click", "tap", "vclick"], S, { x: j[0], y: j[1] }), D = false, S.timeStamp - O <= ie.multiClickDebounceTime() ? (_ && clearTimeout(_), D = true, O = null, n(ve, ["dblclick", "dbltap", "vdblclick"], S, { x: j[0], y: j[1] })) : (_ = setTimeout(function() { D || n(ve, ["oneclick", "onetap", "voneclick"], S, { x: j[0], y: j[1] }); }, ie.multiClickDebounceTime()), O = S.timeStamp)), ve == null && !t13.dragData.didDrag && !t13.hoverData.selecting && !t13.hoverData.dragged && !a(S) && (ie.$(r).unselect(["tapunselect"]), re.length > 0 && t13.redrawHint("eles", true), t13.dragData.possibleDragElements = re = ie.collection()), pe == ve && !t13.dragData.didDrag && !t13.hoverData.selecting && pe != null && pe._private.selectable && (t13.hoverData.dragging || (ie.selectionType() === "additive" || Ae ? pe.selected() ? pe.unselect(["tapunselect"]) : pe.select(["tapselect"]) : Ae || (ie.$(r).unmerge(pe).unselect(["tapunselect"]), pe.select(["tapselect"]))), t13.redrawHint("eles", true)), t13.hoverData.selecting) { var Ne = ie.collection(t13.getAllInBox(Y[0], Y[1], Y[2], Y[3])); t13.redrawHint("select", true), Ne.length > 0 && t13.redrawHint("eles", true), ie.emit({ type: "boxend", originalEvent: S, position: { x: j[0], y: j[1] } }); var Te = function(nt) { return nt.selectable() && !nt.selected(); }; ie.selectionType() === "additive" || Ae || ie.$(r).unmerge(Ne).unselect(), Ne.emit("box").stdFilter(Te).select().emit("boxselect"), t13.redraw(); } if (t13.hoverData.dragging && (t13.hoverData.dragging = false, t13.redrawHint("select", true), t13.redrawHint("eles", true), t13.redraw()), !Y[4]) { t13.redrawHint("drag", true), t13.redrawHint("eles", true); var Oe = ve && ve.grabbed(); m(re), Oe && (ve.emit("freeon"), re.emit("free"), t13.dragData.didDrag && (ve.emit("dragfreeon"), re.emit("dragfree"))); } } Y[4] = 0, t13.hoverData.down = null, t13.hoverData.cxtStarted = false, t13.hoverData.draggingEles = false, t13.hoverData.selecting = false, t13.hoverData.isOverThresholdDrag = false, t13.dragData.didDrag = false, t13.hoverData.dragged = false, t13.hoverData.dragDelta = [], t13.hoverData.mdownPos = null, t13.hoverData.mdownGPos = null, t13.hoverData.which = null; } } }, false); var F = function(S) { if (!t13.scrollingPage) { var z = t13.cy, ie = z.zoom(), j = z.pan(), Y = t13.projectIntoViewport(S.clientX, S.clientY), pe = [Y[0] * ie + j.x, Y[1] * ie + j.y]; if (t13.hoverData.draggingEles || t13.hoverData.dragging || t13.hoverData.cxtStarted || T()) { S.preventDefault(); return; } if (z.panningEnabled() && z.userPanningEnabled() && z.zoomingEnabled() && z.userZoomingEnabled()) { S.preventDefault(), t13.data.wheelZooming = true, clearTimeout(t13.data.wheelTimeout), t13.data.wheelTimeout = setTimeout(function() { t13.data.wheelZooming = false, t13.redrawHint("eles", true), t13.redraw(); }, 150); var re; S.deltaY != null ? re = S.deltaY / -250 : S.wheelDeltaY != null ? re = S.wheelDeltaY / 1e3 : re = S.wheelDelta / 1e3, re = re * t13.wheelSensitivity; var ve = S.deltaMode === 1; ve && (re *= 33); var Ae = z.zoom() * Math.pow(10, re); S.type === "gesturechange" && (Ae = t13.gestureStartZoom * S.scale), z.zoom({ level: Ae, renderedPosition: { x: pe[0], y: pe[1] } }), z.emit(S.type === "gesturechange" ? "pinchzoom" : "scrollzoom"); } } }; t13.registerBinding(t13.container, "wheel", F, true), t13.registerBinding(e, "scroll", function(S) { t13.scrollingPage = true, clearTimeout(t13.scrollingPageTimeout), t13.scrollingPageTimeout = setTimeout(function() { t13.scrollingPage = false; }, 250); }, true), t13.registerBinding(t13.container, "gesturestart", function(S) { t13.gestureStartZoom = t13.cy.zoom(), t13.hasTouchStarted || S.preventDefault(); }, true), t13.registerBinding(t13.container, "gesturechange", function(le) { t13.hasTouchStarted || F(le); }, true), t13.registerBinding(t13.container, "mouseout", function(S) { var z = t13.projectIntoViewport(S.clientX, S.clientY); t13.cy.emit({ originalEvent: S, type: "mouseout", position: { x: z[0], y: z[1] } }); }, false), t13.registerBinding(t13.container, "mouseover", function(S) { var z = t13.projectIntoViewport(S.clientX, S.clientY); t13.cy.emit({ originalEvent: S, type: "mouseover", position: { x: z[0], y: z[1] } }); }, false); var L, B, I, M, A, R, K, H, q, ee, se, oe, ae, ue = function(S, z, ie, j) { return Math.sqrt((ie - S) * (ie - S) + (j - z) * (j - z)); }, te = function(S, z, ie, j) { return (ie - S) * (ie - S) + (j - z) * (j - z); }, $; t13.registerBinding(t13.container, "touchstart", $ = function(S) { if (t13.hasTouchStarted = true, !!k(S)) { y(), t13.touchData.capture = true, t13.data.bgActivePosistion = void 0; var z = t13.cy, ie = t13.touchData.now, j = t13.touchData.earlier; if (S.touches[0]) { var Y = t13.projectIntoViewport(S.touches[0].clientX, S.touches[0].clientY); ie[0] = Y[0], ie[1] = Y[1]; } if (S.touches[1]) { var Y = t13.projectIntoViewport(S.touches[1].clientX, S.touches[1].clientY); ie[2] = Y[0], ie[3] = Y[1]; } if (S.touches[2]) { var Y = t13.projectIntoViewport(S.touches[2].clientX, S.touches[2].clientY); ie[4] = Y[0], ie[5] = Y[1]; } if (S.touches[1]) { t13.touchData.singleTouchMoved = true, m(t13.dragData.touchDragEles); var pe = t13.findContainerClientCoords(); q = pe[0], ee = pe[1], se = pe[2], oe = pe[3], L = S.touches[0].clientX - q, B = S.touches[0].clientY - ee, I = S.touches[1].clientX - q, M = S.touches[1].clientY - ee, ae = 0 <= L && L <= se && 0 <= I && I <= se && 0 <= B && B <= oe && 0 <= M && M <= oe; var re = z.pan(), ve = z.zoom(); A = ue(L, B, I, M), R = te(L, B, I, M), K = [(L + I) / 2, (B + M) / 2], H = [(K[0] - re.x) / ve, (K[1] - re.y) / ve]; var Ae = 200, Me = Ae * Ae; if (R < Me && !S.touches[2]) { var _e = t13.findNearestElement(ie[0], ie[1], true, true), Ne = t13.findNearestElement(ie[2], ie[3], true, true); _e && _e.isNode() ? (_e.activate().emit({ originalEvent: S, type: "cxttapstart", position: { x: ie[0], y: ie[1] } }), t13.touchData.start = _e) : Ne && Ne.isNode() ? (Ne.activate().emit({ originalEvent: S, type: "cxttapstart", position: { x: ie[0], y: ie[1] } }), t13.touchData.start = Ne) : z.emit({ originalEvent: S, type: "cxttapstart", position: { x: ie[0], y: ie[1] } }), t13.touchData.start && (t13.touchData.start._private.grabbed = false), t13.touchData.cxt = true, t13.touchData.cxtDragged = false, t13.data.bgActivePosistion = void 0, t13.redraw(); return; } } if (S.touches[2]) z.boxSelectionEnabled() && S.preventDefault(); else if (!S.touches[1]) { if (S.touches[0]) { var Te = t13.findNearestElements(ie[0], ie[1], true, true), Oe = Te[0]; if (Oe != null && (Oe.activate(), t13.touchData.start = Oe, t13.touchData.starts = Te, t13.nodeIsGrabbable(Oe))) { var ut = t13.dragData.touchDragEles = z.collection(), nt = null; t13.redrawHint("eles", true), t13.redrawHint("drag", true), Oe.selected() ? (nt = z.$(function(Pt) { return Pt.selected() && t13.nodeIsGrabbable(Pt); }), f(nt, { addToList: ut })) : p(Oe, { addToList: ut }), c(Oe); var kt = function(Mt) { return { originalEvent: S, type: Mt, position: { x: ie[0], y: ie[1] } }; }; Oe.emit(kt("grabon")), nt ? nt.forEach(function(Pt) { Pt.emit(kt("grab")); }) : Oe.emit(kt("grab")); } n(Oe, ["touchstart", "tapstart", "vmousedown"], S, { x: ie[0], y: ie[1] }), Oe == null && (t13.data.bgActivePosistion = { x: Y[0], y: Y[1] }, t13.redrawHint("select", true), t13.redraw()), t13.touchData.singleTouchMoved = false, t13.touchData.singleTouchStartTime = +/* @__PURE__ */ new Date(), clearTimeout(t13.touchData.tapholdTimeout), t13.touchData.tapholdTimeout = setTimeout(function() { t13.touchData.singleTouchMoved === false && !t13.pinching && !t13.touchData.selecting && n(t13.touchData.start, ["taphold"], S, { x: ie[0], y: ie[1] }); }, t13.tapholdDuration); } } if (S.touches.length >= 1) { for (var St = t13.touchData.startPosition = [null, null, null, null, null, null], wt = 0; wt < ie.length; wt++) St[wt] = j[wt] = ie[wt]; var Zt = S.touches[0]; t13.touchData.startGPosition = [Zt.clientX, Zt.clientY]; } } }, false); var G; t13.registerBinding(e, "touchmove", G = function(S) { var z = t13.touchData.capture; if (!(!z && !k(S))) { var ie = t13.selection, j = t13.cy, Y = t13.touchData.now, pe = t13.touchData.earlier, re = j.zoom(); if (S.touches[0]) { var ve = t13.projectIntoViewport(S.touches[0].clientX, S.touches[0].clientY); Y[0] = ve[0], Y[1] = ve[1]; } if (S.touches[1]) { var ve = t13.projectIntoViewport(S.touches[1].clientX, S.touches[1].clientY); Y[2] = ve[0], Y[3] = ve[1]; } if (S.touches[2]) { var ve = t13.projectIntoViewport(S.touches[2].clientX, S.touches[2].clientY); Y[4] = ve[0], Y[5] = ve[1]; } var Ae = t13.touchData.startGPosition, Me; if (z && S.touches[0] && Ae) { for (var _e = [], Ne = 0; Ne < Y.length; Ne++) _e[Ne] = Y[Ne] - pe[Ne]; var Te = S.touches[0].clientX - Ae[0], Oe = Te * Te, ut = S.touches[0].clientY - Ae[1], nt = ut * ut, kt = Oe + nt; Me = kt >= t13.touchTapThreshold2; } if (z && t13.touchData.cxt) { S.preventDefault(); var St = S.touches[0].clientX - q, wt = S.touches[0].clientY - ee, Zt = S.touches[1].clientX - q, Pt = S.touches[1].clientY - ee, Mt = te(St, wt, Zt, Pt), gr = Mt / R, Xt = 150, jt = Xt * Xt, wr = 1.5, Pr = wr * wr; if (gr >= Pr || Mt >= jt) { t13.touchData.cxt = false, t13.data.bgActivePosistion = void 0, t13.redrawHint("select", true); var ur = { originalEvent: S, type: "cxttapend", position: { x: Y[0], y: Y[1] } }; t13.touchData.start ? (t13.touchData.start.unactivate().emit(ur), t13.touchData.start = null) : j.emit(ur); } } if (z && t13.touchData.cxt) { var ur = { originalEvent: S, type: "cxtdrag", position: { x: Y[0], y: Y[1] } }; t13.data.bgActivePosistion = void 0, t13.redrawHint("select", true), t13.touchData.start ? t13.touchData.start.emit(ur) : j.emit(ur), t13.touchData.start && (t13.touchData.start._private.grabbed = false), t13.touchData.cxtDragged = true; var Ct = t13.findNearestElement(Y[0], Y[1], true, true); (!t13.touchData.cxtOver || Ct !== t13.touchData.cxtOver) && (t13.touchData.cxtOver && t13.touchData.cxtOver.emit({ originalEvent: S, type: "cxtdragout", position: { x: Y[0], y: Y[1] } }), t13.touchData.cxtOver = Ct, Ct && Ct.emit({ originalEvent: S, type: "cxtdragover", position: { x: Y[0], y: Y[1] } })); } else if (z && S.touches[2] && j.boxSelectionEnabled()) S.preventDefault(), t13.data.bgActivePosistion = void 0, this.lastThreeTouch = +/* @__PURE__ */ new Date(), t13.touchData.selecting || j.emit({ originalEvent: S, type: "boxstart", position: { x: Y[0], y: Y[1] } }), t13.touchData.selecting = true, t13.touchData.didSelect = true, ie[4] = 1, !ie || ie.length === 0 || ie[0] === void 0 ? (ie[0] = (Y[0] + Y[2] + Y[4]) / 3, ie[1] = (Y[1] + Y[3] + Y[5]) / 3, ie[2] = (Y[0] + Y[2] + Y[4]) / 3 + 1, ie[3] = (Y[1] + Y[3] + Y[5]) / 3 + 1) : (ie[2] = (Y[0] + Y[2] + Y[4]) / 3, ie[3] = (Y[1] + Y[3] + Y[5]) / 3), t13.redrawHint("select", true), t13.redraw(); else if (z && S.touches[1] && !t13.touchData.didSelect && j.zoomingEnabled() && j.panningEnabled() && j.userZoomingEnabled() && j.userPanningEnabled()) { S.preventDefault(), t13.data.bgActivePosistion = void 0, t13.redrawHint("select", true); var Tt = t13.dragData.touchDragEles; if (Tt) { t13.redrawHint("drag", true); for (var Bt = 0; Bt < Tt.length; Bt++) { var kn = Tt[Bt]._private; kn.grabbed = false, kn.rscratch.inDragLayer = false; } } var W = t13.touchData.start, St = S.touches[0].clientX - q, wt = S.touches[0].clientY - ee, Zt = S.touches[1].clientX - q, Pt = S.touches[1].clientY - ee, we = ue(St, wt, Zt, Pt), We = we / A; if (ae) { var at = St - L, Gr = wt - B, Sn = Zt - I, Oa = Pt - M, sn = (at + Sn) / 2, Cr = (Gr + Oa) / 2, Tn = j.zoom(), ml = Tn * We, Bo = j.pan(), Lc = H[0] * Tn + Bo.x, Ic = H[1] * Tn + Bo.y, v0 = { x: -ml / Tn * (Lc - Bo.x - sn) + Lc, y: -ml / Tn * (Ic - Bo.y - Cr) + Ic }; if (W && W.active()) { var Tt = t13.dragData.touchDragEles; m(Tt), t13.redrawHint("drag", true), t13.redrawHint("eles", true), W.unactivate().emit("freeon"), Tt.emit("free"), t13.dragData.didDrag && (W.emit("dragfreeon"), Tt.emit("dragfree")); } j.viewport({ zoom: ml, pan: v0, cancelOnFailedZoom: true }), j.emit("pinchzoom"), A = we, L = St, B = wt, I = Zt, M = Pt, t13.pinching = true; } if (S.touches[0]) { var ve = t13.projectIntoViewport(S.touches[0].clientX, S.touches[0].clientY); Y[0] = ve[0], Y[1] = ve[1]; } if (S.touches[1]) { var ve = t13.projectIntoViewport(S.touches[1].clientX, S.touches[1].clientY); Y[2] = ve[0], Y[3] = ve[1]; } if (S.touches[2]) { var ve = t13.projectIntoViewport(S.touches[2].clientX, S.touches[2].clientY); Y[4] = ve[0], Y[5] = ve[1]; } } else if (S.touches[0] && !t13.touchData.didSelect) { var Or = t13.touchData.start, yl = t13.touchData.last, Ct; if (!t13.hoverData.draggingEles && !t13.swipePanning && (Ct = t13.findNearestElement(Y[0], Y[1], true, true)), z && Or != null && S.preventDefault(), z && Or != null && t13.nodeIsDraggable(Or)) if (Me) { var Tt = t13.dragData.touchDragEles, Fc = !t13.dragData.didDrag; Fc && f(Tt, { inDragLayer: true }), t13.dragData.didDrag = true; var ki = { x: 0, y: 0 }; if (be(_e[0]) && be(_e[1]) && (ki.x += _e[0], ki.y += _e[1], Fc)) { t13.redrawHint("eles", true); var Lr = t13.touchData.dragDelta; Lr && be(Lr[0]) && be(Lr[1]) && (ki.x += Lr[0], ki.y += Lr[1]); } t13.hoverData.draggingEles = true, Tt.silentShift(ki).emit("position drag"), t13.redrawHint("drag", true), t13.touchData.startPosition[0] == pe[0] && t13.touchData.startPosition[1] == pe[1] && t13.redrawHint("eles", true), t13.redraw(); } else { var Lr = t13.touchData.dragDelta = t13.touchData.dragDelta || []; Lr.length === 0 ? (Lr.push(_e[0]), Lr.push(_e[1])) : (Lr[0] += _e[0], Lr[1] += _e[1]); } if (n(Or || Ct, ["touchmove", "tapdrag", "vmousemove"], S, { x: Y[0], y: Y[1] }), (!Or || !Or.grabbed()) && Ct != yl && (yl && yl.emit({ originalEvent: S, type: "tapdragout", position: { x: Y[0], y: Y[1] } }), Ct && Ct.emit({ originalEvent: S, type: "tapdragover", position: { x: Y[0], y: Y[1] } })), t13.touchData.last = Ct, z) for (var Bt = 0; Bt < Y.length; Bt++) Y[Bt] && t13.touchData.startPosition[Bt] && Me && (t13.touchData.singleTouchMoved = true); if (z && (Or == null || Or.pannable()) && j.panningEnabled() && j.userPanningEnabled()) { var h0 = i(Or, t13.touchData.starts); h0 && (S.preventDefault(), t13.data.bgActivePosistion || (t13.data.bgActivePosistion = Ha(t13.touchData.startPosition)), t13.swipePanning ? (j.panBy({ x: _e[0] * re, y: _e[1] * re }), j.emit("dragpan")) : Me && (t13.swipePanning = true, j.panBy({ x: Te * re, y: ut * re }), j.emit("dragpan"), Or && (Or.unactivate(), t13.redrawHint("select", true), t13.touchData.start = null))); var ve = t13.projectIntoViewport(S.touches[0].clientX, S.touches[0].clientY); Y[0] = ve[0], Y[1] = ve[1]; } } for (var Ne = 0; Ne < Y.length; Ne++) pe[Ne] = Y[Ne]; z && S.touches.length > 0 && !t13.hoverData.draggingEles && !t13.swipePanning && t13.data.bgActivePosistion != null && (t13.data.bgActivePosistion = void 0, t13.redrawHint("select", true), t13.redraw()); } }, false); var Q; t13.registerBinding(e, "touchcancel", Q = function(S) { var z = t13.touchData.start; t13.touchData.capture = false, z && z.unactivate(); }); var ge, Ee, fe, me; if (t13.registerBinding(e, "touchend", ge = function(S) { var z = t13.touchData.start, ie = t13.touchData.capture; if (ie) S.touches.length === 0 && (t13.touchData.capture = false), S.preventDefault(); else return; var j = t13.selection; t13.swipePanning = false, t13.hoverData.draggingEles = false; var Y = t13.cy, pe = Y.zoom(), re = t13.touchData.now, ve = t13.touchData.earlier; if (S.touches[0]) { var Ae = t13.projectIntoViewport(S.touches[0].clientX, S.touches[0].clientY); re[0] = Ae[0], re[1] = Ae[1]; } if (S.touches[1]) { var Ae = t13.projectIntoViewport(S.touches[1].clientX, S.touches[1].clientY); re[2] = Ae[0], re[3] = Ae[1]; } if (S.touches[2]) { var Ae = t13.projectIntoViewport(S.touches[2].clientX, S.touches[2].clientY); re[4] = Ae[0], re[5] = Ae[1]; } z && z.unactivate(); var Me; if (t13.touchData.cxt) { if (Me = { originalEvent: S, type: "cxttapend", position: { x: re[0], y: re[1] } }, z ? z.emit(Me) : Y.emit(Me), !t13.touchData.cxtDragged) { var _e = { originalEvent: S, type: "cxttap", position: { x: re[0], y: re[1] } }; z ? z.emit(_e) : Y.emit(_e); } t13.touchData.start && (t13.touchData.start._private.grabbed = false), t13.touchData.cxt = false, t13.touchData.start = null, t13.redraw(); return; } if (!S.touches[2] && Y.boxSelectionEnabled() && t13.touchData.selecting) { t13.touchData.selecting = false; var Ne = Y.collection(t13.getAllInBox(j[0], j[1], j[2], j[3])); j[0] = void 0, j[1] = void 0, j[2] = void 0, j[3] = void 0, j[4] = 0, t13.redrawHint("select", true), Y.emit({ type: "boxend", originalEvent: S, position: { x: re[0], y: re[1] } }); var Te = function(jt) { return jt.selectable() && !jt.selected(); }; Ne.emit("box").stdFilter(Te).select().emit("boxselect"), Ne.nonempty() && t13.redrawHint("eles", true), t13.redraw(); } if (z != null && z.unactivate(), S.touches[2]) t13.data.bgActivePosistion = void 0, t13.redrawHint("select", true); else if (!S.touches[1]) { if (!S.touches[0]) { if (!S.touches[0]) { t13.data.bgActivePosistion = void 0, t13.redrawHint("select", true); var Oe = t13.dragData.touchDragEles; if (z != null) { var ut = z._private.grabbed; m(Oe), t13.redrawHint("drag", true), t13.redrawHint("eles", true), ut && (z.emit("freeon"), Oe.emit("free"), t13.dragData.didDrag && (z.emit("dragfreeon"), Oe.emit("dragfree"))), n(z, ["touchend", "tapend", "vmouseup", "tapdragout"], S, { x: re[0], y: re[1] }), z.unactivate(), t13.touchData.start = null; } else { var nt = t13.findNearestElement(re[0], re[1], true, true); n(nt, ["touchend", "tapend", "vmouseup", "tapdragout"], S, { x: re[0], y: re[1] }); } var kt = t13.touchData.startPosition[0] - re[0], St = kt * kt, wt = t13.touchData.startPosition[1] - re[1], Zt = wt * wt, Pt = St + Zt, Mt = Pt * pe * pe; t13.touchData.singleTouchMoved || (z || Y.$(":selected").unselect(["tapunselect"]), n(z, ["tap", "vclick"], S, { x: re[0], y: re[1] }), Ee = false, S.timeStamp - me <= Y.multiClickDebounceTime() ? (fe && clearTimeout(fe), Ee = true, me = null, n(z, ["dbltap", "vdblclick"], S, { x: re[0], y: re[1] })) : (fe = setTimeout(function() { Ee || n(z, ["onetap", "voneclick"], S, { x: re[0], y: re[1] }); }, Y.multiClickDebounceTime()), me = S.timeStamp)), z != null && !t13.dragData.didDrag && z._private.selectable && Mt < t13.touchTapThreshold2 && !t13.pinching && (Y.selectionType() === "single" ? (Y.$(r).unmerge(z).unselect(["tapunselect"]), z.select(["tapselect"])) : z.selected() ? z.unselect(["tapunselect"]) : z.select(["tapselect"]), t13.redrawHint("eles", true)), t13.touchData.singleTouchMoved = true; } } } for (var gr = 0; gr < re.length; gr++) ve[gr] = re[gr]; t13.dragData.didDrag = false, S.touches.length === 0 && (t13.touchData.dragDelta = [], t13.touchData.startPosition = [null, null, null, null, null, null], t13.touchData.startGPosition = null, t13.touchData.didSelect = false), S.touches.length < 2 && (S.touches.length === 1 && (t13.touchData.startGPosition = [S.touches[0].clientX, S.touches[0].clientY]), t13.pinching = false, t13.redrawHint("eles", true), t13.redraw()); }, false), typeof TouchEvent > "u") { var Ce = [], ke = function(S) { return { clientX: S.clientX, clientY: S.clientY, force: 1, identifier: S.pointerId, pageX: S.pageX, pageY: S.pageY, radiusX: S.width / 2, radiusY: S.height / 2, screenX: S.screenX, screenY: S.screenY, target: S.target }; }, xe = function(S) { return { event: S, touch: ke(S) }; }, De = function(S) { Ce.push(xe(S)); }, qe = function(S) { for (var z = 0; z < Ce.length; z++) { var ie = Ce[z]; if (ie.event.pointerId === S.pointerId) { Ce.splice(z, 1); return; } } }, Ke = function(S) { var z = Ce.filter(function(ie) { return ie.event.pointerId === S.pointerId; })[0]; z.event = S, z.touch = ke(S); }, Be = function(S) { S.touches = Ce.map(function(z) { return z.touch; }); }, Ge = function(S) { return S.pointerType === "mouse" || S.pointerType === 4; }; t13.registerBinding(t13.container, "pointerdown", function(le) { Ge(le) || (le.preventDefault(), De(le), Be(le), $(le)); }), t13.registerBinding(t13.container, "pointerup", function(le) { Ge(le) || (qe(le), Be(le), ge(le)); }), t13.registerBinding(t13.container, "pointercancel", function(le) { Ge(le) || (qe(le), Be(le), Q(le)); }), t13.registerBinding(t13.container, "pointermove", function(le) { Ge(le) || (le.preventDefault(), Ke(le), Be(le), G(le)); }); } }; var xn = {}; xn.generatePolygon = function(t13, e) { return this.nodeShapes[t13] = { renderer: this, name: t13, 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 oo(s, u, this.points, n, a, i / 2, o / 2, l); }, checkPoint: function(n, a, i, o, s, u, l, c) { return mn(n, a, this.points, u, l, o, s, [0, -1], i); } }; }; xn.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 n4(i, o, e, r, n / 2 + s, a / 2 + s); }, checkPoint: function(e, r, n, a, i, o, s, u) { return la(e, r, a, i, o, s, n); } }; }; xn.generateRoundPolygon = function(t13, e) { return this.nodeShapes[t13] = { renderer: this, name: t13, 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" ? mp(i, o) : s; for (var v = new Array(e.length / 2), h6 = 0; h6 < e.length / 2; h6++) v[h6] = { x: n + c * e[h6 * 2], y: a + d * e[h6 * 2 + 1] }; var f, p, m, g, y = v.length; for (p = v[y - 1], f = 0; f < y; f++) m = v[f % y], g = v[(f + 1) % y], u[l][f] = Tc(p, m, g, s), p = m, m = g; 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 a4(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 r4(n, a, this.points, u, l, o, s, this.getOrCreateCorners(u, l, o, s, c, d, "corners")); } }; }; xn.generateRoundRectangle = function() { return this.nodeShapes["round-rectangle"] = this.nodeShapes.roundrectangle = { renderer: this, name: "round-rectangle", points: sr(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 pp(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" ? ba(a, i) : u, u = Math.min(l, c, u); var d = u * 2; return !!(mn(e, r, this.points, o, s, a, i - d, [0, -1], n) || mn(e, r, this.points, o, s, a - d, i, [0, -1], n) || la(e, r, d, d, o - l + u, s - c + u, n) || la(e, r, d, d, o + l - u, s - c + u, n) || la(e, r, d, d, o + l - u, s + c - u, n) || la(e, r, d, d, o - l + u, s + c - u, n)); } }; }; xn.generateCutRectangle = function() { return this.nodeShapes["cut-rectangle"] = this.nodeShapes.cutrectangle = { renderer: this, name: "cut-rectangle", cornerLength: hc(), points: sr(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, v = 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, v - o, c - o, v, c - o, v - o], bottomLeft: [l + o, v, l, v - o, l + o, v - 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 oo(i, o, c, e, r); }, checkPoint: function(e, r, n, a, i, o, s, u) { var l = u === "auto" ? this.cornerLength : u; if (mn(e, r, this.points, o, s, a, i - 2 * l, [0, -1], n) || mn(e, r, this.points, o, s, a - 2 * l, i, [0, -1], n)) return true; var c = this.generateCutTrianglePts(a, i, o, s); return dr(e, r, c.topLeft) || dr(e, r, c.topRight) || dr(e, r, c.bottomRight) || dr(e, r, c.bottomLeft); } }; }; xn.generateBarrel = function() { return this.nodeShapes.barrel = { renderer: this, name: "barrel", points: sr(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, v = this.generateBarrelBezierPts(n + 2 * s, a + 2 * s, e, r), h6 = function(m) { var g = Ga({ x: m[0], y: m[1] }, { x: m[2], y: m[3] }, { x: m[4], y: m[5] }, l), y = Ga({ x: m[0], y: m[1] }, { x: m[2], y: m[3] }, { x: m[4], y: m[5] }, c), b = Ga({ x: m[0], y: m[1] }, { x: m[2], y: m[3] }, { x: m[4], y: m[5] }, d); return [m[0], m[1], g.x, g.y, y.x, y.y, b.x, b.y, m[4], m[5]]; }, f = [].concat(h6(v.topLeft), h6(v.topRight), h6(v.bottomRight), h6(v.bottomLeft)); return oo(i, o, f, 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 = lu(e, r), v = d.heightOffset, h6 = d.widthOffset, f = d.ctrlPtOffsetPct * e, p = { topLeft: [s, l + v, s + f, l, s + h6, l], topRight: [u - h6, l, u - f, l, u, l + v], bottomRight: [u, c - v, u - f, c, u - h6, c], bottomLeft: [s + h6, c, s + f, c, s, c - v] }; return p.topLeft.isTop = true, p.topRight.isTop = true, p.bottomLeft.isBottom = true, p.bottomRight.isBottom = true, p; }, checkPoint: function(e, r, n, a, i, o, s, u) { var l = lu(a, i), c = l.heightOffset, d = l.widthOffset; if (mn(e, r, this.points, o, s, a, i - 2 * c, [0, -1], n) || mn(e, r, this.points, o, s, a - 2 * d, i, [0, -1], n)) return true; for (var v = this.generateBarrelBezierPts(a, i, o, s), h6 = function(T, k, _) { var D = _[4], O = _[2], F = _[0], L = _[5], B = _[1], I = Math.min(D, F), M = Math.max(D, F), A = Math.min(L, B), R = Math.max(L, B); if (I <= T && T <= M && A <= k && k <= R) { var K = i4(D, O, F), H = Q5(K[0], K[1], K[2], T), q = H.filter(function(ee) { return 0 <= ee && ee <= 1; }); if (q.length > 0) return q[0]; } return null; }, f = Object.keys(v), p = 0; p < f.length; p++) { var m = f[p], g = v[m], y = h6(e, r, g); if (y != null) { var b = g[5], w = g[3], x = g[1], E = Nt(b, w, x, y); if (g.isTop && E <= r || g.isBottom && r <= E) return true; } } return false; } }; }; xn.generateBottomRoundrectangle = function() { return this.nodeShapes["bottom-round-rectangle"] = this.nodeShapes.bottomroundrectangle = { renderer: this, name: "bottom-round-rectangle", points: sr(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, v = e + (n / 2 + s), h6 = Nn(i, o, e, r, l, c, v, d, false); return h6.length > 0 ? h6 : pp(i, o, e, r, n, a, s, u); }, checkPoint: function(e, r, n, a, i, o, s, u) { u = u === "auto" ? ba(a, i) : u; var l = 2 * u; if (mn(e, r, this.points, o, s, a, i - l, [0, -1], n) || mn(e, r, this.points, o, s, a - l, i, [0, -1], n)) return true; var c = a / 2 + 2 * n, d = i / 2 + 2 * n, v = [o - c, s - d, o - c, s, o + c, s, o + c, s - d]; return !!(dr(e, r, v) || la(e, r, l, l, o + a / 2 - u, s + i / 2 - u, n) || la(e, r, l, l, o - a / 2 + u, s + i / 2 - u, n)); } }; }; xn.registerNodeShapes = function() { var t13 = this.nodeShapes = {}, e = this; this.generateEllipse(), this.generatePolygon("triangle", sr(3, 0)), this.generateRoundPolygon("round-triangle", sr(3, 0)), this.generatePolygon("rectangle", sr(4, 0)), t13.square = t13.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", sr(5, 0)), this.generateRoundPolygon("round-pentagon", sr(5, 0)), this.generatePolygon("hexagon", sr(6, 0)), this.generateRoundPolygon("round-hexagon", sr(6, 0)), this.generatePolygon("heptagon", sr(7, 0)), this.generateRoundPolygon("round-heptagon", sr(7, 0)), this.generatePolygon("octagon", sr(8, 0)), this.generateRoundPolygon("round-octagon", sr(8, 0)); var n = new Array(20); { var a = su(5, 0), i = su(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 = gp(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); } t13.makePolygon = function(l) { var c = l.join("$"), d = "polygon-" + c, v; return (v = this[d]) ? v : e.generatePolygon(d, l); }; }; var Ao = {}; Ao.timeToRender = function() { return this.redrawTotalTime / this.redrawCount; }; Ao.redraw = function(t13) { t13 = t13 || cp(); 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 = true, e.renderOptions = t13; }; Ao.beforeRender = function(t13, e) { if (!this.destroyed) { e == null && yt("Priority is not optional for beforeRender"); var r = this.beforeRenderCallbacks; r.push({ fn: t13, priority: e }), r.sort(function(n, a) { return a.priority - n.priority; }); } }; var iv = function(e, r, n) { for (var a = e.beforeRenderCallbacks, i = 0; i < a.length; i++) a[i].fn(r, n); }; Ao.startRenderLoop = function() { var t13 = this, e = t13.cy; if (!t13.renderLoopStarted) { t13.renderLoopStarted = true; var r = function n(a) { if (!t13.destroyed) { if (!e.batching()) if (t13.requestedFrame && !t13.skipFrame) { iv(t13, true, a); var i = gn(); t13.render(t13.renderOptions); var o = t13.lastDrawTime = gn(); t13.averageRedrawTime === void 0 && (t13.averageRedrawTime = o - i), t13.redrawCount === void 0 && (t13.redrawCount = 0), t13.redrawCount++, t13.redrawTotalTime === void 0 && (t13.redrawTotalTime = 0); var s = o - i; t13.redrawTotalTime += s, t13.lastRedrawTime = s, t13.averageRedrawTime = t13.averageRedrawTime / 2 + s / 2, t13.requestedFrame = false; } else iv(t13, false, a); t13.skipFrame = false, Ps(n); } }; Ps(r); } }; var zP = function(e) { this.init(e); }; var pg = zP; var Ci = pg.prototype; Ci.clientFunctions = ["redrawHint", "render", "renderTo", "matchCanvasSize", "nodeShapeImpl", "arrowShapeImpl"]; Ci.init = function(t13) { var e = this; e.options = t13, e.cy = t13.cy; var r = e.container = t13.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: false, initialPan: [null, null], capture: false }, e.dragData = { possibleDragElements: [] }, e.touchData = { start: null, capture: false, // These 3 fields related to tap, taphold events startPosition: [null, null, null, null, null, null], singleTouchStartTime: null, singleTouchMoved: true, now: [null, null, null, null, null, null], earlier: [null, null, null, null, null, null] }, e.redraws = 0, e.showFps = t13.showFps, e.debug = t13.debug, e.hideEdgesOnViewport = t13.hideEdgesOnViewport, e.textureOnViewport = t13.textureOnViewport, e.wheelSensitivity = t13.wheelSensitivity, e.motionBlurEnabled = t13.motionBlur, e.forcedPixelRatio = be(t13.pixelRatio) ? t13.pixelRatio : null, e.motionBlur = t13.motionBlur, e.motionBlurOpacity = t13.motionBlurOpacity, e.motionBlurTransparency = 1 - e.motionBlurOpacity, e.motionBlurPxRatio = 1, e.mbPxRBlurry = 1, e.minMbLowQualFrames = 4, e.fullQualityMb = false, e.clearedForMotionBlur = [], e.desktopTapThreshold = t13.desktopTapThreshold, e.desktopTapThreshold2 = t13.desktopTapThreshold * t13.desktopTapThreshold, e.touchTapThreshold = t13.touchTapThreshold, e.touchTapThreshold2 = t13.touchTapThreshold * t13.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(); }; Ci.notify = function(t13, e) { var r = this, n = r.cy; if (!this.destroyed) { if (t13 === "init") { r.load(); return; } if (t13 === "destroy") { r.destroy(); return; } (t13 === "add" || t13 === "remove" || t13 === "move" && n.hasCompoundNodes() || t13 === "load" || t13 === "zorder" || t13 === "mount") && r.invalidateCachedZSortedEles(), t13 === "viewport" && r.redrawHint("select", true), (t13 === "load" || t13 === "resize" || t13 === "mount") && (r.invalidateContainerClientCoordsCache(), r.matchCanvasSize(r.container)), r.redrawHint("eles", true), r.redrawHint("drag", true), this.startRenderLoop(), this.redraw(); } }; Ci.destroy = function() { var t13 = this; t13.destroyed = true, t13.cy.stopAnimationLoop(); for (var e = 0; e < t13.bindings.length; e++) { var r = t13.bindings[e], n = r, a = n.target; (a.off || a.removeEventListener).apply(a, n.args); } if (t13.bindings = [], t13.beforeRenderCallbacks = [], t13.onUpdateEleCalcsFns = [], t13.removeObserver && t13.removeObserver.disconnect(), t13.styleObserver && t13.styleObserver.disconnect(), t13.resizeObserver && t13.resizeObserver.disconnect(), t13.labelCalcDiv) try { document.body.removeChild(t13.labelCalcDiv); } catch { } }; Ci.isHeadless = function() { return false; }; [Sc, vg, hg, wi, xn, Ao].forEach(function(t13) { Re(Ci, t13); }); var ql = 1e3 / 60; var gg = { setupDequeueing: function(e) { return function() { var n = this, a = this.renderer; if (!n.dequeueingSetup) { n.dequeueingSetup = true; var i = tl(function() { a.redrawHint("eles", true), a.redrawHint("drag", true), a.redraw(); }, e.deqRedrawThreshold), o = function(l, c) { var d = gn(), v = a.averageRedrawTime, h6 = a.lastRedrawTime, f = [], p = a.cy.extent(), m = a.getPixelRatio(); for (l || a.flushRenderedStyleQueue(); ; ) { var g = gn(), y = g - d, b = g - c; if (h6 < ql) { var w = ql - (l ? v : 0); if (b >= e.deqFastCost * w) break; } else if (l) { if (y >= e.deqCost * h6 || y >= e.deqAvgCost * v) break; } else if (b >= e.deqNoDrawCost * ql) break; var x = e.deq(n, m, p); if (x.length > 0) for (var E = 0; E < x.length; E++) f.push(x[E]); else break; } f.length > 0 && (e.onDeqd(n, f), !l && e.shouldRedraw(n, f, m, p) && i()); }, s = e.priority || cc; a.beforeRender(o, s(n)); } }; } }; var VP = function() { function t13(e) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Os; ic(this, t13), this.idsByKey = new Xr(), this.keyForId = new Xr(), this.cachesByLvl = new Xr(), this.lvls = [], this.getKey = e, this.doesEleInvalidateKey = r; } return oc(t13, [{ key: "getIdsFor", value: function(r) { r == null && yt("Can not get id list for null key"); var n = this.idsByKey, a = this.idsByKey.get(r); return a || (a = new vi(), 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 Xr(), 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; } }]), t13; }(); var ov = 25; var ns = 50; var ms = -4; var bu = 3; var HP = 7.99; var qP = 8; var KP = 1024; var UP = 1024; var GP = 1024; var WP = 0.2; var YP = 0.8; var ZP = 10; var XP = 0.15; var jP = 0.1; var QP = 0.9; var JP = 0.9; var eO = 100; var tO = 1; var qa = { dequeue: "dequeue", downscale: "downscale", highQuality: "highQuality" }; var rO = Wt({ getKey: null, doesEleInvalidateKey: Os, drawElement: null, getBoundingBox: null, getRotationPoint: null, getRotationOffset: null, isVisible: sp, allowEdgeTxrCaching: true, allowParentTxrCaching: true }); var Ri = function(e, r) { var n = this; n.renderer = e, n.onDequeues = []; var a = rO(r); Re(n, a), n.lookup = new VP(a.getKey, a.doesEleInvalidateKey), n.setupDequeueing(); }; var At = Ri.prototype; At.reasons = qa; At.getTextureQueue = function(t13) { var e = this; return e.eleImgCaches = e.eleImgCaches || {}, e.eleImgCaches[t13] = e.eleImgCaches[t13] || []; }; At.getRetiredTextureQueue = function(t13) { var e = this, r = e.eleImgCaches.retired = e.eleImgCaches.retired || {}, n = r[t13] = r[t13] || []; return n; }; At.getElementQueue = function() { var t13 = this, e = t13.eleCacheQueue = t13.eleCacheQueue || new Oo(function(r, n) { return n.reqs - r.reqs; }); return e; }; At.getElementKeyToQueue = function() { var t13 = this, e = t13.eleKeyToCacheQueue = t13.eleKeyToCacheQueue || {}; return e; }; At.getElement = function(t13, 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) || !t13.visible() || t13.removed() || !i.allowEdgeTxrCaching && t13.isEdge() || !i.allowParentTxrCaching && t13.isParent()) return null; if (n == null && (n = Math.ceil(fc(s * r))), n < ms) n = ms; else if (s >= HP || n > bu) return null; var l = Math.pow(2, n), c = e.h * l, d = e.w * l, v = o.eleTextBiggerThanMin(t13, l); if (!this.isVisible(t13, v)) return null; var h6 = u.get(t13, n); if (h6 && h6.invalidated && (h6.invalidated = false, h6.texture.invalidatedWidth -= h6.width), h6) return h6; var f; if (c <= ov ? f = ov : c <= ns ? f = ns : f = Math.ceil(c / ns) * ns, c > GP || d > UP) return null; var p = i.getTextureQueue(f), m = p[p.length - 2], g = function() { return i.recycleTexture(f, d) || i.addTexture(f, d); }; m || (m = p[p.length - 1]), m || (m = g()), m.width - m.usedWidth < d && (m = g()); for (var y = function(I) { return I && I.scaledLabelShown === v; }, b = a && a === qa.dequeue, w = a && a === qa.highQuality, x = a && a === qa.downscale, E, C = n + 1; C <= bu; C++) { var T = u.get(t13, C); if (T) { E = T; break; } } var k = E && E.level === n + 1 ? E : null, _ = function() { m.context.drawImage(k.texture.canvas, k.x, 0, k.width, k.height, m.usedWidth, 0, d, c); }; if (m.context.setTransform(1, 0, 0, 1, 0, 0), m.context.clearRect(m.usedWidth, 0, d, f), y(k)) _(); else if (y(E)) if (w) { for (var D = E.level; D > n; D--) k = i.getElement(t13, e, r, D, qa.downscale); _(); } else return i.queueElement(t13, E.level - 1), E; else { var O; if (!b && !w && !x) for (var F = n - 1; F >= ms; F--) { var L = u.get(t13, F); if (L) { O = L; break; } } if (y(O)) return i.queueElement(t13, n), O; m.context.translate(m.usedWidth, 0), m.context.scale(l, l), this.drawElement(m.context, t13, e, v, false), m.context.scale(1 / l, 1 / l), m.context.translate(-m.usedWidth, 0); } return h6 = { x: m.usedWidth, texture: m, level: n, scale: l, width: d, height: c, scaledLabelShown: v }, m.usedWidth += Math.ceil(d + qP), m.eleCaches.push(h6), u.set(t13, n, h6), i.checkTextureFullness(m), h6; }; At.invalidateElements = function(t13) { for (var e = 0; e < t13.length; e++) this.invalidateElement(t13[e]); }; At.invalidateElement = function(t13) { var e = this, r = e.lookup, n = [], a = r.isInvalid(t13); if (a) { for (var i = ms; i <= bu; i++) { var o = r.getForCachedKey(t13, i); o && n.push(o); } var s = r.invalidate(t13); if (s) for (var u = 0; u < n.length; u++) { var l = n[u], c = l.texture; c.invalidatedWidth += l.width, l.invalidated = true, e.checkTextureUtility(c); } e.removeFromQueue(t13); } }; At.checkTextureUtility = function(t13) { t13.invalidatedWidth >= WP * t13.width && this.retireTexture(t13); }; At.checkTextureFullness = function(t13) { var e = this, r = e.getTextureQueue(t13.height); t13.usedWidth / t13.width > YP && t13.fullnessChecks >= ZP ? Kn(r, t13) : t13.fullnessChecks++; }; At.retireTexture = function(t13) { var e = this, r = t13.height, n = e.getTextureQueue(r), a = this.lookup; Kn(n, t13), t13.retired = true; for (var i = t13.eleCaches, o = 0; o < i.length; o++) { var s = i[o]; a.deleteCache(s.key, s.level); } dc(i); var u = e.getRetiredTextureQueue(r); u.push(t13); }; At.addTexture = function(t13, e) { var r = this, n = r.getTextureQueue(t13), a = {}; return n.push(a), a.eleCaches = [], a.height = t13, a.width = Math.max(KP, 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; }; At.recycleTexture = function(t13, e) { for (var r = this, n = r.getTextureQueue(t13), a = r.getRetiredTextureQueue(t13), i = 0; i < a.length; i++) { var o = a[i]; if (o.width >= e) return o.retired = false, o.usedWidth = 0, o.invalidatedWidth = 0, o.fullnessChecks = 0, dc(o.eleCaches), o.context.setTransform(1, 0, 0, 1, 0, 0), o.context.clearRect(0, 0, o.width, o.height), Kn(a, o), n.push(o), o; } }; At.queueElement = function(t13, e) { var r = this, n = r.getElementQueue(), a = r.getElementKeyToQueue(), i = this.getKey(t13), o = a[i]; if (o) o.level = Math.max(o.level, e), o.eles.merge(t13), o.reqs++, n.updateItem(o); else { var s = { eles: t13.spawn().merge(t13), level: e, reqs: 1, key: i }; n.push(s), a[i] = s; } }; At.dequeue = function(t13) { for (var e = this, r = e.getElementQueue(), n = e.getElementKeyToQueue(), a = [], i = e.lookup, o = 0; o < tO && 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, t13, s.level, qa.dequeue); } return a; }; At.removeFromQueue = function(t13) { var e = this, r = e.getElementQueue(), n = e.getElementKeyToQueue(), a = this.getKey(t13), i = n[a]; i != null && (i.eles.length === 1 ? (i.reqs = uc, r.updateItem(i), r.pop(), n[a] = null) : i.eles.unmerge(t13)); }; At.onDequeue = function(t13) { this.onDequeues.push(t13); }; At.offDequeue = function(t13) { Kn(this.onDequeues, t13); }; At.setupDequeueing = gg.setupDequeueing({ deqRedrawThreshold: eO, deqCost: XP, deqAvgCost: jP, deqNoDrawCost: QP, deqFastCost: JP, 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 (vc(u, a)) return true; } return false; }, priority: function(e) { return e.renderer.beforeRenderPriorities.eleTxrDeq; } }); var nO = 1; var Ui = -4; var $s = 2; var aO = 3.99; var iO = 50; var oO = 50; var sO = 0.15; var lO = 0.1; var uO = 0.9; var cO = 0.9; var dO = 1; var sv = 250; var fO = 4e3 * 4e3; var vO = true; var mg = function(e) { var r = this, n = r.renderer = e, a = n.cy; r.layersByLevel = {}, r.firstGet = true, r.lastInvalidationTime = gn() - 2 * sv, r.skipping = false, r.eleTxrDeqs = a.collection(), r.scheduleElementRefinement = tl(function() { r.refineElementTextures(r.eleTxrDeqs), r.eleTxrDeqs.unmerge(r.eleTxrDeqs); }, oO), n.beforeRender(function(o, s) { s - r.lastInvalidationTime <= sv ? r.skipping = true : r.skipping = false; }, n.beforeRenderPriorities.lyrTxrSkip); var i = function(s, u) { return u.reqs - s.reqs; }; r.layersQueue = new Oo(i), r.setupDequeueing(); }; var Yt = mg.prototype; var lv = 0; var hO = Math.pow(2, 53) - 1; Yt.makeLayer = function(t13, e) { var r = Math.pow(2, e), n = Math.ceil(t13.w * r), a = Math.ceil(t13.h * r), i = this.renderer.makeOffscreenCanvas(n, a), o = { id: lv = ++lv % hO, bb: t13, 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; }; Yt.getLayers = function(t13, e, r) { var n = this, a = n.renderer, i = a.cy, o = i.zoom(), s = n.firstGet; if (n.firstGet = false, r == null) { if (r = Math.ceil(fc(o * e)), r < Ui) r = Ui; else if (o >= aO || r > $s) return null; } n.validateLayersElesOrdering(r, t13); var u = n.layersByLevel, l = Math.pow(2, r), c = u[r] = u[r] || [], d, v = n.levelIsComplete(r, t13), h6, f = function() { var _ = function(B) { if (n.validateLayersElesOrdering(B, t13), n.levelIsComplete(B, t13)) return h6 = u[B], true; }, D = function(B) { if (!h6) for (var I = r + B; Ui <= I && I <= $s && !_(I); I += B) ; }; D(1), D(-1); for (var O = c.length - 1; O >= 0; O--) { var F = c[O]; F.invalid && Kn(c, F); } }; if (!v) f(); else return c; var p = function() { if (!d) { d = pr(); for (var _ = 0; _ < t13.length; _++) vp(d, t13[_].boundingBox()); } return d; }, m = function(_) { _ = _ || {}; var D = _.after; p(); var O = d.w * l * (d.h * l); if (O > fO) return null; var F = n.makeLayer(d, r); if (D != null) { var L = c.indexOf(D) + 1; c.splice(L, 0, F); } else (_.insert === void 0 || _.insert) && c.unshift(F); return F; }; if (n.skipping && !s) return null; for (var g = null, y = t13.length / nO, b = !s, w = 0; w < t13.length; w++) { var x = t13[w], E = x._private.rscratch, C = E.imgLayerCaches = E.imgLayerCaches || {}, T = C[r]; if (T) { g = T; continue; } if ((!g || g.eles.length >= y || !hp(g.bb, x.boundingBox())) && (g = m({ insert: true, after: g }), !g)) return null; h6 || b ? n.queueLayer(g, x) : n.drawEleInLayer(g, x, r, e), g.eles.push(x), C[r] = g; } return h6 || (b ? null : c); }; Yt.getEleLevelForLayerLevel = function(t13, e) { return t13; }; Yt.drawEleInLayer = function(t13, e, r, n) { var a = this, i = this.renderer, o = t13.context, s = e.boundingBox(); s.w === 0 || s.h === 0 || !e.visible() || (r = a.getEleLevelForLayerLevel(r, n), i.setImgSmoothing(o, false), i.drawCachedElement(o, e, null, null, r, vO), i.setImgSmoothing(o, true)); }; Yt.levelIsComplete = function(t13, e) { var r = this, n = r.layersByLevel[t13]; if (!n || n.length === 0) return false; for (var a = 0, i = 0; i < n.length; i++) { var o = n[i]; if (o.reqs > 0 || o.invalid) return false; a += o.eles.length; } return a === e.length; }; Yt.validateLayersElesOrdering = function(t13, e) { var r = this.layersByLevel[t13]; 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; } } }; Yt.updateElementsInLayers = function(t13, e) { for (var r = this, n = Do(t13[0]), a = 0; a < t13.length; a++) for (var i = n ? null : t13[a], o = n ? t13[a] : t13[a].ele, s = o._private.rscratch, u = s.imgLayerCaches = s.imgLayerCaches || {}, l = Ui; l <= $s; l++) { var c = u[l]; c && (i && r.getEleLevelForLayerLevel(c.level) !== i.level || e(c, o, i)); } }; Yt.haveLayers = function() { for (var t13 = this, e = false, r = Ui; r <= $s; r++) { var n = t13.layersByLevel[r]; if (n && n.length > 0) { e = true; break; } } return e; }; Yt.invalidateElements = function(t13) { var e = this; t13.length !== 0 && (e.lastInvalidationTime = gn(), !(t13.length === 0 || !e.haveLayers()) && e.updateElementsInLayers(t13, function(n, a, i) { e.invalidateLayer(n); })); }; Yt.invalidateLayer = function(t13) { if (this.lastInvalidationTime = gn(), !t13.invalid) { var e = t13.level, r = t13.eles, n = this.layersByLevel[e]; Kn(n, t13), t13.elesQueue = [], t13.invalid = true, t13.replacement && (t13.replacement.invalid = true); for (var a = 0; a < r.length; a++) { var i = r[a]._private.rscratch.imgLayerCaches; i && (i[e] = null); } } }; Yt.refineElementTextures = function(t13) { var e = this; e.updateElementsInLayers(t13, 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]); }); }; Yt.enqueueElementRefinement = function(t13) { this.eleTxrDeqs.merge(t13), this.scheduleElementRefinement(); }; Yt.queueLayer = function(t13, e) { var r = this, n = r.layersQueue, a = t13.elesQueue, i = a.hasId = a.hasId || {}; if (!t13.replacement) { if (e) { if (i[e.id()]) return; a.push(e), i[e.id()] = true; } t13.reqs ? (t13.reqs++, n.updateItem(t13)) : (t13.reqs = 1, n.push(t13)); } }; Yt.dequeue = function(t13) { for (var e = this, r = e.layersQueue, n = [], a = 0; a < dO && 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, t13), a++), n.length === 0 && n.push(true), i.elesQueue.length === 0 && (r.pop(), i.reqs = 0, i.replaces && e.applyLayerReplacement(i), e.requestRedraw()); } return n; }; Yt.applyLayerReplacement = function(t13) { var e = this, r = e.layersByLevel[t13.level], n = t13.replaces, a = r.indexOf(n); if (!(a < 0 || n.invalid)) { r[a] = t13; for (var i = 0; i < t13.eles.length; i++) { var o = t13.eles[i]._private, s = o.imgLayerCaches = o.imgLayerCaches || {}; s && (s[t13.level] = t13); } e.requestRedraw(); } }; Yt.requestRedraw = tl(function() { var t13 = this.renderer; t13.redrawHint("eles", true), t13.redrawHint("drag", true), t13.redraw(); }, 100); Yt.setupDequeueing = gg.setupDequeueing({ deqRedrawThreshold: iO, deqCost: sO, deqAvgCost: lO, deqNoDrawCost: uO, deqFastCost: cO, deq: function(e, r) { return e.dequeue(r); }, onDeqd: cc, shouldRedraw: sp, priority: function(e) { return e.renderer.beforeRenderPriorities.lyrTxrDeq; } }); var yg = {}; var uv; function pO(t13, e) { for (var r = 0; r < e.length; r++) { var n = e[r]; t13.lineTo(n.x, n.y); } } function gO(t13, e, r) { for (var n, a = 0; a < e.length; a++) { var i = e[a]; a === 0 && (n = i), t13.lineTo(i.x, i.y); } t13.quadraticCurveTo(r.x, r.y, n.x, n.y); } function cv(t13, e, r) { t13.beginPath && t13.beginPath(); for (var n = e, a = 0; a < n.length; a++) { var i = n[a]; t13.lineTo(i.x, i.y); } var o = r, s = r[0]; t13.moveTo(s.x, s.y); for (var a = 1; a < o.length; a++) { var i = o[a]; t13.lineTo(i.x, i.y); } t13.closePath && t13.closePath(); } function mO(t13, e, r, n, a) { t13.beginPath && t13.beginPath(), t13.arc(r, n, a, 0, Math.PI * 2, false); var i = e, o = i[0]; t13.moveTo(o.x, o.y); for (var s = 0; s < i.length; s++) { var u = i[s]; t13.lineTo(u.x, u.y); } t13.closePath && t13.closePath(); } function yO(t13, e, r, n) { t13.arc(e, r, n, 0, Math.PI * 2, false); } yg.arrowShapeImpl = function(t13) { return (uv || (uv = { polygon: pO, "triangle-backcurve": gO, "triangle-tee": cv, "circle-triangle": mO, "triangle-cross": cv, circle: yO }))[t13]; }; var on = {}; on.drawElement = function(t13, e, r, n, a, i) { var o = this; e.isNode() ? o.drawNode(t13, e, r, n, a, i) : o.drawEdge(t13, e, r, n, a, i); }; on.drawElementOverlay = function(t13, e) { var r = this; e.isNode() ? r.drawNodeOverlay(t13, e) : r.drawEdgeOverlay(t13, e); }; on.drawElementUnderlay = function(t13, e) { var r = this; e.isNode() ? r.drawNodeUnderlay(t13, e) : r.drawEdgeUnderlay(t13, e); }; on.drawCachedElementPortion = function(t13, 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 v = o(u, e), h6 = l.x1, f = l.y1, p = l.w, m = l.h, g, y, b, w, x; if (v !== 0) { var E = r.getRotationPoint(e); b = E.x, w = E.y, t13.translate(b, w), t13.rotate(v), x = u.getImgSmoothing(t13), x || u.setImgSmoothing(t13, true); var C = r.getRotationOffset(e); g = C.x, y = C.y; } else g = h6, y = f; var T; d !== 1 && (T = t13.globalAlpha, t13.globalAlpha = T * d), t13.drawImage(c.texture.canvas, c.x, 0, c.width, c.height, g, y, p, m), d !== 1 && (t13.globalAlpha = T), v !== 0 && (t13.rotate(-v), t13.translate(-b, -w), x || u.setImgSmoothing(t13, false)); } else r.drawElement(t13, e); } }; var bO = function() { return 0; }; var wO = function(e, r) { return e.getTextAngle(r, null); }; var CO = function(e, r) { return e.getTextAngle(r, "source"); }; var xO = function(e, r) { return e.getTextAngle(r, "target"); }; var EO = function(e, r) { return r.effectiveOpacity(); }; var Kl = function(e, r) { return r.pstyle("text-opacity").pfValue * r.effectiveOpacity(); }; on.drawCachedElement = function(t13, e, r, n, a, i) { var o = this, s = o.data, u = s.eleTxrCache, l = s.lblTxrCache, c = s.slbTxrCache, d = s.tlbTxrCache, v = e.boundingBox(), h6 = i === true ? u.reasons.highQuality : null; if (!(v.w === 0 || v.h === 0 || !e.visible()) && (!n || vc(v, n))) { var f = e.isEdge(), p = e.element()._private.rscratch.badLine; o.drawElementUnderlay(t13, e), o.drawCachedElementPortion(t13, e, u, r, a, h6, bO, EO), (!f || !p) && o.drawCachedElementPortion(t13, e, l, r, a, h6, wO, Kl), f && !p && (o.drawCachedElementPortion(t13, e, c, r, a, h6, CO, Kl), o.drawCachedElementPortion(t13, e, d, r, a, h6, xO, Kl)), o.drawElementOverlay(t13, e); } }; on.drawElements = function(t13, e) { for (var r = this, n = 0; n < e.length; n++) { var a = e[n]; r.drawElement(t13, a); } }; on.drawCachedElements = function(t13, e, r, n) { for (var a = this, i = 0; i < e.length; i++) { var o = e[i]; a.drawCachedElement(t13, o, r, n); } }; on.drawCachedNodes = function(t13, e, r, n) { for (var a = this, i = 0; i < e.length; i++) { var o = e[i]; o.isNode() && a.drawCachedElement(t13, o, r, n); } }; on.drawLayeredElements = function(t13, 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 || t13.drawImage(s.canvas, u.x1, u.y1, u.w, u.h); } else a.drawCachedElements(t13, e, r, n); }; var En = {}; En.drawEdge = function(t13, e, r) { var n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true, a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true, i = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true, o = this, s = e._private.rscratch; if (!(i && !e.visible()) && !(s.badLine || s.allpts == null || isNaN(s.allpts[0]))) { var u; r && (u = r, t13.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, v = e.pstyle("line-style").value, h6 = e.pstyle("width").pfValue, f = e.pstyle("line-cap").value, p = e.pstyle("line-outline-width").value, m = e.pstyle("line-outline-color").value, g = l * c, y = l * c, b = function() { var B = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : g; d === "straight-triangle" ? (o.eleStrokeStyle(t13, e, B), o.drawEdgeTrianglePath(e, t13, s.allpts)) : (t13.lineWidth = h6, t13.lineCap = f, o.eleStrokeStyle(t13, e, B), o.drawEdgePath(e, t13, s.allpts, v), t13.lineCap = "butt"); }, w = function() { var B = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : g; if (t13.lineWidth = h6 + p, t13.lineCap = f, p > 0) o.colorStrokeStyle(t13, m[0], m[1], m[2], B); else { t13.lineCap = "butt"; return; } d === "straight-triangle" ? o.drawEdgeTrianglePath(e, t13, s.allpts) : (o.drawEdgePath(e, t13, s.allpts, v), t13.lineCap = "butt"); }, x = function() { a && o.drawEdgeOverlay(t13, e); }, E = function() { a && o.drawEdgeUnderlay(t13, e); }, C = function() { var B = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : y; o.drawArrowheads(t13, e, B); }, T = function() { o.drawElementText(t13, e, null, n); }; t13.lineJoin = "round"; var k = e.pstyle("ghost").value === "yes"; if (k) { var _ = e.pstyle("ghost-offset-x").pfValue, D = e.pstyle("ghost-offset-y").pfValue, O = e.pstyle("ghost-opacity").value, F = g * O; t13.translate(_, D), b(F), C(F), t13.translate(-_, -D); } else w(); E(), b(), C(), x(), T(), r && t13.translate(u.x1, u.y1); } }; var bg = 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"); } } }; }; En.drawEdgeOverlay = bg("overlay"); En.drawEdgeUnderlay = bg("underlay"); En.drawEdgePath = function(t13, e, r, n) { var a = t13._private.rscratch, i = e, o, s = false, u = this.usePaths(), l = t13.pstyle("line-dash-pattern").pfValue, c = t13.pstyle("line-dash-offset").pfValue; if (u) { var d = r.join("$"), v = a.pathCacheKey && a.pathCacheKey === d; v ? (o = e = a.pathCache, s = true) : (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 h6 = 2; h6 + 3 < r.length; h6 += 4) e.quadraticCurveTo(r[h6], r[h6 + 1], r[h6 + 2], r[h6 + 3]); break; case "straight": case "haystack": for (var f = 2; f + 1 < r.length; f += 2) e.lineTo(r[f], r[f + 1]); break; case "segments": if (a.isRound) { var p = Wh(a.roundCorners), m; try { for (p.s(); !(m = p.n()).done; ) { var g = m.value; lg(e, g); } } catch (b) { p.e(b); } finally { p.f(); } e.lineTo(r[r.length - 2], r[r.length - 1]); } else for (var y = 2; y + 1 < r.length; y += 2) e.lineTo(r[y], r[y + 1]); break; } e = i, u ? e.stroke(o) : e.stroke(), e.setLineDash && e.setLineDash([]); }; En.drawEdgeTrianglePath = function(t13, e, r) { e.fillStyle = e.strokeStyle; for (var n = t13.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(); } }; En.drawArrowheads = function(t13, e, r) { var n = e._private.rscratch, a = n.edgeType === "haystack"; a || this.drawArrowhead(t13, e, "source", n.arrowStartX, n.arrowStartY, n.srcArrowAngle, r), this.drawArrowhead(t13, e, "mid-target", n.midX, n.midY, n.midtgtArrowAngle, r), this.drawArrowhead(t13, e, "mid-source", n.midX, n.midY, n.midsrcArrowAngle, r), a || this.drawArrowhead(t13, e, "target", n.arrowEndX, n.arrowEndY, n.tgtArrowAngle, r); }; En.drawArrowhead = function(t13, 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, v = e.pstyle(r + "-arrow-width"), h6 = v.value === "match-line" ? d : v.pfValue; v.units === "%" && (h6 *= d); var f = e.pstyle("opacity").value; o === void 0 && (o = f); var p = t13.globalCompositeOperation; (o !== 1 || c === "hollow") && (t13.globalCompositeOperation = "destination-out", s.colorFillStyle(t13, 255, 255, 255, 1), s.colorStrokeStyle(t13, 255, 255, 255, 1), s.drawArrowShape(e, t13, l, d, u, h6, n, a, i), t13.globalCompositeOperation = p); var m = e.pstyle(r + "-arrow-color").value; s.colorFillStyle(t13, m[0], m[1], m[2], o), s.colorStrokeStyle(t13, m[0], m[1], m[2], o), s.drawArrowShape(e, t13, c, d, u, h6, n, a, i); } } }; En.drawArrowShape = function(t13, e, r, n, a, i, o, s, u) { var l = this, c = this.usePaths() && a !== "triangle-cross", d = false, v, h6 = e, f = { x: o, y: s }, p = t13.pstyle("arrow-scale").value, m = this.getArrowWidth(n, p), g = l.arrowShapes[a]; if (c) { var y = l.arrowPathCache = l.arrowPathCache || [], b = ma(a), w = y[b]; w != null ? (v = e = w, d = true) : (v = e = new Path2D(), y[b] = v); } d || (e.beginPath && e.beginPath(), c ? g.draw(e, 1, 0, { x: 0, y: 0 }, 1) : g.draw(e, m, u, f, n), e.closePath && e.closePath()), e = h6, c && (e.translate(o, s), e.rotate(u), e.scale(m, m)), (r === "filled" || r === "both") && (c ? e.fill(v) : e.fill()), (r === "hollow" || r === "both") && (e.lineWidth = i / (c ? m : 1), e.lineJoin = "miter", c ? e.stroke(v) : e.stroke()), c && (e.scale(1 / m, 1 / m), e.rotate(-u), e.translate(-o, -s)); }; var Dc = {}; Dc.safeDrawImage = function(t13, e, r, n, a, i, o, s, u, l) { if (!(a <= 0 || i <= 0 || u <= 0 || l <= 0)) try { t13.drawImage(e, r, n, a, i, o, s, u, l); } catch (c) { tt(c); } }; Dc.drawInscribedImage = function(t13, 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), v = c(r, "background-repeat", "value", n), h6 = r.width(), f = r.height(), p = r.padding() * 2, m = h6 + (c(r, "background-width-relative-to", "value", n) === "inner" ? 0 : p), g = f + (c(r, "background-height-relative-to", "value", n) === "inner" ? 0 : p), y = 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 T = e.width || e.cachedW, k = e.height || e.cachedH; (T == null || k == null) && (document.body.appendChild(e), T = e.cachedW = e.width || e.offsetWidth, k = e.cachedH = e.height || e.offsetHeight, document.body.removeChild(e)); var _ = T, D = k; if (c(r, "background-width", "value", n) !== "auto" && (c(r, "background-width", "units", n) === "%" ? _ = c(r, "background-width", "pfValue", n) * m : _ = c(r, "background-width", "pfValue", n)), c(r, "background-height", "value", n) !== "auto" && (c(r, "background-height", "units", n) === "%" ? D = c(r, "background-height", "pfValue", n) * g : D = c(r, "background-height", "pfValue", n)), !(_ === 0 || D === 0)) { if (d === "contain") { var O = Math.min(m / _, g / D); _ *= O, D *= O; } else if (d === "cover") { var O = Math.max(m / _, g / D); _ *= O, D *= O; } var F = s - m / 2, L = c(r, "background-position-x", "units", n), B = c(r, "background-position-x", "pfValue", n); L === "%" ? F += (m - _) * B : F += B; var I = c(r, "background-offset-x", "units", n), M = c(r, "background-offset-x", "pfValue", n); I === "%" ? F += (m - _) * M : F += M; var A = u - g / 2, R = c(r, "background-position-y", "units", n), K = c(r, "background-position-y", "pfValue", n); R === "%" ? A += (g - D) * K : A += K; var H = c(r, "background-offset-y", "units", n), q = c(r, "background-offset-y", "pfValue", n); H === "%" ? A += (g - D) * q : A += q, y.pathCache && (F -= s, A -= u, s = 0, u = 0); var ee = t13.globalAlpha; t13.globalAlpha = x; var se = i.getImgSmoothing(t13), oe = false; if (E === "no" && se ? (i.setImgSmoothing(t13, false), oe = true) : E === "yes" && !se && (i.setImgSmoothing(t13, true), oe = true), v === "no-repeat") w && (t13.save(), y.pathCache ? t13.clip(y.pathCache) : (i.nodeShapes[i.getNodeShape(r)].draw(t13, s, u, m, g, C, y), t13.clip())), i.safeDrawImage(t13, e, 0, 0, T, k, F, A, _, D), w && t13.restore(); else { var ae = t13.createPattern(e, v); t13.fillStyle = ae, i.nodeShapes[i.getNodeShape(r)].draw(t13, s, u, m, g, C, y), t13.translate(F, A), t13.fill(), t13.translate(-F, -A); } t13.globalAlpha = ee, oe && i.setImgSmoothing(t13, se); } }; var Pa = {}; Pa.eleTextBiggerThanMin = function(t13, e) { if (!e) { var r = t13.cy().zoom(), n = this.getPixelRatio(), a = Math.ceil(fc(r * n)); e = Math.pow(2, a); } var i = t13.pstyle("font-size").pfValue * e, o = t13.pstyle("min-zoomed-font-size").pfValue; return !(i < o); }; Pa.drawElementText = function(t13, e, r, n, a) { var i = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true, o = this; if (n == null) { if (i && !o.eleTextBiggerThanMin(e)) return; } else if (n === false) return; if (e.isNode()) { var s = e.pstyle("label"); if (!s || !s.value) return; var u = o.getLabelJustification(e); t13.textAlign = u, t13.textBaseline = "bottom"; } else { var l = e.element()._private.rscratch.badLine, c = e.pstyle("label"), d = e.pstyle("source-label"), v = e.pstyle("target-label"); if (l || (!c || !c.value) && (!d || !d.value) && (!v || !v.value)) return; t13.textAlign = "center", t13.textBaseline = "bottom"; } var h6 = !r, f; r && (f = r, t13.translate(-f.x1, -f.y1)), a == null ? (o.drawText(t13, e, null, h6, i), e.isEdge() && (o.drawText(t13, e, "source", h6, i), o.drawText(t13, e, "target", h6, i))) : o.drawText(t13, e, a, h6, i), r && t13.translate(f.x1, f.y1); }; Pa.getFontCache = function(t13) { var e; this.fontCaches = this.fontCaches || []; for (var r = 0; r < this.fontCaches.length; r++) if (e = this.fontCaches[r], e.context === t13) return e; return e = { context: t13 }, this.fontCaches.push(e), e; }; Pa.setupTextStyle = function(t13, e) { var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true, 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; t13.font = n + " " + o + " " + a + " " + i, t13.lineJoin = "round", this.colorFillStyle(t13, l[0], l[1], l[2], s), this.colorStrokeStyle(t13, c[0], c[1], c[2], u); }; function Ul(t13, e, r, n, a) { var i = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : 5, o = arguments.length > 6 ? arguments[6] : void 0; t13.beginPath(), t13.moveTo(e + i, r), t13.lineTo(e + n - i, r), t13.quadraticCurveTo(e + n, r, e + n, r + i), t13.lineTo(e + n, r + a - i), t13.quadraticCurveTo(e + n, r + a, e + n - i, r + a), t13.lineTo(e + i, r + a), t13.quadraticCurveTo(e, r + a, e, r + a - i), t13.lineTo(e, r + i), t13.quadraticCurveTo(e, r, e + i, r), t13.closePath(), o ? t13.stroke() : t13.fill(); } Pa.getTextAngle = function(t13, e) { var r, n = t13._private, a = n.rscratch, i = e ? e + "-" : "", o = t13.pstyle(i + "text-rotation"), s = Nr(a, "labelAngle", e); return o.strValue === "autorotate" ? r = t13.isEdge() ? s : 0 : o.strValue === "none" ? r = 0 : r = o.pfValue, r; }; Pa.drawText = function(t13, e, r) { var n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true, a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true, 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 = Nr(o, "labelX", r), l = Nr(o, "labelY", r), c, d, v = this.getLabelText(e, r); if (v != null && v !== "" && !isNaN(u) && !isNaN(l)) { this.setupTextStyle(t13, e, a); var h6 = r ? r + "-" : "", f = Nr(o, "labelWidth", r), p = Nr(o, "labelHeight", r), m = e.pstyle(h6 + "text-margin-x").pfValue, g = e.pstyle(h6 + "text-margin-y").pfValue, y = e.isEdge(), b = e.pstyle("text-halign").value, w = e.pstyle("text-valign").value; y && (b = "center", w = "center"), u += m, l += g; var x; switch (n ? x = this.getTextAngle(e, r) : x = 0, x !== 0 && (c = u, d = l, t13.translate(c, d), t13.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, T = e.pstyle("text-border-width").pfValue, k = e.pstyle("text-background-padding").pfValue, _ = e.pstyle("text-background-shape").strValue, D = _.indexOf("round") === 0, O = 2; if (E > 0 || T > 0 && C > 0) { var F = u - k; switch (b) { case "left": F -= f; break; case "center": F -= f / 2; break; } var L = l - p - k, B = f + 2 * k, I = p + 2 * k; if (E > 0) { var M = t13.fillStyle, A = e.pstyle("text-background-color").value; t13.fillStyle = "rgba(" + A[0] + "," + A[1] + "," + A[2] + "," + E * s + ")", D ? Ul(t13, F, L, B, I, O) : t13.fillRect(F, L, B, I), t13.fillStyle = M; } if (T > 0 && C > 0) { var R = t13.strokeStyle, K = t13.lineWidth, H = e.pstyle("text-border-color").value, q = e.pstyle("text-border-style").value; if (t13.strokeStyle = "rgba(" + H[0] + "," + H[1] + "," + H[2] + "," + C * s + ")", t13.lineWidth = T, t13.setLineDash) switch (q) { case "dotted": t13.setLineDash([1, 1]); break; case "dashed": t13.setLineDash([4, 2]); break; case "double": t13.lineWidth = T / 4, t13.setLineDash([]); break; case "solid": t13.setLineDash([]); break; } if (D ? Ul(t13, F, L, B, I, O, "stroke") : t13.strokeRect(F, L, B, I), q === "double") { var ee = T / 2; D ? Ul(t13, F + ee, L + ee, B - ee * 2, I - ee * 2, O, "stroke") : t13.strokeRect(F + ee, L + ee, B - ee * 2, I - ee * 2); } t13.setLineDash && t13.setLineDash([]), t13.lineWidth = K, t13.strokeStyle = R; } } var se = 2 * e.pstyle("text-outline-width").pfValue; if (se > 0 && (t13.lineWidth = se), e.pstyle("text-wrap").value === "wrap") { var oe = Nr(o, "labelWrapCachedLines", r), ae = Nr(o, "labelLineHeight", r), ue = f / 2, te = this.getLabelJustification(e); switch (te === "auto" || (b === "left" ? te === "left" ? u += -f : te === "center" && (u += -ue) : b === "center" ? te === "left" ? u += -ue : te === "right" && (u += ue) : b === "right" && (te === "center" ? u += ue : te === "right" && (u += f))), w) { case "top": l -= (oe.length - 1) * ae; break; case "center": case "bottom": l -= (oe.length - 1) * ae; break; } for (var $ = 0; $ < oe.length; $++) se > 0 && t13.strokeText(oe[$], u, l), t13.fillText(oe[$], u, l), l += ae; } else se > 0 && t13.strokeText(v, u, l), t13.fillText(v, u, l); x !== 0 && (t13.rotate(-x), t13.translate(-c, -d)); } } }; var xi = {}; xi.drawNode = function(t13, e, r) { var n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true, a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true, i = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true, o = this, s, u, l = e._private, c = l.rscratch, d = e.position(); if (!(!be(d.x) || !be(d.y)) && !(i && !e.visible())) { var v = i ? e.effectiveOpacity() : 1, h6 = o.usePaths(), f, p = false, m = e.padding(); s = e.width() + 2 * m, u = e.height() + 2 * m; var g; r && (g = r, t13.translate(-g.x1, -g.y1)); for (var y = e.pstyle("background-image"), b = y.value, w = new Array(b.length), x = new Array(b.length), E = 0, C = 0; C < b.length; C++) { var T = b[C], k = w[C] = T != null && T !== "none"; if (k) { var _ = e.cy().style().getIndexedStyle(e, "background-image-crossorigin", "value", C); E++, x[C] = o.getCachedImage(T, _, function() { l.backgroundTimestamp = Date.now(), e.emitAndNotify("background"); }); } } var D = e.pstyle("background-blacken").value, O = e.pstyle("border-width").pfValue, F = e.pstyle("background-opacity").value * v, L = e.pstyle("border-color").value, B = e.pstyle("border-style").value, I = e.pstyle("border-join").value, M = e.pstyle("border-cap").value, A = e.pstyle("border-position").value, R = e.pstyle("border-dash-pattern").pfValue, K = e.pstyle("border-dash-offset").pfValue, H = e.pstyle("border-opacity").value * v, q = e.pstyle("outline-width").pfValue, ee = e.pstyle("outline-color").value, se = e.pstyle("outline-style").value, oe = e.pstyle("outline-opacity").value * v, ae = e.pstyle("outline-offset").value, ue = e.pstyle("corner-radius").value; ue !== "auto" && (ue = e.pstyle("corner-radius").pfValue); var te = function() { var pe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : F; o.eleFillStyle(t13, e, pe); }, $ = function() { var pe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : H; o.colorStrokeStyle(t13, L[0], L[1], L[2], pe); }, G = function() { var pe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : oe; o.colorStrokeStyle(t13, ee[0], ee[1], ee[2], pe); }, Q = function(pe, re, ve, Ae) { var Me = o.nodePathCache = o.nodePathCache || [], _e = op(ve === "polygon" ? ve + "," + Ae.join(",") : ve, "" + re, "" + pe, "" + ue), Ne = Me[_e], Te, Oe = false; return Ne != null ? (Te = Ne, Oe = true, c.pathCache = Te) : (Te = new Path2D(), Me[_e] = c.pathCache = Te), { path: Te, cacheHit: Oe }; }, ge = e.pstyle("shape").strValue, Ee = e.pstyle("shape-polygon-points").pfValue; if (h6) { t13.translate(d.x, d.y); var fe = Q(s, u, ge, Ee); f = fe.path, p = fe.cacheHit; } var me = function() { if (!p) { var pe = d; h6 && (pe = { x: 0, y: 0 }), o.nodeShapes[o.getNodeShape(e)].draw(f || t13, pe.x, pe.y, s, u, ue, c); } h6 ? t13.fill(f) : t13.fill(); }, Ce = function() { for (var pe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : v, re = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true, ve = l.backgrounding, Ae = 0, Me = 0; Me < x.length; Me++) { var _e = e.cy().style().getIndexedStyle(e, "background-image-containment", "value", Me); if (re && _e === "over" || !re && _e === "inside") { Ae++; continue; } w[Me] && x[Me].complete && !x[Me].error && (Ae++, o.drawInscribedImage(t13, x[Me], e, Me, pe)); } l.backgrounding = Ae !== E, ve !== l.backgrounding && e.updateStyle(false); }, ke = function() { var pe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false, re = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : v; o.hasPie(e) && (o.drawPie(t13, e, re), pe && (h6 || o.nodeShapes[o.getNodeShape(e)].draw(t13, d.x, d.y, s, u, ue, c))); }, xe = function() { var pe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : v, re = (D > 0 ? D : -D) * pe, ve = D > 0 ? 0 : 255; D !== 0 && (o.colorFillStyle(t13, ve, ve, ve, re), h6 ? t13.fill(f) : t13.fill()); }, De = function() { if (O > 0) { if (t13.lineWidth = O, t13.lineCap = M, t13.lineJoin = I, t13.setLineDash) switch (B) { case "dotted": t13.setLineDash([1, 1]); break; case "dashed": t13.setLineDash(R), t13.lineDashOffset = K; break; case "solid": case "double": t13.setLineDash([]); break; } if (A !== "center") { if (t13.save(), t13.lineWidth *= 2, A === "inside") h6 ? t13.clip(f) : t13.clip(); else { var pe = new Path2D(); pe.rect(-s / 2 - O, -u / 2 - O, s + 2 * O, u + 2 * O), pe.addPath(f), t13.clip(pe, "evenodd"); } h6 ? t13.stroke(f) : t13.stroke(), t13.restore(); } else h6 ? t13.stroke(f) : t13.stroke(); if (B === "double") { t13.lineWidth = O / 3; var re = t13.globalCompositeOperation; t13.globalCompositeOperation = "destination-out", h6 ? t13.stroke(f) : t13.stroke(), t13.globalCompositeOperation = re; } t13.setLineDash && t13.setLineDash([]); } }, qe = function() { if (q > 0) { if (t13.lineWidth = q, t13.lineCap = "butt", t13.setLineDash) switch (se) { case "dotted": t13.setLineDash([1, 1]); break; case "dashed": t13.setLineDash([4, 2]); break; case "solid": case "double": t13.setLineDash([]); break; } var pe = d; h6 && (pe = { x: 0, y: 0 }); var re = o.getNodeShape(e), ve = O; A === "inside" && (ve = 0), A === "outside" && (ve *= 2); var Ae = (s + ve + (q + ae)) / s, Me = (u + ve + (q + ae)) / u, _e = s * Ae, Ne = u * Me, Te = o.nodeShapes[re].points, Oe; if (h6) { var ut = Q(_e, Ne, re, Te); Oe = ut.path; } if (re === "ellipse") o.drawEllipsePath(Oe || t13, pe.x, pe.y, _e, Ne); else if (["round-diamond", "round-heptagon", "round-hexagon", "round-octagon", "round-pentagon", "round-polygon", "round-triangle", "round-tag"].includes(re)) { var nt = 0, kt = 0, St = 0; re === "round-diamond" ? nt = (ve + ae + q) * 1.4 : re === "round-heptagon" ? (nt = (ve + ae + q) * 1.075, St = -(ve / 2 + ae + q) / 35) : re === "round-hexagon" ? nt = (ve + ae + q) * 1.12 : re === "round-pentagon" ? (nt = (ve + ae + q) * 1.13, St = -(ve / 2 + ae + q) / 15) : re === "round-tag" ? (nt = (ve + ae + q) * 1.12, kt = (ve / 2 + q + ae) * 0.07) : re === "round-triangle" && (nt = (ve + ae + q) * (Math.PI / 2), St = -(ve + ae / 2 + q) / Math.PI), nt !== 0 && (Ae = (s + nt) / s, _e = s * Ae, ["round-hexagon", "round-tag"].includes(re) || (Me = (u + nt) / u, Ne = u * Me)), ue = ue === "auto" ? mp(_e, Ne) : ue; for (var wt = _e / 2, Zt = Ne / 2, Pt = ue + (ve + q + ae) / 2, Mt = new Array(Te.length / 2), gr = new Array(Te.length / 2), Xt = 0; Xt < Te.length / 2; Xt++) Mt[Xt] = { x: pe.x + kt + wt * Te[Xt * 2], y: pe.y + St + Zt * Te[Xt * 2 + 1] }; var jt, wr, Pr, ur, Ct = Mt.length; for (wr = Mt[Ct - 1], jt = 0; jt < Ct; jt++) Pr = Mt[jt % Ct], ur = Mt[(jt + 1) % Ct], gr[jt] = Tc(wr, Pr, ur, Pt), wr = Pr, Pr = ur; o.drawRoundPolygonPath(Oe || t13, pe.x + kt, pe.y + St, s * Ae, u * Me, Te, gr); } else if (["roundrectangle", "round-rectangle"].includes(re)) ue = ue === "auto" ? ba(_e, Ne) : ue, o.drawRoundRectanglePath(Oe || t13, pe.x, pe.y, _e, Ne, ue + (ve + q + ae) / 2); else if (["cutrectangle", "cut-rectangle"].includes(re)) ue = ue === "auto" ? hc() : ue, o.drawCutRectanglePath(Oe || t13, pe.x, pe.y, _e, Ne, null, ue + (ve + q + ae) / 4); else if (["bottomroundrectangle", "bottom-round-rectangle"].includes(re)) ue = ue === "auto" ? ba(_e, Ne) : ue, o.drawBottomRoundRectanglePath(Oe || t13, pe.x, pe.y, _e, Ne, ue + (ve + q + ae) / 2); else if (re === "barrel") o.drawBarrelPath(Oe || t13, pe.x, pe.y, _e, Ne); else if (re.startsWith("polygon") || ["rhomboid", "right-rhomboid", "round-tag", "tag", "vee"].includes(re)) { var Tt = (ve + q + ae) / s; Te = Ls(Is(Te, Tt)), o.drawPolygonPath(Oe || t13, pe.x, pe.y, s, u, Te); } else { var Bt = (ve + q + ae) / s; Te = Ls(Is(Te, -Bt)), o.drawPolygonPath(Oe || t13, pe.x, pe.y, s, u, Te); } if (h6 ? t13.stroke(Oe) : t13.stroke(), se === "double") { t13.lineWidth = ve / 3; var kn = t13.globalCompositeOperation; t13.globalCompositeOperation = "destination-out", h6 ? t13.stroke(Oe) : t13.stroke(), t13.globalCompositeOperation = kn; } t13.setLineDash && t13.setLineDash([]); } }, Ke = function() { a && o.drawNodeOverlay(t13, e, d, s, u); }, Be = function() { a && o.drawNodeUnderlay(t13, e, d, s, u); }, Ge = function() { o.drawElementText(t13, e, null, n); }, le = e.pstyle("ghost").value === "yes"; if (le) { var S = e.pstyle("ghost-offset-x").pfValue, z = e.pstyle("ghost-offset-y").pfValue, ie = e.pstyle("ghost-opacity").value, j = ie * v; t13.translate(S, z), G(), qe(), te(ie * F), me(), Ce(j, true), $(ie * H), De(), ke(D !== 0 || O !== 0), Ce(j, false), xe(j), t13.translate(-S, -z); } h6 && t13.translate(-d.x, -d.y), Be(), h6 && t13.translate(d.x, d.y), G(), qe(), te(), me(), Ce(v, true), $(), De(), ke(D !== 0 || O !== 0), Ce(v, false), xe(), h6 && t13.translate(-d.x, -d.y), Ge(), Ke(), r && t13.translate(g.x1, g.y1); } }; var wg = 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, v = n.pstyle("".concat(e, "-corner-radius")).value; if (l > 0) { if (a = a || n.position(), i == null || o == null) { var h6 = n.padding(); i = n.width() + 2 * h6, o = n.height() + 2 * h6; } 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, v), r.fill(); } } }; }; xi.drawNodeOverlay = wg("overlay"); xi.drawNodeUnderlay = wg("underlay"); xi.hasPie = function(t13) { return t13 = t13[0], t13._private.hasPie; }; xi.drawPie = function(t13, 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, v = this.usePaths(); v && (o = 0, s = 0), i.units === "%" ? c = c * i.pfValue : i.pfValue !== void 0 && (c = i.pfValue / 2); for (var h6 = 1; h6 <= a.pieBackgroundN; h6++) { var f = e.pstyle("pie-" + h6 + "-background-size").value, p = e.pstyle("pie-" + h6 + "-background-color").value, m = e.pstyle("pie-" + h6 + "-background-opacity").value * r, g = f / 100; g + d > 1 && (g = 1 - d); var y = 1.5 * Math.PI + 2 * Math.PI * d, b = 2 * Math.PI * g, w = y + b; f === 0 || d >= 1 || d + g > 1 || (t13.beginPath(), t13.moveTo(o, s), t13.arc(o, s, c, y, w), t13.closePath(), this.colorFillStyle(t13, p[0], p[1], p[2], m), t13.fill(), d += g); } }; var br = {}; var kO = 100; br.getPixelRatio = function() { var t13 = this.data.contexts[0]; if (this.forcedPixelRatio != null) return this.forcedPixelRatio; var e = this.cy.window(), r = t13.backingStorePixelRatio || t13.webkitBackingStorePixelRatio || t13.mozBackingStorePixelRatio || t13.msBackingStorePixelRatio || t13.oBackingStorePixelRatio || t13.backingStorePixelRatio || 1; return (e.devicePixelRatio || 1) / r; }; br.paintCache = function(t13) { for (var e = this.paintCaches = this.paintCaches || [], r = true, n, a = 0; a < e.length; a++) if (n = e[a], n.context === t13) { r = false; break; } return r && (n = { context: t13 }, e.push(n)), n; }; br.createGradientStyleFor = function(t13, 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(), v = ya(l, d), h6 = ya(c, d); i = t13.createRadialGradient(d.x, d.y, 0, d.x, d.y, Math.max(v, h6)); } else { var f = o ? { x: 0, y: 0 } : r.position(), p = r.paddedWidth(), m = r.paddedHeight(); i = t13.createRadialGradient(f.x, f.y, 0, f.x, f.y, Math.max(p, m)); } else if (r.isEdge()) { var g = r.sourceEndpoint(), y = r.targetEndpoint(); i = t13.createLinearGradient(g.x, g.y, y.x, y.y); } else { var b = o ? { x: 0, y: 0 } : r.position(), w = r.paddedWidth(), x = r.paddedHeight(), E = w / 2, C = x / 2, T = r.pstyle("background-gradient-direction").value; switch (T) { case "to-bottom": i = t13.createLinearGradient(b.x, b.y - C, b.x, b.y + C); break; case "to-top": i = t13.createLinearGradient(b.x, b.y + C, b.x, b.y - C); break; case "to-left": i = t13.createLinearGradient(b.x + E, b.y, b.x - E, b.y); break; case "to-right": i = t13.createLinearGradient(b.x - E, b.y, b.x + E, b.y); break; case "to-bottom-right": case "to-right-bottom": i = t13.createLinearGradient(b.x - E, b.y - C, b.x + E, b.y + C); break; case "to-top-right": case "to-right-top": i = t13.createLinearGradient(b.x - E, b.y + C, b.x + E, b.y - C); break; case "to-bottom-left": case "to-left-bottom": i = t13.createLinearGradient(b.x + E, b.y - C, b.x - E, b.y + C); break; case "to-top-left": case "to-left-top": i = t13.createLinearGradient(b.x + E, b.y + C, b.x - E, b.y - C); break; } } if (!i) return null; for (var k = u.length === s.length, _ = s.length, D = 0; D < _; D++) i.addColorStop(k ? u[D] : D / (_ - 1), "rgba(" + s[D][0] + "," + s[D][1] + "," + s[D][2] + "," + a + ")"); return i; }; br.gradientFillStyle = function(t13, e, r, n) { var a = this.createGradientStyleFor(t13, "background", e, r, n); if (!a) return null; t13.fillStyle = a; }; br.colorFillStyle = function(t13, e, r, n, a) { t13.fillStyle = "rgba(" + e + "," + r + "," + n + "," + a + ")"; }; br.eleFillStyle = function(t13, e, r) { var n = e.pstyle("background-fill").value; if (n === "linear-gradient" || n === "radial-gradient") this.gradientFillStyle(t13, e, n, r); else { var a = e.pstyle("background-color").value; this.colorFillStyle(t13, a[0], a[1], a[2], r); } }; br.gradientStrokeStyle = function(t13, e, r, n) { var a = this.createGradientStyleFor(t13, "line", e, r, n); if (!a) return null; t13.strokeStyle = a; }; br.colorStrokeStyle = function(t13, e, r, n, a) { t13.strokeStyle = "rgba(" + e + "," + r + "," + n + "," + a + ")"; }; br.eleStrokeStyle = function(t13, e, r) { var n = e.pstyle("line-fill").value; if (n === "linear-gradient" || n === "radial-gradient") this.gradientStrokeStyle(t13, e, n, r); else { var a = e.pstyle("line-color").value; this.colorStrokeStyle(t13, a[0], a[1], a[2], r); } }; br.matchCanvasSize = function(t13) { var e = this, r = e.data, n = e.findContainerClientCoords(), a = n[2], i = n[3], o = e.getPixelRatio(), s = e.motionBlurPxRatio; (t13 === e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE] || t13 === 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 v = 0; v < e.CANVAS_LAYERS; v++) c = r.canvases[v], c.width = u, c.height = l, c.style.width = a + "px", c.style.height = i + "px"; for (var v = 0; v < e.BUFFER_COUNT; v++) c = r.bufferCanvases[v], 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; } }; br.renderTo = function(t13, e, r, n) { this.render({ forcedContext: t13, forcedZoom: e, forcedPan: r, drawAllLayers: true, forcedPxRatio: n }); }; br.render = function(t13) { t13 = t13 || cp(); var e = t13.forcedContext, r = t13.drawAllLayers, n = t13.drawOnlyNodeLayer, a = t13.forcedZoom, i = t13.forcedPan, o = this, s = t13.forcedPxRatio === void 0 ? this.getPixelRatio() : t13.forcedPxRatio, u = o.cy, l = o.data, c = l.canvasNeedsRedraw, d = o.textureOnViewport && !e && (o.pinching || o.hoverData.dragging || o.swipePanning || o.data.wheelZooming), v = t13.motionBlur !== void 0 ? t13.motionBlur : o.motionBlur, h6 = o.motionBlurPxRatio, f = u.hasCompoundNodes(), p = o.hoverData.draggingEles, m = !!(o.hoverData.selecting || o.touchData.selecting); v = v && !e && o.motionBlurEnabled && !m; var g = v; e || (o.prevPxRatio !== s && (o.invalidateContainerClientCoordsCache(), o.matchCanvasSize(o.container), o.redrawHint("eles", true), o.redrawHint("drag", true)), o.prevPxRatio = s), !e && o.motionBlurTimeout && clearTimeout(o.motionBlurTimeout), v && (o.mbFrames == null && (o.mbFrames = 0), o.mbFrames++, o.mbFrames < 3 && (g = false), o.mbFrames > o.minMbLowQualFrames && (o.motionBlurPxRatio = o.mbPxRBlurry)), o.clearingMotionBlur && (o.motionBlurPxRatio = 1), o.textureDrawLastFrame && !d && (c[o.NODE] = true, c[o.SELECT_BOX] = true); var y = 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 } }, T = o.prevViewport, k = T === void 0 || C.zoom !== T.zoom || C.pan.x !== T.pan.x || C.pan.y !== T.pan.y; !k && !(p && !f) && (o.motionBlurPxRatio = 1), i && (E = i), w *= s, E.x *= s, E.y *= s; var _ = o.getCachedZSortedEles(); function D(fe, me, Ce, ke, xe) { var De = fe.globalCompositeOperation; fe.globalCompositeOperation = "destination-out", o.colorFillStyle(fe, 255, 255, 255, o.motionBlurTransparency), fe.fillRect(me, Ce, ke, xe), fe.globalCompositeOperation = De; } function O(fe, me) { var Ce, ke, xe, De; !o.clearingMotionBlur && (fe === l.bufferContexts[o.MOTIONBLUR_BUFFER_NODE] || fe === l.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]) ? (Ce = { x: x.x * h6, y: x.y * h6 }, ke = b * h6, xe = o.canvasWidth * h6, De = o.canvasHeight * h6) : (Ce = E, ke = w, xe = o.canvasWidth, De = o.canvasHeight), fe.setTransform(1, 0, 0, 1, 0, 0), me === "motionBlur" ? D(fe, 0, 0, xe, De) : !e && (me === void 0 || me) && fe.clearRect(0, 0, xe, De), r || (fe.translate(Ce.x, Ce.y), fe.scale(ke, ke)), i && fe.translate(i.x, i.y), a && fe.scale(a, a); } if (d || (o.textureDrawLastFrame = false), d) { if (o.textureDrawLastFrame = true, !o.textureCache) { o.textureCache = {}, o.textureCache.bb = u.mutableElements().boundingBox(), o.textureCache.texture = o.data.bufferCanvases[o.TEXTURE_BUFFER]; var F = o.data.bufferContexts[o.TEXTURE_BUFFER]; F.setTransform(1, 0, 0, 1, 0, 0), F.clearRect(0, 0, o.canvasWidth * o.textureMult, o.canvasHeight * o.textureMult), o.render({ forcedContext: F, drawOnlyNodeLayer: true, 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] = false, c[o.NODE] = false; var L = l.contexts[o.NODE], B = o.textureCache.texture, C = o.textureCache.viewport; L.setTransform(1, 0, 0, 1, 0, 0), v ? D(L, 0, 0, C.width, C.height) : L.clearRect(0, 0, C.width, C.height); var I = y.core("outside-texture-bg-color").value, M = y.core("outside-texture-bg-opacity").value; o.colorFillStyle(L, I[0], I[1], I[2], M), L.fillRect(0, 0, C.width, C.height); var b = u.zoom(); O(L, false), L.clearRect(C.mpan.x, C.mpan.y, C.width / C.zoom / s, C.height / C.zoom / s), L.drawImage(B, C.mpan.x, C.mpan.y, C.width / C.zoom / s, C.height / C.zoom / s); } else o.textureOnViewport && !e && (o.textureCache = null); var A = u.extent(), R = o.pinching || o.hoverData.dragging || o.swipePanning || o.data.wheelZooming || o.hoverData.draggingEles || o.cy.animated(), K = o.hideEdgesOnViewport && R, H = []; if (H[o.NODE] = !c[o.NODE] && v && !o.clearedForMotionBlur[o.NODE] || o.clearingMotionBlur, H[o.NODE] && (o.clearedForMotionBlur[o.NODE] = true), H[o.DRAG] = !c[o.DRAG] && v && !o.clearedForMotionBlur[o.DRAG] || o.clearingMotionBlur, H[o.DRAG] && (o.clearedForMotionBlur[o.DRAG] = true), c[o.NODE] || r || n || H[o.NODE]) { var q = v && !H[o.NODE] && h6 !== 1, L = e || (q ? o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE] : l.contexts[o.NODE]), ee = v && !q ? "motionBlur" : void 0; O(L, ee), K ? o.drawCachedNodes(L, _.nondrag, s, A) : o.drawLayeredElements(L, _.nondrag, s, A), o.debug && o.drawDebugPoints(L, _.nondrag), !r && !v && (c[o.NODE] = false); } if (!n && (c[o.DRAG] || r || H[o.DRAG])) { var q = v && !H[o.DRAG] && h6 !== 1, L = e || (q ? o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG] : l.contexts[o.DRAG]); O(L, v && !q ? "motionBlur" : void 0), K ? o.drawCachedNodes(L, _.drag, s, A) : o.drawCachedElements(L, _.drag, s, A), o.debug && o.drawDebugPoints(L, _.drag), !r && !v && (c[o.DRAG] = false); } if (o.showFps || !n && c[o.SELECT_BOX] && !r) { var L = e || l.contexts[o.SELECT_BOX]; if (O(L), o.selection[4] == 1 && (o.hoverData.selecting || o.touchData.selecting)) { var b = o.cy.zoom(), se = y.core("selection-box-border-width").value / b; L.lineWidth = se, L.fillStyle = "rgba(" + y.core("selection-box-color").value[0] + "," + y.core("selection-box-color").value[1] + "," + y.core("selection-box-color").value[2] + "," + y.core("selection-box-opacity").value + ")", L.fillRect(o.selection[0], o.selection[1], o.selection[2] - o.selection[0], o.selection[3] - o.selection[1]), se > 0 && (L.strokeStyle = "rgba(" + y.core("selection-box-border-color").value[0] + "," + y.core("selection-box-border-color").value[1] + "," + y.core("selection-box-border-color").value[2] + "," + y.core("selection-box-opacity").value + ")", L.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(), oe = l.bgActivePosistion; L.fillStyle = "rgba(" + y.core("active-bg-color").value[0] + "," + y.core("active-bg-color").value[1] + "," + y.core("active-bg-color").value[2] + "," + y.core("active-bg-opacity").value + ")", L.beginPath(), L.arc(oe.x, oe.y, y.core("active-bg-size").pfValue / b, 0, 2 * Math.PI), L.fill(); } var ae = o.lastRedrawTime; if (o.showFps && ae) { ae = Math.round(ae); var ue = Math.round(1e3 / ae); L.setTransform(1, 0, 0, 1, 0, 0), L.fillStyle = "rgba(255, 0, 0, 0.75)", L.strokeStyle = "rgba(255, 0, 0, 0.75)", L.lineWidth = 1, L.fillText("1 frame = " + ae + " ms = " + ue + " fps", 0, 20); var te = 60; L.strokeRect(0, 30, 250, 20), L.fillRect(0, 30, 250 * Math.min(ue / te, 1), 20); } r || (c[o.SELECT_BOX] = false); } if (v && h6 !== 1) { var $ = l.contexts[o.NODE], G = o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_NODE], Q = l.contexts[o.DRAG], ge = o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_DRAG], Ee = function(me, Ce, ke) { me.setTransform(1, 0, 0, 1, 0, 0), ke || !g ? me.clearRect(0, 0, o.canvasWidth, o.canvasHeight) : D(me, 0, 0, o.canvasWidth, o.canvasHeight); var xe = h6; me.drawImage( Ce, // 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]) && (Ee($, G, H[o.NODE]), c[o.NODE] = false), (c[o.DRAG] || H[o.DRAG]) && (Ee(Q, ge, H[o.DRAG]), c[o.DRAG] = false); } o.prevViewport = C, o.clearingMotionBlur && (o.clearingMotionBlur = false, o.motionBlurCleared = true, o.motionBlur = true), v && (o.motionBlurTimeout = setTimeout(function() { o.motionBlurTimeout = null, o.clearedForMotionBlur[o.NODE] = false, o.clearedForMotionBlur[o.DRAG] = false, o.motionBlur = false, o.clearingMotionBlur = !d, o.mbFrames = 0, c[o.NODE] = true, c[o.DRAG] = true, o.redraw(); }, kO)), e || u.emit("render"); }; var jn = {}; jn.drawPolygonPath = function(t13, e, r, n, a, i) { var o = n / 2, s = a / 2; t13.beginPath && t13.beginPath(), t13.moveTo(e + o * i[0], r + s * i[1]); for (var u = 1; u < i.length / 2; u++) t13.lineTo(e + o * i[u * 2], r + s * i[u * 2 + 1]); t13.closePath(); }; jn.drawRoundPolygonPath = function(t13, e, r, n, a, i, o) { o.forEach(function(s) { return lg(t13, s); }), t13.closePath(); }; jn.drawRoundRectanglePath = function(t13, e, r, n, a, i) { var o = n / 2, s = a / 2, u = i === "auto" ? ba(n, a) : Math.min(i, s, o); t13.beginPath && t13.beginPath(), t13.moveTo(e, r - s), t13.arcTo(e + o, r - s, e + o, r, u), t13.arcTo(e + o, r + s, e, r + s, u), t13.arcTo(e - o, r + s, e - o, r, u), t13.arcTo(e - o, r - s, e, r - s, u), t13.lineTo(e, r - s), t13.closePath(); }; jn.drawBottomRoundRectanglePath = function(t13, e, r, n, a, i) { var o = n / 2, s = a / 2, u = i === "auto" ? ba(n, a) : i; t13.beginPath && t13.beginPath(), t13.moveTo(e, r - s), t13.lineTo(e + o, r - s), t13.lineTo(e + o, r), t13.arcTo(e + o, r + s, e, r + s, u), t13.arcTo(e - o, r + s, e - o, r, u), t13.lineTo(e - o, r - s), t13.lineTo(e, r - s), t13.closePath(); }; jn.drawCutRectanglePath = function(t13, e, r, n, a, i, o) { var s = n / 2, u = a / 2, l = o === "auto" ? hc() : o; t13.beginPath && t13.beginPath(), t13.moveTo(e - s + l, r - u), t13.lineTo(e + s - l, r - u), t13.lineTo(e + s, r - u + l), t13.lineTo(e + s, r + u - l), t13.lineTo(e + s - l, r + u), t13.lineTo(e - s + l, r + u), t13.lineTo(e - s, r + u - l), t13.lineTo(e - s, r - u + l), t13.closePath(); }; jn.drawBarrelPath = function(t13, e, r, n, a) { var i = n / 2, o = a / 2, s = e - i, u = e + i, l = r - o, c = r + o, d = lu(n, a), v = d.widthOffset, h6 = d.heightOffset, f = d.ctrlPtOffsetPct * v; t13.beginPath && t13.beginPath(), t13.moveTo(s, l + h6), t13.lineTo(s, c - h6), t13.quadraticCurveTo(s + f, c, s + v, c), t13.lineTo(u - v, c), t13.quadraticCurveTo(u - f, c, u, c - h6), t13.lineTo(u, l + h6), t13.quadraticCurveTo(u - f, l, u - v, l), t13.lineTo(s + v, l), t13.quadraticCurveTo(s + f, l, s, l + h6), t13.closePath(); }; var dv = Math.sin(0); var fv = Math.cos(0); var wu = {}; var Cu = {}; var Cg = Math.PI / 40; for ($a = 0 * Math.PI; $a < 2 * Math.PI; $a += Cg) wu[$a] = Math.sin($a), Cu[$a] = Math.cos($a); var $a; jn.drawEllipsePath = function(t13, e, r, n, a) { if (t13.beginPath && t13.beginPath(), t13.ellipse) t13.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 += Cg) i = e - s * wu[l] * dv + s * Cu[l] * fv, o = r + u * Cu[l] * dv + u * wu[l] * fv, l === 0 ? t13.moveTo(i, o) : t13.lineTo(i, o); t13.closePath(); }; var Mo = {}; Mo.createBuffer = function(t13, e) { var r = document.createElement("canvas"); return r.width = t13, r.height = e, [r, r.getContext("2d")]; }; Mo.bufferCanvasImage = function(t13) { var e = this.cy, r = e.mutableElements(), n = r.boundingBox(), a = this.findContainerClientCoords(), i = t13.full ? Math.ceil(n.w) : a[2], o = t13.full ? Math.ceil(n.h) : a[3], s = be(t13.maxWidth) || be(t13.maxHeight), u = this.getPixelRatio(), l = 1; if (t13.scale !== void 0) i *= t13.scale, o *= t13.scale, l = t13.scale; else if (s) { var c = 1 / 0, d = 1 / 0; be(t13.maxWidth) && (c = l * t13.maxWidth / i), be(t13.maxHeight) && (d = l * t13.maxHeight / o), l = Math.min(c, d), i *= l, o *= l; } s || (i *= u, o *= u, l *= u); var v = document.createElement("canvas"); v.width = i, v.height = o, v.style.width = i + "px", v.style.height = o + "px"; var h6 = v.getContext("2d"); if (i > 0 && o > 0) { h6.clearRect(0, 0, i, o), h6.globalCompositeOperation = "source-over"; var f = this.getCachedZSortedEles(); if (t13.full) h6.translate(-n.x1 * l, -n.y1 * l), h6.scale(l, l), this.drawElements(h6, f), h6.scale(1 / l, 1 / l), h6.translate(n.x1 * l, n.y1 * l); else { var p = e.pan(), m = { x: p.x * l, y: p.y * l }; l *= e.zoom(), h6.translate(m.x, m.y), h6.scale(l, l), this.drawElements(h6, f), h6.scale(1 / l, 1 / l), h6.translate(-m.x, -m.y); } t13.bg && (h6.globalCompositeOperation = "destination-over", h6.fillStyle = t13.bg, h6.rect(0, 0, i, o), h6.fill()); } return v; }; function SO(t13, e) { for (var r = atob(t13), 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 vv(t13) { var e = t13.indexOf(","); return t13.substr(e + 1); } function xg(t13, e, r) { var n = function() { return e.toDataURL(r, t13.quality); }; switch (t13.output) { case "blob-promise": return new hi(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, t13.quality); } catch (o) { i(o); } }); case "blob": return SO(vv(n()), r); case "base64": return vv(n()); case "base64uri": default: return n(); } } Mo.png = function(t13) { return xg(t13, this.bufferCanvasImage(t13), "image/png"); }; Mo.jpg = function(t13) { return xg(t13, this.bufferCanvasImage(t13), "image/jpeg"); }; var Eg = {}; Eg.nodeShapeImpl = function(t13, e, r, n, a, i, o, s) { switch (t13) { 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 TO = kg; var je = kg.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 kg(t13) { 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 = t13.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" }; vT() && (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(te) { c.style[te] = u[te]; }), 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] = false; } 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 = true; var d = pr(), v = function($) { return { x: ($.x1 + $.x2) / 2, y: ($.y1 + $.y2) / 2 }; }, h6 = function($) { return { x: -$.w / 2, y: -$.h / 2 }; }, f = function($) { var G = $[0]._private, Q = G.oldBackgroundTimestamp === G.backgroundTimestamp; return !Q; }, p = function($) { return $[0]._private.nodeKey; }, m = function($) { return $[0]._private.labelStyleKey; }, g = function($) { return $[0]._private.sourceLabelStyleKey; }, y = function($) { return $[0]._private.targetLabelStyleKey; }, b = function($, G, Q, ge, Ee) { return e.drawElement($, G, Q, false, false, Ee); }, w = function($, G, Q, ge, Ee) { return e.drawElementText($, G, Q, ge, "main", Ee); }, x = function($, G, Q, ge, Ee) { return e.drawElementText($, G, Q, ge, "source", Ee); }, E = function($, G, Q, ge, Ee) { return e.drawElementText($, G, Q, ge, "target", Ee); }, C = function($) { return $.boundingBox(), $[0]._private.bodyBounds; }, T = function($) { return $.boundingBox(), $[0]._private.labelBounds.main || d; }, k = function($) { return $.boundingBox(), $[0]._private.labelBounds.source || d; }, _ = function($) { return $.boundingBox(), $[0]._private.labelBounds.target || d; }, D = function($, G) { return G; }, O = function($) { return v(C($)); }, F = function($, G, Q) { var ge = $ ? $ + "-" : ""; return { x: G.x + Q.pstyle(ge + "text-margin-x").pfValue, y: G.y + Q.pstyle(ge + "text-margin-y").pfValue }; }, L = function($, G, Q) { var ge = $[0]._private.rscratch; return { x: ge[G], y: ge[Q] }; }, B = function($) { return F("", L($, "labelX", "labelY"), $); }, I = function($) { return F("source", L($, "sourceLabelX", "sourceLabelY"), $); }, M = function($) { return F("target", L($, "targetLabelX", "targetLabelY"), $); }, A = function($) { return h6(C($)); }, R = function($) { return h6(k($)); }, K = function($) { return h6(_($)); }, H = function($) { var G = T($), Q = h6(T($)); if ($.isNode()) { switch ($.pstyle("text-halign").value) { case "left": Q.x = -G.w; break; case "right": Q.x = 0; break; } switch ($.pstyle("text-valign").value) { case "top": Q.y = -G.h; break; case "bottom": Q.y = 0; break; } } return Q; }, q = e.data.eleTxrCache = new Ri(e, { getKey: p, doesEleInvalidateKey: f, drawElement: b, getBoundingBox: C, getRotationPoint: O, getRotationOffset: A, allowEdgeTxrCaching: false, allowParentTxrCaching: false }), ee = e.data.lblTxrCache = new Ri(e, { getKey: m, drawElement: w, getBoundingBox: T, getRotationPoint: B, getRotationOffset: H, isVisible: D }), se = e.data.slbTxrCache = new Ri(e, { getKey: g, drawElement: x, getBoundingBox: k, getRotationPoint: I, getRotationOffset: R, isVisible: D }), oe = e.data.tlbTxrCache = new Ri(e, { getKey: y, drawElement: E, getBoundingBox: _, getRotationPoint: M, getRotationOffset: K, isVisible: D }), ae = e.data.lyrTxrCache = new mg(e); e.onUpdateEleCalcs(function($, G) { q.invalidateElements(G), ee.invalidateElements(G), se.invalidateElements(G), oe.invalidateElements(G), ae.invalidateElements(G); for (var Q = 0; Q < G.length; Q++) { var ge = G[Q]._private; ge.oldBackgroundTimestamp = ge.backgroundTimestamp; } }); var ue = function($) { for (var G = 0; G < $.length; G++) ae.enqueueElementRefinement($[G].ele); }; q.onDequeue(ue), ee.onDequeue(ue), se.onDequeue(ue), oe.onDequeue(ue); } je.redrawHint = function(t13, e) { var r = this; switch (t13) { 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 _O = typeof Path2D < "u"; je.path2dEnabled = function(t13) { if (t13 === void 0) return this.pathsEnabled; this.pathsEnabled = !!t13; }; je.usePaths = function() { return _O && this.pathsEnabled; }; je.setImgSmoothing = function(t13, e) { t13.imageSmoothingEnabled != null ? t13.imageSmoothingEnabled = e : (t13.webkitImageSmoothingEnabled = e, t13.mozImageSmoothingEnabled = e, t13.msImageSmoothingEnabled = e); }; je.getImgSmoothing = function(t13) { return t13.imageSmoothingEnabled != null ? t13.imageSmoothingEnabled : t13.webkitImageSmoothingEnabled || t13.mozImageSmoothingEnabled || t13.msImageSmoothingEnabled; }; je.makeOffscreenCanvas = function(t13, e) { var r; if ((typeof OffscreenCanvas > "u" ? "undefined" : Ft(OffscreenCanvas)) !== "undefined") r = new OffscreenCanvas(t13, e); else { var n = this.cy.window(), a = n.document; r = a.createElement("canvas"), r.width = t13, r.height = e; } return r; }; [yg, on, En, Dc, Pa, xi, br, jn, Mo, Eg].forEach(function(t13) { Re(je, t13); }); var DO = [{ name: "null", impl: ig }, { name: "base", impl: pg }, { name: "canvas", impl: TO }]; var PO = [{ type: "layout", extensions: MP }, { type: "renderer", extensions: DO }]; var Sg = {}; var Tg = {}; function _g(t13, e, r) { var n = r, a = function(T) { tt("Can not register `" + e + "` for `" + t13 + "` since `" + T + "` already exists in the prototype and can not be overridden"); }; if (t13 === "core") { if (fo.prototype[e]) return a(e); fo.prototype[e] = r; } else if (t13 === "collection") { if (Gt.prototype[e]) return a(e); Gt.prototype[e] = r; } else if (t13 === "layout") { for (var i = function(T) { this.options = T, r.call(this, T), Xe(this._private) || (this._private = {}), this._private.cy = T.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 T = this.animations; if (T) for (var k = 0; k < T.length; k++) T[k].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(T) { return T._private.cy; }, v = { addEventFields: function(T, k) { k.layout = T, k.cy = d(T), k.target = T; }, bubble: function() { return true; }, parent: function(T) { return d(T); } }; Re(o, { createEmitter: function() { return this._private.emitter = new ul(v, this), this; }, emitter: function() { return this._private.emitter; }, on: function(T, k) { return this.emitter().on(T, k), this; }, one: function(T, k) { return this.emitter().one(T, k), this; }, once: function(T, k) { return this.emitter().one(T, k), this; }, removeListener: function(T, k) { return this.emitter().removeListener(T, k), this; }, removeAllListeners: function() { return this.emitter().removeAllListeners(), this; }, emit: function(T, k) { return this.emitter().emit(T, k), this; } }), et.eventAliasesOn(o), n = i; } else if (t13 === "renderer" && e !== "null" && e !== "base") { var h6 = Dg("renderer", "base"), f = h6.prototype, p = r, m = r.prototype, g = function() { h6.apply(this, arguments), p.apply(this, arguments); }, y = g.prototype; for (var b in f) { var w = f[b], x = m[b] != null; if (x) return a(b); y[b] = w; } for (var E in m) y[E] = m[E]; f.clientFunctions.forEach(function(C) { y[C] = y[C] || function() { yt("Renderer does not implement `renderer." + C + "()` on its prototype"); }; }), n = g; } else if (t13 === "__proto__" || t13 === "constructor" || t13 === "prototype") return yt(t13 + " is an illegal type to be registered, possibly lead to prototype pollutions"); return Jh({ map: Sg, keys: [t13, e], value: n }); } function Dg(t13, e) { return ep({ map: Sg, keys: [t13, e] }); } function OO(t13, e, r, n, a) { return Jh({ map: Tg, keys: [t13, e, r, n], value: a }); } function LO(t13, e, r, n) { return ep({ map: Tg, keys: [t13, e, r, n] }); } var xu = function() { if (arguments.length === 2) return Dg.apply(null, arguments); if (arguments.length === 3) return _g.apply(null, arguments); if (arguments.length === 4) return LO.apply(null, arguments); if (arguments.length === 5) return OO.apply(null, arguments); yt("Invalid extension access syntax"); }; fo.prototype.extension = xu; PO.forEach(function(t13) { t13.extensions.forEach(function(e) { _g(t13.type, e.name, e.impl); }); }); var Pg = function t12() { if (!(this instanceof t12)) return new t12(); this.length = 0; }; var xa = Pg.prototype; xa.instanceString = function() { return "stylesheet"; }; xa.selector = function(t13) { var e = this.length++; return this[e] = { selector: t13, properties: [] }, this; }; xa.css = function(t13, e) { var r = this.length - 1; if (Fe(t13)) this[r].properties.push({ name: t13, value: e }); else if (Xe(t13)) for (var n = t13, a = Object.keys(n), i = 0; i < a.length; i++) { var o = a[i], s = n[o]; if (s != null) { var u = rr.properties[o] || rr.properties[Js(o)]; if (u != null) { var l = u.name, c = s; this[r].properties.push({ name: l, value: c }); } } } return this; }; xa.style = xa.css; xa.generateStyle = function(t13) { var e = new rr(t13); return this.appendToStyle(e); }; xa.appendToStyle = function(t13) { for (var e = 0; e < this.length; e++) { var r = this[e], n = r.selector, a = r.properties; t13.selector(n); for (var i = 0; i < a.length; i++) { var o = a[i]; t13.css(o.name, o.value); } } return t13; }; var IO = "3.30.2"; var Ea = function(e) { if (e === void 0 && (e = {}), Xe(e)) return new fo(e); if (Fe(e)) return xu.apply(xu, arguments); }; Ea.use = function(t13) { var e = Array.prototype.slice.call(arguments, 1); return e.unshift(Ea), t13.apply(null, e), this; }; Ea.warnings = function(t13) { return lp(t13); }; Ea.version = IO; Ea.stylesheet = Ea.Stylesheet = Pg; var FO = class extends EventTarget { constructor(r, n) { super(); Ir(this, "cyg", null); Ir(this, "nodes", []); Ir(this, "edges", []); Ir(this, "axons", []); Ir(this, "dendrites", []); Ir(this, "somas", []); Ir(this, "labelCache", /* @__PURE__ */ new Map()); Ir(this, "graphCanvas", null); this.labelCache = r, this.graphCanvas = n; } async addConnectivity(r) { var n; if (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))), 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 RO(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 = Eu(o); $O(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.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.axons.includes(n) ? this.dendrites.includes(n) || this.somas.includes(n) ? o["both-a-d"] = true : o.axon = true : (this.dendrites.includes(n) || this.somas.includes(n)) && (o.dendrite = true), o; } on(r, n) { this.addEventListener(r, n); } }; var AO = "#8300bf"; var MO = "#f3ecf6"; var BO = [ { selector: "node", style: { label: function(t13) { return NO(t13.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[both-a-d]", style: { // 'background-color': 'gray', shape: "round-rectangle" } }, { selector: "edge", style: { width: 1, "line-color": "dimgray", "target-arrow-color": "dimgray", "target-arrow-shape": "triangle", "curve-style": "bezier" } }, { selector: "node.active", style: { "border-color": AO, "background-color": MO, "background-opacity": 0.75 } } ]; function NO(t13) { const e = t13.split(` `), r = e.length / 2, n = e.slice(r); return Og(n.join(` `)); } function Og(t13) { return t13.split(` `).map((e) => e && e[0] >= "a" && e[0] <= "z" ? e.charAt(0).toUpperCase() + e.slice(1) : e).join(` `); } function Eu(t13) { const e = t13 ? t13.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 $O(t13, e) { t13.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 < t13.length; r++) if (JSON.stringify(t13[r]) !== JSON.stringify(e[r])) return false; return true; } var RO = class extends EventTarget { constructor(r, n) { var a; super(); Ir(this, "cy"); Ir(this, "tooltip"); this.cy = Ea({ container: n, elements: r.elements, layout: { name: "breadthfirst", circle: false, roots: r.roots }, directed: true, style: BO, minZoom: 0.5, 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 = true, (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 = Eu(i).map((u) => u.label + " (" + u.id + ")"); this.tooltip.innerText = Og(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 = false, this.checkRightBoundary(r.renderedPosition.x), this.tapNode(r, true); } 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 = true, this.tapNode(r, false); } 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 = Eu(o), u = new CustomEvent("tap-node", { detail: s }); this.dispatchEvent(u); } on(r, n) { this.addEventListener(r, n); } }; var zO = 1.3; var VO = 24 * 60 * 60 * 1e3; var HO = "Reset position"; var hv = "Lock zoom"; var qO = "Unlock zoom"; var KO = "Zoom in"; var UO = "Zoom out"; var pv = 0.25; var GO = "#8300bf"; var WO = 3e3; var YO = { name: "ConnectivityGraph", props: { /** * Entity to load its connectivity graph. */ entry: { type: String, default: "" }, mapServer: { type: String, default: "" }, selectedConnectivityData: { type: Array, default: [] } }, data: function() { return { loading: true, connectivityGraph: null, selectedSource: "", pathList: [], schemaVersion: "", knowledgeByPath: /* @__PURE__ */ new Map(), labelledTerms: /* @__PURE__ */ new Set(), labelCache: /* @__PURE__ */ new Map(), resetLabel: HO, zoomLockLabel: hv, zoomInLabel: KO, zoomOutLabel: UO, iconColor: GO, zoomEnabled: false, connectivityError: null, timeoutID: void 0 }; }, mounted() { this.refreshCache(), this.loadCacheData(), this.run().then((t13) => { this.showGraph(this.entry); }); }, methods: { loadCacheData: function() { const t13 = sessionStorage.getItem("connectivity-graph-source"), e = sessionStorage.getItem("connectivity-graph-labels"), r = sessionStorage.getItem("connectivity-graph-pathlist"), n = sessionStorage.getItem("connectivity-graph-schema-version"); if (t13 && (this.selectedSource = t13), r && (this.pathList = JSON.parse(r)), e) { const a = JSON.parse(e); this.labelCache = new Map(Object.entries(a)); } n && (this.schemaVersion = n); }, removeAllCacheData: function() { [ "connectivity-graph-expiry", "connectivity-graph-source", "connectivity-graph-labels", "connectivity-graph-pathlist", "connectivity-graph-schema-version" ].forEach((e) => { sessionStorage.removeItem(e); }); }, refreshCache: function() { const t13 = sessionStorage.getItem("connectivity-graph-expiry"); (/* @__PURE__ */ new Date()).getTime() > t13 && this.removeAllCacheData(); }, updateCacheExpiry: function() { const e = (/* @__PURE__ */ new Date()).getTime() + VO; sessionStorage.setItem("connectivity-graph-expiry", e); }, run: async function() { if (this.schemaVersion || (this.schemaVersion = await this.getSchemaVersion(), sessionStorage.setItem("connectivity-graph-schema-version", this.schemaVersion), this.updateCacheExpiry()), this.schemaVersion < zO) { console.warn("No Server!"); return; } this.showSpinner(), this.selectedSource || (this.selectedSource = await this.setSourceList(), sessionStorage.setItem("connectivity-graph-source", this.selectedSource), this.updateCacheExpiry()), await this.setPathList(this.selectedSource), this.hideSpinner(); }, showGraph: async function(t13) { const e = this.$refs.graphCanvas; this.showSpinner(), this.connectivityGraph = new FO(this.labelCache, e), await this.connectivityGraph.addConnectivity(this.knowledgeByPath.get(t13)), this.hideSpinner(), this.connectivityGraph.showConnectivity(e), this.selectedConnectivityData.length && this.connectivityGraph.selectConnectivity(this.selectedConnectivityData), this.connectivityGraph.on("tap-node", (r) => { const n = r.detail; this.$emit("tap-node", n); }); }, query: async function(t13, e) { const r = `${this.mapServer}knowledge/query/`, n = { sql: t13, 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: [] }; } }, setSourceList: async function() { const t13 = await this.getJsonData(`${this.mapServer}knowledge/sources`), e = t13 ? t13.sources || [] : []; let r = ""; for (const n of e) n && r === "" && (r = n); return r; }, loadPathData: async function(t13) { const e = await this.query( `select entity, knowledge from knowledge where entity like 'ilxtr:%' and source=? order by entity`, [t13] ); return e ? e.values : []; }, setPathList: async function(t13) { this.pathList.length || (this.pathList = await this.loadPathData(t13), 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 t13 = await this.getJsonData(`${this.mapServer}knowledge/schema-version`); return t13 && +t13.version || 0; }, getJsonData: async function(t13) { try { const e = await fetch(t13, { method: "GET", headers: { Accept: "application/json; charset=utf-8", "Cache-Control": "no-store", "Content-Type": "application/json" } }); return e.ok || console.error(`Cannot access ${t13}`), await e.json(); } catch { return null; } }, getCachedTermLabels: async function() { if (this.labelledTerms.size) { const t13 = 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 t13.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(t13) { for (const e of [t13[0], ...t13[1]]) this.labelledTerms.add(e); }, cacheLabels: async function(t13) { for (const e of t13.connectivity) this.cacheNodeLabels(e[0]), this.cacheNodeLabels(e[1]); }, showSpinner: function() { this.loading = true; }, hideSpinner: function() { this.loading = false; }, reset: function() { this.connectivityGraph.reset(); }, zoomIn: function() { this.connectivityGraph.zoom(pv); }, zoomOut: function() { this.connectivityGraph.zoom(-pv); }, /** * Enable/disable user zoom for scrolling */ toggleZoom: function() { this.zoomEnabled = !this.zoomEnabled, this.zoomLockLabel = this.zoomEnabled ? qO : hv, this.connectivityGraph.enableZoom(!this.zoomEnabled); }, showErrorMessage: function(t13) { this.connectivityError = { ...t13 }, this.timeoutID && clearTimeout(this.timeoutID), this.timeoutID = setTimeout(() => { this.connectivityError = null; }, WO); } } }; var ZO = { class: "connectivity-graph" }; var XO = { ref: "graphCanvas", class: "graph-canvas" }; var jO = { class: "control-panel control-panel-tools" }; var QO = { class: "visually-hidden" }; var JO = { class: "visually-hidden" }; var eL = { class: "visually-hidden" }; var tL = { class: "visually-hidden" }; var rL = createStaticVNode('
Origin
Components
Destination
', 1); var nL = { key: 0, class: "connectivity-graph-error" }; var aL = { key: 0 }; function iL(t13, e, r, n, a, i) { const o = t2, s = Vt, u = Hr, l = ko, c = x2, d = T2, v = I2, h6 = A2, f = ac; return withDirectives((openBlock(), createElementBlock("div", ZO, [ createBaseVNode("div", XO, null, 512), createBaseVNode("div", jO, [ createBaseVNode("div", { class: normalizeClass(["tools", { "zoom-locked": t13.zoomEnabled }]) }, [ createVNode(l, { content: t13.resetLabel, placement: "top", effect: "control-tooltip" }, { default: withCtx(() => [ createVNode(u, { class: normalizeClass(["control-button", t13.theme]), size: "small", onClick: i.reset }, { default: withCtx(() => [ createVNode(s, { color: "white" }, { default: withCtx(() => [ createVNode(o) ]), _: 1 }), createBaseVNode("span", QO, toDisplayString(t13.resetLabel), 1) ]), _: 1 }, 8, ["class", "onClick"]) ]), _: 1 }, 8, ["content"]), createVNode(l, { content: t13.zoomLockLabel, placement: "top", effect: "control-tooltip" }, { default: withCtx(() => [ createVNode(u, { class: normalizeClass(["control-button", t13.theme]), size: "small", onClick: i.toggleZoom }, { default: withCtx(() => [ createVNode(s, { color: "white" }, { default: withCtx(() => [ t13.zoomEnabled ? (openBlock(), createBlock(c, { key: 0 })) : (openBlock(), createBlock(d, { key: 1 })) ]), _: 1 }), createBaseVNode("span", JO, toDisplayString(t13.zoomLockLabel), 1) ]), _: 1 }, 8, ["class", "onClick"]) ]), _: 1 }, 8, ["content"]), createVNode(l, { content: t13.zoomInLabel, placement: "left", effect: "control-tooltip" }, { default: withCtx(() => [ createVNode(u, { class: normalizeClass(["control-button", t13.theme]), size: "small", onClick: i.zoomIn }, { default: withCtx(() => [ createVNode(s, { color: "white" }, { default: withCtx(() => [ createVNode(v) ]), _: 1 }), createBaseVNode("span", eL, toDisplayString(t13.zoomInLabel), 1) ]), _: 1 }, 8, ["class", "onClick"]) ]), _: 1 }, 8, ["content"]), createVNode(l, { content: t13.zoomOutLabel, placement: "left", effect: "control-tooltip" }, { default: withCtx(() => [ createVNode(u, { class: normalizeClass(["control-button", t13.theme]), size: "small", onClick: i.zoomOut }, { default: withCtx(() => [ createVNode(s, { color: "white" }, { default: withCtx(() => [ createVNode(h6) ]), _: 1 }), createBaseVNode("span", tL, toDisplayString(t13.zoomOutLabel), 1) ]), _: 1 }, 8, ["class", "onClick"]) ]), _: 1 }, 8, ["content"]) ], 2) ]), rL, t13.connectivityError ? (openBlock(), createElementBlock("div", nL, [ t13.connectivityError.errorConnectivities ? (openBlock(), createElementBlock("strong", aL, toDisplayString(t13.connectivityError.errorConnectivities), 1)) : createCommentVNode("", true), createTextVNode(" " + toDisplayString(t13.connectivityError.errorMessage), 1) ])) : createCommentVNode("", true) ])), [ [f, t13.loading] ]); } var VI = Ur(YO, [["render", iL], ["__scopeId", "data-v-2ea51769"]]); var gv = "Copy to clipboard"; var oL = "Copied!"; var sL = "#8300bf"; var lL = { name: "CopyToClipboard", props: { content: { type: String, default: "" }, /** * `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: gv, autoHideTimeout: 0, iconColor: sL }; }, methods: { copyToClipboard: async function() { let t13 = true; 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 ), t13 = false; } t13 ? this.textLabel = oL : this.textLabel = "Error trying to copy to clipboard!"; }, resetSettings: function() { this.autoHideTimeout = 0, this.textLabel = gv; } } }; var uL = { class: "visually-hidden" }; function cL(t13, e, r, n, a, i) { const o = d2, s = Vt, u = Hr, l = ko; return openBlock(), createBlock(l, { content: t13.textLabel, placement: "bottom", "hide-after": t13.autoHideTimeout, effect: "clipboard-tooltip", onHide: i.resetSettings }, { default: withCtx(() => [ createVNode(u, { class: normalizeClass(["copy-clipboard-button", r.theme]), size: "small", onClick: i.copyToClipboard }, { default: withCtx(() => [ createVNode(s, { color: t13.iconColor }, { default: withCtx(() => [ createVNode(o) ]), _: 1 }, 8, ["color"]), createBaseVNode("span", uL, toDisplayString(t13.textLabel), 1) ]), _: 1 }, 8, ["class", "onClick"]) ]), _: 1 }, 8, ["content", "hide-after", "onHide"]); } var HI = Ur(lL, [["render", cL], ["__scopeId", "data-v-de3b5311"]]); var dL = function(t13) { return t13 ? t13.charAt(0).toUpperCase() + t13.slice(1) : ""; }; var fL = { name: "ConnectionDialog", props: { connectionEntry: { type: Object, default: {} }, inDrawing: { type: Boolean, default: false }, connectionExist: { type: Boolean, default: false } }, data: function() { return { tooltipId: void 0 }; }, methods: { shadowDisplay: function(t13) { return this.tooltipId === t13 ? "always" : "hover"; }, capitalise: function(t13) { return dL(t13); }, handleTooltip: function(t13) { this.tooltipId = this.tooltipId === t13 ? void 0 : t13, this.$emit("featureTooltip", this.tooltipId); } } }; var Pc = (t13) => (pushScopeId("data-v-8168ee98"), t13 = t13(), popScopeId(), t13); var vL = { class: "dialog-container" }; var hL = Pc(() => createBaseVNode("span", { class: "dialog-title" }, "Finalise drawing", -1)); var pL = Pc(() => createBaseVNode("span", { class: "dialog-title" }, "Visualise connection", -1)); var gL = Pc(() => createBaseVNode("b", null, [ createBaseVNode("span", null, "Related Features") ], -1)); function mL(t13, e, r, n, a, i) { const o = Hr, s = yE, u = Qs, l = So, c = EE; return openBlock(), createElementBlock("div", vL, [ createVNode(u, null, { default: withCtx(() => [ createVNode(l, null, { default: withCtx(() => [ r.inDrawing ? (openBlock(), createBlock(u, { key: 0 }, { default: withCtx(() => [ hL, createVNode(s, null, { default: withCtx(() => [ createVNode(o, { type: "primary", plain: "", onClick: e[0] || (e[0] = (d) => t13.$emit("confirmDrawn", true)) }, { default: withCtx(() => [ createTextVNode(" Confirm ") ]), _: 1 }), createVNode(o, { type: "primary", plain: "", onClick: e[1] || (e[1] = (d) => t13.$emit("cancelDrawn", true)) }, { default: withCtx(() => [ createTextVNode(" Cancel ") ]), _: 1 }) ]), _: 1 }) ]), _: 1 })) : (openBlock(), createBlock(u, { key: 1 }, { default: withCtx(() => [ pL, createVNode(o, { type: "primary", plain: "", onClick: e[2] || (e[2] = (d) => t13.$emit("dialogDisplay", false)) }, { default: withCtx(() => [ createTextVNode(" Close ") ]), _: 1 }) ]), _: 1 })) ]), _: 1 }) ]), _: 1 }), r.connectionExist ? (openBlock(), createBlock(u, { key: 0 }, { default: withCtx(() => [ createVNode(l, null, { default: withCtx(() => [ gL, (openBlock(true), createElementBlock(Fragment, null, renderList(r.connectionEntry, (d, v) => (openBlock(), createBlock(u, { key: v }, { default: withCtx(() => [ createVNode(c, { shadow: i.shadowDisplay(v), onClick: (h6) => i.handleTooltip(v) }, { default: withCtx(() => [ createBaseVNode("span", null, toDisplayString(i.capitalise(d.label)), 1) ]), _: 2 }, 1032, ["shadow", "onClick"]) ]), _: 2 }, 1024))), 128)) ]), _: 1 }) ]), _: 1 })) : createCommentVNode("", true) ]); } var yL = Ur(fL, [["render", mL], ["__scopeId", "data-v-8168ee98"]]); var Lg = (t13, e) => { const r = t13.__vccOpts || t13; for (const [n, a] of e) r[n] = a; return r; }; var bL = ["xlink:href"]; var wL = { __name: "SvgIcon", props: { /** * The svg icon to show. */ icon: { type: String, required: true }, /** * The option to spin the icon. */ spin: { type: Boolean, default: false } }, setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { class: normalizeClass(["map-icon", { "map-icon-spin": t13.spin }]) }, [ createBaseVNode("use", { "xlink:href": `#${t13.icon}` }, null, 8, bL) ], 2)); } }; var CL = Lg(wL, [["__scopeId", "data-v-e172d5ff"]]); var Ig = ` 2horpanel ? `; var Fg = ` 2vertpanel ? `; var Ag = ` 3panel ? `; var Mg = ` 4panel ? `; var Bg = ` 2horpanel ? `; var Ng = ` 2horpanel ? `; var $g = ` 4panel ? `; var Rg = ` changeBckgd `; var zg = ` close no bk `; var Vg = ` close `; var Hg = ` closeFullScreen `; var qg = ` Comment `; var Kg = ` Connection `; var Ug = ` dock `; var Gg = ` drawLine `; var Wg = ` drawPoint `; var Yg = ` drawPolygon `; var Zg = ` drawTrash `; var Xg = ` fitWindow `; var jg = ` fullScreen `; var Qg = 'DataPortal-Icons'; var Jg = ` magnifyingGlass `; var e0 = `Created by Wahyu Prihantorofrom the Noun Project`; var t0 = ` openMap `; var r0 = ` Artboard Copy 6 `; var n0 = ` permalink `; var a0 = ` play `; var i0 = ` resetZoom `; var o0 = ` singlepanel ? `; var s0 = ` tooltips ? `; var l0 = ` undock `; var u0 = ` zoomIn `; var c0 = ` zoomOut `; var d0 = (t13, e, r, n) => { const a = ["title", "desc", "defs", "style"], i = ["width", "height"], o = n || []; let s = document.createElement("div"); s.innerHTML = t13, 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; }; var f0 = (t13) => [ // Remove XML stuffs and comments [/<\?xml[\s\S]*?>/gi, ""], [//gi, ""], [//gi, ""], // SVG XML -> HTML5 [/\<([A-Za-z]+)([^\>]*)\/\>/g, "<$1$2>"], // convert self-closing XML SVG nodes to explicitly closed HTML5 SVG nodes [/\s+/g, " "], // replace whitespace sequences with a single space [/\> \<"] // remove whitespace between tags ].reduce((e, r) => "".replace.apply(e, r), t13).trim(); var xL = true; var EL = true; var kL = ["fill"]; var ku = Object.assign({ "/assets/icons/2horpanel.svg": Ig, "/assets/icons/2vertpanel.svg": Fg, "/assets/icons/3panel.svg": Ag, "/assets/icons/4panel.svg": Mg, "/assets/icons/5panel.svg": Bg, "/assets/icons/6panel.svg": Ng, "/assets/icons/6panelVertical.svg": $g, "/assets/icons/changeBckgd.svg": Rg, "/assets/icons/close-no-bk.svg": zg, "/assets/icons/close.svg": Vg, "/assets/icons/closeFullScreen.svg": Hg, "/assets/icons/comment.svg": qg, "/assets/icons/connection.svg": Kg, "/assets/icons/dock.svg": Ug, "/assets/icons/drawLine.svg": Gg, "/assets/icons/drawPoint.svg": Wg, "/assets/icons/drawPolygon.svg": Yg, "/assets/icons/drawTrash.svg": Zg, "/assets/icons/fitWindow.svg": Xg, "/assets/icons/fullScreen.svg": jg, "/assets/icons/help.svg": Qg, "/assets/icons/magnifyingGlass.svg": Jg, "/assets/icons/noun-filter.svg": e0, "/assets/icons/openMap.svg": t0, "/assets/icons/pause.svg": r0, "/assets/icons/permalink.svg": n0, "/assets/icons/play.svg": a0, "/assets/icons/resetZoom.svg": i0, "/assets/icons/singlepanel.svg": o0, "/assets/icons/tooltips.svg": s0, "/assets/icons/undock.svg": l0, "/assets/icons/zoomIn.svg": u0, "/assets/icons/zoomOut.svg": c0 }); var SL = Object.keys(ku).map((t13) => { const e = d0(ku[t13], xL, EL, kL), r = t13.replace(/^.+\/(\w+).svg$/, "$1"); return f0(e).replace("", "symbol>"); }); SL.join(` `); var Su = Object.assign({ "/assets/icons/2horpanel.svg": Ig, "/assets/icons/2vertpanel.svg": Fg, "/assets/icons/3panel.svg": Ag, "/assets/icons/4panel.svg": Mg, "/assets/icons/5panel.svg": Bg, "/assets/icons/6panel.svg": Ng, "/assets/icons/6panelVertical.svg": $g, "/assets/icons/changeBckgd.svg": Rg, "/assets/icons/close-no-bk.svg": zg, "/assets/icons/close.svg": Vg, "/assets/icons/closeFullScreen.svg": Hg, "/assets/icons/comment.svg": qg, "/assets/icons/connection.svg": Kg, "/assets/icons/dock.svg": Ug, "/assets/icons/drawLine.svg": Gg, "/assets/icons/drawPoint.svg": Wg, "/assets/icons/drawPolygon.svg": Yg, "/assets/icons/drawTrash.svg": Zg, "/assets/icons/fitWindow.svg": Xg, "/assets/icons/fullScreen.svg": jg, "/assets/icons/help.svg": Qg, "/assets/icons/magnifyingGlass.svg": Jg, "/assets/icons/noun-filter.svg": e0, "/assets/icons/openMap.svg": t0, "/assets/icons/pause.svg": r0, "/assets/icons/permalink.svg": n0, "/assets/icons/play.svg": a0, "/assets/icons/resetZoom.svg": i0, "/assets/icons/singlepanel.svg": o0, "/assets/icons/tooltips.svg": s0, "/assets/icons/undock.svg": l0, "/assets/icons/zoomIn.svg": u0, "/assets/icons/zoomOut.svg": c0 }); var TL = Object.keys(Su).map((t13) => { const e = d0(Su[t13]), r = t13.replace(/^.+\/(\w+).svg$/, "$1"); return f0(e).replace("", "symbol>"); }); var _L = { name: "MapSvgSpriteColor", svgContext: Su, svgSprite: TL.join(` `) // concatenate all symbols into $options.svgSprite }; var DL = ["innerHTML"]; function PL(t13, e, r, n, a, i) { return openBlock(), createElementBlock("svg", { width: "0", height: "0", style: { display: "none" }, innerHTML: t13.$options.svgSprite }, null, 8, DL); } var OL = Lg(_L, [["render", PL]]); var LL = (t13, 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, false), document.addEventListener( "mouseup", () => { e.removeEventListener("mousemove", u, false); }, false ); }, false ); 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`; } }; var IL = { name: "DrawToolbar", components: { MapSvgIcon: CL, MapSvgSpriteColor: OL }, 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: true }, activeDrawMode: { required: true }, /** * 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: true, default: [ { value: false, ref: "editPopover" }, { value: false, ref: "deletePopover" }, { value: false, ref: "pointPopover" }, { value: false, ref: "lineStringPopover" }, { value: false, ref: "polygonPopover" }, { value: false, ref: "connectionPopover" } ] } }, data: function() { return { toolbarIcons: [ { name: "Edit", active: false, disabled: false }, { name: "Delete", active: false, disabled: false }, { name: "Point", active: false, disabled: false }, { name: "LineString", active: false, disabled: false }, { name: "Polygon", active: false, disabled: false }, { name: "Connection", active: false, disabled: true } ], connectionDisplay: false, 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(true); }, activeDrawMode: function(t13) { this.updateToolbarIcons(t13), t13 === "Delete" && (this.connectionDisplay = false); }, activeDrawTool: function(t13) { this.updateToolbarIcons(t13), t13 || (this.connectionDisplay = false); }, newlyDrawnExist: function(t13) { t13 && (this.connectionDisplay = true); }, connectionExist: function(t13) { this.disabledToolbarConnectionIcon(!t13), t13 || (this.connectionDisplay = false); }, connectionDisplay: function(t13) { this.activeToolbarConnectionIcon(t13), t13 ? this.dialogCssHacks() : this.$emit("featureTooltip", void 0); }, dialogPosition: { handler: function() { const t13 = this.$el.getBoundingClientRect(); this.dialogPosition.offsetX = t13.x, this.dialogPosition.offsetY = t13.y; }, deep: true, once: true } }, methods: { iconDisabled: function(t13) { return this.toolbarIcons.filter((e) => e.name === t13)[0].disabled; }, modeClickEvent: function(t13) { if (!this.iconDisabled(t13)) { const e = this.activeDrawMode === t13 ? void 0 : t13; this.$emit("clickToolbar", "mode", e); } }, toolClickEvent: function(t13) { if (!this.iconDisabled(t13)) { const e = this.activeDrawTool === t13 ? void 0 : t13; this.$emit("clickToolbar", "tool", e); } }, connectionClickEvent: function() { !this.iconDisabled("Connection") && !this.newlyDrawnExist && (this.connectionDisplay = !this.connectionDisplay); }, updateToolbarIcons: function(t13) { this.toolbarIcons.map((e) => { e.name === t13 ? e.active = true : e.active = false; }), this.toolbarIcons.filter((e) => e.name !== "Connection" && e.name !== t13).map((e) => { t13 ? e.disabled = true : e.disabled = false; }), this.toolbarCssHacks(); }, disabledToolbarConnectionIcon: function(t13) { this.toolbarIcons.filter((e) => e.name === "Connection").map((e) => { t13 ? e.disabled = true : e.disabled = false, this.activeDrawMode === "Delete" && (e.disabled = true); }), this.toolbarCssHacks(); }, activeToolbarConnectionIcon: function(t13) { this.toolbarIcons.filter((e) => e.name === "Connection").map((e) => { t13 ? e.active = true : e.active = false; }), this.toolbarCssHacks(); }, toolbarCssHacks: function() { this.$nextTick(() => { this.toolbarIcons.map((t13) => { const e = this.$el.querySelector(`.draw${t13.name}`); e && (t13.active ? e.classList.add("active") : e.classList.remove("active"), t13.disabled ? e.classList.add("disabled") : e.classList.remove("disabled")); }); }); }, dialogCssHacks: function() { this.$nextTick(() => { const t13 = this.$el.querySelector(".connection-dialog"); LL(this.mapCanvas.containerHTML, t13); let e, r; const n = this.mapCanvas.containerHTML.getBoundingClientRect(), a = t13.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, t13.style.transform = `translate(${e - this.dialogPosition.offsetX}px, ${r - this.dialogPosition.offsetY}px)`; }); }, hoverIndex: function(t13) { return this.hoverVisibilities.findIndex((e) => e.ref === t13); }, showTooltip: function(t13) { this.$emit("showTooltip", t13); }, hideTooltip: function(t13) { this.$emit("hideTooltip", t13); }, dialogPopUpPositionHandler: function(t13) { t13.preventDefault(), this.dialogPosition.x = t13.clientX, this.dialogPosition.y = t13.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, false); }); }, destroyed: function() { this.mapCanvas && this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).removeEventListener("click", this.dialogPopUpPositionHandler, false); } }; var FL = { class: "toolbar-container" }; var AL = { class: "toolbar-icons" }; function ML(t13, e, r, n, a, i) { const o = resolveComponent("map-svg-sprite-color"), s = resolveComponent("map-svg-icon"), u = rc, l = yL; return openBlock(), createElementBlock("div", FL, [ createVNode(o), createBaseVNode("div", AL, [ i.showEditModeIcon ? (openBlock(), createBlock(u, { key: 0, content: "Edit Mode", placement: "top", teleported: false, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[i.hoverIndex("editPopover")].value, ref: "editPopover" }, { reference: withCtx(() => [ createVNode(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"])) : createCommentVNode("", true), i.showDeleteModeIcon ? (openBlock(), createBlock(u, { key: 1, content: "Delete Mode", placement: "top", teleported: false, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[i.hoverIndex("deletePopover")].value, ref: "deletePopover" }, { reference: withCtx(() => [ createVNode(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"])) : createCommentVNode("", true), i.showDrawPointIcon ? (openBlock(), createBlock(u, { key: 2, content: "Draw Point", placement: "top", teleported: false, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[i.hoverIndex("pointPopover")].value, ref: "pointPopover" }, { reference: withCtx(() => [ createVNode(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"])) : createCommentVNode("", true), i.showDrawLineStringIcon ? (openBlock(), createBlock(u, { key: 3, content: "Draw LineString", placement: "top", teleported: false, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[i.hoverIndex("lineStringPopover")].value, ref: "drawLinePopover" }, { reference: withCtx(() => [ createVNode(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"])) : createCommentVNode("", true), i.showDrawPolygonIcon ? (openBlock(), createBlock(u, { key: 4, content: "Draw Polygon", placement: "top", teleported: false, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[i.hoverIndex("polygonPopover")].value, ref: "polygonPopover" }, { reference: withCtx(() => [ createVNode(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"])) : createCommentVNode("", true), i.showConnectionIcon ? (openBlock(), createBlock(u, { key: 5, content: "Connectivity", placement: "top", teleported: false, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[i.hoverIndex("connectionPopover")].value, ref: "connectionPopover" }, { reference: withCtx(() => [ createVNode(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"])) : createCommentVNode("", true) ]), r.mapCanvas ? withDirectives((openBlock(), createBlock(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) => t13.$emit("confirmDrawn", c)), onCancelDrawn: e[20] || (e[20] = (c) => t13.$emit("cancelDrawn", c)), onFeatureTooltip: e[21] || (e[21] = (c) => t13.$emit("featureTooltip", c)) }, null, 8, ["connectionEntry", "inDrawing", "connectionExist"])), [ [vShow, t13.connectionDisplay] ]) : createCommentVNode("", true) ]); } var qI = Ur(IL, [["render", ML], ["__scopeId", "data-v-6ac1a744"]]); var BL = { 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: false, required: false } }, mounted: function() { this.toggleHelpModeHighlight(true), this.toggleTooltipHighlight(); }, unmounted: function() { this.toggleHelpModeHighlight(false); }, watch: { lastItem: function(t13) { t13 && 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 t13 = this.getCurrentFlatmap(); this.resetHighlightedItems(), this.$nextTick(() => { var i; const e = t13.querySelectorAll(".maplibregl-marker"), r = t13.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(t13) { const e = (t13 == null ? void 0 : t13.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 t13 = this.flatmapRef || ((r = this.multiflatmapRef) == null ? void 0 : r.getCurrentFlatmap()); return (t13 == null ? void 0 : t13.$el) || null; }, toggleHelpModeHighlight: function(t13) { const e = this.getCurrentMultiflatmap(), r = this.getCurrentFlatmap(), n = this.getCurrentScaffold(), a = document.querySelectorAll(".in-help-highlight"); e && (t13 ? e.classList.add("in-help") : e.classList.remove("in-help")), r && (t13 ? r.classList.add("in-help") : r.classList.remove("in-help")), n && (t13 ? n.classList.add("in-help") : n.classList.remove("in-help")), t13 || a.forEach((i) => { i.classList.remove("in-help-highlight"); }); }, /** * Temporary solution to find the position of map marker from popover */ extractMarkerPosition: function(t13) { const e = /translate\((.*?)\)/g, r = t13.match(e); return r ? r[r.length - 1].slice(10, -1) : ""; } } }; var Oc = (t13) => (pushScopeId("data-v-3efb89fb"), t13 = t13(), popScopeId(), t13); var NL = Oc(() => createBaseVNode("h4", null, "Help Mode", -1)); var $L = Oc(() => createBaseVNode("p", null, [ createTextVNode(" All caught up! "), createBaseVNode("br"), createTextVNode(" Click 'Help' to restart. ") ], -1)); var RL = Oc(() => createBaseVNode("p", null, 'Click "Next" to see the next item.', -1)); function zL(t13, e, r, n, a, i) { const o = Hr; return openBlock(), createElementBlock("div", { class: normalizeClass(["help-mode-dialog", { finish: r.lastItem }]) }, [ NL, r.lastItem ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ $L, createBaseVNode("div", null, [ createVNode(o, { class: "button", onClick: i.finishHelpMode }, { default: withCtx(() => [ createTextVNode(" Finish ") ]), _: 1 }, 8, ["onClick"]) ]) ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [ RL, createBaseVNode("div", null, [ createVNode(o, { class: "button", onClick: i.showNext }, { default: withCtx(() => [ createTextVNode(" Next ") ]), _: 1 }, 8, ["onClick"]), createVNode(o, { class: "button secondary", onClick: i.finishHelpMode }, { default: withCtx(() => [ createTextVNode(" Exit Help Mode ") ]), _: 1 }, 8, ["onClick"]) ]) ], 64)) ], 2); } var KI = Ur(BL, [["render", zL], ["__scopeId", "data-v-3efb89fb"]]); function VL(t13) { return { all: t13 = t13 || /* @__PURE__ */ new Map(), on: function(e, r) { var n = t13.get(e); n ? n.push(r) : t13.set(e, [r]); }, off: function(e, r) { var n = t13.get(e); n && (r ? n.splice(n.indexOf(r) >>> 0, 1) : t13.set(e, [])); }, emit: function(e, r) { var n = t13.get(e); n && n.slice().map(function(a) { a(r); }), (n = t13.get("*")) && n.slice().map(function(a) { a(e, r); }); } }; } var Gi = new VL(); var HL = { name: "ExternalResourceCard", props: { resources: { type: Array, default: () => [] } }, data: function() { return { pubmeds: [], pubmedIds: [], ElIconNotebook: shallowRef(k2) }; }, methods: { capitalise: function(t13) { return t13.charAt(0).toUpperCase() + t13.slice(1); }, openUrl: function(t13) { Gi.emit("open-pubmed-url", t13), window.open(t13, "_blank"); } } }; var qL = { class: "resource-container" }; function KL(t13, e, r, n, a, i) { const o = Hr; return openBlock(), createElementBlock("div", qL, [ (openBlock(true), createElementBlock(Fragment, null, renderList(r.resources, (s) => (openBlock(), createElementBlock("div", { key: s.id, class: "resource" }, [ s.id === "pubmed" ? (openBlock(), createBlock(o, { key: 0, class: "button", id: "open-pubmed-button", icon: t13.ElIconNotebook, onClick: (u) => i.openUrl(s.url) }, { default: withCtx(() => [ createTextVNode(" Open publications in PubMed ") ]), _: 2 }, 1032, ["icon", "onClick"])) : createCommentVNode("", true) ]))), 128)) ]); } var UL = Ur(HL, [["render", KL], ["__scopeId", "data-v-4f8d8b0f"]]); var GL = (t13) => t13.replace(/\w\S*/g, (e) => e.charAt(0).toUpperCase() + e.substr(1).toLowerCase()); var WL = function(t13) { return t13 ? t13.charAt(0).toUpperCase() + t13.slice(1) : ""; }; var YL = { name: "ProvenancePopup", props: { tooltipEntry: { type: Object, default: () => ({ destinations: [], origins: [], components: [], destinationsWithDatasets: [], originsWithDatasets: [], componentsWithDatasets: [], resource: void 0 }) } }, inject: ["getFeaturesAlert"], data: function() { return { controller: void 0, activeSpecies: void 0, pubmedSearchUrl: "", loading: false, showToolip: false, showDetails: false, 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" }, componentsWithDatasets: [], uberons: [{ id: void 0, name: void 0 }] }; }, computed: { featuresAlert() { return this.getFeaturesAlert(); }, resources: function() { let t13 = []; return this.tooltipEntry && this.tooltipEntry.hyperlinks && (t13 = this.tooltipEntry.hyperlinks), t13; }, originDescription: function() { return this.tooltipEntry && this.tooltipEntry.title && this.tooltipEntry.title.toLowerCase().includes("motor") ? this.originDescriptions.motor : this.originDescriptions.sensory; }, provSpeciesDescription: function() { let t13 = "Studied in"; return this.tooltipEntry.provenanceTaxonomyLabel.forEach((e) => { t13 += ` ${e},`; }), t13 = t13.slice(0, -1), t13 += " species", t13; } }, methods: { titleCase: function(t13) { return GL(t13); }, capitalise: function(t13) { return WL(t13); }, openUrl: function(t13) { window.open(t13, "_blank"); }, openAll: function() { Gi.emit("onActionClick", { type: "Facets", labels: this.tooltipEntry.componentsWithDatasets.map((t13) => t13.name) }); }, openAxons: function() { Gi.emit("onActionClick", { type: "Facets", labels: this.tooltipEntry.destinationsWithDatasets.map((t13) => t13.name) }); }, openDendrites: function() { Gi.emit("onActionClick", { type: "Facets", labels: this.tooltipEntry.originsWithDatasets.map((t13) => t13.name) }); }, pubmedSearchUrlUpdate: function(t13) { this.pubmedSearchUrl = t13; } } }; var Ei = (t13) => (pushScopeId("data-v-ef9a0f6d"), t13 = t13(), popScopeId(), t13); var ZL = { key: 0, class: "main" }; var XL = { key: 0, class: "block" }; var jL = { class: "title" }; var QL = { key: 0, class: "subtitle" }; var JL = { key: 1, class: "block" }; var eI = { class: "title" }; var tI = { key: 2, class: "attribute-title-container" }; var rI = Ei(() => createBaseVNode("span", { class: "attribute-title" }, "Alert", -1)); var nI = { style: { "word-break": "keep-all" } }; var aI = { class: "content-container scrollbar" }; var iI = { key: 0, class: "block" }; var oI = { class: "attribute-title-container" }; var sI = Ei(() => createBaseVNode("span", { class: "attribute-title" }, "Origin", -1)); var lI = { style: { "word-break": "keep-all" } }; var uI = Ei(() => createBaseVNode("i", null, "Origin", -1)); var cI = ["origin-item-label"]; var dI = { key: 0, class: "separator" }; var fI = { key: 1, class: "block" }; var vI = Ei(() => createBaseVNode("div", { class: "attribute-title-container" }, [ createBaseVNode("div", { class: "attribute-title" }, "Components") ], -1)); var hI = ["component-item-label"]; var pI = { key: 0, class: "separator" }; var gI = { key: 2, class: "block" }; var mI = { class: "attribute-title-container" }; var yI = Ei(() => createBaseVNode("span", { class: "attribute-title" }, "Destination", -1)); var bI = Ei(() => createBaseVNode("span", { style: { "word-break": "keep-all" } }, [ createBaseVNode("i", null, "Destination"), createTextVNode(" is where the axons terminate ") ], -1)); var wI = ["destination-item-label"]; var CI = { key: 0, class: "separator" }; function xI(t13, e, r, n, a, i) { const o = O2, s = Vt, u = rc, l = qv, c = Gs, d = Hr, v = UL, h6 = ac; return r.tooltipEntry ? withDirectives((openBlock(), createElementBlock("div", ZL, [ r.tooltipEntry.title ? (openBlock(), createElementBlock("div", XL, [ createBaseVNode("div", jL, toDisplayString(i.capitalise(r.tooltipEntry.title)), 1), r.tooltipEntry.provenanceTaxonomyLabel && r.tooltipEntry.provenanceTaxonomyLabel.length > 0 ? (openBlock(), createElementBlock("div", QL, toDisplayString(i.provSpeciesDescription), 1)) : createCommentVNode("", true) ])) : (openBlock(), createElementBlock("div", JL, [ createBaseVNode("div", eI, toDisplayString(r.tooltipEntry.featureId), 1) ])), i.featuresAlert ? (openBlock(), createElementBlock("div", tI, [ rI, createVNode(u, { width: "250", trigger: "hover", teleported: false, "popper-class": "popover-origin-help" }, { reference: withCtx(() => [ createVNode(s, { class: "info" }, { default: withCtx(() => [ createVNode(o) ]), _: 1 }) ]), default: withCtx(() => [ createBaseVNode("span", nI, toDisplayString(i.featuresAlert), 1) ]), _: 1 }) ])) : createCommentVNode("", true), withDirectives(createBaseVNode("div", { class: "hide", id: "hide-path-info", onClick: e[0] || (e[0] = (f) => t13.showDetails = false) }, [ createTextVNode(" Hide path information "), createVNode(s, null, { default: withCtx(() => [ createVNode(l) ]), _: 1 }) ], 512), [ [vShow, t13.showDetails] ]), withDirectives(createBaseVNode("div", { class: "hide", id: "show-path-info", onClick: e[1] || (e[1] = (f) => t13.showDetails = true) }, [ createTextVNode(" Show path information "), createVNode(s, null, { default: withCtx(() => [ createVNode(c) ]), _: 1 }) ], 512), [ [vShow, !t13.showDetails] ]), createVNode(Transition, { name: "slide-fade" }, { default: withCtx(() => [ withDirectives(createBaseVNode("div", aI, [ createTextVNode(toDisplayString(r.tooltipEntry.paths) + " ", 1), r.tooltipEntry.origins && r.tooltipEntry.origins.length > 0 ? (openBlock(), createElementBlock("div", iI, [ createBaseVNode("div", oI, [ sI, createVNode(u, { width: "250", trigger: "hover", teleported: false, "popper-class": "popover-origin-help" }, { reference: withCtx(() => [ createVNode(s, { class: "info" }, { default: withCtx(() => [ createVNode(o) ]), _: 1 }) ]), default: withCtx(() => [ createBaseVNode("span", lI, [ uI, createTextVNode(" " + toDisplayString(i.originDescription), 1) ]) ]), _: 1 }) ]), (openBlock(true), createElementBlock(Fragment, null, renderList(r.tooltipEntry.origins, (f, p) => (openBlock(), createElementBlock("div", { class: "attribute-content", "origin-item-label": f, key: f }, [ createTextVNode(toDisplayString(i.capitalise(f)) + " ", 1), p != r.tooltipEntry.origins.length - 1 ? (openBlock(), createElementBlock("div", dI)) : createCommentVNode("", true) ], 8, cI))), 128)), withDirectives(createVNode(d, { class: "button", id: "open-dendrites-button", onClick: i.openDendrites }, { default: withCtx(() => [ createTextVNode(" Explore origin data ") ]), _: 1 }, 8, ["onClick"]), [ [ vShow, r.tooltipEntry.originsWithDatasets && r.tooltipEntry.originsWithDatasets.length > 0 ] ]) ])) : createCommentVNode("", true), r.tooltipEntry.components && r.tooltipEntry.components.length > 0 ? (openBlock(), createElementBlock("div", fI, [ vI, (openBlock(true), createElementBlock(Fragment, null, renderList(r.tooltipEntry.components, (f, p) => (openBlock(), createElementBlock("div", { class: "attribute-content", "component-item-label": f, key: f }, [ createTextVNode(toDisplayString(i.capitalise(f)) + " ", 1), p != r.tooltipEntry.components.length - 1 ? (openBlock(), createElementBlock("div", pI)) : createCommentVNode("", true) ], 8, hI))), 128)) ])) : createCommentVNode("", true), r.tooltipEntry.destinations && r.tooltipEntry.destinations.length > 0 ? (openBlock(), createElementBlock("div", gI, [ createBaseVNode("div", mI, [ yI, createVNode(u, { width: "250", trigger: "hover", teleported: false, "popper-class": "popover-origin-help" }, { reference: withCtx(() => [ createVNode(s, { class: "info" }, { default: withCtx(() => [ createVNode(o) ]), _: 1 }) ]), default: withCtx(() => [ bI ]), _: 1 }) ]), (openBlock(true), createElementBlock(Fragment, null, renderList(r.tooltipEntry.destinations, (f, p) => (openBlock(), createElementBlock("div", { class: "attribute-content", "destination-item-label": f, key: f }, [ createTextVNode(toDisplayString(i.capitalise(f)) + " ", 1), p != r.tooltipEntry.destinations.length - 1 ? (openBlock(), createElementBlock("div", CI)) : createCommentVNode("", true) ], 8, wI))), 128)), withDirectives(createVNode(d, { class: "button", onClick: i.openAxons }, { default: withCtx(() => [ createTextVNode(" Explore destination data ") ]), _: 1 }, 8, ["onClick"]), [ [ vShow, r.tooltipEntry.destinationsWithDatasets && r.tooltipEntry.destinationsWithDatasets.length > 0 ] ]) ])) : createCommentVNode("", true), withDirectives(createVNode(d, { class: "button", onClick: i.openAll }, { default: withCtx(() => [ createTextVNode(" Search for data on components ") ]), _: 1 }, 8, ["onClick"]), [ [ vShow, r.tooltipEntry.componentsWithDatasets && r.tooltipEntry.componentsWithDatasets.length > 0 ] ]), createVNode(v, { resources: i.resources }, null, 8, ["resources"]) ], 512), [ [vShow, t13.showDetails] ]) ]), _: 1 }) ])), [ [h6, t13.loading] ]) : createCommentVNode("", true); } var EI = Ur(YL, [["render", xI], ["__scopeId", "data-v-ef9a0f6d"]]); var kI = { name: "Tooltip", props: { tooltipEntry: { type: Object }, annotationDisplay: { type: Boolean, default: false }, annotationEntry: { type: Object } }, mounted: function() { Gi.on("onActionClick", (t13) => { this.$emit("onActionClick", t13); }); } }; var SI = { class: "tooltip-container", id: "tooltip-container" }; function TI(t13, e, r, n, a, i) { const o = ZS, s = EI; return openBlock(), createElementBlock("div", SI, [ r.annotationDisplay ? (openBlock(), createBlock(o, { key: 0, annotationEntry: r.annotationEntry, onAnnotation: e[0] || (e[0] = (u) => t13.$emit("annotation", u)) }, null, 8, ["annotationEntry"])) : (openBlock(), createBlock(s, { key: 1, tooltipEntry: r.tooltipEntry }, null, 8, ["tooltipEntry"])) ]); } var UI = Ur(kI, [["render", TI], ["__scopeId", "data-v-229b3988"]]); var _I = { name: "TreeControls", props: { /** * The type of map that the TreeControls is used. Either "flatmap" or "scaffold". */ mapType: { type: String, required: true }, isReady: { type: Boolean, default: true }, /** * The title of the TreeControls. */ title: { type: String }, /** * The data of the tree. */ treeData: { type: Array, default: function() { return []; } }, showColourPicker: { type: Boolean, default: false }, /** * The active node of the tree. */ active: { type: [String, Array], required: true }, /** * The hover node of the tree. */ hover: { type: [String, Array], required: true }, enableFilter: { type: Boolean, default: true } }, data: function() { return { defaultExpandedKeys: ["All"], filterText: "", myPopperClass: "hide-scaffold-colour-popup", tooltipVisible: false, tooltipLabel: "", tooltipAtBottom: false }; }, 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: { showColourPicker: { immediate: true, handler: function() { this.showColourPicker ? this.myPopperClass = "showPicker" : this.myPopperClass = "hide-scaffold-colour-popup"; } }, filterText: { handler: function(t13) { this.$refs.regionTree && this.$refs.regionTree.filter(t13); } } }, methods: { filterNode: function(t13, e) { return t13 ? e.label ? e.label.toLowerCase().includes(t13.toLowerCase()) : false : true; }, setColour: function(t13, e) { this.$emit("setColour", t13, e); }, getBackgroundStyles: function(t13) { return "colour" in t13 ? { background: t13.colour } : {}; }, nodeIsActive: function(t13) { return this.active === t13.models; }, nodeIsHover: function(t13) { return this.hover === t13.models; }, changeActiveByNode: function(t13, e = false) { this.isFlatmap ? t13.models && this.$emit("changeActive", t13.models) : this.isScaffold && (t13.isPrimitives || t13.isRegion) && this.$emit("changeActive", t13, e); }, changeHoverByNode: function(t13, e = false) { this.isFlatmap ? t13.models && this.$emit("changeHover", t13.models) : this.isScaffold && t13.isPrimitives && this.$emit("changeHover", t13, e); }, checkChanged: function(t13, e) { if (this.isFlatmap) { const r = e.checkedKeys.includes(t13.key); t13.key === "All" ? this.$emit("checkAll", r) : this.$emit("checkChanged", { key: t13.key, value: r }); } else this.isScaffold && this.$emit("checkChanged", t13, e); }, displayTooltip: function(t13, 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 = t13, 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); } }; var DI = { class: "selections-container" }; var PI = { class: "title-text" }; var OI = { class: "tree-container", ref: "treeContainer" }; var LI = { class: "tooltip-text" }; var II = ["onClick", "onMouseover", "onMouseenter"]; var FI = ["onClick", "onMouseover", "onMouseenter"]; var AI = { class: "lastChildInItem" }; var MI = { key: 0, class: "node-options" }; function BI(t13, e, r, n, a, i) { const o = So, s = Eo, u = Qs, l = rc, c = _k, d = LS, v = ac; return openBlock(), createElementBlock("div", DI, [ r.title ? (openBlock(), createBlock(u, { key: 0 }, { default: withCtx(() => [ createVNode(o, { span: 12 }, { default: withCtx(() => [ createBaseVNode("div", PI, toDisplayString(r.title), 1) ]), _: 1 }), r.enableFilter ? (openBlock(), createBlock(o, { key: 0, span: 12 }, { default: withCtx(() => [ createBaseVNode("div", null, [ createVNode(s, { class: "tree-filter-input", modelValue: t13.filterText, "onUpdate:modelValue": e[0] || (e[0] = (h6) => t13.filterText = h6), placeholder: "Filter " + r.title }, null, 8, ["modelValue", "placeholder"]) ]) ]), _: 1 })) : createCommentVNode("", true) ]), _: 1 })) : createCommentVNode("", true), createBaseVNode("div", OI, [ createBaseVNode("div", { class: normalizeClass(["tree-tooltip", t13.tooltipAtBottom ? "bottom" : ""]) }, [ createVNode(l, { ref: "tooltip", visible: t13.tooltipVisible && t13.tooltipLabel !== "", placement: "top", "show-arrow": false, teleported: false, trigger: "manual", "popper-class": "tree-tooltip-popper", "virtual-triggering": "", width: 260 }, { default: withCtx(() => [ createBaseVNode("div", LI, toDisplayString(t13.tooltipLabel), 1) ]), _: 1 }, 8, ["visible"]) ], 2), withDirectives((openBlock(), createBlock(d, { ref: "regionTree", "element-loading-background": "rgba(0, 0, 0, 0.3)", "show-checkbox": "", "node-key": i.nodeKey, data: r.treeData, "check-strictly": false, "expand-on-click-node": false, "render-after-expand": false, "default-expanded-keys": i.expandedKeys, onCheck: i.checkChanged, indent: 8, "filter-node-method": i.filterNode, class: normalizeClass([r.mapType === "flatmap" ? "hide_grandchildren_checkbox" : ""]) }, { default: withCtx(({ node: h6, data: f }) => [ r.mapType === "flatmap" ? (openBlock(), createElementBlock("span", { key: 0, class: normalizeClass(["region-tree-node", { activeItem: i.nodeIsActive(f), hoverItem: i.nodeIsHover(f) }]), onClick: (p) => i.changeActiveByNode(f), onMouseover: (p) => i.changeHoverByNode(f, false), onMouseenter: (p) => i.displayTooltip(h6.label, true, p), onMouseleave: e[1] || (e[1] = (p) => i.displayTooltip("", false, p)) }, [ createBaseVNode("div", { style: normalizeStyle(i.getBackgroundStyles(f)), class: "lastChildInItem" }, toDisplayString(h6.label), 5) ], 42, II)) : r.mapType === "scaffold" ? (openBlock(), createElementBlock("span", { key: 1, class: normalizeClass(["region-tree-node", { activeItem: r.active.includes(f.id), hoverItem: r.hover.includes(f.id) }]), onClick: (p) => i.changeActiveByNode(f, true), onMouseover: (p) => i.changeHoverByNode(f, true, p), onMouseenter: (p) => i.displayTooltip(h6.label, true, p), onMouseleave: e[2] || (e[2] = (p) => i.displayTooltip("", false, p)) }, [ f.isPrimitives ? (openBlock(), createBlock(c, { key: 0, class: normalizeClass({ "show-picker": r.showColourPicker }), modelValue: f.activeColour, "onUpdate:modelValue": (p) => f.activeColour = p, size: "small", "popper-class": t13.myPopperClass, onChange: (p) => i.setColour(f, p) }, null, 8, ["class", "modelValue", "onUpdate:modelValue", "popper-class", "onChange"])) : createCommentVNode("", true), createBaseVNode("div", AI, [ createBaseVNode("span", null, toDisplayString(h6.label), 1), f.isTextureSlides ? (openBlock(), createElementBlock("span", MI, " (Texture) ")) : createCommentVNode("", true) ]) ], 42, FI)) : createCommentVNode("", true) ]), _: 1 }, 8, ["node-key", "data", "default-expanded-keys", "onCheck", "filter-node-method", "class"])), [ [v, !r.isReady] ]) ], 512) ]); } var GI = Ur(_I, [["render", BI], ["__scopeId", "data-v-823a8388"]]); export { ZS as AnnotationPopup, VI as ConnectivityGraph, HI as CopyToClipboard, RI as CreateTooltipContent, qI as DrawToolbar, KI as HelpModeDialog, UI as Tooltip, GI as TreeControls }; /*! Bundled license information: @abi-software/map-utilities/dist/map-utilities.js: (** * @vue/shared v3.4.27 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **) (*! Element Plus Icons Vue v2.3.1 *) (*! 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) *) (*! 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 *) (*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License *) (*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License *) */ //# sourceMappingURL=@abi-software_map-utilities.js.map